]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/panels/information/phononwidget.h
Allow dolphin to auto-play previewed media file, click on preview to play/pause video...
[dolphin.git] / src / panels / information / phononwidget.h
index 971e8c7312d8c370fd9936ea715f362ec5247d3a..b9e7d4f05ac4f87c0fe823d396c1418973b5b4c8 100644 (file)
@@ -43,14 +43,22 @@ class PhononWidget : public QWidget
 {
     Q_OBJECT
     public:
+
+        enum MediaKind {
+            Video,
+            Audio
+        };
+
         explicit PhononWidget(QWidget *parent = nullptr);
 
-        void setUrl(const QUrl &url);
+        void setUrl(const QUrl &url, MediaKind kind);
         QUrl url() const;
 
         void setVideoSize(const QSize& size);
         QSize videoSize() const;
 
+        void setAutoPlay(bool autoPlay);
+
     signals:
         /**
          * Is emitted whenever the video-state
@@ -62,15 +70,17 @@ class PhononWidget : public QWidget
          */
         void hasVideoChanged(bool hasVideo);
 
+    public slots:
+        void play();
+
     protected:
         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 +97,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