various fixes
This commit is contained in:
parent
e278280c4b
commit
24110624fb
9 changed files with 163 additions and 137 deletions
|
|
@ -1,7 +1,7 @@
|
|||
QMAKE_CXXFLAGS += --target=x86_64-w64-mingw32 -g -gcodeview
|
||||
#QMAKE_LINK += clang++
|
||||
QMAKE_LFLAGS += --target=x86_64-w64-mingw32 -g -Wl,-pdb= -v
|
||||
|
||||
QMAKE_LFLAGS += --target=x86_64-w64-mingw32 -g -Wl,-pdb= -v
|
||||
LIBS += -LC:/capybara/libclang/x86_64-w64-mingw32/lib -lWinmm -lodbc32 -lodbccp32 -luuid -loleaut32 -lole32 -lshell32 -ladvapi32 -lcomdlg32 -lwinspool -lgdi32 -luser32 -lkernel32
|
||||
#"kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" -luuid -loleaut32 -lole32 -lshell32 -ladvapi32 -lcomdlg32 -lwinspool -lgdi32 -luser32 -lkernel32
|
||||
DEFINES += DEBUG
|
||||
CONFIG += debug console
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
GUID NGuidToGUID(NGuid* guid) {
|
||||
GUID NGuidToGUID(NGuid guid) {
|
||||
GUID msGuid = GUID();
|
||||
msGuid.Data1 = guid->data1;
|
||||
msGuid.Data2 = guid->data2;
|
||||
msGuid.Data3 = guid->data3;
|
||||
msGuid.Data1 = guid->data1;
|
||||
msGuid.Data1 = guid.data1;
|
||||
msGuid.Data2 = guid.data2;
|
||||
msGuid.Data3 = guid.data3;
|
||||
msGuid.Data1 = guid.data1;
|
||||
for (int i = 0; i < 8; i++){
|
||||
msGuid.Data4[i] = guid->data4[i];
|
||||
msGuid.Data4[i] = guid.data4[i];
|
||||
//log_debugcpp("MSGUID DATA4 BYTE " << i << ": ");
|
||||
//log_debugcpp(print_as_binary(8, uint32_t, msGuid.Data4[i]));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ HRESULT EndpointVolumeCallback::QueryInterface(REFIID riid, VOID **ppvInterface)
|
|||
HRESULT EndpointVolumeCallback::OnNotify(PAUDIO_VOLUME_NOTIFICATION_DATA pNotify) {
|
||||
if (pNotify == NULL) return E_INVALIDARG;
|
||||
|
||||
//TODO: el default = objcopy frees?
|
||||
//delete osh->getEndpointHandlers().at(this->ep->getIndex())->getCallbackInfo()->caller;
|
||||
//osh->getEndpointHandlers().at(this->ep->getIndex())->getCallbackInfo()->caller.freeData4();
|
||||
//Could've made a function or = override to hide this within Nguid, but back in cont = bad.
|
||||
|
|
@ -142,7 +141,7 @@ uint8_t Endpoint::getState(){
|
|||
}
|
||||
|
||||
|
||||
void Endpoint::setVolume(NGuid* guid, int channel, float volume) {
|
||||
void Endpoint::setVolume(NGuid guid, int channel, float volume) {
|
||||
//TIP: There used to be log messages here. Now, it's a ghost town.
|
||||
GUID tempMsGuid = NGuidToGUID(guid);
|
||||
if (channel == AudioChannel::CHANNEL_MAIN) {
|
||||
|
|
@ -152,7 +151,7 @@ void Endpoint::setVolume(NGuid* guid, int channel, float volume) {
|
|||
}
|
||||
}
|
||||
|
||||
void Endpoint::setMute(NGuid* guid, bool muted) {
|
||||
void Endpoint::setMute(NGuid guid, bool muted) {
|
||||
GUID tempMsGuid = NGuidToGUID(guid);
|
||||
if(FAILED(endpointVolume->SetMute(muted, &tempMsGuid))) { /* TIP: Above */ };
|
||||
}
|
||||
|
|
@ -197,6 +196,10 @@ void Overseer::initCOMLibrary() {
|
|||
GUID tempGuid;
|
||||
if(FAILED(CoCreateGuid(&tempGuid))) { log_debugcpp("Failed to obtain GUID: " ); };
|
||||
this->guid = GUIDToNGuid(&tempGuid);
|
||||
|
||||
//if(FAILED(CoCreateInstance(__uuidof(CPolicyConfigClient),
|
||||
// NULL, CLSCTX_ALL, __uuidof(IPolicyConfig10), (LPVOID *)&policyConfig))) {exit(-1);}
|
||||
|
||||
//TODO: Release lpguid?
|
||||
//TODO: Uninitialize COM
|
||||
}
|
||||
|
|
@ -244,9 +247,9 @@ void Overseer::reloadEndpoints() {
|
|||
LPWSTR id = nullptr;
|
||||
|
||||
for (unsigned int j = 0; j < numPlaybackEndpoints; j++){
|
||||
std::wstring test = playbackDevices.at(j)->getId();
|
||||
std::wstring eptId = playbackDevices.at(j)->getId();
|
||||
temp->GetId(&id);
|
||||
int comparison = CompareStringEx(LOCALE_NAME_USER_DEFAULT, 0, test.c_str(), -987, id, -987, NULL, NULL, 0);
|
||||
int comparison = CompareStringEx(LOCALE_NAME_USER_DEFAULT, 0, eptId.c_str(), -987, id, -987, NULL, NULL, 0);
|
||||
if (comparison - 2 == 0) {
|
||||
log_wdebugcpp("ola defaul de " << i << " es " << id);
|
||||
playbackDevices.at(j)->setRoles((1 << i));
|
||||
|
|
@ -273,9 +276,8 @@ Overseer::Overseer(){
|
|||
|
||||
//int Overseer::getDefaultCaptureEndpoint(Endpoint** defaultEndpoint);
|
||||
|
||||
//TODO guid
|
||||
NGuid* Overseer::getGuid() {
|
||||
return &guid;
|
||||
NGuid Overseer::getGuid() {
|
||||
return guid;
|
||||
}
|
||||
|
||||
std::vector<Endpoint*> Overseer::getPlaybackEndpoints() {
|
||||
|
|
|
|||
|
|
@ -1,16 +1,15 @@
|
|||
#pragma once
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
//done by qt by def #define UNICODE
|
||||
#define _WIN32_WINNT 0x0A00
|
||||
#include <sdkddkver.h>
|
||||
|
||||
//#include "debug.h"
|
||||
/* #include <vector> */
|
||||
/* #include <iostream> */
|
||||
/* #include <wstring> */
|
||||
//done by qt by def #define UNICODE
|
||||
|
||||
#include <Windows.h>
|
||||
#include <mmdeviceapi.h>
|
||||
#include <combaseapi.h>
|
||||
#include <initguid.h>
|
||||
#include <Propidl.h>
|
||||
#include <functiondiscoverykeys_devpkey.h>
|
||||
|
||||
#include <endpointvolume.h>
|
||||
|
|
@ -20,6 +19,8 @@
|
|||
//#include <comip.h>
|
||||
#include <Winerror.h>
|
||||
#include <stringapiset.h>
|
||||
#include "ipolicyconfig.h"
|
||||
#include <Mmreg.h>
|
||||
|
||||
#include "global.h"
|
||||
#include "contclasses.h"
|
||||
|
|
@ -32,10 +33,10 @@ class Endpoint {
|
|||
Endpoint(IMMDevice* endpoint, uint64_t idx);
|
||||
uint64_t getIndex();
|
||||
void setIndex(uint64_t idx);
|
||||
void setVolume(NGuid* guid, int channel, float volume);
|
||||
void setVolume(NGuid guid, int channel, float volume);
|
||||
uint32_t getChannelCount();
|
||||
float getVolume(int channel);
|
||||
void setMute(NGuid* guid, bool muted);
|
||||
void setMute(NGuid guid, bool muted);
|
||||
bool getMute();
|
||||
void setState(uint8_t state);
|
||||
uint8_t getState();
|
||||
|
|
@ -82,7 +83,7 @@ class Overseer {
|
|||
Overseer();
|
||||
std::vector<Endpoint*> getPlaybackEndpoints();
|
||||
void reloadEndpoints();
|
||||
NGuid* getGuid();
|
||||
NGuid getGuid();
|
||||
//~Overseer();
|
||||
//int getDefaultPlaybackEndpoint(Endpoint** defaultEndpoint);
|
||||
//int getDefaultCaptureEndpoint(Endpoint** defaultEndpoint);
|
||||
|
|
@ -94,6 +95,7 @@ class Overseer {
|
|||
NGuid guid;
|
||||
unsigned int numPlaybackEndpoints;
|
||||
IMMDeviceEnumerator *deviceEnumerator;
|
||||
IPolicyConfig *policyConfig;
|
||||
std::vector<Endpoint*> playbackDevices;
|
||||
void initCOMLibrary();
|
||||
//IMMDeviceCollection *deviceCollection;
|
||||
|
|
|
|||
|
|
@ -9,6 +9,18 @@
|
|||
#pragma once
|
||||
|
||||
|
||||
interface DECLSPEC_UUID("CA286FC3-91FD-42C3-8E9B-CAAFA66242E3")
|
||||
IPolicyConfig10;
|
||||
|
||||
interface DECLSPEC_UUID("00000000-0000-0000-C000-000000000046")
|
||||
IPolicyConfig10_1;
|
||||
|
||||
interface DECLSPEC_UUID("F8679F50-850A-41CF-9C72-430F290290C8")
|
||||
IPolicyConfig7;
|
||||
|
||||
/* interface DECLSPEC_UUID("568B9108-44BF-40B4-9006-86AFE5B5A620") */
|
||||
/* IPolicyConfigVista; */
|
||||
|
||||
interface DECLSPEC_UUID("f8679f50-850a-41cf-9c72-430f290290c8")
|
||||
IPolicyConfig;
|
||||
class DECLSPEC_UUID("870af99c-171d-4f9e-af0d-e63df40c2bc9")
|
||||
|
|
@ -86,8 +98,8 @@ public:
|
|||
);
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE SetDefaultEndpoint(
|
||||
__in PCWSTR wszDeviceId,
|
||||
__in ERole eRole
|
||||
PCWSTR wszDeviceId,
|
||||
ERole eRole
|
||||
);
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE SetEndpointVisibility(
|
||||
|
|
@ -96,85 +108,85 @@ public:
|
|||
);
|
||||
};
|
||||
|
||||
interface DECLSPEC_UUID("568b9108-44bf-40b4-9006-86afe5b5a620")
|
||||
IPolicyConfigVista;
|
||||
class DECLSPEC_UUID("294935CE-F637-4E7C-A41B-AB255460B862")
|
||||
CPolicyConfigVistaClient;
|
||||
// ----------------------------------------------------------------------------
|
||||
// class CPolicyConfigVistaClient
|
||||
// {294935CE-F637-4E7C-A41B-AB255460B862}
|
||||
//
|
||||
// interface IPolicyConfigVista
|
||||
// {568b9108-44bf-40b4-9006-86afe5b5a620}
|
||||
//
|
||||
// Query interface:
|
||||
// CComPtr<IPolicyConfigVista> PolicyConfig;
|
||||
// PolicyConfig.CoCreateInstance(__uuidof(CPolicyConfigVistaClient));
|
||||
//
|
||||
// @compatible: Windows Vista and Later
|
||||
// ----------------------------------------------------------------------------
|
||||
interface IPolicyConfigVista : public IUnknown
|
||||
{
|
||||
public:
|
||||
/* interface DECLSPEC_UUID("568b9108-44bf-40b4-9006-86afe5b5a620") */
|
||||
/* IPolicyConfigVista; */
|
||||
/* class DECLSPEC_UUID("294935CE-F637-4E7C-A41B-AB255460B862") */
|
||||
/* CPolicyConfigVistaClient; */
|
||||
/* // ---------------------------------------------------------------------------- */
|
||||
/* // class CPolicyConfigVistaClient */
|
||||
/* // {294935CE-F637-4E7C-A41B-AB255460B862} */
|
||||
/* // */
|
||||
/* // interface IPolicyConfigVista */
|
||||
/* // {568b9108-44bf-40b4-9006-86afe5b5a620} */
|
||||
/* // */
|
||||
/* // Query interface: */
|
||||
/* // CComPtr<IPolicyConfigVista> PolicyConfig; */
|
||||
/* // PolicyConfig.CoCreateInstance(__uuidof(CPolicyConfigVistaClient)); */
|
||||
/* // */
|
||||
/* // @compatible: Windows Vista and Later */
|
||||
/* // ---------------------------------------------------------------------------- */
|
||||
/* interface IPolicyConfigVista : public IUnknown */
|
||||
/* { */
|
||||
/* public: */
|
||||
|
||||
virtual HRESULT GetMixFormat(
|
||||
PCWSTR,
|
||||
WAVEFORMATEX **
|
||||
); // not available on Windows 7, use method from IPolicyConfig
|
||||
/* virtual HRESULT GetMixFormat( */
|
||||
/* PCWSTR, */
|
||||
/* WAVEFORMATEX ** */
|
||||
/* ); // not available on Windows 7, use method from IPolicyConfig */
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetDeviceFormat(
|
||||
PCWSTR,
|
||||
INT,
|
||||
WAVEFORMATEX **
|
||||
);
|
||||
/* virtual HRESULT STDMETHODCALLTYPE GetDeviceFormat( */
|
||||
/* PCWSTR, */
|
||||
/* INT, */
|
||||
/* WAVEFORMATEX ** */
|
||||
/* ); */
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE SetDeviceFormat(
|
||||
PCWSTR,
|
||||
WAVEFORMATEX *,
|
||||
WAVEFORMATEX *
|
||||
);
|
||||
/* virtual HRESULT STDMETHODCALLTYPE SetDeviceFormat( */
|
||||
/* PCWSTR, */
|
||||
/* WAVEFORMATEX *, */
|
||||
/* WAVEFORMATEX * */
|
||||
/* ); */
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetProcessingPeriod(
|
||||
PCWSTR,
|
||||
INT,
|
||||
PINT64,
|
||||
PINT64
|
||||
); // not available on Windows 7, use method from IPolicyConfig
|
||||
/* virtual HRESULT STDMETHODCALLTYPE GetProcessingPeriod( */
|
||||
/* PCWSTR, */
|
||||
/* INT, */
|
||||
/* PINT64, */
|
||||
/* PINT64 */
|
||||
/* ); // not available on Windows 7, use method from IPolicyConfig */
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE SetProcessingPeriod(
|
||||
PCWSTR,
|
||||
PINT64
|
||||
); // not available on Windows 7, use method from IPolicyConfig
|
||||
/* virtual HRESULT STDMETHODCALLTYPE SetProcessingPeriod( */
|
||||
/* PCWSTR, */
|
||||
/* PINT64 */
|
||||
/* ); // not available on Windows 7, use method from IPolicyConfig */
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetShareMode(
|
||||
PCWSTR,
|
||||
struct DeviceShareMode *
|
||||
); // not available on Windows 7, use method from IPolicyConfig
|
||||
/* virtual HRESULT STDMETHODCALLTYPE GetShareMode( */
|
||||
/* PCWSTR, */
|
||||
/* struct DeviceShareMode * */
|
||||
/* ); // not available on Windows 7, use method from IPolicyConfig */
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE SetShareMode(
|
||||
PCWSTR,
|
||||
struct DeviceShareMode *
|
||||
); // not available on Windows 7, use method from IPolicyConfig
|
||||
/* virtual HRESULT STDMETHODCALLTYPE SetShareMode( */
|
||||
/* PCWSTR, */
|
||||
/* struct DeviceShareMode * */
|
||||
/* ); // not available on Windows 7, use method from IPolicyConfig */
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetPropertyValue(
|
||||
PCWSTR,
|
||||
const PROPERTYKEY &,
|
||||
PROPVARIANT *
|
||||
);
|
||||
/* virtual HRESULT STDMETHODCALLTYPE GetPropertyValue( */
|
||||
/* PCWSTR, */
|
||||
/* const PROPERTYKEY &, */
|
||||
/* PROPVARIANT * */
|
||||
/* ); */
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE SetPropertyValue(
|
||||
PCWSTR,
|
||||
const PROPERTYKEY &,
|
||||
PROPVARIANT *
|
||||
);
|
||||
/* virtual HRESULT STDMETHODCALLTYPE SetPropertyValue( */
|
||||
/* PCWSTR, */
|
||||
/* const PROPERTYKEY &, */
|
||||
/* PROPVARIANT * */
|
||||
/* ); */
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE SetDefaultEndpoint(
|
||||
__in PCWSTR wszDeviceId,
|
||||
__in ERole eRole
|
||||
);
|
||||
/* virtual HRESULT STDMETHODCALLTYPE SetDefaultEndpoint( */
|
||||
/* __in PCWSTR wszDeviceId, */
|
||||
/* __in ERole eRole */
|
||||
/* ); */
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE SetEndpointVisibility(
|
||||
PCWSTR,
|
||||
INT
|
||||
); // not available on Windows 7, use method from IPolicyConfig
|
||||
};
|
||||
/* virtual HRESULT STDMETHODCALLTYPE SetEndpointVisibility( */
|
||||
/* PCWSTR, */
|
||||
/* INT */
|
||||
/* ); // not available on Windows 7, use method from IPolicyConfig */
|
||||
/* }; */
|
||||
|
|
|
|||
|
|
@ -2,9 +2,6 @@
|
|||
#include "contclasses.h"
|
||||
//TODO: pragma once
|
||||
|
||||
//TODO: ?????
|
||||
Overseer OverseerHandler::os;
|
||||
|
||||
EndpointHandler::EndpointHandler(uint64_t idx) {
|
||||
//std::vector<Endpoint*> endpoints = osh->getPlaybackEndpoints().at(idx);
|
||||
this->ep = osh->getPlaybackEndpoints().at(idx);
|
||||
|
|
@ -39,13 +36,13 @@ uint64_t EndpointHandler::getIndex(){
|
|||
/*
|
||||
* -1 for master volume
|
||||
*/
|
||||
void EndpointHandler::setVolume(NGuid* guid, int channel, int value){
|
||||
void EndpointHandler::setVolume(NGuid guid, int channel, int value){
|
||||
if (channel == AudioChannel::CHANNEL_MAIN)
|
||||
ep->setVolume(guid, channel, (float)value / 100);
|
||||
else ep->setVolume(guid, channel, (float)value / 100);
|
||||
}
|
||||
|
||||
void EndpointHandler::setMute(NGuid* guid, bool muted){
|
||||
void EndpointHandler::setMute(NGuid guid, bool muted){
|
||||
ep->setMute(guid, muted);
|
||||
}
|
||||
|
||||
|
|
@ -79,8 +76,12 @@ EndpointHandler::~EndpointHandler() {
|
|||
delete ep;
|
||||
}
|
||||
|
||||
OverseerHandler::OverseerHandler() {
|
||||
this->os = new Overseer();
|
||||
}
|
||||
|
||||
std::vector<Endpoint*> OverseerHandler::getPlaybackEndpoints() {
|
||||
return this->os.getPlaybackEndpoints();
|
||||
return this->os->getPlaybackEndpoints();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -89,7 +90,7 @@ std::vector<EndpointHandler*> OverseerHandler::getEndpointHandlers(){
|
|||
}
|
||||
|
||||
uint64_t OverseerHandler::getPlaybackEndpointsCount(){
|
||||
return this->os.getPlaybackEndpoints().size();
|
||||
return this->os->getPlaybackEndpoints().size();
|
||||
}
|
||||
|
||||
void OverseerHandler::reloadEndpointHandlers(){
|
||||
|
|
@ -113,8 +114,8 @@ void OverseerHandler::reloadEndpointHandlers(){
|
|||
//setEndpointHandlers(ephs);
|
||||
}
|
||||
|
||||
NGuid* OverseerHandler::getGuid() {
|
||||
return this->os.getGuid();
|
||||
NGuid OverseerHandler::getGuid() {
|
||||
return this->os->getGuid();
|
||||
}
|
||||
|
||||
void OverseerHandler::setEndpointHandlers(std::vector<EndpointHandler*> ephs){
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ enum Roles {
|
|||
ROLE_CONSOLE = (1 << 0),
|
||||
ROLE_MULTIMEDIA = (1 << 1),
|
||||
ROLE_COMMUNICATIONS = (1 << 2),
|
||||
ROLE_ALL = (7 << 0),
|
||||
ROLE_ALL = 0x07,
|
||||
};
|
||||
|
||||
struct NGuid {
|
||||
|
|
@ -79,8 +79,8 @@ public:
|
|||
uint8_t getState();
|
||||
uint8_t getRoles();
|
||||
|
||||
void setVolume(NGuid* guid, int channel, int value);
|
||||
void setMute(NGuid* guid, bool muted);
|
||||
void setVolume(NGuid guid, int channel, int value);
|
||||
void setMute(NGuid guid, bool muted);
|
||||
void setState(uint8_t state);
|
||||
|
||||
~EndpointHandler();
|
||||
|
|
@ -94,16 +94,16 @@ private:
|
|||
class OverseerHandler {
|
||||
|
||||
public:
|
||||
//OverseerHandler();
|
||||
OverseerHandler();
|
||||
void setEndpointHandlers(std::vector<EndpointHandler*> ephs);
|
||||
std::vector<EndpointHandler*> getEndpointHandlers();
|
||||
std::vector<Endpoint*> getPlaybackEndpoints();
|
||||
uint64_t getPlaybackEndpointsCount();
|
||||
void reloadEndpointHandlers();
|
||||
NGuid* getGuid();
|
||||
NGuid getGuid();
|
||||
|
||||
private:
|
||||
static Overseer os;
|
||||
Overseer *os;
|
||||
std::vector<EndpointHandler*> endpointHandlers;
|
||||
|
||||
//std::function<void(uint64_t /* device */, uint32_t /* channel */, float /* value */)> updateFrontVolumeCallback;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ EndpointWidget::EndpointWidget(uint64_t idx, EndpointHandler* eph, QWidget *pare
|
|||
log_debugcpp("olaW");
|
||||
if (parent == nullptr) { log_debugcpp("owo?"); }
|
||||
|
||||
|
||||
defaultRolesCheckBoxes = {
|
||||
{Roles::ROLE_ALL, new QCheckBox()},
|
||||
{Roles::ROLE_CONSOLE, new QCheckBox()},
|
||||
|
|
@ -68,14 +67,22 @@ EndpointWidget::EndpointWidget(uint64_t idx, EndpointHandler* eph, QWidget *pare
|
|||
|
||||
uint8_t assignedRoles = eph->getRoles();
|
||||
defaultRolesCheckBoxes.at(Roles::ROLE_ALL)->setCheckState(assignedRoles == Roles::ROLE_ALL ? Qt::Checked : Qt::Unchecked);
|
||||
/*
|
||||
* {ROLE_ALL, new QCheckBox(this)},
|
||||
* {ROLE_CONSOLE, new QCheckBox(this)},
|
||||
* {ROLE_MULTIMEDIA, new QCheckBox(this)},
|
||||
* {ROLE_COMMUNICATIONS, new QCheckBox(this)}
|
||||
* };
|
||||
*/
|
||||
defaultRolesCheckBoxes.at(Roles::ROLE_ALL)->setText(STRING_ROLE_ALL);
|
||||
|
||||
defaultRolesCheckBoxes.at(Roles::ROLE_CONSOLE)->setCheckState(assignedRoles & Roles::ROLE_CONSOLE ? Qt::Checked : Qt::Unchecked);
|
||||
defaultRolesCheckBoxes.at(Roles::ROLE_CONSOLE)->setText(STRING_ROLE_CONSOLE);
|
||||
|
||||
defaultRolesCheckBoxes.at(Roles::ROLE_MULTIMEDIA)->setCheckState(assignedRoles & Roles::ROLE_MULTIMEDIA ? Qt::Checked : Qt::Unchecked);
|
||||
defaultRolesCheckBoxes.at(Roles::ROLE_MULTIMEDIA)->setText(STRING_ROLE_MULTIMEDIA);
|
||||
|
||||
defaultRolesCheckBoxes.at(Roles::ROLE_COMMUNICATIONS)->setCheckState(assignedRoles & Roles::ROLE_COMMUNICATIONS ? Qt::Checked : Qt::Unchecked);
|
||||
defaultRolesCheckBoxes.at(Roles::ROLE_COMMUNICATIONS)->setText(STRING_ROLE_COMMUNICATIONS);
|
||||
|
||||
defaultRolesCheckBoxes.at(Roles::ROLE_ALL)->setText(STRING_ROLE_ALL);
|
||||
layout->addWidget(defaultRolesCheckBoxes.at(Roles::ROLE_ALL), 3, 0);
|
||||
layout->addWidget(defaultRolesCheckBoxes.at(Roles::ROLE_CONSOLE), 3, 1);
|
||||
layout->addWidget(defaultRolesCheckBoxes.at(Roles::ROLE_MULTIMEDIA), 3, 2);
|
||||
layout->addWidget(defaultRolesCheckBoxes.at(Roles::ROLE_COMMUNICATIONS), 3, 3);
|
||||
|
||||
|
||||
//Polling time
|
||||
|
|
@ -97,14 +104,14 @@ EndpointWidget::EndpointWidget(uint64_t idx, EndpointHandler* eph, QWidget *pare
|
|||
//memcpy(osh->callbackInfo[idx]->caller, osh->getGuid(), sizeof(NGuid));
|
||||
|
||||
//TODO: el default = objcopy frees?
|
||||
eph->getCallbackInfo()->caller = *osh->getGuid();
|
||||
eph->getCallbackInfo()->caller = osh->getGuid();
|
||||
mainSlider->blockSignals(false);
|
||||
muteButton->blockSignals(false);
|
||||
});
|
||||
timer->start(10);
|
||||
|
||||
layout->addItem(new QSpacerItem(1, 1, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding), 3, 0);
|
||||
layout->addItem(new QSpacerItem(1, 1, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding), 3, 1);
|
||||
layout->addItem(new QSpacerItem(1, 1, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding), 4, 0);
|
||||
layout->addItem(new QSpacerItem(1, 1, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding), 4, 1);
|
||||
log_debugcpp("ENDPOINT_WIDGETED");
|
||||
}
|
||||
|
||||
|
|
@ -230,7 +237,7 @@ void MainWindow::reloadEndpointWidgets() {
|
|||
size_t i = 0;
|
||||
for (; i < (osh->getEndpointHandlers().size()); i++) {
|
||||
log_debugcpp("EPWidget creation");
|
||||
osh->getEndpointHandlers().at(i)->getCallbackInfo()->caller = *osh->getGuid();
|
||||
osh->getEndpointHandlers().at(i)->getCallbackInfo()->caller = osh->getGuid();
|
||||
EndpointWidget *epw = new EndpointWidget(i, osh->getEndpointHandlers().at(i), widget);
|
||||
//TODO: ALWAYS PUSH BACK??? PSZ CHANGE DIS WHEN IMPLEMENTING DYN ENDPOINT DET
|
||||
ews.push_back(epw);
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#include "qtclasses.h"
|
||||
#include "global.h"
|
||||
|
||||
OverseerHandler *osh = new OverseerHandler();
|
||||
OverseerHandler *osh = nullptr;
|
||||
|
||||
QApplication* createApplication(int &argc, char *argv[])
|
||||
{
|
||||
|
|
@ -44,6 +44,8 @@ int main (int argc, char* argv[]) {
|
|||
startSingleInstanceServer("Mixer");
|
||||
else exit(0);
|
||||
|
||||
osh = new OverseerHandler();
|
||||
|
||||
//INIT CONT
|
||||
log_debugcpp("main init");
|
||||
osh->reloadEndpointHandlers();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue