Commit Graph

164 Commits

Author SHA1 Message Date
Glenn Maynard 85fb6e85d2 don't throw on failed sound load 2004-06-17 01:22:47 +00:00
Steve Checkoway a613d4d9fa s/RAGE_ASSERT/ASSERT/ 2004-06-16 00:38:31 +00:00
Glenn Maynard dd4bc636f4 cleanups 2004-06-13 20:03:18 +00:00
Glenn Maynard 3119833bae types 2004-05-11 21:08:13 +00:00
Glenn Maynard a5cc8adfef fix mostly innocuous race condition: init ID before registering the sound,
or it might get sound position commits from other sounds due to the
uninitialized variable
2004-05-08 20:42:33 +00:00
Glenn Maynard f9f10e2372 more license updates 2004-05-06 02:40:33 +00:00
Glenn Maynard 712e1ec445 If a sound is started, plays for a while, then stopped, repositioned and
started quickly, queued position data from the previous play will still
be flushed.  We clear already-flushed data in StopMixing (pos_map.clear())
so we don't have stale data, but some is being re-flushed afterwards because
we have the same ID.  Change sound IDs when stopping a sound.

(The symptom was the first frame in Play mode in the editor would process
using an old position; the position was usually later in the song, which
sometimes marked hold notes as dead.)
2004-05-02 23:54:39 +00:00
Glenn Maynard dd7336185d catch out of order position returns from sound drivers early and handle
them sanely
2004-04-20 05:59:40 +00:00
Glenn Maynard 7ffad5c4f6 cleanup 2004-04-20 03:55:36 +00:00
Glenn Maynard b82a155fe7 cleanup 2004-04-20 03:51:41 +00:00
Glenn Maynard 3bbefc42d4 name sound mutexes differently 2004-04-20 01:55:23 +00:00
Glenn Maynard b925b61654 fix lock ordering
all sounds are now deleted in the main thread
2004-04-16 22:28:01 +00:00
Glenn Maynard 1875901837 Rewrite sound locking. Having a single global mutex for the sound system
is causing contention, leading to skips.  A detail on this is probably
coming to -devs soon ... (this will break the ALSA hw driver compile until
I update it; an hour or so)
2004-04-13 00:04:09 +00:00
Glenn Maynard b21fd54b8e split out RageSoundPosMap (too much code in RageSound) 2004-04-11 04:51:03 +00:00
Glenn Maynard 0b0db1cbe0 s/position/decode_position/ 2004-04-11 04:01:07 +00:00
Glenn Maynard 228f2bf858 split out AdjustBalance, FadeSound 2004-04-11 03:31:14 +00:00
Glenn Maynard fb5be14eeb add RageSound::SoundIsFinishedPlaying (replaces StopPlaying for
use from sound drivers)
2004-04-07 04:10:26 +00:00
Glenn Maynard 37de4a8898 Add RageSoundManager::StopPlayingSoundsForThisThread. We
need to stop playing the sounds that a thread started before exiting
the thread, or it causes unpredictable behavior with DirectSound.
2004-04-07 03:47:12 +00:00
Glenn Maynard 960bc1eaac rename RageSoundManager::StopPlayingSound to RageSoundManager::StopPlayingAllCopiesOfSound 2004-04-07 03:42:14 +00:00
Steve Checkoway 20a8bab45c Clean up includes. 2004-04-05 05:22:32 +00:00
Glenn Maynard fb6e5d1a2a don't use -1 as a sentinel position value; -1 is a valid frame number
improve GetPosition edge cases
2004-04-04 04:06:05 +00:00
Glenn Maynard 84617d0d29 cleanup 2004-03-26 03:38:27 +00:00
Glenn Maynard 1a775939a6 simplify 2004-03-26 03:29:44 +00:00
Glenn Maynard 4ba7e5451b GetData: take frames 2004-03-26 03:26:20 +00:00
Glenn Maynard 88025a50cb FillBuf: take frames 2004-03-26 03:19:55 +00:00
Glenn Maynard f5b3c5425e GetDataToPlay: take frames, not samples (use frames as a basic unit
of measuring sound buffer sizes whenever there's channel count available)
2004-03-26 03:13:57 +00:00
Glenn Maynard 9a74f9be01 optimizion for small chunksizes 2004-03-25 02:24:39 +00:00
Glenn Maynard dcb33fe120 split out GetDataToPlay from GetPCM 2004-03-18 03:30:36 +00:00
Glenn Maynard 5788f354e6 typo 2004-03-18 01:32:40 +00:00
Glenn Maynard 6ea531d584 give each RageSound instance a unique ID 2004-03-18 01:31:34 +00:00
Glenn Maynard eb86c76b9f Make CircBuf are lock-free, threadsafe buffer. (We don't actually
take advantage of this yet.)
2004-03-16 03:06:10 +00:00
Glenn Maynard e04b8bb457 fix stop mode 2004-02-28 02:47:15 +00:00
Glenn Maynard 9530cff9a6 better balance 2004-02-28 02:35:18 +00:00
Glenn Maynard be03ed1c21 Pass RageSoundParams to Play() (or SetParams). This should help fix
the long-standing ambiguity of "what happens if parameters are changed
for a second copy of a sound when a first is still playing".
2004-02-28 02:09:46 +00:00
Glenn Maynard 71d1380951 make RageSoundParams available 2004-02-28 01:02:06 +00:00
Glenn Maynard e1ed217f78 store start/length in seconds instead of frames, so RageSoundParams
isn't tied to a sound
2004-02-28 00:35:29 +00:00
Glenn Maynard 0c19d92dbf fix frame vs sample names
move sound params into a private struct
2004-02-28 00:14:16 +00:00
Glenn Maynard 8b149bd832 add balance (panning) support 2004-02-27 23:26:55 +00:00
Glenn Maynard 5b5834acba remove ResolvePath calls; this is done automatically and has been a noop
for a long time
2004-02-27 05:42:44 +00:00
Glenn Maynard 6acfd7a22e remove GetOffsetFix 2004-02-20 04:16:12 +00:00
Glenn Maynard d7be0781cc don't FillBuf in the main thread 2004-01-22 23:08:25 +00:00
Glenn Maynard b28c406879 per-sample volume 2004-01-22 06:52:44 +00:00
Glenn Maynard 268b7c1e76 fix warning 2004-01-22 06:14:58 +00:00
Glenn Maynard 2a7285ea77 lock in RageSound::Update 2004-01-22 06:13:31 +00:00
Glenn Maynard 040bba5a8c 64-bit frame counts, so we don't get confused when frame counts
pass 2^31 (takes about 13 hours)
2004-01-19 22:21:02 +00:00
Glenn Maynard ce6b11a343 RageSound::CleanPosMap 2004-01-19 20:37:14 +00:00
Glenn Maynard 62227ce90d comments 2004-01-18 04:04:37 +00:00
Glenn Maynard 74e1b8e276 accurate sound position timestamps 2004-01-18 04:01:52 +00:00
Glenn Maynard 7676ccf397 split RageSound::SearchPosMap 2004-01-18 02:07:58 +00:00
Glenn Maynard 3633d424d7 s/RageDriverSound/RageSoundBase/ 2004-01-15 02:31:09 +00:00