back to front now works without hangs?

This commit is contained in:
Hane 2023-08-16 19:50:58 +02:00
commit 726f425e6d
5 changed files with 166 additions and 78 deletions

View file

@ -20,10 +20,18 @@ enum AudioChannel {
};
struct NGuid {
uint32_t data1;
uint16_t data2;
uint16_t data3;
unsigned char data4[8];
uint32_t data1;
uint16_t data2;
uint16_t data3;
unsigned char data4[8];
};
struct BackEndpointCallbackInfo {
NGuid* caller = new NGuid();
bool muted;
float mainVolume;
size_t channels;
float* channelVolumes = nullptr;
};
class EndpointHandler {
@ -69,15 +77,20 @@ public:
uint64_t getPlaybackEndpointsCount();
void reloadEndpointHandlers();
NGuid* getGuid();
void updateMuteCallback(uint64_t idx, bool muted);
void setFrontMuteCallback(std::function<void(uint64_t, bool)> f);
void setFrontVolumeCallback(std::function<void(uint64_t, uint32_t, float)> f);
//void updateMainVolumeCallback(uint64_t idx, float newVal);
void updateVolumeCallback(uint64_t idx, uint32_t channel, float newVal);
void setUpdateFrontCallback(std::function<void(uint64_t, BackEndpointCallbackInfo*)> f);
//TODO: A EPH
BackEndpointCallbackInfo** callbackInfo = nullptr;
int callbackInfoSize = 0;
/* void updateMuteCallback(uint64_t idx, bool muted); */
/* void updateVolumeCallback(uint64_t idx, uint32_t channel, float newVal); */
//void receiveBackEndpointCallback(uint64_t index);
private:
static Overseer os;
std::vector<EndpointHandler*> endpointHandlers;
std::function<void(uint64_t /* device */, uint32_t /* channel */, float /* value */)> updateFrontVolumeCallback;
std::function<void(uint64_t /* device */, bool /* mute */)> updateFrontMuteCallback;