Lightweight Qt6 desktop client for Qobuz with a Rust audio backend (Symphonia/CPAL via staticlib FFI). Mirrors the spotify-qt layout: toolbar with playback controls, library/context docks on the left, tabbed search side panel on the right, queue panel, now-playing dock. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
57 lines
1.7 KiB
C++
57 lines
1.7 KiB
C++
#pragma once
|
|
|
|
#include "backend/qobuzbackend.hpp"
|
|
#include "playqueue.hpp"
|
|
#include "view/maintoolbar.hpp"
|
|
#include "view/maincontent.hpp"
|
|
#include "view/context/view.hpp"
|
|
#include "view/queuepanel.hpp"
|
|
#include "view/sidepanel/view.hpp"
|
|
#include "list/library.hpp"
|
|
|
|
#include <QMainWindow>
|
|
#include <QDockWidget>
|
|
#include <QJsonObject>
|
|
|
|
class MainWindow : public QMainWindow
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit MainWindow(QobuzBackend *backend, QWidget *parent = nullptr);
|
|
static QSize defaultSize() { return {1100, 700}; }
|
|
|
|
private slots:
|
|
void onLoginSuccess(const QString &token, const QJsonObject &user);
|
|
void onLoginError(const QString &error);
|
|
|
|
void onFavTracksLoaded(const QJsonObject &result);
|
|
void onFavAlbumsLoaded(const QJsonObject &result);
|
|
void onAlbumLoaded(const QJsonObject &album);
|
|
void onArtistLoaded(const QJsonObject &artist);
|
|
void onPlaylistLoaded(const QJsonObject &playlist);
|
|
|
|
void onTrackChanged(const QJsonObject &track);
|
|
void onPlayTrackRequested(qint64 trackId);
|
|
void onSearchAlbumSelected(const QString &albumId);
|
|
void onSearchArtistSelected(qint64 artistId);
|
|
void onSearchToggled(bool visible);
|
|
|
|
void showLoginDialog();
|
|
void showSettingsDialog();
|
|
|
|
private:
|
|
QobuzBackend *m_backend = nullptr;
|
|
PlayQueue *m_queue = nullptr;
|
|
MainToolBar *m_toolBar = nullptr;
|
|
MainContent *m_content = nullptr;
|
|
List::Library *m_library = nullptr;
|
|
Context::View *m_contextView = nullptr;
|
|
QueuePanel *m_queuePanel = nullptr;
|
|
SidePanel::View *m_sidePanel = nullptr;
|
|
QDockWidget *m_libraryDock = nullptr;
|
|
|
|
void setupMenuBar();
|
|
void tryRestoreSession();
|
|
};
|