// ---------------------------------------------------------------------- // Call when the app is done with this object before calling release. // This detaches from the endpoint and releases all audio service references. // // ---------------------------------------------------------------------- void CVolumeMonitor::Dispose() { DetachFromEndpoint(); if (m_bRegisteredForEndpointNotifications) { m_spEnumerator->UnregisterEndpointNotificationCallback(this); m_bRegisteredForEndpointNotifications = FALSE; } }
// ---------------------------------------------------------------------- // Call when the app is done with this object before calling release. // This detaches from the endpoint and releases all audio service references. // // ---------------------------------------------------------------------- void AudioVolume::Dispose() { TRACE("AudioVolume::Dispose Enters\n"); DetachFromEndpoint(); m_csEndpoint.Enter(); if (m_bRegisteredForEndpointNotifications) { m_spEnumerator->UnregisterEndpointNotificationCallback(this); m_bRegisteredForEndpointNotifications = FALSE; } m_csEndpoint.Leave(); SAFE_RELEASE(m_spEnumerator); }
// ---------------------------------------------------------------------- // Call this from the UI thread when the default device changes // // ---------------------------------------------------------------------- void CVolumeMonitor::ChangeEndpoint() { DetachFromEndpoint(); AttachToDefaultEndpoint(); }