diff options
| author | Peter Penz <[email protected]> | 2012-05-19 22:27:53 +0200 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2012-05-19 22:30:31 +0200 |
| commit | c318a3da6c79c35b4d3ba3043d71228cbeda64f8 (patch) | |
| tree | b4cec1654cc109e381b4ac60e1daac4bb550b0f7 /src/panels/information/phononwidget.h | |
| parent | e9d29bcf30ccbd7c76ba37ce9efcfac1649fc46e (diff) | |
Show video previews according to file content instead of the mimetype-string
Show a video widget depending on the video content instead of the mimetype
string: There are container formats which can be either audios or videos.
Besides, the rmvb video files have a mimetype of
"application/vnd.rn-realmedia", and these files can be recognized as videos
correctly now.
The patch has been provided by Hui Ni.
REVIEW: 104988
FIXED-IN: 4.9
Diffstat (limited to 'src/panels/information/phononwidget.h')
| -rw-r--r-- | src/panels/information/phononwidget.h | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/panels/information/phononwidget.h b/src/panels/information/phononwidget.h index 1e1ea37e9..b5aedfe4f 100644 --- a/src/panels/information/phononwidget.h +++ b/src/panels/information/phononwidget.h @@ -30,6 +30,7 @@ namespace Phonon { + class AudioOutput; class MediaObject; class SeekSlider; class VideoPlayer; @@ -43,26 +44,24 @@ class PhononWidget : public QWidget { Q_OBJECT public: - enum Mode - { - Audio, - Video - }; - PhononWidget(QWidget *parent = 0); void setUrl(const KUrl &url); KUrl url() const; - void setMode(Mode mode); - Mode mode() const; - void setVideoSize(const QSize& size); QSize videoSize() const; signals: - void playingStarted(); - void playingStopped(); + /** + * Is emitted whenever the video-state + * has changed: If true is returned, a video + * including control-buttons will be shown. + * If false is returned, no video is shown + * and the control-buttons are available for + * audio only. + */ + void hasVideoChanged(bool hasVideo); protected: virtual void showEvent(QShowEvent *event); @@ -72,12 +71,12 @@ class PhononWidget : public QWidget void stateChanged(Phonon::State); void play(); void stop(); + void slotHasVideoChanged(bool); private: void applyVideoSize(); private: - Mode m_mode; KUrl m_url; QSize m_videoSize; @@ -85,9 +84,9 @@ class PhononWidget : public QWidget QToolButton *m_stopButton; QVBoxLayout *m_topLayout; - Phonon::MediaObject *m_audioMedia; Phonon::MediaObject *m_media; Phonon::SeekSlider *m_seekSlider; + Phonon::AudioOutput *m_audioOutput; EmbeddedVideoPlayer *m_videoPlayer; }; |
