refactor: MainWindow class into multiple items / controllers ; fix: Bug with PlaylistBrowserDialog.cpp : List item "No playlists available" was selectable

This commit is contained in:
2026-06-19 13:05:45 +02:00
parent 97166e9f4e
commit e62ab4626c
10 changed files with 573 additions and 391 deletions
+49
View File
@@ -0,0 +1,49 @@
#pragma once
#include <QGroupBox>
#include <QLabel>
#include <QSlider>
#include <QPushButton>
#include <QCheckBox>
class CoverArtWidget;
namespace engine { struct Track; }
class NowPlayingPanel : public QGroupBox
{
Q_OBJECT
public:
explicit NowPlayingPanel(QWidget *parent = nullptr);
QCheckBox *shuffleCheckBox() const { return m_chkShuffle; }
QCheckBox *repeatCheckBox() const { return m_chkRepeat; }
public slots:
void updateTrack(const engine::Track *track);
void updatePosition(qint64 posFrames, qint64 totalFrames, float sampleRate);
void setPlaybackActive(bool playing);
signals:
void playPauseClicked();
void prevClicked();
void nextClicked();
void seekRequested(double fraction); // 0.01.0
void volumeChanged(int percent); // 0100
private:
void buildLayout();
CoverArtWidget *m_cover;
QLabel *m_lblTitle = new QLabel("No track selected");
QLabel *m_lblArtist = new QLabel(" ");
QLabel *m_lblAlbum = new QLabel(" ");
QLabel *m_lblTime = new QLabel("0:00 / 0:00");
QSlider *m_seekBar = new QSlider(Qt::Horizontal);
QPushButton *m_btnPrev = new QPushButton("|<");
QPushButton *m_btnPlay = new QPushButton("Play");
QPushButton *m_btnNext = new QPushButton(">|");
QCheckBox *m_chkShuffle = new QCheckBox("Shuffle");
QCheckBox *m_chkRepeat = new QCheckBox("Repeat");
QSlider *m_volSlider = new QSlider(Qt::Horizontal);
bool m_seekDragging { false };
};