Sunshine master
Self-hosted game stream host for Moonlight.
platf::audio::audio_notification_t Class Reference

Windows audio endpoint notification callback registered with MMDevice. More...

Inheritance diagram for platf::audio::audio_notification_t:
[legend]
Collaboration diagram for platf::audio::audio_notification_t:
[legend]

Public Member Functions

ULONG STDMETHODCALLTYPE AddRef ()
 Satisfy IUnknown reference counting for the notification callback.
 
bool check_default_render_device_changed ()
 Checks if the default rendering device changed and resets the change flag.
 
HRESULT STDMETHODCALLTYPE OnDefaultDeviceChanged (EDataFlow flow, ERole role, LPCWSTR pwstrDeviceId)
 Handle a Windows default-audio-device change notification.
 
HRESULT STDMETHODCALLTYPE OnDeviceAdded (LPCWSTR pwstrDeviceId)
 Ignore endpoint-add notifications.
 
HRESULT STDMETHODCALLTYPE OnDeviceRemoved (LPCWSTR pwstrDeviceId)
 Ignore endpoint-removal notifications.
 
HRESULT STDMETHODCALLTYPE OnDeviceStateChanged (LPCWSTR pwstrDeviceId, DWORD dwNewState)
 Handle Windows audio endpoint state changes.
 
HRESULT STDMETHODCALLTYPE OnPropertyValueChanged (LPCWSTR pwstrDeviceId, const PROPERTYKEY key)
 Handle Windows audio endpoint property changes.
 
HRESULT STDMETHODCALLTYPE QueryInterface (REFIID riid, VOID **ppvInterface)
 Return the supported COM interface for the notification callback.
 
ULONG STDMETHODCALLTYPE Release ()
 Release the COM or platform reference owned by the pointer.
 

Detailed Description

Windows audio endpoint notification callback registered with MMDevice.

Member Function Documentation

◆ AddRef()

ULONG STDMETHODCALLTYPE platf::audio::audio_notification_t::AddRef ( )
inline

Satisfy IUnknown reference counting for the notification callback.

Returns
Static reference count because the callback lifetime is externally owned.

◆ check_default_render_device_changed()

bool platf::audio::audio_notification_t::check_default_render_device_changed ( )
inline

Checks if the default rendering device changed and resets the change flag.

Returns
true if the device changed since last call

◆ OnDefaultDeviceChanged()

HRESULT STDMETHODCALLTYPE platf::audio::audio_notification_t::OnDefaultDeviceChanged ( EDataFlow flow,
ERole role,
LPCWSTR pwstrDeviceId )
inline

Handle a Windows default-audio-device change notification.

Parameters
flowAudio endpoint data-flow direction.
roleAudio endpoint role used for default-device lookup.
pwstrDeviceIdWindows endpoint ID for the new default device.
Returns
S_OK after recording the render-device change notification.

◆ OnDeviceAdded()

HRESULT STDMETHODCALLTYPE platf::audio::audio_notification_t::OnDeviceAdded ( LPCWSTR pwstrDeviceId)
inline

Ignore endpoint-add notifications.

Parameters
pwstrDeviceIdWindows endpoint ID for the added device.
Returns
S_OK because Sunshine does not act on this notification.

◆ OnDeviceRemoved()

HRESULT STDMETHODCALLTYPE platf::audio::audio_notification_t::OnDeviceRemoved ( LPCWSTR pwstrDeviceId)
inline

Ignore endpoint-removal notifications.

Parameters
pwstrDeviceIdWindows endpoint ID for the removed device.
Returns
S_OK because Sunshine does not act on this notification.

◆ OnDeviceStateChanged()

HRESULT STDMETHODCALLTYPE platf::audio::audio_notification_t::OnDeviceStateChanged ( LPCWSTR pwstrDeviceId,
DWORD dwNewState )
inline

Handle Windows audio endpoint state changes.

Parameters
pwstrDeviceIdAudio device ID.
dwNewStateNew device state.
Returns
COM status code.

◆ OnPropertyValueChanged()

HRESULT STDMETHODCALLTYPE platf::audio::audio_notification_t::OnPropertyValueChanged ( LPCWSTR pwstrDeviceId,
const PROPERTYKEY key )
inline

Handle Windows audio endpoint property changes.

Parameters
pwstrDeviceIdAudio device ID.
keyChanged property key.
Returns
COM status code.

◆ QueryInterface()

HRESULT STDMETHODCALLTYPE platf::audio::audio_notification_t::QueryInterface ( REFIID riid,
VOID ** ppvInterface )
inline

Return the supported COM interface for the notification callback.

Parameters
riidCOM interface identifier requested by QueryInterface.
ppvInterfaceOutput pointer receiving the requested interface.
Returns
S_OK when the interface is supported; E_NOINTERFACE otherwise.

◆ Release()

ULONG STDMETHODCALLTYPE platf::audio::audio_notification_t::Release ( )
inline

Release the COM or platform reference owned by the pointer.

Returns
Reference count or status returned after releasing the object.

The documentation for this class was generated from the following file: