Bump CMake minimum to 4.0 for VoidLibrary toolchain
This commit is contained in:
1 parent
e646080683
commit
bcf4f4770a
12 files changed
+1784
-1208
No files matched your search
+53
-135
@@ -1,155 +1,73 @@
|
||||
#pragma once
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QWidget>
|
||||
#include <QVBoxLayout>
|
||||
#include <QHBoxLayout>
|
||||
#include <QPushButton>
|
||||
#include "CoreClient.hpp"
|
||||
#include <QJsonObject>
|
||||
#include <QLabel>
|
||||
#include <QSlider>
|
||||
#include <QProgressBar>
|
||||
#include <QLineEdit>
|
||||
#include <QListWidget>
|
||||
#include <QGroupBox>
|
||||
#include <QMainWindow>
|
||||
#include <QPushButton>
|
||||
#include <QStatusBar>
|
||||
#include <QMenuBar>
|
||||
#include <QAction>
|
||||
#include <QMessageBox>
|
||||
#include <QTimer>
|
||||
#include <optional>
|
||||
#include <echoion/api.hpp>
|
||||
#include <QVBoxLayout>
|
||||
#include <QWidget>
|
||||
|
||||
namespace Echoion::Desktop {
|
||||
namespace Echoion::Desktop
|
||||
{
|
||||
|
||||
class MainWindow : public QMainWindow {
|
||||
Q_OBJECT
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MainWindow(QWidget* parent = nullptr);
|
||||
~MainWindow() override;
|
||||
public:
|
||||
|
||||
// Authentication
|
||||
void setAuthToken(const QString& token);
|
||||
void clearAuthToken();
|
||||
[[nodiscard]] bool isAuthenticated() const;
|
||||
explicit MainWindow(CoreClient* client, QWidget* parent = nullptr);
|
||||
~MainWindow() override;
|
||||
|
||||
// State updates
|
||||
void onPlaybackStateChanged(const Api::PlaybackState& state);
|
||||
void onQueueUpdated(const std::vector<Api::QueueEntry>& queue);
|
||||
void onConnectionStatusChanged(bool connected);
|
||||
void onSearchResultsReceived(const Api::SearchResult& results);
|
||||
private slots:
|
||||
|
||||
signals:
|
||||
// Connection signals
|
||||
void loginRequested();
|
||||
void logoutRequested();
|
||||
|
||||
// Playback control signals
|
||||
void playRequested(const QString& query);
|
||||
void playFromQueueRequested(int index);
|
||||
void pauseRequested();
|
||||
void stopRequested();
|
||||
void resumeRequested();
|
||||
void skipRequested();
|
||||
void seekRequested(int positionMs);
|
||||
void volumeChangeRequested(int volume);
|
||||
void toggleShuffleRequested();
|
||||
void toggleRepeatRequested();
|
||||
|
||||
// Queue signals
|
||||
void clearQueueRequested();
|
||||
void removeFromQueueRequested(int index);
|
||||
void moveInQueueRequested(int from, int to);
|
||||
|
||||
// Search signals
|
||||
void searchRequested(const QString& query);
|
||||
void addSearchResultToQueueRequested(int index);
|
||||
|
||||
// System signals
|
||||
void reloadCoreRequested();
|
||||
void settingsRequested();
|
||||
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 slots:
|
||||
void onPlayClicked();
|
||||
void onPauseClicked();
|
||||
void onStopClicked();
|
||||
void onSkipClicked();
|
||||
void onVolumeChanged(int value);
|
||||
void onSeekSliderMoved(int value);
|
||||
void onSearchClicked();
|
||||
void onSearchResultDoubleClicked(QListWidgetItem* item);
|
||||
void onQueueItemDoubleClicked(QListWidgetItem* item);
|
||||
void onShuffleClicked();
|
||||
void onRepeatClicked();
|
||||
void onClearQueueClicked();
|
||||
void onRemoveFromQueueClicked();
|
||||
void onSettingsClicked();
|
||||
void onReloadClicked();
|
||||
void onLoginLogoutClicked();
|
||||
private:
|
||||
|
||||
private:
|
||||
void setupUi();
|
||||
void setupMenuBar();
|
||||
void setupPlaybackControls();
|
||||
void setupSearchPanel();
|
||||
void setupQueueView();
|
||||
void setupStatusBar();
|
||||
void updatePlaybackDisplay();
|
||||
void updateQueueDisplay();
|
||||
void updateButtonStates();
|
||||
|
||||
[[nodiscard]] QString formatDuration(std::chrono::milliseconds ms);
|
||||
void setupUI();
|
||||
void setupConnections();
|
||||
|
||||
// Central widget
|
||||
QWidget* centralWidget_;
|
||||
QVBoxLayout* mainLayout_;
|
||||
CoreClient* client_ = nullptr;
|
||||
|
||||
// Playback controls
|
||||
QLabel* nowPlayingLabel_;
|
||||
QLabel* artistLabel_;
|
||||
QProgressBar* progressBar_;
|
||||
QLabel* timeLabel_;
|
||||
QPushButton* playButton_;
|
||||
QPushButton* pauseButton_;
|
||||
QPushButton* stopButton_;
|
||||
QPushButton* skipButton_;
|
||||
QPushButton* shuffleButton_;
|
||||
QPushButton* repeatButton_;
|
||||
QSlider* volumeSlider_;
|
||||
QLabel* volumeLabel_;
|
||||
// Connection section
|
||||
QLineEdit* hostEdit_ = nullptr;
|
||||
QLineEdit* portEdit_ = nullptr;
|
||||
QPushButton* connectBtn_ = nullptr;
|
||||
QLabel* connectionStatus_ = nullptr;
|
||||
|
||||
// Search panel
|
||||
QLineEdit* searchEdit_;
|
||||
QPushButton* searchButton_;
|
||||
QListWidget* searchResults_;
|
||||
// Auth section
|
||||
QLineEdit* nicknameEdit_ = nullptr;
|
||||
QLineEdit* tokenEdit_ = nullptr;
|
||||
QPushButton* requestTokenBtn_ = nullptr;
|
||||
QPushButton* authBtn_ = nullptr;
|
||||
QLabel* authStatus_ = nullptr;
|
||||
|
||||
// Queue view
|
||||
QListWidget* queueList_;
|
||||
QPushButton* clearQueueButton_;
|
||||
QPushButton* removeFromQueueButton_;
|
||||
// Playback section
|
||||
QLabel* currentTrackLabel_ = nullptr;
|
||||
QLabel* artistLabel_ = nullptr;
|
||||
QLabel* statusLabel_ = nullptr;
|
||||
QPushButton* playBtn_ = nullptr;
|
||||
QPushButton* pauseBtn_ = nullptr;
|
||||
QPushButton* skipBtn_ = nullptr;
|
||||
|
||||
// Status bar
|
||||
QStatusBar* statusBar_;
|
||||
QLabel* connectionStatusLabel_;
|
||||
QLabel* authStatusLabel_;
|
||||
|
||||
// Menu actions
|
||||
QAction* loginAction_;
|
||||
QAction* logoutAction_;
|
||||
QAction* settingsAction_;
|
||||
QAction* reloadAction_;
|
||||
QAction* exitAction_;
|
||||
QAction* aboutAction_;
|
||||
|
||||
// State
|
||||
QTimer* updateTimer_;
|
||||
std::optional<QString> authToken_;
|
||||
Api::PlaybackState currentState_;
|
||||
std::vector<Api::QueueEntry> currentQueue_;
|
||||
bool connectedToCore_ = false;
|
||||
|
||||
// Buttons for login/logout
|
||||
QPushButton* loginLogoutButton_;
|
||||
};
|
||||
// Status bar
|
||||
QStatusBar* statusBar_ = nullptr;
|
||||
};
|
||||
|
||||
} // namespace Echoion::Desktop
|
||||
Reference in new issue
Block a user