File indexing completed on 2025-01-05 03:57:28
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2014-09-22 0007 * Description : Slideshow video viewer based on QtMultimedia 0008 * 0009 * SPDX-FileCopyrightText: 2014-2023 Gilles Caulier <caulier dot gilles at gmail dot com> 0010 * 0011 * SPDX-License-Identifier: GPL-2.0-or-later 0012 * 0013 * ============================================================ */ 0014 0015 #ifndef DIGIKAM_SLIDE_VIDEO_H 0016 #define DIGIKAM_SLIDE_VIDEO_H 0017 0018 // Qt includes 0019 0020 #include <QWidget> 0021 #include <QEvent> 0022 #include <QUrl> 0023 #include <QMediaPlayer> 0024 0025 // Local includes 0026 0027 #include "dinfointerface.h" 0028 #include "digikam_export.h" 0029 0030 namespace Digikam 0031 { 0032 0033 class DIGIKAM_EXPORT SlideVideo : public QWidget 0034 { 0035 Q_OBJECT 0036 0037 public: 0038 0039 explicit SlideVideo(QWidget* const parent); 0040 ~SlideVideo() override; 0041 0042 void setInfoInterface(DInfoInterface* const iface); 0043 void setCurrentUrl(const QUrl& url); 0044 void showIndicator(bool); 0045 void pause(bool); 0046 void stop(); 0047 0048 Q_SIGNALS: 0049 0050 void signalVideoLoaded(bool); 0051 void signalVideoFinished(); 0052 0053 void signalVideoPosition(qint64); 0054 void signalVideoDuration(qint64); 0055 0056 private Q_SLOTS: 0057 0058 void slotPlayerStateChanged(QMediaPlayer::PlaybackState newState); 0059 void slotMediaStatusChanged(QMediaPlayer::MediaStatus status); 0060 void slotHandlePlayerError(QMediaPlayer::Error, const QString&); 0061 void slotNativeSizeChanged(); 0062 0063 void slotPositionChanged(qint64 position); 0064 void slotDurationChanged(qint64 duration); 0065 void slotVolumeChanged(int volume); 0066 void slotPosition(int position); 0067 0068 private: 0069 0070 void resizeEvent(QResizeEvent*) override; 0071 0072 private: 0073 0074 class Private; 0075 Private* const d; 0076 }; 0077 0078 } // namespace Digikam 0079 0080 #endif // DIGIKAM_SLIDE_VIDEO_H