Commit Graph
100 Commits
Author SHA1 Message Date
Glenn Maynard f2eb0043de remove RageSound::IsStreamingFromDisk 2006-12-23 01:16:37 +00:00
Glenn Maynard bafea3b7ab GetPosition() -> GetHardwareFrame; handle timing retry in the driver,
so the logic is available to the driver
2006-12-22 22:22:01 +00:00
Glenn Maynard 24624a5c92 GetDataToPlay API more like RSR::Read 2006-12-22 21:24:19 +00:00
Glenn Maynard 5bfc731036 remove old GetPCM 2006-12-13 18:40:02 +00:00
Glenn Maynard 7385c1f4c1 merge SetPosition_Accurate and SetPosition_Fast. Use a property
instead.
2006-12-10 08:59:13 +00:00
Glenn Maynard 8c7173f26c use RageSoundReader_Pan for panning 2006-12-10 00:43:51 +00:00
Glenn Maynard d30d0c0e76 expose SetProperty 2006-12-09 23:54:33 +00:00
Glenn Maynard d0153d06b3 remove unused 2006-12-07 02:51:08 +00:00
Glenn Maynard edcc1c2f40 bind RageSound 2006-12-04 22:31:25 +00:00
Glenn Maynard 90b56c3705 remove m_fRate (if you really want that effect, set both pitch and speed) 2006-11-30 07:34:05 +00:00
Glenn Maynard 458be5efa4 add RageSoundLoadParams, to specify load-time params
allow loading pitch shifter
add pitch and speed params
2006-11-30 07:28:26 +00:00
Glenn Maynard 9ee3bee4fd remove SetPlaybackRate 2006-11-30 06:45:31 +00:00
Glenn Maynard 2ee6acbcbe stream frames are 64-bit (sound driver api change) 2006-11-30 06:00:51 +00:00
Glenn Maynard 7af5741c08 stream frames are 64-bit 2006-11-30 05:55:42 +00:00
Glenn Maynard eee319b535 Refactor sample tracking to support GetNextSourceFrame and
GetStreamToSourceRatio.  This will allow RateChange() to
be implemented with a filter, instead of being built into
RageSound, allow filters that change the music rate while
preserving robust correlation to the original audio.

This tightens up the frame definitions, resulting in three
frame counters:
 - source frames; frames into the original source audio
 - stream frames; frame counter after all filtering
 - hardware frames; the sound driver's frame counter

All frames are in the sample rate of the stream; if audio
is resampled to match the hardware, the resampled audio is
considered the source audio, and frame units are in the
resulting sample rate.

By design, source frames are never exposed to the sound
driver, which only deals with stream and hardware frames.

The principle of the ratio API is that while a filter stream
should ideally output audio at the exact rate it advertises
through GetStreamToSourceRatio, rounding error will inevitably
creep in.  Rather than depending on the ratio being exact
over an arbitrary length of time, each filter's GetNextSourceFrame
calculates the actual next source frame.  Typically, it
will be equal to (its value before the previous read) + (number
of frames read * previous ratio).  This avoids hard-to-debug
synchronization drift.

(This also eliminates the 1k buffer which was used for crappy
rate changing, which can be readded with a buffer filter if
needed.  Rate changing is disabled for a while until a bit
more work is done.)
2006-11-30 03:54:57 +00:00
Glenn Maynard f50944c291 unused 2006-11-30 02:17:53 +00:00
Glenn Maynard f2b893939d SoundReader -> RageSoundReader 2006-11-29 02:20:10 +00:00
Chris Danford 7f821e8cfc CString -> RString 2006-01-22 01:00:06 +00:00
Glenn Maynard ee14402dd8 remove unused 2005-12-23 05:21:32 +00:00
Glenn Maynard 3a77a52dba this only returns bool; fix comment 2005-11-23 18:52:49 +00:00
Glenn Maynard 7a67264ece remove GetVolume 2005-10-23 07:05:33 +00:00
Glenn Maynard 03cb8bda22 remove unused 2005-10-19 11:47:56 +00:00
Chris Danford 15880eafd6 When in attract and not playing attract sounds, have SOUNDMAN only play sounds with RageSoundParams.m_bCriticalSound == true.
Currently, only the coin sound has RageSoundParams.m_bCriticalSound = true.
2005-10-04 06:51:06 +00:00
Chris Danford 7b345b5c75 make volume changes affect playing sounds 2005-10-02 08:35:46 +00:00
Glenn Maynard 2f3905325d style cleanup 2005-09-23 00:12:32 +00:00
Glenn Maynard 935675cef6 cleanup 2005-06-08 21:22:08 +00:00
Glenn Maynard 55f47ff85c style cleanup 2005-06-08 04:47:03 +00:00
Chris Danford c45c229995 cleanup: don't cast bool to int 2005-03-16 04:10:10 +00:00
Glenn Maynard ef68b4acdd Working on clean pausing support. (This will break the ALSA and DSound hardware builds until they're updated, soon.) 2005-03-10 22:49:28 +00:00
Glenn Maynard 0979c9dcee const 2004-12-04 21:20:02 +00:00
Chris Danford 6181e142dc add metric to put timer in stealth mode 2004-12-04 21:13:29 +00:00
Glenn Maynard cca289bcf9 remove unused stuff 2004-11-15 18:24:50 +00:00
Glenn Maynard c85de593f9 s/SoundReader_Preload/RageSoundReader_Preload/
split RageSoundReader_Preload::PreloadSound
split RageSound::LoadSoundReader
2004-10-24 19:25:21 +00:00
Glenn Maynard 1b02c6d494 remove m_FadedOutAt; didn't like the effect produced 2004-09-23 12:23:24 +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 ed2939b205 IsStreamingFromDisk 2004-08-21 07:01:54 +00:00
Glenn Maynard 13104cc6e7 type fix 2004-06-11 19:39:32 +00:00
Glenn Maynard f9f10e2372 more license updates 2004-05-06 02:40:33 +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 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 5fd6938bd0 remove RageSoundBase::StopPlaying 2004-04-07 08:06:36 +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 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 dcb33fe120 split out GetDataToPlay from GetPCM 2004-03-18 03:30:36 +00:00
Glenn Maynard 6ea531d584 give each RageSound instance a unique ID 2004-03-18 01:31:34 +00:00