Commit Graph
176 Commits
Author SHA1 Message Date
Glenn Maynard 1b02c6d494 remove m_FadedOutAt; didn't like the effect produced 2004-09-23 12:23:24 +00:00
Glenn Maynard 9dbfc3ace1 fade fix 2004-09-23 09:31:12 +00:00
Glenn Maynard 4a17c3d725 If m_LengthSeconds is longer than the actual file, pad with silence; this way,
if looping, the sound will loop exactly once every m_LengthSeconds.  This should
fix obscure beat alignment problems if sample music ends at the end of the file,
since before, extending the length beyond the end of the file didn't do anything.

Fix m_FadeLength.  The length was being ignored.

Add m_FadedOutAt; this way, if beat alignment extends a 10-second clip at the
end of a file by .5 seconds, we can fade out 9..10, instead of 9.5 ... 10.5,
which would cause the sound to cut out early.
2004-09-23 09:10:04 +00:00
Glenn Maynard d6d3a3ccc5 typo 2004-09-08 00:36:30 +00:00
Glenn Maynard 197b54dd8b AdjustBalance -> PanSound; balance and panning aren't the same thing 2004-08-29 03:21:45 +00:00
Glenn Maynard 78b019fe0c fix mono->stereo conversion 2004-08-26 20:01:43 +00:00
Glenn Maynard 8fb41ed93c clamp "lesser position" output 2004-08-24 23:51:43 +00:00
Glenn Maynard ed2939b205 IsStreamingFromDisk 2004-08-21 07:01:54 +00:00
Glenn Maynard 4efa41dba5 reduce RageSound internal buffering; maybe this can go away, since all drivers buffer properly now ... 2004-08-15 04:31:19 +00:00
Glenn Maynard 69cf82de49 handle mono 2004-07-24 02:01:12 +00:00
Glenn Maynard 9f4f314f7a assert 2004-07-17 22:20:42 +00:00
Glenn Maynard 28d25210a2 asserts 2004-07-17 22:03:41 +00:00
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