GUI Milestone 5
This commit is contained in:
parent
a369381b6c
commit
79cced017e
6 changed files with 228 additions and 20 deletions
19
gui/main.cpp
19
gui/main.cpp
|
|
@ -5,7 +5,10 @@
|
|||
#include <QAction>
|
||||
#include <QApplication>
|
||||
#include <QKeySequence>
|
||||
#include <QLabel>
|
||||
#include <QMainWindow>
|
||||
#include <QStatusBar>
|
||||
#include <QTimer>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
|
@ -27,12 +30,26 @@ int main(int argc, char *argv[]) {
|
|||
auto &client = result.value;
|
||||
|
||||
QMainWindow window;
|
||||
window.setWindowTitle("Warppipe — Audio Router");
|
||||
window.setWindowTitle("Warppipe \u2014 Audio Router");
|
||||
|
||||
auto *editor = new GraphEditorWidget(client.get(), &window);
|
||||
window.setCentralWidget(editor);
|
||||
window.resize(1280, 720);
|
||||
|
||||
auto *statusLabel = new QLabel(&window);
|
||||
window.statusBar()->addWidget(statusLabel);
|
||||
|
||||
auto *statusTimer = new QTimer(&window);
|
||||
QObject::connect(statusTimer, &QTimer::timeout, [&]() {
|
||||
int nodes = editor->nodeCount();
|
||||
int links = editor->linkCount();
|
||||
statusLabel->setText(
|
||||
QString("PipeWire connected | %1 nodes | %2 links")
|
||||
.arg(nodes)
|
||||
.arg(links));
|
||||
});
|
||||
statusTimer->start(500);
|
||||
|
||||
auto *closeAction = new QAction(&window);
|
||||
closeAction->setShortcut(QKeySequence::Quit);
|
||||
QObject::connect(closeAction, &QAction::triggered, &window,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue