Playlist management: - Add/remove tracks from playlists via right-click context menu - Create new playlists (right-click Playlists sidebar header) - Delete playlists with confirmation dialog (right-click playlist item) - Playlist view removes track immediately on delete (optimistic) - Deleting currently-open playlist clears the track view Gapless playback: - Single long-running audio thread owns AudioOutput; CPAL stream stays open between tracks eliminating device teardown/startup gap - Decode runs inline on the audio thread; command channel polled via try_recv() so Pause/Resume/Seek/Stop/Play all work without spawning - New Play command arriving mid-decode is handled immediately, reusing the same audio output for zero-gap transition - Position timer reduced from 500 ms to 50 ms for faster track-end detection - URL/metadata prefetch: when gapless is enabled Qt pre-fetches the next track while the current one is still playing ReplayGain: - Toggled in Settings → Playback - replaygain_track_gain (dB) from track audio_info converted to linear gain factor and applied per-sample alongside volume Qobuz dark theme: - Background #191919, base #141414, accent #FFB232 (yellow-orange) - Selection highlight, slider fill, scrollbar hover all use #FFB232 - Links use Qobuz blue #46B3EE - Hi-res H badges updated to #FFB232 (from #FFD700) - Now-playing row uses #FFB232 (was Spotify green) - QSS stylesheet for scrollbars, menus, inputs, buttons, groups Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
66 lines
2.1 KiB
C++
66 lines
2.1 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 "scrobbler/lastfm.hpp"
|
|
|
|
#include <QMainWindow>
|
|
#include <QDockWidget>
|
|
#include <QJsonObject>
|
|
#include <QVector>
|
|
#include <QPair>
|
|
#include <QString>
|
|
|
|
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 onFavArtistsLoaded(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 onPlaylistCreated(const QJsonObject &playlist);
|
|
void onUserPlaylistsChanged(const QVector<QPair<qint64, QString>> &playlists);
|
|
|
|
void showLoginDialog();
|
|
void showSettingsDialog();
|
|
|
|
private:
|
|
QobuzBackend *m_backend = nullptr;
|
|
PlayQueue *m_queue = nullptr;
|
|
QVector<QPair<qint64, QString>> m_userPlaylists;
|
|
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;
|
|
LastFmScrobbler *m_scrobbler = nullptr;
|
|
|
|
void setupMenuBar();
|
|
void tryRestoreSession();
|
|
};
|