session volume/mute polling
This commit is contained in:
parent
cb9446cb42
commit
064c16d9e7
10 changed files with 263 additions and 4 deletions
|
|
@ -6,6 +6,26 @@
|
|||
|
||||
class Endpoint;
|
||||
|
||||
class SessionStateCallback : public IAudioSessionEvents {
|
||||
public:
|
||||
SessionStateCallback(SessionHandler *sh);
|
||||
ULONG AddRef();
|
||||
ULONG Release();
|
||||
HRESULT QueryInterface(REFIID riid, VOID **ppvInterface);
|
||||
HRESULT OnSessionCreated(IAudioSessionControl *NewSession);
|
||||
HRESULT OnChannelVolumeChanged(DWORD ChannelCount, float NewChannelVolumeArray[], DWORD ChangedChannel, LPCGUID EventContext);
|
||||
HRESULT OnDisplayNameChanged(LPCWSTR NewDisplayName, LPCGUID EventContext);
|
||||
HRESULT OnGroupingParamChanged( LPCGUID NewGroupingParam, LPCGUID EventContext);
|
||||
HRESULT OnIconPathChanged(LPCWSTR NewIconPath, LPCGUID EventContext);
|
||||
HRESULT OnSessionDisconnected(AudioSessionDisconnectReason DisconnectReason);
|
||||
HRESULT OnSimpleVolumeChanged(float NewVolume, BOOL NewMute, LPCGUID EventContext);
|
||||
HRESULT OnStateChanged(AudioSessionState NewState);
|
||||
|
||||
private:
|
||||
ULONG ref = 1;
|
||||
SessionHandler *sh;
|
||||
};
|
||||
|
||||
class Session {
|
||||
|
||||
public:
|
||||
|
|
@ -15,6 +35,9 @@ class Session {
|
|||
void setMute(NGuid guid, bool muted);
|
||||
bool getMute();
|
||||
std::wstring getName();
|
||||
|
||||
void setStateCallback(SessionStateCallback *ssc);
|
||||
void removeStateCallback(SessionStateCallback *ssc);
|
||||
//uint32_t getChannelCount();
|
||||
|
||||
private:
|
||||
|
|
@ -25,3 +48,4 @@ class Session {
|
|||
ISimpleAudioVolume* sessionVolume = nullptr;
|
||||
size_t idx;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue