Example #1
0
    void Notify()
    {
        if (m_pbPlaying && !*m_pbPlaying)
        {
            Shutdown();
        }

        SCStatus stat;

        if (SndChannelStatus((SndChannelPtr)m_pSndChannel, sizeof(SCStatus), &stat) != 0)
            Shutdown();

        //if the sound isn't playing anymore, see if it's looped,
        //and if so play it again, otherwise close things up
        if (stat.scChannelBusy == FALSE)
        {
            if (m_bLoop)
            {
                if(SndPlay((SndChannelPtr)m_pSndChannel, (SndListHandle) m_hSnd, true) != noErr)
                    Shutdown();
            }
            else
                Shutdown();
        }
    }
Example #2
0
bool GBSoundChannel::Busy() {
	SCStatus status;
	if ( SndChannelStatus(channel, sizeof(SCStatus), &status) )
		throw GBGenericError("couldn't get sound channel status");
	if ( ! status.scChannelBusy )
		priority = 0;
	return status.scChannelBusy;
}
Example #3
0
static PyObject *SndCh_SndChannelStatus(SndChannelObject *_self, PyObject *_args)
{
	PyObject *_res = NULL;
	OSErr _err;
	short theLength;
	SCStatus theStatus__out__;
	if (!PyArg_ParseTuple(_args, "h",
	                      &theLength))
		return NULL;
	_err = SndChannelStatus(_self->ob_itself,
	                        theLength,
	                        &theStatus__out__);
	if (_err != noErr) return PyMac_Error(_err);
	_res = Py_BuildValue("s#",
	                     (char *)&theStatus__out__, (int)sizeof(SCStatus));
	return _res;
}
Example #4
0
void wxOSXSoundManagerSoundData::SoundTask()
{
    SCStatus stat;

    if (SndChannelStatus((SndChannelPtr)m_pSndChannel, sizeof(SCStatus), &stat) != 0)
        Stop();

    //if the sound isn't playing anymore, see if it's looped,
    //and if so play it again, otherwise close things up
    if (stat.scChannelBusy == FALSE)
    {
        if (m_flags & wxSOUND_LOOP)
        {
            if(SndPlay((SndChannelPtr)m_pSndChannel, (SndListHandle) m_hSnd, true) != noErr)
                Stop();
        }
        else
            Stop();
    }
}