wip: setenabled crash to fix

This commit is contained in:
Hane 2023-09-01 21:36:07 +02:00
commit 4fc1019409
6 changed files with 111 additions and 17 deletions

View file

@ -62,11 +62,11 @@ class EndpointHandler {
public:
EndpointHandler(uint64_t idx);
//TODO: get();
Endpoint *ep = nullptr;
EndpointVolumeCallback *epc = nullptr;
//these two, currently unused. If I use them, I should feel bad.
//EndpointVolumeCallback* getEndpointVolumeCallback();
//Endpoint* getEndpoint();
//std::wstring epName;
BackEndpointVolumeCallbackInfo* getCallbackInfo();
uint32_t getChannelCount();
@ -75,11 +75,15 @@ public:
void setVolume(int channel, float volume);
std::wstring getName();
std::wstring getId();
float getVolume(int channel);
bool getMute();
uint8_t getState();
uint8_t getRoles();
void setRoles(Roles newRole);
void assignRoles(Roles newRole);
void removeRoles(Roles newRole);
void setVolume(NGuid guid, int channel, int value);
void setMute(NGuid guid, bool muted);
@ -88,6 +92,8 @@ public:
~EndpointHandler();
private:
uint64_t idx;
Endpoint *ep = nullptr;
EndpointVolumeCallback *epc = nullptr;
BackEndpointVolumeCallbackInfo callbackInfo;
//QSlider *slidy;
};
@ -97,7 +103,9 @@ class OverseerHandler {
public:
OverseerHandler();
void setChangeFrontDefaultsFunction(std::function<void(Roles, wchar* endpointId)> changeFrontDefaults);
void setChangeFrontDefaultsFunction(std::function<void(Roles, std::wstring)> changeFrontDefaults);
void changeFrontDefaultsCallback(Roles role, std::wstring endpointId);
void setEndpointHandlers(std::vector<EndpointHandler*> ephs);
std::vector<EndpointHandler*> getEndpointHandlers();
std::vector<Endpoint*> getPlaybackEndpoints();
@ -108,7 +116,8 @@ public:
private:
Overseer *os;
std::vector<EndpointHandler*> endpointHandlers;
std::function<void(Roles, wchar* endpointId)> changeFrontDefaults;
std::function<void(Roles, std::wstring)> changeFrontDefaults;
//std::function<void(uint64_t /* device */, uint32_t /* channel */, float /* value */)> updateFrontVolumeCallback;
//std::function<void(uint64_t /* device */, bool /* mute */)> updateFrontMuteCallback;