XnStatus LinkInputStream::Stop()
{
	if(--m_streamingRefcount == 0)
	{
		return StopImpl();
	}
	return XN_STATUS_OK;
}
    // called for background thread; changes state (since that can involve 
    // slow blocking calls) and updates the state (since the state is read 
    // frequently and querying the device is a bit slow)  
    bool ThreadIteration()
    {
        // fetch the current requested state and copy it to the current state
        int nRequestedTrack;
        int nOldTrack;
        {
            CriticalSectionLock lock(m_csTrack);

            nOldTrack = m_nCurrentTrack;
            nRequestedTrack = m_nQueuedTrack;
            
            if (nRequestedTrack != trackEmpty)
                m_nCurrentTrack = nRequestedTrack;
            m_nQueuedTrack = trackEmpty;
        }

        // if there is a new state requested, make that change
        if (nRequestedTrack != trackEmpty)
        {
            if (nRequestedTrack == trackStop)
                StopImpl();
            else 
                PlayImpl(nRequestedTrack);
        }
        // otherwise, just update the current state
        else 
        {
            if ((nOldTrack != trackStop) && (IsPlayingImpl() != S_OK))
            {
                CriticalSectionLock lock(m_csTrack);
                m_nCurrentTrack = trackStop;
            }
        }

        return true;
    }
示例#3
0
void Argon::Thread::Stop()
{
	StopImpl();
}
 void ThreadCleanup()
 {
     StopImpl();
     mciSendCommand(m_idDevice, MCI_CLOSE, 0, NULL);
 }