43 lines
971 B
C++
43 lines
971 B
C++
#ifndef PLAYERWINDOW_H
|
|
#define PLAYERWINDOW_H
|
|
|
|
#include <QWidget>
|
|
#include <QLabel>
|
|
#include <QMediaPlayer>
|
|
#include <QAudioOutput>
|
|
#include <QTimer>
|
|
#include "src/data/albumInformation.h"
|
|
#include "src/components/spinningalbumart/spinningAlbumArt.h"
|
|
#include "src/components/tracklistWidget/tracklistwidget.h"
|
|
#include "src/components/timePlayedWidget/timePlayedWidget.h"
|
|
|
|
class PlayerWindow : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
QSlider* volumeSlider_;
|
|
TimePlayedWidget* timeIndicator_;
|
|
|
|
public:
|
|
explicit PlayerWindow(const AlbumData& item, QWidget* parent = nullptr);
|
|
void setCurrentRow(int row);
|
|
|
|
protected:
|
|
void closeEvent(QCloseEvent* event) override;
|
|
|
|
private:
|
|
void playTrack(int index);
|
|
void handleTrackFinished();
|
|
|
|
AlbumData item_;
|
|
int index_ = 0; // active track index
|
|
|
|
SpinningAlbumArt* spinningArt_;
|
|
QLabel* trackLabel_;
|
|
TrackListWidget* trackList_;
|
|
|
|
QMediaPlayer* player_;
|
|
QAudioOutput* audio_;
|
|
};
|
|
|
|
#endif
|