X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/1b4572dac9fb529d31b786f93e4f02c6f8aeeb21..eaec53a7af4e098acd957a274f059920d569e0be:/src/panels/information/phononwidget.h diff --git a/src/panels/information/phononwidget.h b/src/panels/information/phononwidget.h index 09b4ee26f..90a1d1e5a 100644 --- a/src/panels/information/phononwidget.h +++ b/src/panels/information/phononwidget.h @@ -21,12 +21,12 @@ #ifndef PHONONWIDGET_H #define PHONONWIDGET_H -#include +#include + #include +#include #include -#include - namespace Phonon { class AudioOutput; @@ -43,13 +43,24 @@ class PhononWidget : public QWidget { Q_OBJECT public: - PhononWidget(QWidget *parent = 0); - void setUrl(const QUrl &url); + enum MediaKind { + Video, + Audio + }; + + explicit PhononWidget(QWidget *parent = nullptr); + + void setUrl(const QUrl &url, MediaKind kind); QUrl url() const; + void clearUrl(); void setVideoSize(const QSize& size); QSize videoSize() const; + Phonon::State state() const; + + void setAutoPlay(bool autoPlay); + bool eventFilter(QObject *object, QEvent *event) override; signals: /** @@ -62,15 +73,17 @@ class PhononWidget : public QWidget */ void hasVideoChanged(bool hasVideo); + public slots: + void play(); + protected: - virtual void showEvent(QShowEvent *event); - virtual void hideEvent(QHideEvent *event); + void showEvent(QShowEvent *event) override; + void hideEvent(QHideEvent *event) override; private slots: - void stateChanged(Phonon::State); - void play(); + void stateChanged(Phonon::State newstate); void stop(); - void slotHasVideoChanged(bool); + void finished(); private: void applyVideoSize(); @@ -87,6 +100,8 @@ class PhononWidget : public QWidget Phonon::SeekSlider *m_seekSlider; Phonon::AudioOutput *m_audioOutput; EmbeddedVideoPlayer *m_videoPlayer; + bool m_autoPlay; + bool m_isVideo; }; #endif // PHONONWIDGET_H