Commit Graph

10 Commits

Author SHA1 Message Date
Glenn Maynard 7385c1f4c1 merge SetPosition_Accurate and SetPosition_Fast. Use a property
instead.
2006-12-10 08:59:13 +00:00
Glenn Maynard 0b529a4960 RageSoundReader::Read() returns sound data which may be at a
different rate than the source it's reading from; one second
of returned data may correspond to two seconds in the source
material.

GetStreamToSourceRatio returns the ratio of returned data in
the next Read() call to source data.  This is propagated
upwards in the filter tree, so rate changes by a speed changer
in the middle of the tree will be reflected in the final
GetStreamToSourceRatio().

This means that whenever the ratio changes, Read() stops
returning data; it returns whatever it has, so the caller
has an opportunity to call GetStreamToSourceRatio again
and notice the change.

These semantics can be annoying to implement in some
cases, where only the processing of Read() may notice
a ratio change.  Read() may want to return 0, to say
"something changed, call GetStreamToSourceRatio again",
but 0 means EOF.

Add RageSoundReader::END_OF_FILE.  0 is now no
longer a special case; it means "there's more data, I
just didn't return any this time".  This is functionally
equivalent to errno EINTR.
2006-12-10 07:08:17 +00:00
Glenn Maynard 25e67dd4dc RageSoundReader::Read(buf, unsigned bytes) -> (buf, int frames);
return value in frames, not bytes
2006-12-10 03:56:36 +00:00
Glenn Maynard ca67a9cb7c change SetPosition_Accurate and SetPosition_Fast to take and return frames 2006-12-09 06:35:09 +00:00
Glenn Maynard ffac3acbca fix up infinite loop at EOF 2006-11-30 21:04:51 +00:00
Glenn Maynard bd639a7547 fix bounds assert 2006-11-30 07:26:34 +00:00
Glenn Maynard a92125f391 remove debug 2006-11-30 06:46:46 +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 6874d44a2b add speed change filter 2006-11-30 03:59:02 +00:00