Files
SubWave/src/gui/NowPlayingPanel.h
T

49 lines
1.5 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#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 };
};