void CCoreAudioDevice::Close() { if (!m_DeviceId) return; Stop(); // Stop the device if it was started RemoveIOProc(); // Unregister the IOProc if we have one SetHogStatus(false); if (m_MixerRestore > -1) // We changed the mixer status SetMixingSupport((m_MixerRestore ? true : false)); m_MixerRestore = -1; if (m_SampleRateRestore != 0.0f) { CLog::Log(LOGDEBUG, "CCoreAudioUnit::Close: Restoring original nominal samplerate."); SetNominalSampleRate(m_SampleRateRestore); } CLog::Log(LOGDEBUG, "CCoreAudioDevice::Close: Closed device 0x%04x", m_DeviceId); m_DeviceId = 0; m_IoProc = NULL; }
void CCoreAudioDevice::Close() { if (!m_DeviceId) return; // Stop the device if it was started Stop(); // Unregister the IOProc if we have one RemoveIOProc(); SetHogStatus(false); CCoreAudioHardware::SetAutoHogMode(false); if (m_MixerRestore > -1) // We changed the mixer status SetMixingSupport((m_MixerRestore ? true : false)); m_MixerRestore = -1; if (m_SampleRateRestore != 0.0f) SetNominalSampleRate(m_SampleRateRestore); if (m_BufferSizeRestore && m_BufferSizeRestore != GetBufferSize()) { SetBufferSize(m_BufferSizeRestore); m_BufferSizeRestore = 0; } m_IoProc = NULL; m_DeviceId = 0; m_ObjectListenerProc = NULL; }
bool CCoreAudioDevice::SetInputSource(ICoreAudioSource* pSource, unsigned int frameSize, unsigned int outputBufferIndex) { m_pSource = pSource; m_frameSize = frameSize; m_OutputBufferIndex = outputBufferIndex; if (pSource) return AddIOProc(); else return RemoveIOProc(); }