Commit Graph

240 Commits

Author SHA1 Message Date
hiker
11a213fa8d Significantly reduced number of audio sfx commands: instead of sending
7 commands for each kart (when only engine is actually playing),
now there is only one command being sent: positions of sfx that are
not playing are not sent anymore, a duplication engine position was
removed, and speed and position are combined into one event.
2015-06-29 08:09:42 +10:00
Marianne Gagnon
90cf3176d1 Start adding an audio scripting API, and also fix a deadlock in sfx_manager due to improper release of locks 2015-06-21 18:31:16 -04:00
Dmitry Marakasov
cfbec1f470 Include cerrno for errno; fixes clang compilation error 2015-06-02 04:36:30 +03:00
hiker
8d07d26c25 Updated (c) year to include 2015. 2015-03-30 11:42:50 +11:00
hiker
1971254a7f Fixed compiler warning. 2015-03-30 09:43:58 +11:00
Marianne Gagnon
26bd5a89a0 Use accurate timing for sounds. Fixes #2049 2015-03-26 20:49:36 -04:00
hiker
efcfdcced7 Oops - fixed typo in previous commit ... where I ignored the nicely
computed 'accurate' values in the end :)
2015-03-27 11:14:34 +11:00
hiker
0c6f3eb3dd Tried to increase accuracy by measuing the sleeping time exactly. 2015-03-27 11:07:38 +11:00
Marianne Gagnon
f81f684b34 Improve timings used for audio status. Could be more precise but is good enough for the moment. See #2049 2015-03-26 19:37:17 -04:00
Marianne Gagnon
e6aea6e0b6 Improve tools and usage of XML encoding, fixes #1982 2015-02-14 18:30:23 -05:00
hiker
f589b2063e Fix crash when going story mode while music is disabled. 2015-02-12 13:19:58 +11:00
hiker
2d5f78974a Merge pull request #1975 from Flakebi/sound
Set correct volume for last lap music
2015-02-12 08:02:10 +11:00
hiker
33f87e28f7 Prevent flooding of terminal with "music not playing" messages, added
debug error check.
2015-02-12 07:57:25 +11:00
hiker
f57ad3c1ed Try to fix #1972 (things went wrong when stk tried to delete uninitialised
sound sources).
2015-02-11 09:16:48 +11:00
hiker
a598b0ed1a Fix after-race sfx which wasn't playing anymore (caused by quick sound
effects not having update() called, which is necessary to detect if they
have stopped playing).
2015-02-11 08:06:28 +11:00
Flakebi
91d042da31 Set correct volume for last lap music 2015-02-10 16:52:50 +01:00
hiker
84a84b6776 Try to fix playing without music. 2015-02-10 17:31:35 +11:00
hiker
95ecd0eed1 Let the audio thread run 'all the time' by sending itself an
update package after the queue is empty.
2015-02-10 09:22:23 +11:00
hiker
58f0ce412e Removed unnecessary m_adjusted_gain variable and resetTempVolume
function. Fixed that music volume in race could not be changed.
2015-02-10 08:32:05 +11:00
hiker
43aadcef34 Follow coding style for #includes. 2015-02-08 22:12:08 +11:00
hiker
2d4200c754 Removed rather embarrassing left-over debug code. 2015-02-05 18:29:05 +11:00
hiker
0ab3d12eab Fixed invalid name openal error when setting the volume of fast
music (apparently caused by trying to set the music of the actually
freeded normal music just before).
2015-02-05 15:22:20 +11:00
hiker
1e994748cc Properly handle volume setting from sfx thread, removed MusicManager
from friends of MusicInformation to enforce this. Added error checks
to properly detect location of warning when faster music is plaued
(still under investigation).
2015-02-05 09:22:13 +11:00
hiker
eb37092643 Moved all remaining music commands to be handled by sfx thread. 2015-02-04 17:08:22 +11:00
hiker
6aa9ff86a4 Removed unnecessary function. 2015-02-03 16:29:54 +11:00
hiker
4658bd83de Handle playing and stopping of music in separate thread. Make the sfx
manager thread use CanBeDeleted to allow for timed deleting.S
2015-02-03 16:27:05 +11:00
hiker
c37e1eec0d Updated documentation and minor style changes. 2015-02-02 16:31:54 +11:00
hiker
6ffb30d63a Fixed memory leak. 2014-12-14 12:04:48 +11:00
Marianne Gagnon
5d5460d845 Add way to test intro cutscene easily; do not throttle sound effects on cutscenes 2014-11-22 18:21:31 -05:00
hiker
86b8036926 Fix #1631 (SFX can not be enabled in in-race game menu). 2014-10-22 17:16:39 +11:00
hiker
690ad4ce95 Fixed sfx direction. 2014-10-21 22:07:22 +11:00
hiker
8d9f1aa002 Renamed SoundToggled to toggleSound. 2014-10-21 08:48:21 +11:00
hiker
65b7589849 Make sure the sfx are resumed before calling onSOundEnbaledBack(). 2014-10-21 08:31:10 +11:00
hiker
c7d7e17ff9 Handle setMasterVolume in sfx thread. 2014-10-21 08:28:41 +11:00
hiker
8b7bf28e0f Fixed #1147 - sounds should stopped when they are disabled in option screen.
Fixed by explicitely stopping all non-looped sfx.
2014-10-20 22:37:19 +11:00
hiker
36ea7f30bf Only restart sfx if they were really paused. 2014-10-20 09:43:05 +11:00
hiker
11dbb6f062 Fixed some warnings printed when sfx are disabled. 2014-10-20 00:05:48 +11:00
hiker
3082267eb4 Properly test for sfx disabled, and only schedule events if sfx
are enabled. Fixes #1629.
2014-10-18 12:11:02 +11:00
hiker
19f9afb67f Manually keep track of the duration each sfx has been played (instead
of relying on the world clock, which can run backwards, e.g. in
FTL mode). Fixes #1624.
2014-10-18 11:46:22 +11:00
hiker
7103ea8e88 Throttle sfx command if the queue should get too long (might need some
tuning). Non-essential sfx (positioning, speed, looping, and play)
are discarded.
2014-10-17 16:53:44 +11:00
hiker
403702d6bb Handle pauseAll and resumeAll completely in thread now. Avoids a crash
(caused by pauseAll trying to pause a sfx that is still in the list of
all sfx, but has a delete command already queued up).
2014-10-17 16:26:15 +11:00
hiker
c7f37297b1 Fixed potential deadlock (if a sfx is not found in the queue, which shouldn't
happen); stop sounds which are deleted only once, slightly reduce size of
locked region.
2014-10-17 12:02:23 +11:00
hiker
813edc7ddf Remove SFX_INITIAL state. 2014-10-17 12:00:00 +11:00
hiker
a40d6d8a00 Removed isPlaying function, and use getStatus instead. 2014-10-17 08:27:40 +11:00
hiker
3d15f13c74 iFixed #1624 (though it is a bit of a hack). 2014-10-16 23:45:09 +11:00
hiker
a18766e3e6 Handle looping in sfx thread. 2014-10-16 16:57:12 +11:00
hiker
c61b7d632d Fix stk hanging on exit. 2014-10-16 12:48:48 +11:00
hiker
140ea5ed84 Update comments. 2014-10-16 08:21:26 +11:00
hiker
aae834ba4b Run the music manager from the sfx thread. 2014-10-16 08:13:55 +11:00
hiker
bba7156aff Handle the setting of the listener position in the sfx thread. 2014-10-15 23:42:59 +11:00