mirror of
https://github.com/jorio/Pomme.git
synced 2024-12-26 14:29:38 +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)
|
||||
{
|
||||
(void) theLength;
|
||||
// Must have room to write an entire SCStatus struct
|
||||
if ((size_t) theLength < sizeof(SCStatus))
|
||||
{
|
||||
return paramErr;
|
||||
}
|
||||
|
||||
*theStatus = {};
|
||||
|
||||
auto& source = GetChannelImpl(chan).source;
|
||||
|
||||
theStatus->scChannelPaused = source.GetState() == cmixer::CM_STATE_PAUSED;
|
||||
theStatus->scChannelBusy = source.GetState() == cmixer::CM_STATE_PLAYING;
|
||||
int state = source.GetState();
|
||||
|
||||
theStatus->scChannelPaused = state == cmixer::CM_STATE_PAUSED;
|
||||
theStatus->scChannelBusy = state != cmixer::CM_STATE_STOPPED;
|
||||
|
||||
return noErr;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user