diff options
| author | Serg Podtynnyi <[email protected]> | 2023-02-04 00:14:53 +0700 |
|---|---|---|
| committer | Serg Podtynnyi <[email protected]> | 2023-02-05 12:45:38 +0700 |
| commit | 38c34eeca315c7be58e65d4d3fb72aaf7b866719 (patch) | |
| tree | 886e53f20c9c43edc3eb7fe04789716a9bc98ebe /src/panels/information/phononwidget.h | |
| parent | ffff8af851e3a386c44438337779d0ce7ca98a61 (diff) | |
Add clang-format and format code as in Frameworks
Diffstat (limited to 'src/panels/information/phononwidget.h')
| -rw-r--r-- | src/panels/information/phononwidget.h | 102 |
1 files changed, 49 insertions, 53 deletions
diff --git a/src/panels/information/phononwidget.h b/src/panels/information/phononwidget.h index 5510b0544..4662e47af 100644 --- a/src/panels/information/phononwidget.h +++ b/src/panels/information/phononwidget.h @@ -15,10 +15,10 @@ namespace Phonon { - class AudioOutput; - class MediaObject; - class SeekSlider; - class VideoPlayer; +class AudioOutput; +class MediaObject; +class SeekSlider; +class VideoPlayer; } // namespace Phonon class EmbeddedVideoPlayer; @@ -28,68 +28,64 @@ class QVBoxLayout; class PhononWidget : public QWidget { Q_OBJECT - public: +public: + enum MediaKind { Video, Audio }; - enum MediaKind { - Video, - Audio - }; + explicit PhononWidget(QWidget *parent = nullptr); - explicit PhononWidget(QWidget *parent = nullptr); + void setUrl(const QUrl &url, MediaKind kind); + QUrl url() const; + void clearUrl(); - 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 setVideoSize(const QSize& size); - QSize videoSize() const; - Phonon::State state() const; + void setAutoPlay(bool autoPlay); + bool eventFilter(QObject *object, QEvent *event) override; - void setAutoPlay(bool autoPlay); - bool eventFilter(QObject *object, QEvent *event) override; +Q_SIGNALS: + /** + * 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); - Q_SIGNALS: - /** - * 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); +public Q_SLOTS: + void play(); - public Q_SLOTS: - void play(); +protected: + void showEvent(QShowEvent *event) override; + void hideEvent(QHideEvent *event) override; - protected: - void showEvent(QShowEvent *event) override; - void hideEvent(QHideEvent *event) override; +private Q_SLOTS: + void stateChanged(Phonon::State newstate); + void stop(); + void finished(); - private Q_SLOTS: - void stateChanged(Phonon::State newstate); - void stop(); - void finished(); +private: + void applyVideoSize(); - private: - void applyVideoSize(); +private: + void togglePlayback(); - private: - void togglePlayback(); + QUrl m_url; + QSize m_videoSize; - QUrl m_url; - QSize m_videoSize; + QToolButton *m_playButton; + QToolButton *m_pauseButton; - QToolButton *m_playButton; - QToolButton *m_pauseButton; - - QVBoxLayout *m_topLayout; - Phonon::MediaObject *m_media; - Phonon::SeekSlider *m_seekSlider; - Phonon::AudioOutput *m_audioOutput; - EmbeddedVideoPlayer *m_videoPlayer; - bool m_autoPlay; - bool m_isVideo; + QVBoxLayout *m_topLayout; + Phonon::MediaObject *m_media; + Phonon::SeekSlider *m_seekSlider; + Phonon::AudioOutput *m_audioOutput; + EmbeddedVideoPlayer *m_videoPlayer; + bool m_autoPlay; + bool m_isVideo; }; #endif // PHONONWIDGET_H |
