Refactored program structure
This commit is contained in:
parent
e43e4c0569
commit
80685f1a21
10 changed files with 140 additions and 96 deletions
|
|
@ -9,7 +9,7 @@ EndpointWidget::EndpointWidget(EndpointHandler* eph, QWidget *parent) : QWidget(
|
|||
if (parent == nullptr) { log_debugcpp("owo?"); }
|
||||
|
||||
muteButton = new QPushButton();
|
||||
mainLabel = new QLabel(eph->getName());
|
||||
mainLabel = new QLabel(QString::fromStdWString(eph->getName()));
|
||||
leftChannelLabel = new QLabel("88");
|
||||
rightChannelLabel = new QLabel("77");
|
||||
mainSlider = new QSlider(Qt::Horizontal);
|
||||
|
|
@ -64,7 +64,7 @@ EndpointWidget::EndpointWidget(EndpointHandler* eph, QWidget *parent) : QWidget(
|
|||
|
||||
|
||||
void EndpointWidget::setIndex(uint64_t idx){
|
||||
this.idx = idx;
|
||||
this->idx = idx;
|
||||
}
|
||||
|
||||
uint64_t EndpointWidget::getIndex(){
|
||||
|
|
@ -89,7 +89,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
|
|||
* setEndpointHandlers(ephs);
|
||||
*/
|
||||
unsigned int i = 0;
|
||||
for (; i < ephs->size(); i++) {
|
||||
for (; i < (osh->getEndpointHandlers().size()); i++) {
|
||||
log_debugcpp("EPWidget creation");
|
||||
EndpointWidget *epw = new EndpointWidget(osh->getEndpointHandlers().at(i), widget);
|
||||
ews.push_back(epw);
|
||||
|
|
|
|||
|
|
@ -2,13 +2,16 @@
|
|||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
|
||||
#include <vector>
|
||||
//#include <vector>
|
||||
#include <QMainWindow>
|
||||
#include <QApplication>
|
||||
#include <QLabel>
|
||||
#include <QSlider>
|
||||
#include <QGridLayout>
|
||||
#include <QPushButton>
|
||||
|
||||
//#include "debug.h"
|
||||
#include "global.h"
|
||||
#include "contclasses.h"
|
||||
//#include <Q>
|
||||
//#include <QWidgets>
|
||||
|
|
@ -22,6 +25,8 @@ public:
|
|||
//TODO: get();
|
||||
EndpointHandler* eph;
|
||||
void setIndex(uint64_t idx);
|
||||
uint64_t getIndex();
|
||||
|
||||
void setVolume(int channel, float volume);
|
||||
|
||||
QPushButton *muteButton = nullptr;
|
||||
|
|
@ -53,7 +58,7 @@ class MainWindow : public QMainWindow {
|
|||
//QWidget *centralWidget;
|
||||
|
||||
public:
|
||||
MainWindow(std::vector<EndpointHandler*> *ephs, QWidget *parent = nullptr);
|
||||
MainWindow(QWidget *parent = nullptr);
|
||||
//void setEndpointHandlers(std::vector<EndpointHandler*> *ephs);
|
||||
|
||||
private:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue