Add widget to seek through songs on an album
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
#ifndef PLAYERWINDOW_H
|
||||
#define PLAYERWINDOW_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QLabel>
|
||||
@@ -7,33 +8,32 @@
|
||||
#include <QTimer>
|
||||
#include "src/data/albumInformation.h"
|
||||
#include "src/components/spinningalbumart/spinningAlbumArt.h"
|
||||
#include "src/components/tracklistWidget/tracklistwidget.h"
|
||||
|
||||
class PlayerWindow : public QWidget {
|
||||
class PlayerWindow : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
SpinningAlbumArt* spinningArt_;
|
||||
|
||||
public:
|
||||
explicit PlayerWindow(const AlbumData& item, QWidget* parent = nullptr);
|
||||
void setCurrentRow(int row);
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent* event) override;
|
||||
|
||||
private slots:
|
||||
void playNext();
|
||||
|
||||
private:
|
||||
void playTrack(int index);
|
||||
void handleTrackFinished();
|
||||
|
||||
AlbumData item_;
|
||||
int index_ = 0;
|
||||
int index_ = 0; // active track index
|
||||
|
||||
SpinningAlbumArt* spinningArt_;
|
||||
QLabel* trackLabel_;
|
||||
TrackListWidget* trackList_;
|
||||
|
||||
QMediaPlayer* player_;
|
||||
QAudioOutput* audio_;
|
||||
|
||||
QLabel* artLabel_;
|
||||
QLabel* trackLabel_;
|
||||
|
||||
QPixmap discArt_; // circular cropped album art
|
||||
QPixmap overlayArt_; // optional overlay (not required)
|
||||
qreal rotationAngle_ = 0;
|
||||
|
||||
QTimer* spinTimer_;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user