phantom header and default role recollection

This commit is contained in:
Hane 2023-08-29 19:00:07 +02:00
commit 5638f2e1f3
10 changed files with 354 additions and 46 deletions

View file

@ -4,7 +4,7 @@
class EndpointWidget;
class Endpoint;
class EndpointCallback;
class EndpointVolumeCallback;
class Overseer;
enum AudioChannel {
@ -13,6 +13,26 @@ enum AudioChannel {
CHANNEL_MAIN = ~0,
};
enum EndpointState {
ENDPOINT_ACTIVE = (1 << 0),
ENDPOINT_DISABLED = (1 << 1),
ENDPOINT_NOTPRESENT = (1 << 2),
ENDPOINT_UNPLUGGED = (1 << 3),
};
enum Flows {
FLOW_PLAYBACK = (1 << 0),
FLOW_CAPTURE = (1 << 1),
FLOW_BOTH = (1 << 2),
};
enum Roles {
ROLE_CONSOLE = (1 << 0),
ROLE_MULTIMEDIA = (1 << 1),
ROLE_COMMUNICATIONS = (1 << 2),
ROLE_ALL = (7 << 0),
};
struct NGuid {
uint32_t data1;
uint16_t data2;
@ -29,7 +49,7 @@ struct NGuid {
/* } */
};
struct BackEndpointCallbackInfo {
struct BackEndpointVolumeCallbackInfo {
NGuid caller;
bool muted;
float mainVolume;
@ -43,10 +63,10 @@ public:
EndpointHandler(uint64_t idx);
//TODO: get();
Endpoint *ep = nullptr;
EndpointCallback *epc = nullptr;
EndpointVolumeCallback *epc = nullptr;
//std::wstring epName;
BackEndpointCallbackInfo* getCallbackInfo();
BackEndpointVolumeCallbackInfo* getCallbackInfo();
uint32_t getChannelCount();
void setIndex(uint64_t idx);
@ -56,14 +76,17 @@ public:
std::wstring getName();
float getVolume(int channel);
bool getMute();
uint8_t getState();
uint8_t getRoles();
void setVolume(NGuid* guid, int channel, int value);
void setMute(NGuid* guid, bool muted);
void setState(uint8_t state);
~EndpointHandler();
private:
uint64_t idx;
BackEndpointCallbackInfo callbackInfo;
BackEndpointVolumeCallbackInfo callbackInfo;
//QSlider *slidy;
};