Commit Graph
23846 Commits
Author SHA1 Message Date
Glenn Maynard cd5f4a6e39 SoundReader_FileReader -> RageSoundReader_FileReader 2006-11-30 04:22:38 +00:00
Glenn Maynard f41362f7a9 SoundReader -> RageSoundReader 2006-11-30 04:19:51 +00:00
Glenn Maynard 6c625a50f1 remove noisy 2006-11-30 04:05:34 +00:00
Glenn Maynard a640f52171 update 2006-11-30 04:04:38 +00:00
Glenn Maynard 9bbed7d6fc pure virtual 2006-11-30 04:02:53 +00:00
Glenn Maynard 1c3e34d4a4 rate fix 2006-11-30 04:02:32 +00:00
Glenn Maynard 8419633852 add pitch change filter 2006-11-30 03:59:35 +00:00
Glenn Maynard 6874d44a2b add speed change filter 2006-11-30 03:59:02 +00:00
Glenn Maynard 286d9c5594 add helper RageSoundReader_Filter 2006-11-30 03:57:48 +00:00
Glenn Maynard 9e261cca19 support dynamic rate changing 2006-11-30 03:57:09 +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 630c84d0c1 SetProperty 2006-11-30 02:52:41 +00:00
Glenn Maynard 4d03863226 add SetProperty, for setting properties somewhere in a filter chain 2006-11-30 02:50:31 +00:00
Glenn Maynard f50944c291 unused 2006-11-30 02:17:53 +00:00
Glenn Maynard b5db09f362 allow variable ratios 2006-11-30 02:14:30 +00:00
Glenn Maynard b9bee153c1 both source and dest units are 64-bit 2006-11-30 02:13:02 +00:00
Glenn Maynard 3afa9e231e change param order 2006-11-30 02:11:08 +00:00
Glenn Maynard 71c95983dc old, confusing comments 2006-11-30 02:06:56 +00:00
Glenn Maynard f42efc3b22 use a list instead of a deque 2006-11-30 02:05:36 +00:00
Glenn Maynard c0d13ba04f set directly 2006-11-30 01:55:52 +00:00
Glenn Maynard cf6da4c2f4 simplify 2006-11-30 01:52:12 +00:00
Glenn Maynard 115bad2017 CommitPosition -> Insert 2006-11-30 01:47:51 +00:00
Glenn Maynard a66bc2c949 semantic cleanup 2006-11-30 01:46:20 +00:00
Glenn Maynard 512e889d29 cleanup 2006-11-30 01:41:00 +00:00
Glenn Maynard 0cc1832628 hide implementation 2006-11-30 01:39:58 +00:00
Glenn Maynard 9676f351d9 This doesn't really need to be a deque. Note skin inheritance is
typically only one or two deep, and we only update these rarely.
(deque uses about 500 bytes minimum in linux)
2006-11-30 01:05:07 +00:00
Glenn Maynard d33755fd24 unused 2006-11-30 01:01:33 +00:00
Glenn Maynard d19d8bd8d9 fix copy 2006-11-29 22:13:22 +00:00
John Bauer ed7394d72e Reorder some more includes. 2006-11-29 22:04:29 +00:00
Glenn Maynard 8542b7d190 GetNextStreamFrame -> GetNextSourceFrame 2006-11-29 21:52:31 +00:00
Glenn Maynard 14c8d02e9e GetNextSourceFrame, GetStreamToSourceRatio 2006-11-29 21:47:23 +00:00
Glenn Maynard 0bd9c4e032 mad->Timer is the beginning of the frame; advance by outpos to find the current source frame 2006-11-29 20:56:32 +00:00
John Bauer bf6da7d8b4 Reorder some includes. 2006-11-29 14:57:21 +00:00
Glenn Maynard c895f1c29c SoundReader -> RageSoundReader 2006-11-29 09:16:59 +00:00
Glenn Maynard c68c60c67a GetNextStreamFrame -> GetNextSourceFrame 2006-11-29 09:15:23 +00:00
Glenn Maynard acb7f4ae6b doesn't exist 2006-11-29 09:05:04 +00:00
Glenn Maynard 8db49e53eb RString 2006-11-29 08:16:29 +00:00
Glenn Maynard e3b98efd66 GetNextStreamFrame, GetStreamToSourceRatio implementations 2006-11-29 08:15:22 +00:00
Glenn Maynard e6d5cbbd77 EOF is signalled by 0, not by a short block. (short blocks can be returned for any reason by a filter, most commonly due to changing ratios) 2006-11-29 07:59:17 +00:00
Glenn Maynard 58c0138e5e removed RageSoundReader_Resample 2006-11-29 07:54:47 +00:00
Glenn Maynard 95eaf5b98d use RageSoundReader_Resample_Good directly 2006-11-29 07:53:05 +00:00
Glenn Maynard 3638b723e8 SoundReader -> RageSoundReader 2006-11-29 07:44:59 +00:00
Glenn Maynard 0f9e6c9153 GetNextStreamFrame implementations 2006-11-29 07:40:19 +00:00
Glenn Maynard b2bbf941fc file readers are always rate 1 2006-11-29 07:39:38 +00:00
Glenn Maynard a03cd1d32a please to be saving the file, VC 2006-11-29 07:39:10 +00:00
Glenn Maynard 46a1da7fbf for now 2006-11-29 07:38:40 +00:00
Glenn Maynard 830577f81e add GetNextStreamFrame, GetStreamToSourceRatio 2006-11-29 07:38:21 +00:00
Glenn Maynard 73d26022fa remove unused 2006-11-29 02:46:54 +00:00
Glenn Maynard 1146c57dc8 specify source and dest sample rate in the ctor; they don't change 2006-11-29 02:45:40 +00:00
Glenn Maynard 7c56fe71dd copy with a copy ctor 2006-11-29 02:38:56 +00:00