mirror of
https://github.com/jorio/Pomme.git
synced 2025-01-13 12:31:44 +00:00
SndChannelStatus: paused channels count as busy
This commit is contained in:
parent
fbdc8fcf5e
commit
caa3414833
@ -106,14 +106,20 @@ OSErr SndDisposeChannel(SndChannelPtr macChanPtr, Boolean quietNow)
|
|||||||
|
|
||||||
OSErr SndChannelStatus(SndChannelPtr chan, short theLength, SCStatusPtr theStatus)
|
OSErr SndChannelStatus(SndChannelPtr chan, short theLength, SCStatusPtr theStatus)
|
||||||
{
|
{
|
||||||
(void) theLength;
|
// Must have room to write an entire SCStatus struct
|
||||||
|
if ((size_t) theLength < sizeof(SCStatus))
|
||||||
|
{
|
||||||
|
return paramErr;
|
||||||
|
}
|
||||||
|
|
||||||
*theStatus = {};
|
*theStatus = {};
|
||||||
|
|
||||||
auto& source = GetChannelImpl(chan).source;
|
auto& source = GetChannelImpl(chan).source;
|
||||||
|
|
||||||
theStatus->scChannelPaused = source.GetState() == cmixer::CM_STATE_PAUSED;
|
int state = source.GetState();
|
||||||
theStatus->scChannelBusy = source.GetState() == cmixer::CM_STATE_PLAYING;
|
|
||||||
|
theStatus->scChannelPaused = state == cmixer::CM_STATE_PAUSED;
|
||||||
|
theStatus->scChannelBusy = state != cmixer::CM_STATE_STOPPED;
|
||||||
|
|
||||||
return noErr;
|
return noErr;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user