poll merge squash
This commit is contained in:
parent
308a0486b6
commit
40bee90610
21 changed files with 2753 additions and 261 deletions
|
|
@ -1,48 +1,138 @@
|
|||
#pragma once
|
||||
#include <QObject>
|
||||
#include "backlasses.h"
|
||||
|
||||
#include "global.h"
|
||||
#include "contsessionclasses.h"
|
||||
//#define invoke_mem_fn(object,ptrToMember) ((object).*(ptrToMember))
|
||||
//#define pinvoke_mem_fn(object,ptrToMember) ((object)->*(ptrToMember))
|
||||
|
||||
class EndpointHandler : public QObject {
|
||||
Q_OBJECT
|
||||
class EndpointWidget;
|
||||
class Endpoint;
|
||||
class EndpointVolumeCallback;
|
||||
class Overseer;
|
||||
class SessionHandler;
|
||||
class EndpointNewSessionCallback;
|
||||
|
||||
struct BackEndpointVolumeCallbackInfo {
|
||||
NGuid caller;
|
||||
bool muted;
|
||||
float mainVolume;
|
||||
size_t channels;
|
||||
std::vector<float> channelVolumes;
|
||||
};
|
||||
|
||||
class EndpointHandler {
|
||||
|
||||
public:
|
||||
EndpointHandler(Endpoint *ept, QObject *parent = nullptr);
|
||||
QString getName();
|
||||
EndpointHandler(uint64_t idx, Flows flow);
|
||||
void setBackEndpointVolumeCallbackInfoContent(uint8_t state);
|
||||
|
||||
//these two, currently unused. If I use them, I should feel bad.
|
||||
//EndpointVolumeCallback* getEndpointVolumeCallback();
|
||||
//Endpoint* getEndpoint();
|
||||
|
||||
//std::wstring epName;
|
||||
BackEndpointVolumeCallbackInfo* getCallbackInfo();
|
||||
uint32_t getChannelCount();
|
||||
|
||||
void setIndex(uint64_t idx);
|
||||
uint64_t getIndex();
|
||||
void setVolume(int channel, float volume);
|
||||
|
||||
std::wstring getName();
|
||||
std::wstring getId();
|
||||
|
||||
void setFrontVisibilityInfo(EndpointState state, uint64_t frontIdx);
|
||||
uint64_t getFrontVisibilityIndex();
|
||||
EndpointState getFrontVisibilityState();
|
||||
|
||||
Flows getFlow();
|
||||
float getVolume(int channel);
|
||||
bool getMute();
|
||||
size_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);
|
||||
void setState(uint8_t state);
|
||||
void setState(uint8_t state, uint64_t idx);
|
||||
|
||||
/* sessions */
|
||||
size_t getSessionCount();
|
||||
std::vector<SessionHandler*> getSessionHandlers();
|
||||
void createNewSession();
|
||||
Endpoint* getEndpoint();
|
||||
|
||||
/*Session*/
|
||||
void addSessionSendFront(Session* session);
|
||||
void setAddSessionWidgetFunction(std::function<void(SessionHandler*)> addSessionWidget);
|
||||
void setRemoveSessionWidgetFunction(std::function<void(SessionHandler*)> removeSessionWidget);
|
||||
void sendSessionToFront(SessionHandler* sh);
|
||||
void removeSessionFromFront(SessionHandler* sh);
|
||||
|
||||
~EndpointHandler();
|
||||
private:
|
||||
Endpoint *ept;
|
||||
QString eptName;
|
||||
//QSlider *slidy;
|
||||
|
||||
public slots:
|
||||
void setValue(int channel, int value);
|
||||
void setMute();
|
||||
//signals:
|
||||
|
||||
std::vector<Session*> getSessions();
|
||||
|
||||
uint64_t idx;
|
||||
Endpoint *ep = nullptr;
|
||||
EndpointVolumeCallback *epc = nullptr;
|
||||
Flows flow;
|
||||
BackEndpointVolumeCallbackInfo callbackInfo;
|
||||
struct EndpointHandlerFrontVisibility {
|
||||
EndpointState visibility = EndpointState::ENDPOINT_ALL;
|
||||
uint64_t frontIdx = INT_MAX;
|
||||
};
|
||||
EndpointHandlerFrontVisibility ephfv;
|
||||
EndpointNewSessionCallback* ensc;
|
||||
std::vector<SessionHandler*> sessionHandlers;
|
||||
std::function<void(SessionHandler*)> addSessionWidget;
|
||||
std::function<void(SessionHandler*)> removeSessionWidget;
|
||||
//QSlider *slidy;
|
||||
};
|
||||
|
||||
|
||||
class OverseerHandler : public QObject {
|
||||
Q_OBJECT
|
||||
class OverseerHandler {
|
||||
|
||||
public:
|
||||
OverseerHandler(QObject *parent = nullptr);
|
||||
void setEndpointHandlers(std::vector<EndpointHandler*> *ephs);
|
||||
std::vector<EndpointHandler*>* getEndpointHandlers();
|
||||
static Overseer* getOverseer();
|
||||
OverseerHandler();
|
||||
void setChangeFrontDefaultsFunction(std::function<void(Roles, std::wstring)> changeFrontDefaults);
|
||||
void changeFrontDefaultsCallback(Roles role, std::wstring endpointId);
|
||||
|
||||
//void setReviseEndpointShowingFunction(std::function<void(std::wstring, EndpointState)> reviseEndpointShowing);
|
||||
void reviseEndpointShowing(std::wstring endpointId, EndpointState state);
|
||||
void setRemoveEndpointWidgetFunction(std::function<void(uint64_t)> removeEndpointWidget);
|
||||
void setAddEndpointWidgetFunction(std::function<void(EndpointHandler*)> addEndpointWidget);
|
||||
|
||||
void setEndpointHandlers(std::vector<EndpointHandler*> ephs);
|
||||
std::vector<EndpointHandler*> getPlaybackEndpointHandlers();
|
||||
std::vector<EndpointHandler*> getCaptureEndpointHandlers();
|
||||
std::vector<Endpoint*> getPlaybackEndpoints();
|
||||
std::vector<Endpoint*> getCaptureEndpoints();
|
||||
void pushBackEndpointHandler(EndpointHandler* eph, Flows flow);
|
||||
uint64_t getPlaybackEndpointsCount();
|
||||
uint64_t getCaptureEndpointsCount();
|
||||
void reloadEndpointHandlers();
|
||||
EndpointHandler* addEndpoint(std::wstring endpointId, Flows *flow);
|
||||
NGuid getGuid();
|
||||
|
||||
/*
|
||||
* void setSessionVolumeCallback(std::function<void(float)> changeSessionVolume);
|
||||
* void setSessionVolume(float newValue, );
|
||||
*/
|
||||
|
||||
private:
|
||||
static Overseer os;
|
||||
std::vector<EndpointHandler*> *endpointHandlers;
|
||||
//QSlider *slidy;
|
||||
|
||||
//public slots:
|
||||
//void setValue(int value);
|
||||
|
||||
|
||||
Overseer *os;
|
||||
std::vector<EndpointHandler*> playbackEndpointHandlers;
|
||||
std::vector<EndpointHandler*> captureEndpointHandlers;
|
||||
std::function<void(Roles, std::wstring /* endpointid */)> changeFrontDefaults;
|
||||
std::function<void(uint64_t /* epw id */)> removeEndpointWidget;
|
||||
std::function<void(EndpointHandler*)> addEndpointWidget;
|
||||
|
||||
/* Session's */
|
||||
std::function<void(float)> changeSessionVolume;
|
||||
//std::function<void(uint64_t /* device */, uint32_t /* channel */, float /* value */)> updateFrontVolumeCallback;
|
||||
//std::function<void(uint64_t /* device */, bool /* mute */)> updateFrontMuteCallback;
|
||||
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue