- Rust backend (qobuz-backend static lib): Qobuz API client (reqwest/tokio), Symphonia audio decoder, CPAL audio output, extern "C" FFI bridge - Qt 6 frontend mirroring spotify-qt layout: toolbar with playback controls, left library dock, central track list, right search panel - Auth: email/password login with MD5-signed requests; session token persisted via QSettings - Playback: double-click a track → Rust fetches stream URL → Symphonia decodes → CPAL outputs to default audio device - Dark Fusion palette matching spotify-qt feel Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
53 lines
1.4 KiB
C++
53 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include "backend/qobuzbackend.hpp"
|
|
#include "view/maintoolbar.hpp"
|
|
#include "view/maincontent.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 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;
|
|
MainToolBar *m_toolBar = nullptr;
|
|
MainContent *m_content = nullptr;
|
|
List::Library *m_library = nullptr;
|
|
SidePanel::View *m_sidePanel = nullptr;
|
|
|
|
QDockWidget *m_libraryDock = nullptr;
|
|
|
|
void setupMenuBar();
|
|
void tryRestoreSession();
|
|
};
|