75 lines
1.6 KiB
C++
75 lines
1.6 KiB
C++
#pragma once
|
|
|
|
/* #ifndef QTBLESSED */
|
|
/* //#define Q_OBJECT */
|
|
/* class QWidget{}; */
|
|
/* class QMainWindow{}; */
|
|
/* #endif */
|
|
|
|
class EndpointWidget;
|
|
|
|
class Endpoint;
|
|
class EndpointCallback;
|
|
class Overseer;
|
|
|
|
struct NGuid {
|
|
uint32_t data1;
|
|
uint16_t data2;
|
|
uint16_t data3;
|
|
unsigned char data4[8];
|
|
};
|
|
|
|
class EndpointHandler {
|
|
|
|
public:
|
|
EndpointHandler(uint64_t idx);
|
|
//TODO: get();
|
|
Endpoint *ep = nullptr;
|
|
EndpointCallback *epc = nullptr;
|
|
//std::wstring epName;
|
|
|
|
uint32_t getChannelCount();
|
|
|
|
void setIndex(uint64_t idx);
|
|
uint64_t getIndex();
|
|
void setVolume(int channel, float volume);
|
|
|
|
std::wstring getName();
|
|
float getVolume(int channel);
|
|
bool getMute();
|
|
|
|
void setVolume(NGuid* guid, int channel, int value);
|
|
void setMute(NGuid* guid, bool muted);
|
|
~EndpointHandler();
|
|
private:
|
|
uint64_t idx;
|
|
//QSlider *slidy;
|
|
|
|
//signals:
|
|
|
|
|
|
};
|
|
|
|
|
|
class OverseerHandler {
|
|
|
|
public:
|
|
//OverseerHandler();
|
|
void setEndpointHandlers(std::vector<EndpointHandler*> ephs);
|
|
void setEndpointWidgets(std::vector<EndpointWidget*> ews);
|
|
std::vector<EndpointHandler*> getEndpointHandlers();
|
|
std::vector<Endpoint*> getPlaybackEndpoints();
|
|
uint64_t getPlaybackEndpointsCount();
|
|
void reloadEndpointHandlers();
|
|
NGuid* getGuid();
|
|
void updateMuteCallback(uint64_t idx, bool muted);
|
|
void updateMainVolumeCallback(uint64_t idx, float newVal);
|
|
|
|
//void parseExternalEndpointCallback(EndpointCallback *epc, PAUDIO_VOLUME_NOTIFICATION_DATA pNotify);
|
|
//static Overseer* getOverseer();
|
|
|
|
private:
|
|
static Overseer os;
|
|
std::vector<EndpointHandler*> endpointHandlers;
|
|
std::vector<EndpointWidget*> endpointWidgets;
|
|
};
|