74 lines
1.6 KiB
C++
74 lines
1.6 KiB
C++
#pragma once
|
|
|
|
#include "CoreClient.hpp"
|
|
#include <QJsonObject>
|
|
#include <QLabel>
|
|
#include <QLineEdit>
|
|
#include <QMainWindow>
|
|
#include <QPushButton>
|
|
#include <QStatusBar>
|
|
#include <QVBoxLayout>
|
|
#include <QWidget>
|
|
|
|
namespace Echoion::Desktop
|
|
{
|
|
|
|
class MainWindow : public QMainWindow
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit MainWindow(CoreClient* client, QWidget* parent = nullptr);
|
|
~MainWindow() override;
|
|
|
|
private slots:
|
|
|
|
void onConnectClicked();
|
|
void onAuthClicked();
|
|
void onConnected();
|
|
void onDisconnected();
|
|
void onAuthTokenRequested();
|
|
void onAuthenticated();
|
|
void onAuthFailed(const QString& reason);
|
|
void onEventReceived(const QString& event, const QJsonObject& data);
|
|
void updateConnectionStatus();
|
|
void updatePlaybackInfo(const QJsonObject& data);
|
|
void onPlayClicked();
|
|
void onPauseClicked();
|
|
void onSkipClicked();
|
|
|
|
private:
|
|
|
|
void setupUI();
|
|
void setupConnections();
|
|
|
|
CoreClient* client_ = nullptr;
|
|
|
|
// Connection section
|
|
QLineEdit* hostEdit_ = nullptr;
|
|
QLineEdit* portEdit_ = nullptr;
|
|
QPushButton* connectBtn_ = nullptr;
|
|
QLabel* connectionStatus_ = nullptr;
|
|
|
|
// Auth section
|
|
QLineEdit* nicknameEdit_ = nullptr;
|
|
QLineEdit* tokenEdit_ = nullptr;
|
|
QPushButton* requestTokenBtn_ = nullptr;
|
|
QPushButton* authBtn_ = nullptr;
|
|
QLabel* authStatus_ = nullptr;
|
|
|
|
// Playback section
|
|
QLabel* currentTrackLabel_ = nullptr;
|
|
QLabel* artistLabel_ = nullptr;
|
|
QLabel* statusLabel_ = nullptr;
|
|
QPushButton* playBtn_ = nullptr;
|
|
QPushButton* pauseBtn_ = nullptr;
|
|
QPushButton* skipBtn_ = nullptr;
|
|
|
|
// Status bar
|
|
QStatusBar* statusBar_ = nullptr;
|
|
};
|
|
|
|
} // namespace Echoion::Desktop
|