-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbasePlayer.h
77 lines (66 loc) · 2.21 KB
/
basePlayer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#ifndef BASEPLAYER_H
#define BASEPLAYER_H
#include <QWidget>
#include <QListWidget>
#include <QtMultimedia/QMediaPlayer>
#include <QtMultimedia/QMediaPlaylist>
#include <QString>
#include "videowidget.h"
#include "mediadatabase.h"
#include "user.h"
class basePlayer : public QWidget
{
Q_OBJECT
public:
explicit basePlayer(QWidget *parent = 0);
bool openMedia(const QMediaContent & content);
bool openMedia(const QList<QMediaContent> & items);
bool addMedia(const QMediaContent & content);
bool addMedia(const QList<QMediaContent> & items);
static const QList<QMediaContent> * getMediaContentFromFilePaths(const QStringList *);
void setVideoWidget(videoWidget *);
void setMediaDatabase(mediaDatabase * db);
void setUser(User * user);
bool clear();
QStringList * openFileDialog();
const QString & artist() const;
const QString & album() const;
const QString & title() const;
signals:
void stateChanged(QMediaPlayer::State state);
void metaDataChanged(const QString &artist, const QString &title);
void durationChanged(qint64 duration);
void positionChanged(qint64 position);
void videoAvailabilityChanged(bool videoAvailable);
public slots:
void togglePlayPause();
void next();
void previous();
void setVolume(int volume);
void setMediaPosition(qint64);
private slots:
void currentIndexHasChanged(int index);
void metaDataChanged();
void metaDataAvailablityHasChanged(bool isMetaDataAvailable);
void initiateAddMedia();
void initiateOpenMedia();
void mediaDurationChanged(qint64);
void mediaPositionChanged(qint64);
void videoAvailableChanged(bool videoAvailable);
void mediaStateChanged(QMediaPlayer::State state);
protected:
bool event(QEvent *);
private:
QListWidget * _basePlayerView;
QMediaPlayer * _player;
QMediaPlaylist * _mediaPlaylist;
mediaDatabase * _db;
User * _user;
QString _currentlyPlayingArtist;
QString _currentlyPlayingAlbum;
QString _currentlyPlayingTitle;
void removeFeaturingArtistFromTitle();
const QString * getAudioFileTypes();
void updateView();
};
#endif // PLAYLIST_H