Commit Graph

93 Commits

Author SHA1 Message Date
Max Horn
2755d9c00a add param to playInputStream which makes it possible to retain an input stream even after it has been given to the mixer for playback
svn-id: r11933
2003-12-26 02:19:31 +00:00
Max Horn
859a9c0129 o Added SoundMixer::isReady()
o Removed SoundMixer::bindToSystem()
o In scumm, replaced _silentMixer, _silentDigitalImuse and _noDigitalSamples by SoundMixer::isReady()

svn-id: r11893
2003-12-24 17:42:22 +00:00
Max Horn
e9269257f3 turned PlayingSoundHandle into an 'opaque' (well not really :-) data type, mainly because people kept (accidentally and sometimes on purpose :-) misusing them
svn-id: r11881
2003-12-24 00:25:18 +00:00
Max Horn
43875b42fc Allow sound ID for MP3/Vorbis sounds, too; cleaned up Vorbis playback code a bit
svn-id: r11879
2003-12-23 19:14:57 +00:00
Max Horn
e01c3e1b1d o Got rid of Channel::destroy() method (no more evil 'delete this', plus
slightly more efficient)
o Fixed potential memory leak in SoundMixer::playRaw
o Channel not anymore friend class of SoundMixer
o misc cleanup

svn-id: r11857
2003-12-22 19:08:19 +00:00
Max Horn
e439eb5129 added convenience SoundMixer::playVorbis variant which calls through to playSfxSound_Vorbis; made scumm/queen engines use it
svn-id: r11812
2003-12-21 15:47:52 +00:00
Max Horn
7fbb3e0559 Cleaned up SoundMixer::newStream() a bit (I plan to replace all usages of this by playInputStream(), this cleanup eases this a bit)
svn-id: r11803
2003-12-21 01:17:03 +00:00
Max Horn
ec0ebf5380 o Make use of the new LinearMemoryStream feature which allows auto-disposing the sound data
o This allows us to get rid of the ChannelRaw class
o Removed the sound index return value from several methods
o Removed all methods dealing with sound indices (i.e. stopChannel and pauseChannel)

svn-id: r11801
2003-12-21 00:44:31 +00:00
Max Horn
d21fc5845d o Moved MP3 and Vorbis input streams to mp3.* resp. vorbis.*
o Added SoundMixer::playInputStream and made some of the other play* methods use it
o Added ProcInputStream stub (not working yet) which one day may allow us to replace the premix code, and allow other fancy stuff
o Remove AudioInputStream::readBuffer default implementation (subclasses should always provide it for max. performance)
o Some minor cleanup

svn-id: r11754
2003-12-19 00:32:47 +00:00
Max Horn
de51f631be cleanup
svn-id: r11686
2003-12-16 15:34:17 +00:00
Robert Göffringmann
5756a41ba6 added mixer flag for little endian samples
svn-id: r11665
2003-12-16 02:11:04 +00:00
Paweł Kołodziejski
1f99fbe77c cleanup whitespaces
svn-id: r11221
2003-11-08 23:05:04 +00:00
Joost Peters
6fc0cd7913 whatever
svn-id: r10959
2003-10-25 01:11:14 +00:00
Joost Peters
3ad14b06f5 added extra flag to mixer so we don't use free() on new'd pointers
svn-id: r10958
2003-10-24 23:09:01 +00:00
Max Horn
9f537f4b8c clarification: premixer must use native endianess
svn-id: r10621
2003-10-05 17:42:55 +00:00
Max Horn
9470c9f661 changed & documented the premixer semantics
svn-id: r10294
2003-09-18 16:01:33 +00:00
Max Horn
ea461dfc3c new header file for VOC specific stuff
svn-id: r10072
2003-09-07 20:23:38 +00:00
Max Horn
0be0196013 removed pauseMixer method from mixer, and renamed stop to stopChannel
svn-id: r10042
2003-09-06 10:47:30 +00:00
Max Horn
3aa8454efa moved the sound ID param in playRaw before volume/pan
svn-id: r10023
2003-09-05 22:09:56 +00:00
Max Horn
06b6ff9a44 added default volume/pan values
svn-id: r10019
2003-09-05 21:06:32 +00:00
Max Horn
11193b0746 cleaned up sound/mixer.h a bit; renamed some mixer methods for consistency
svn-id: r10018
2003-09-05 20:48:32 +00:00
Paweł Kołodziejski
7bc63a0ce3 fixes for uninitialized pan and volume
svn-id: r9998
2003-09-05 06:22:10 +00:00
Torbjörn Andersson
f486997822 Added per-channel pausing. Maybe I should have named the pauseChannel()
function simply pause() to be consistent with stop(), but there already is
a pause() function and I don't want to have two functions with the same
name doing different things. (The current pause() function pauses all
channels.)

svn-id: r9968
2003-09-02 13:48:20 +00:00
Paweł Kołodziejski
db18d4657c forgot this
svn-id: r9957
2003-09-01 14:02:45 +00:00
Paweł Kołodziejski
82fea49671 added comments:
volume: 0 - 127
pan: (-127 <-> 0 <-> 127) (left <-> center <-> right)

svn-id: r9945
2003-08-31 20:36:53 +00:00
Paweł Kołodziejski
2533b23a60 added mixer features: volume and pan control per channel
svn-id: r9944
2003-08-31 20:26:21 +00:00
Torbjörn Andersson
f72681b10a Made PlayingSoundHandle unsigned again, since the mixer change was
reverted.

svn-id: r9930
2003-08-30 20:36:44 +00:00
Torbjörn Andersson
bfee72f757 If -1 is going to be a valid value for a PlayingSoundHandle, the data type
had better be signed...

svn-id: r9925
2003-08-30 20:07:09 +00:00
Paweł Kołodziejski
9c05d44d00 added func isChannelActive for mixer, and fixed handling numbers of channel 0
svn-id: r9924
2003-08-30 18:12:49 +00:00
Robert Göffringmann
7f7b0af613 added SoundMixer::pauseChannels for pausing SFX and keeping adlib music running (needed by BASS when menu bar drops down)
svn-id: r9607
2003-08-09 19:19:27 +00:00
Max Horn
48d1739e0a some cleanup; added Channel::getVolume, once somebody tells me what exactly is needed, I can add per-channel volume, and also per-channel panning
svn-id: r9525
2003-08-05 23:03:42 +00:00
Max Horn
d9bd77032a implemented raw sound looping; some debug output enabled temporarily
svn-id: r9360
2003-08-01 12:49:24 +00:00
Max Horn
0df319e952 #include cleanup (explicityl specify the location for headers from common/, so that we at some point can get rid of -Icommon; exception is made for stdafx.h, since a) we might want to rename it and b) might want to move it to the top level)
svn-id: r9359
2003-08-01 12:21:04 +00:00
Max Horn
0b4e48b59e revamped MP3/Vorbis CD 'emulation' code to use a PlayingSoundHandle -> this allows to finally get rid of the hackish isChannelActive/isChannelUsed methods in SoundMixer
svn-id: r9346
2003-07-31 20:24:10 +00:00
Max Horn
6b470390f7 cleanup
svn-id: r9281
2003-07-29 12:39:41 +00:00
Max Horn
791efd853a lots of mixer changes: replaced _volumeTable by _globalVolume (applying volume after resampling is more accurate); made more member vars of SoundMixer protected (and thus added some new getter methods); added (untested) support for a second (stereo) channel when playing MP3
svn-id: r9184
2003-07-25 01:19:14 +00:00
Max Horn
f086ab5a05 whitespace
svn-id: r9181
2003-07-24 21:26:46 +00:00
Max Horn
33e6989944 removed whitespaces at line ends; added stopHandle
svn-id: r9022
2003-07-14 20:09:14 +00:00
Max Horn
7e4fa4a1da mix() is really a private method, only to be called by the audio thread; cover setupPremix by the mutex, too (that helps preventing race conditions upon exit)
svn-id: r8809
2003-07-06 17:00:09 +00:00
Max Horn
b6c3d440b5 now that we mutex-protect everything properly, we can get rid of _toBeDestroyed; also, instead of keeping a global _handles array in the mixer, let each Channel manage its own handle
svn-id: r8808
2003-07-06 16:52:09 +00:00
Max Horn
5c17c0f7a7 cleanup to the mixer helper proc interface and to ChannelStream
svn-id: r8785
2003-07-06 01:43:40 +00:00
Max Horn
d098334fe6 updated code to use type MutexRef; added class StackLock (from sdl backend, now in util.*)
svn-id: r8777
2003-07-05 15:19:11 +00:00
Max Horn
4ead10e4d5 Change names of the stream API in the mixer; added endStream method (stop() halts stream immediately; endStream() lets it first finish playing)
svn-id: r8603
2003-06-22 11:47:03 +00:00
Max Horn
4ad5a183ce renamed SoundMixer::hasActiveChannel->hasActiveSFXChannel, and fixed the regression in it caused by removing _beginSlots (I hope); added isActiveChannel method used by scumm/sound.cpp (this allowed me to move the Channel class from mixer.h into mixer.cpp); replaced Channel::soundFinished method by isActive
svn-id: r8597
2003-06-22 01:55:53 +00:00
Max Horn
573a1e3e99 remove the realDestroy methods and instead use destructors; renamed insertAt to insertChannel and simplified/unified its usage; delete the mutex when exiting; cleanup
svn-id: r8596
2003-06-22 01:34:28 +00:00
Max Horn
bd4370c251 lots of mixer cleanup / refactoring / reengineering
svn-id: r8594
2003-06-21 23:29:34 +00:00
Max Horn
7c332d7fdb modified & cleaned up the playStream/append code a bit; but this API really could stand some refinement
svn-id: r8592
2003-06-21 21:17:08 +00:00
Max Horn
11b2961fdb cleanup
svn-id: r8584
2003-06-21 19:52:12 +00:00
Marcus Comstedt
2aed2d9284 Use stdafx.h instead of manually including system headers.
svn-id: r8541
2003-06-18 21:10:05 +00:00
Max Horn
fcc46ac891 more cleanup
svn-id: r8497
2003-06-15 01:56:47 +00:00