[Summary] Improved backend workflow, added synchronization for cases when device reset happens on device parameter change

This commit is contained in:
Greg Zharun 2014-08-31 13:42:18 +03:00
parent 295f361f5e
commit 91fcacd150
12 changed files with 348 additions and 299 deletions

View file

@ -344,6 +344,28 @@ WTErr WCMRAudioDevice::SetStreaming (bool newState)
return (eNoErr);
}
WTErr WCMRAudioDevice::ResetDevice ()
{
// Keep device sates
bool wasStreaming = Streaming();
bool wasActive = Active();
WTErr err = SetStreaming(false);
if (err == eNoErr)
SetActive(false);
if (err == eNoErr && wasActive)
SetActive(true);
if (err == eNoErr && wasStreaming)
SetStreaming(true);
return err;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////
// IsProcessActive - returns true if process code is running.
// A normal audio device should return the Streaming() value