Changeset View
Changeset View
Standalone View
Standalone View
src/panels/information/phononwidget.h
Show All 20 Lines | |||||
21 | #ifndef PHONONWIDGET_H | 21 | #ifndef PHONONWIDGET_H | ||
22 | #define PHONONWIDGET_H | 22 | #define PHONONWIDGET_H | ||
23 | 23 | | |||
24 | #include <Phonon/Global> | 24 | #include <Phonon/Global> | ||
25 | 25 | | |||
26 | #include <QSize> | 26 | #include <QSize> | ||
27 | #include <QUrl> | 27 | #include <QUrl> | ||
28 | #include <QWidget> | 28 | #include <QWidget> | ||
29 | #include <QMediaPlayer> | ||||
30 | #include <QSlider> | ||||
29 | 31 | | |||
30 | namespace Phonon | 32 | class QMediaPlaylist; | ||
31 | { | 33 | class QMediaPlayer; | ||
32 | class AudioOutput; | 34 | class QVideoWidget; | ||
33 | class MediaObject; | | |||
34 | class SeekSlider; | 35 | class SeekSlider; | ||
35 | class VideoPlayer; | | |||
36 | } // namespace Phonon | | |||
37 | 36 | | |||
38 | class EmbeddedVideoPlayer; | 37 | class EmbeddedVideoPlayer; | ||
39 | class QToolButton; | 38 | class QToolButton; | ||
40 | class QVBoxLayout; | 39 | class QVBoxLayout; | ||
41 | 40 | | |||
42 | class PhononWidget : public QWidget | 41 | class PhononWidget : public QWidget | ||
43 | { | 42 | { | ||
44 | Q_OBJECT | 43 | Q_OBJECT | ||
Show All 28 Lines | |||||
73 | public slots: | 72 | public slots: | ||
74 | void play(); | 73 | void play(); | ||
75 | 74 | | |||
76 | protected: | 75 | protected: | ||
77 | void showEvent(QShowEvent *event) override; | 76 | void showEvent(QShowEvent *event) override; | ||
78 | void hideEvent(QHideEvent *event) override; | 77 | void hideEvent(QHideEvent *event) override; | ||
79 | 78 | | |||
80 | private slots: | 79 | private slots: | ||
81 | void stateChanged(Phonon::State newstate); | 80 | void stateChanged(QMediaPlayer::State newstate); | ||
82 | void stop(); | 81 | void stop(); | ||
83 | void finished(); | 82 | void finished(); | ||
84 | 83 | | |||
85 | private: | 84 | private: | ||
86 | void applyVideoSize(); | 85 | void applyVideoSize(); | ||
86 | void setPosition(qint64 position); | ||||
87 | void positionChanged(qint64 position); | ||||
88 | void durationChanged(qint64 position); | ||||
87 | 89 | | |||
88 | private: | 90 | private: | ||
89 | QUrl m_url; | 91 | QUrl m_url; | ||
90 | QSize m_videoSize; | 92 | QSize m_videoSize; | ||
91 | 93 | | |||
92 | QToolButton *m_playButton; | 94 | QToolButton *m_playButton; | ||
93 | QToolButton *m_stopButton; | 95 | QToolButton *m_stopButton; | ||
94 | 96 | | |||
95 | QVBoxLayout *m_topLayout; | 97 | QVBoxLayout *m_topLayout; | ||
96 | Phonon::MediaObject *m_media; | 98 | QMediaPlayer *m_player; | ||
97 | Phonon::SeekSlider *m_seekSlider; | 99 | QSlider *m_seekSlider; | ||
98 | Phonon::AudioOutput *m_audioOutput; | 100 | EmbeddedVideoPlayer *m_videoWidget; | ||
99 | EmbeddedVideoPlayer *m_videoPlayer; | 101 | QMediaPlaylist *m_playlist; | ||
100 | bool m_autoPlay; | 102 | bool m_autoPlay; | ||
101 | bool m_isVideo; | 103 | bool m_isVideo; | ||
102 | }; | 104 | }; | ||
103 | 105 | | |||
104 | #endif // PHONONWIDGET_H | 106 | #endif // PHONONWIDGET_H |