session baby steps

This commit is contained in:
Hane 2023-09-18 23:37:06 +02:00
commit 7eb6e29ee6
14 changed files with 393 additions and 87 deletions

View file

@ -1,4 +1,7 @@
#pragma once
#include "global.h"
#include "contsessionclasses.h"
//#define invoke_mem_fn(object,ptrToMember) ((object).*(ptrToMember))
//#define pinvoke_mem_fn(object,ptrToMember) ((object)->*(ptrToMember))
@ -6,50 +9,7 @@ class EndpointWidget;
class Endpoint;
class EndpointVolumeCallback;
class Overseer;
enum AudioChannel {
CHANNEL_LEFT = (1 << 0),
CHANNEL_RIGHT = (1 << 1),
CHANNEL_MAIN = ~0,
};
enum EndpointState {
ENDPOINT_ACTIVE = (1 << 0),
ENDPOINT_DISABLED = (1 << 1),
ENDPOINT_NOTPRESENT = (1 << 2),
ENDPOINT_UNPLUGGED = (1 << 3),
ENDPOINT_ALL = 0x0F
};
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 = 0x07,
};
struct NGuid {
//todo: still leaking?
uint32_t data1;
uint16_t data2;
uint16_t data3;
unsigned char data4[8];
/* void freeData4(){ */
/* int i = 0; */
/* do{ */
/* if(this->data4 + i != nullptr) free(data4 + i); */
/* i++; */
/* }while (i < 8); */
/* } */
};
class SessionHandler;
struct BackEndpointVolumeCallbackInfo {
NGuid caller;
@ -98,8 +58,14 @@ public:
void setState(uint8_t state);
void setState(uint8_t state, uint64_t idx);
/* sessions */
size_t getSessionCount();
std::vector<SessionHandler*> getSessionHandlers();
~EndpointHandler();
private:
std::vector<Session*> getSessions();
uint64_t idx;
Endpoint *ep = nullptr;
EndpointVolumeCallback *epc = nullptr;
@ -110,6 +76,7 @@ private:
uint64_t frontIdx = INT_MAX;
};
EndpointHandlerFrontVisibility ephfv;
std::vector<SessionHandler*> sessionHandlers;
//QSlider *slidy;
};