VirtualBox

Changeset 83239 in vbox


Ignore:
Timestamp:
Mar 10, 2020 10:13:59 AM (5 years ago)
Author:
vboxsync
Message:

Audio/Win: Added ability to register/unregister the IMMNotificationClient interface at runtime.

Location:
trunk/src/VBox/Devices/Audio
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/VBoxMMNotificationClient.cpp

    r83238 r83239  
    4444
    4545/**
    46  * Uninitializes the mulitmedia notification client implementation.
    47  */
    48 void VBoxMMNotificationClient::Dispose(void)
     46 * Registers the mulitmedia notification client implementation.
     47 */
     48HRESULT VBoxMMNotificationClient::Register(void)
     49{
     50    HRESULT hr = m_pEnum->RegisterEndpointNotificationCallback(this);
     51    if (SUCCEEDED(hr))
     52    {
     53        m_fRegisteredClient = true;
     54
     55        hr = AttachToDefaultEndpoint();
     56    }
     57
     58    return hr;
     59}
     60
     61/**
     62 * Unregisters the mulitmedia notification client implementation.
     63 */
     64void VBoxMMNotificationClient::Unregister(void)
    4965{
    5066    DetachFromEndpoint();
     
    6783    HRESULT hr = CoCreateInstance(__uuidof(MMDeviceEnumerator), 0, CLSCTX_ALL, __uuidof(IMMDeviceEnumerator),
    6884                                  (void **)&m_pEnum);
    69     if (SUCCEEDED(hr))
    70     {
    71         hr = m_pEnum->RegisterEndpointNotificationCallback(this);
    72         if (SUCCEEDED(hr))
    73         {
    74             m_fRegisteredClient = true;
    75 
    76             hr = AttachToDefaultEndpoint();
    77         }
    78     }
    7985
    8086    LogFunc(("Returning %Rhrc\n",  hr));
  • trunk/src/VBox/Devices/Audio/VBoxMMNotificationClient.h

    r83238 r83239  
    4747
    4848    HRESULT Initialize();
     49
     50    HRESULT Register(void);
     51    void    Unregister(void);
     52
    4953    int     RegisterCallback(PPDMDRVINS pDrvIns, PFNPDMHOSTAUDIOCALLBACK pfnCallback);
    5054    void    UnregisterCallback(void);
    51     void    Dispose();
    5255
    5356    /** @name IUnknown interface
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette