Commit Graph
289 Commits
Author SHA1 Message Date
Glenn Maynard eaf12eb84f remove SetPositionSeconds. Use m_Param.m_StartSecond. 2006-12-23 22:30:35 +00:00
Glenn Maynard ff8237c56b set start position in RageSound::StartPlaying 2006-12-23 22:28:17 +00:00
Glenn Maynard 8a8976c460 merge RageSound::GetPositionSeconds and GetPositionSecondsInternal; fix lock order 2006-12-23 11:31:10 +00:00
Glenn Maynard ecb93a7fd2 call SOUNDMAN->GetPosition unlocked (driver call), and GetSourceFrameFromHardwareFrame locked; also simpler (GetPositionSecondsInternal uses m_iStoppedSourceFrame) 2006-12-23 11:01:09 +00:00
Glenn Maynard 880490e4c2 split out RageSound::GetSourceFrameFromHardwareFrame 2006-12-23 10:56:40 +00:00
Glenn Maynard bc097b6b03 clamp hardware frames in RageSoundDriver, instead of in each sound 2006-12-23 10:53:39 +00:00
Glenn Maynard ec08155a86 simplify 2006-12-23 10:33:53 +00:00
Glenn Maynard 98a3d5f856 more consistent code path: call SoundIsFinishedPlaying when the driver stops mixing, even if it's due to RageSoundDriver::StopMixing 2006-12-23 10:32:37 +00:00
Glenn Maynard 71f3bc0a75 fix comment 2006-12-23 10:28:29 +00:00
Glenn Maynard 80059b308b fix possible lock order problem 2006-12-23 10:27:21 +00:00
Glenn Maynard 5dac62ea7d reset m_iMaxDriverFrame in RageSound::SoundIsFinishedPlaying, like StopPlaying 2006-12-23 10:15:23 +00:00
Glenn Maynard 9aaa59f26f remove id, registration; no longer needed 2006-12-23 10:07:20 +00:00
Glenn Maynard b97d8971f9 missed GetError commit 2006-12-23 10:04:49 +00:00
Glenn Maynard e7c9bb14c4 remove id, registration; no longer needed 2006-12-23 10:02:08 +00:00
Glenn Maynard 00f371fa7c remove IsStreamingFromDisk 2006-12-23 07:15:32 +00:00
Glenn Maynard edf8e73149 clarify 2006-12-23 04:27:41 +00:00
Glenn Maynard 0c88ceaa4b simplify 2006-12-23 04:23:19 +00:00
Glenn Maynard 76e3f6a14a simplify: remove RageSound::Fail 2006-12-23 04:16:21 +00:00
Glenn Maynard 9873757c06 merge GetData and GetDataToPlay; simplify 2006-12-23 04:13:18 +00:00
Glenn Maynard 9c8bd97190 remove unused 2006-12-23 04:07:46 +00:00
Glenn Maynard 6cc5a881bc cleanup 2006-12-23 04:06:42 +00:00
Glenn Maynard 39d435c186 unneeded 2006-12-23 04:05:58 +00:00
Glenn Maynard ce0308b234 return errors 2006-12-23 03:49:06 +00:00
Glenn Maynard f2eb0043de remove RageSound::IsStreamingFromDisk 2006-12-23 01:16:37 +00:00
Glenn Maynard c415651f58 cleanup; fix early out 2006-12-23 01:13:45 +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 4dd1f97875 remove unused 2006-12-22 21:56:02 +00:00
Glenn Maynard dddf431e42 use RageSoundReader_ThreadedBuffer 2006-12-22 21:46:03 +00:00
Glenn Maynard a583d179ca don't clamp iFrames when seeking 2006-12-22 21:44:36 +00:00
Glenn Maynard b88f5da9ef comments 2006-12-22 21:43:22 +00:00
Glenn Maynard 6344552161 use RageSoundReader_Extend to implement some features 2006-12-22 21:41:28 +00:00
Glenn Maynard 24624a5c92 GetDataToPlay API more like RSR::Read 2006-12-22 21:24:19 +00:00
Glenn Maynard 3a1d1e129f use RetriedRead 2006-12-22 06:14:20 +00:00
Glenn Maynard fa33890a78 fix RageSoundReader_Silence END_OF_FILE 2006-12-21 23:41:02 +00:00
Glenn Maynard aa4be6dffb Return 1 from SetPosition(n) on success, 0 on seek past EOF, not
"the position seeked to".  This fixes a special case: SetPosition(n)
returning 0 was EOF except when SetPosition(0).  The returned value
on success was always n, anyway; we never seek to a different position
and return success.
2006-12-21 05:07:49 +00:00
Glenn Maynard 1786d99735 GetPositionSeconds(&tm) returns the clock time timestamp associated with the
returned sound time.  This is tricky: we may be interrupted, causing timing error.

We tried working around this by trying to hint the scheduler that we're in a
period where we don't want to be interrupted, even though we're in a thread
that's not normally high priority, by boosting the priority temporarily.  This
worked in Windows, but not in general; it's too far out of the expectations of
schedulers and generally just made things worse.

Let's look at this like an interruption-based lockless algorithm: try it, see
if it succeeded, and if it failed, try again.

Retrying even once should be a rare exception, but failsafe anyway, so a bug
in a sound driver won't hang.
2006-12-19 08:00:45 +00:00
Glenn Maynard 5bfc731036 remove old GetPCM 2006-12-13 18:40:02 +00:00
Glenn Maynard 7fecf43f1d update comment 2006-12-13 18:38:07 +00:00
Glenn Maynard 95f72debdc remove pSound param 2006-12-13 09:17:48 +00:00
Glenn Maynard 2377925f41 remove iRate param 2006-12-13 09:15:29 +00:00
Glenn Maynard a62b963fb8 make GetNumChannels pure virtual
not 1 or 2 anymore; RageSound only supports 1 or 2 but intermediate
filters may have more
2006-12-10 09:04:58 +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 5ad35cc6c6 add a failsafe; this runs in a high-priority thread 2006-12-10 07:12:20 +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 e0dde38b2e don't seek sources below 0 2006-12-10 03:32:56 +00:00
Glenn Maynard 8c7173f26c use RageSoundReader_Pan for panning 2006-12-10 00:43:51 +00:00
Glenn Maynard 602db9c431 bind SetProperty 2006-12-10 00:36:27 +00:00
Glenn Maynard d30d0c0e76 expose SetProperty 2006-12-09 23:54:33 +00:00
Glenn Maynard ca67a9cb7c change SetPosition_Accurate and SetPosition_Fast to take and return frames 2006-12-09 06:35:09 +00:00