116 Commits

Author SHA1 Message Date
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
77b9a4f61e the mutex must be locked by everything which might access _channels while the mixer thread is running, because the mixer thread may modify _channels
svn-id: r8805
2003-07-06 15:57:33 +00:00
Travis Howell
817d600d8e More fixes from Hibernatus
svn-id: r8792
2003-07-06 06:36:26 +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
e993f1d231 protect calls to insertChannel with mutex, too (and switch to using StackLock)
svn-id: r8782
2003-07-05 16:01:55 +00:00
Robert Göffringmann
3aa048d710 make SoundMixer::playRaw only check sound IDs if you actually pass one
svn-id: r8746
2003-07-04 20:08:02 +00:00
James Brown
a4b61ddaba Prevent apparantly possible race condition. I don't get this stuff, and I don't see why the next call to insertChannel is immune to the same theoretical problem :)
svn-id: r8742
2003-07-04 14:49:51 +00:00
James Brown
093a31839b Insert preliminary Zak256 sound looping support. It's not perfect, as some Zak256 sounds only loop a part of the sample - which our mixer API doesn't yet support.
svn-id: r8741
2003-07-04 14:10:44 +00:00
Max Horn
c60e1aeb86 cleanup for -Wundef
svn-id: r8726
2003-07-03 22:05:22 +00:00
Max Horn
01f992db9b cleanup (code easier to read; slightly less rounding errors for the volume; and on BE systems, READ_BE_UINT16 is actually faster ;-)
svn-id: r8706
2003-07-02 10:50:04 +00:00
Paweł Kołodziejski
9385979376 fixed warning
svn-id: r8664
2003-06-27 05:02:01 +00:00
Max Horn
0efc3b2adb cleanup
svn-id: r8645
2003-06-24 23:36:05 +00:00
Paweł Kołodziejski
9d09b77f21 fixed warnings
svn-id: r8613
2003-06-22 14:30:32 +00:00
Max Horn
3883de39a9 d'oh
svn-id: r8611
2003-06-22 14:17:44 +00:00
Max Horn
c03fb13a0b fixed Vorbis CD track code
svn-id: r8610
2003-06-22 13:52:40 +00:00
Max Horn
b4ce216327 don't memset the output buffer to 0 if _eof_flag is set; rather, we should 'add 0' to every byte in the output buffer, i.e.: do nothing
svn-id: r8609
2003-06-22 13:50:46 +00:00
Max Horn
d2b61e9bef properly init member vars instead of using memset
svn-id: r8608
2003-06-22 13:48:47 +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
Jonathan Gray
0a6b7ad6ac fix compile when vorbis is enabled, loomcd is now broken with vorbis after recent changes :/
svn-id: r8598
2003-06-22 03:54:43 +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
Max Horn
fcc46ac891 more cleanup
svn-id: r8497
2003-06-15 01:56:47 +00:00
Max Horn
f7e85af552 use clear_sound_proc to properly deinit the mixer (this fixes a crash-on-exit)
svn-id: r8410
2003-06-09 01:19:44 +00:00
Max Horn
e08d4f072e more OSystem docs & cleanup
svn-id: r8118
2003-05-29 22:34:35 +00:00
Max Horn
0439e0fe58 fixed nasty deadlock I recently introduced
svn-id: r7867
2003-05-23 16:47:45 +00:00
Max Horn
1383ccbdbe make sure that the mutex protects everything that affects the buffer
svn-id: r7835
2003-05-22 21:34:20 +00:00
Max Horn
b4c94e4aee pedantic warning fix
svn-id: r7792
2003-05-21 17:33:32 +00:00
Max Horn
01d3067b7d PalmOS changes
svn-id: r7222
2003-04-30 12:51:07 +00:00
Paweł Kołodziejski
7edc0abd5b changed messages from warning to debug
svn-id: r6888
2003-03-30 16:54:03 +00:00
Max Horn
80e3c23482 cleanup; add stopID method to stop a currently playing sound via its ID
svn-id: r6835
2003-03-18 21:46:44 +00:00
Paweł Kołodziejski
aa3766018f updated copyrights headers
svn-id: r6726
2003-03-06 21:46:56 +00:00
Paweł Kołodziejski
a8c3057875 and more cleanup ....
svn-id: r6719
2003-03-06 18:30:44 +00:00
Max Horn
7e2391fce2 Patch #641607: Louder MP3 sound effects
svn-id: r5882
2002-12-08 14:18:41 +00:00
Nicolas Bacca
cb160cfbf3 Adapt MAD sampling rate to the real sampling rate for WinCE
svn-id: r5657
2002-11-21 08:46:01 +00:00
Max Horn
49d6b10fc3 Patch #639931: ALL: Fix for possible mixer distortion
svn-id: r5602
2002-11-19 01:50:15 +00:00
James Brown
ffa6e2c87f 637471: Hack to work-around 'bad sound in stream' problem.
svn-id: r5560
2002-11-15 10:47:36 +00:00
Oliver Kiehl
a413779432 oops
svn-id: r5504
2002-11-10 17:01:51 +00:00
Oliver Kiehl
fb8f8c6105 added looping support to playRaw
svn-id: r5501
2002-11-10 16:23:02 +00:00
James Brown
63ee97b1ee Fix using MAD -without- Vorbis, and remove COMPRESSED_SOUND_FILE define.
Please keep in mind that if you put an 'else' statement in an if clause, keep in mind that if the code it's supposed to
'else' is in another define.... and that isn't set... the NEXT statement of code will be used as the 'if..else'
condition.

svn-id: r5344
2002-10-28 12:56:42 +00:00
Paweł Kołodziejski
bf3505da5c don't put samples into stream SoundMixer if sound card is disabled
svn-id: r5338
2002-10-27 19:32:36 +00:00
Travis Howell
a0734ef3f9 Add monster.sog support, patch #629362
Enable ogg support by default in mingw builds and link in ogg lib

svn-id: r5333
2002-10-27 11:41:08 +00:00
Jonathan Gray
d93e639086 patch #628997 support for ogg vorbis instead of cd tracks by Daniel Schepler. Uncomment the relevant lines in the makefile to use
svn-id: r5320
2002-10-27 01:12:10 +00:00
Paweł Kołodziejski
99ec620c58 changing warnings to debug level 2
svn-id: r5273
2002-10-23 06:48:10 +00:00
Max Horn
ab13e67b09 fix -Wshadow warnings
svn-id: r5270
2002-10-23 00:24:43 +00:00
Max Horn
6631df898c compilation fix
svn-id: r5158
2002-10-16 00:24:45 +00:00
Paweł Kołodziejski
09225027f1 changes to imuse
svn-id: r5157
2002-10-15 21:55:04 +00:00