poll merge squash
This commit is contained in:
parent
308a0486b6
commit
40bee90610
21 changed files with 2753 additions and 261 deletions
57
src/back/backsessionclasses.h
Normal file
57
src/back/backsessionclasses.h
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
#pragma once
|
||||
#include "msinclude.h"
|
||||
|
||||
#include "global.h"
|
||||
#include "contclasses.h"
|
||||
|
||||
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:
|
||||
Session(Endpoint* ep, IAudioSessionControl2* sessionControl, size_t idx);
|
||||
Session(Endpoint* ep, IAudioSessionControl2* sessionControl) : Session(ep, sessionControl, SIZE_MAX) {};
|
||||
void setVolume(NGuid guid, int channel, float volume);
|
||||
float getVolume(int channel);
|
||||
void setMute(NGuid guid, bool muted);
|
||||
bool getMute();
|
||||
SessionState getState();
|
||||
void setState(SessionState state);
|
||||
void setIndex(size_t idx);
|
||||
std::wstring getName();
|
||||
|
||||
void setStateCallback(SessionStateCallback *ssc);
|
||||
void removeStateCallback(SessionStateCallback *ssc);
|
||||
~Session();
|
||||
//uint32_t getChannelCount();
|
||||
|
||||
private:
|
||||
std::wstring fetchProcessName(DWORD pid);
|
||||
std::wstring sessionName;
|
||||
SessionState sessionState;
|
||||
Endpoint* ep;
|
||||
IAudioSessionControl2* sessionControl = nullptr;
|
||||
ISimpleAudioVolume* sessionVolume = nullptr;
|
||||
size_t idx;
|
||||
};
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue