Sunshine0.0.5917
Sunshine 0.0.5917
Self-hosted game stream host for Moonlight.
Loading...
Searching...
No Matches
platf::audio::audio_notification_t Class Reference

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

Inheritance diagram for platf::audio::audio_notification_t:
Collaboration diagram for platf::audio::audio_notification_t:

Public Member Functions

ULONG STDMETHODCALLTYPE AddRef () override
 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) override
 Handle a Windows default-audio-device change notification.
HRESULT STDMETHODCALLTYPE OnDeviceAdded (LPCWSTR pwstrDeviceId) override
 Ignore endpoint-add notifications.
HRESULT STDMETHODCALLTYPE OnDeviceRemoved (LPCWSTR pwstrDeviceId) override
 Ignore endpoint-removal notifications.
HRESULT STDMETHODCALLTYPE OnDeviceStateChanged (LPCWSTR pwstrDeviceId, DWORD dwNewState) override
 Handle Windows audio endpoint state changes.
HRESULT STDMETHODCALLTYPE OnPropertyValueChanged (LPCWSTR pwstrDeviceId, const PROPERTYKEY key) override
 Handle Windows audio endpoint property changes.
HRESULT STDMETHODCALLTYPE QueryInterface (REFIID riid, VOID **ppvInterface) override
 Implement IUnknown's interface query for the endpoint notification callback.
ULONG STDMETHODCALLTYPE Release () override
 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 ( )
inlineoverride

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 )
inlineoverride

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)
inlineoverride

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)
inlineoverride

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 )
inlineoverride

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 )
inlineoverride

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 )
inlineoverride

Implement IUnknown's interface query for the endpoint 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 ( )
inlineoverride

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: