digiKam
mediaplayerview.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2006-20-12
7  * Description : a view to embed QtAv media player.
8  *
9  * Copyright (C) 2006-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option)
15  * any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_MEDIA_PLAYER_VIEW_H
25 #define DIGIKAM_MEDIA_PLAYER_VIEW_H
26 
27 // Qt includes
28 
29 #include <QStackedWidget>
30 #include <QEvent>
31 #include <QUrl>
32 
33 // QtAV includes
34 
35 #include <QtAV/AVError.h> // krazy:exclude=includes
36 #include <QtAV/AVPlayer.h> // krazy:exclude=includes
37 
38 // Local includes
39 
40 #include "digikam_export.h"
41 #include "dinfointerface.h"
42 
43 namespace Digikam
44 {
45 
46 class DIGIKAM_EXPORT MediaPlayerView : public QStackedWidget
47 {
48  Q_OBJECT
49 
50 public:
51 
52  explicit MediaPlayerView(QWidget* const parent);
53  ~MediaPlayerView() override;
54 
55  void setCurrentItem(const QUrl& url = QUrl(),
56  bool hasPrevious = false,
57  bool hasNext = false);
58 
59  void setInfoInterface(DInfoInterface* const iface);
60  void escapePreview();
61  void reload();
62 
63 Q_SIGNALS:
64 
68 
69 public Q_SLOTS:
70 
71  void slotEscapePressed();
72  void slotRotateVideo();
73 
74 private Q_SLOTS:
75 
76  void slotThemeChanged();
77  void slotPlayerStateChanged(QtAV::AVPlayer::State state);
78  void slotMediaStatusChanged(QtAV::MediaStatus status);
79  void slotHandlePlayerError(const QtAV::AVError& err);
80  void slotImageCaptured(const QImage& image);
81 
83  void slotPositionChanged(qint64 position);
84  void slotDurationChanged(qint64 duration);
85  void slotVolumeChanged(int volume);
86  void slotLoopToggled(bool loop);
87  void slotPosition(int position);
88  void slotPausePlay();
89  void slotCapture();
90 
91 private:
92 
93  int previewMode();
94  void setPreviewMode(int mode);
95 
96 private:
97 
98  class Private;
99  Private* const d;
100 };
101 
102 } // namespace Digikam
103 
104 #endif // DIGIKAM_MEDIA_PLAYER_VIEW_H
Definition: dinfointerface.h:56
Definition: mediaplayerview.h:47
Definition: datefolderview.cpp:43
Definition: scan.h:26