00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef MEDIAPLAYER_H
00021 #define MEDIAPLAYER_H
00022
00023 #include <QObject>
00024 #include <qmmp/soundcore.h>
00025 #include "playlistmanager.h"
00026
00027
00031 class MediaPlayer : public QObject
00032 {
00033 Q_OBJECT
00034 public:
00039 MediaPlayer(QObject *parent = 0);
00043 ~MediaPlayer();
00047 static MediaPlayer* instance();
00053 void initialize(SoundCore *core, PlayListManager *pl_mamager);
00057 PlayListManager *playListManager();
00061 bool isRepeatable() const;
00062
00063 public slots:
00067 void play(qint64 offset = -1);
00071 void stop();
00075 void next();
00079 void previous();
00084 void setRepeatable(bool enable);
00085
00086 signals:
00091 void repeatableChanged(bool enabled);
00092
00093 private slots:
00094 void playNext();
00095 void updateNextUrl();
00096
00097 private:
00098 PlayListManager *m_pl_manager;
00099 SoundCore *m_core;
00100 static MediaPlayer* m_instance;
00101 bool m_repeat;
00102 int m_skips;
00103 QString m_nextUrl;
00104 };
00105
00106 #endif