コード例 #1
0
// ----------------------------------------------------------------------
//  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;
    }
}
コード例 #2
0
ファイル: AudioVolume.cpp プロジェクト: yxl/Firefox-Muter
// ----------------------------------------------------------------------
//  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);
}
コード例 #3
0
// ----------------------------------------------------------------------
//  Call this from the UI thread when the default device changes
//
// ----------------------------------------------------------------------
void CVolumeMonitor::ChangeEndpoint()
{
    DetachFromEndpoint();

    AttachToDefaultEndpoint();
}