Q_CHECK_PTR(m_playlist);
connect(m_playlist, SIGNAL(currentChanged(PlaylistEntry)), this,
SLOT(playPlaylistEntry(PlaylistEntry)));
+
+ connect(this, SIGNAL(currentSourceChanged(QUrl)), this,
+ SLOT(notifyDisplayTitleChanged()));
}
Player::~Player() {
QUrl Player::nextSource() const { return m_nextSource; }
+QString Player::displayTitle() const {
+ return currentSource().isValid() ? currentSource().fileName() : tr("none");
+}
+
Player::PlayState Player::state() const { return m_state; }
Player::Volume Player::volume() const { return m_volume; }
m_playlist->next();
}
+void Player::notifyDisplayTitleChanged() {
+ emit displayTitleChanged(displayTitle());
+}
+
bool Player::canLoadVideoNow() const {
return m_backendInstanceReady && m_renderer && m_rendererReady;
}
Q_PROPERTY(QUrl nextSource READ nextSource WRITE setNextSource NOTIFY
nextSourceChanged)
+ Q_PROPERTY(QString displayTitle READ displayTitle NOTIFY displayTitleChanged
+ STORED false)
+
Q_PROPERTY(double duration READ duration NOTIFY durationChanged)
Q_PROPERTY(double position READ position WRITE seek NOTIFY positionChanged)
QUrl currentSource() const;
QUrl nextSource() const;
+ QString displayTitle() const;
+
PlayState state() const;
Volume volume() const;
Volume maxVolume() const;
void currentSourceChanged(QUrl currentSource);
void nextSourceChanged(QUrl nextSource);
+ void displayTitleChanged(QString displayTitle);
+
void durationChanged(double duration);
void positionChanged(double position);
void onNewFrame();
void playPlaylistEntry(const PlaylistEntry &entry);
void playNextPlaylistEntryOnEndOfFile();
+ void notifyDisplayTitleChanged();
private:
bool canLoadVideoNow() const;