2009-12-24 20:16:07 +01:00
|
|
|
#ifndef PLAYER_H
|
|
|
|
#define PLAYER_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QSettings>
|
|
|
|
|
|
|
|
#include "engine_fwd.h"
|
|
|
|
|
|
|
|
class Playlist;
|
|
|
|
class Settings;
|
|
|
|
|
|
|
|
class Player : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
Player(Playlist* playlist, QObject* parent = 0);
|
|
|
|
|
|
|
|
EngineBase* GetEngine() { return engine_; }
|
|
|
|
Engine::State GetState() const;
|
|
|
|
int GetVolume() const;
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void PlayAt(int index);
|
|
|
|
void PlayPause();
|
|
|
|
void Next();
|
|
|
|
void Previous();
|
|
|
|
void Stop();
|
|
|
|
void SetVolume(int value);
|
|
|
|
|
2009-12-26 23:59:11 +01:00
|
|
|
void TrackEnded();
|
2009-12-26 22:35:45 +01:00
|
|
|
void StreamReady(const QUrl& original_url, const QUrl& media_url);
|
|
|
|
|
2009-12-24 20:16:07 +01:00
|
|
|
signals:
|
|
|
|
void Playing();
|
|
|
|
void Paused();
|
|
|
|
void Stopped();
|
|
|
|
void Error(const QString& message);
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void EngineStateChanged(Engine::State);
|
|
|
|
|
|
|
|
private:
|
|
|
|
Playlist* playlist_;
|
|
|
|
QSettings settings_;
|
|
|
|
|
|
|
|
EngineBase* engine_;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // PLAYER_H
|