- Lock sidebar width (setFixedWidth) so it doesn't jump between views - Remove back/forward navigation buttons and all NavPage history code - Uniform column layout on artist page: hide Artist column from both Popular Tracks and release sections, set matching fixed column widths so columns align vertically across all sections - Deep shuffle: new Rust FFI endpoint fetches tracks from all albums in parallel, combines them, and returns via EV_DEEP_SHUFFLE_OK - Auto-paginate artist releases in Rust (loop until has_more=false) so all releases load at once sorted newest-first Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
77 lines
2.2 KiB
C++
77 lines
2.2 KiB
C++
#pragma once
|
|
|
|
#include "../backend/qobuzbackend.hpp"
|
|
#include "../playqueue.hpp"
|
|
#include "../widget/volumebutton.hpp"
|
|
#include "../widget/clickableslider.hpp"
|
|
#include "../util/icon.hpp"
|
|
|
|
#include <QToolBar>
|
|
#include <QLabel>
|
|
#include <QAction>
|
|
#include <QNetworkAccessManager>
|
|
#include <QNetworkReply>
|
|
#include <QJsonObject>
|
|
|
|
class MainToolBar : public QToolBar
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit MainToolBar(QobuzBackend *backend, PlayQueue *queue, QWidget *parent = nullptr);
|
|
|
|
void setPlaying(bool playing);
|
|
void setCurrentTrack(const QJsonObject &track);
|
|
void updateProgress(quint64 position, quint64 duration);
|
|
|
|
signals:
|
|
void searchToggled(bool visible);
|
|
void queueToggled(bool visible);
|
|
void albumRequested(const QString &albumId);
|
|
void artistRequested(qint64 artistId);
|
|
|
|
protected:
|
|
void resizeEvent(QResizeEvent *event) override;
|
|
|
|
private slots:
|
|
void onPlayPause();
|
|
void onPrevious();
|
|
void onNext();
|
|
void onProgressReleased();
|
|
void onVolumeChanged(int volume);
|
|
|
|
void onBackendStateChanged(const QString &state);
|
|
void onTrackChanged(const QJsonObject &track);
|
|
void onPositionChanged(quint64 position, quint64 duration);
|
|
void onTrackFinished();
|
|
void onQueueChanged();
|
|
void onShuffleToggled(bool checked);
|
|
|
|
void fetchAlbumArt(const QString &url);
|
|
void onAlbumArtReady(QNetworkReply *reply);
|
|
|
|
private:
|
|
QobuzBackend *m_backend = nullptr;
|
|
PlayQueue *m_queue = nullptr;
|
|
|
|
QLabel *m_artLabel = nullptr;
|
|
QLabel *m_trackLabel = nullptr;
|
|
QAction *m_previous = nullptr;
|
|
QAction *m_playPause = nullptr;
|
|
QAction *m_next = nullptr;
|
|
QWidget *m_leftSpacer = nullptr;
|
|
ClickableSlider *m_progress = nullptr;
|
|
QLabel *m_position = nullptr;
|
|
QWidget *m_rightSpacer = nullptr;
|
|
QAction *m_shuffle = nullptr;
|
|
VolumeButton *m_volume = nullptr;
|
|
QAction *m_queueBtn = nullptr;
|
|
QAction *m_search = nullptr;
|
|
|
|
QNetworkAccessManager *m_nam = nullptr;
|
|
QString m_currentArtUrl;
|
|
QJsonObject m_currentTrack;
|
|
bool m_playing = false;
|
|
bool m_seeking = false;
|
|
};
|