digiKam
Loading...
Searching...
No Matches
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 QtMultimedia media player.
8 *
9 * SPDX-FileCopyrightText: 2006-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
10 *
11 * SPDX-License-Identifier: GPL-2.0-or-later
12 *
13 * ============================================================ */
14
15#pragma once
16
17// Qt includes
18
19#include <QStackedWidget>
20#include <QEvent>
21#include <QUrl>
22#include <QMediaPlayer>
23
24// Local includes
25
26#include "digikam_export.h"
27#include "dinfointerface.h"
28
29namespace Digikam
30{
31
32class DIGIKAM_EXPORT MediaPlayerView : public QStackedWidget
33{
34 Q_OBJECT
35
36public:
37
38 explicit MediaPlayerView(QWidget* const parent);
39 ~MediaPlayerView() override;
40
41 void setCurrentItem(const QUrl& url = QUrl(),
42 bool hasPrevious = false,
43 bool hasNext = false);
44
45 void setInfoInterface(DInfoInterface* const iface);
46 void escapePreview();
47 void reload();
48
49Q_SIGNALS:
50
54
55public Q_SLOTS:
56
57 void slotEscapePressed();
58 void slotRotateVideo();
59
60private Q_SLOTS:
61
62 void slotPlayerStateChanged(QMediaPlayer::PlaybackState newState);
63 void slotMediaStatusChanged(QMediaPlayer::MediaStatus newStatus);
64 void slotHandlePlayerError(QMediaPlayer::Error, const QString&);
65 void slotNativeSizeChanged();
66 void slotThemeChanged();
67
69 void slotPositionChanged(qint64 position);
70 void slotDurationChanged(qint64 duration);
71 void slotPlaybackRate(QAction* action);
72 void slotVolumeChanged(int volume);
73 void slotLoopToggled(bool loop);
74 void slotPosition(int position);
75 void slotFrameBackward();
76 void slotFrameForward();
77 void slotPausePlay();
78 void slotCapture();
79
80private:
81
82 int previewMode();
83 void setPreviewMode(int mode);
84
85protected:
86
87 bool eventFilter(QObject* watched, QEvent* event) override;
88
89private:
90
91 class Private;
92 Private* const d = nullptr;
93};
94
95} // namespace Digikam
Definition dinfointerface.h:48
Definition mediaplayerview.h:33
Definition datefolderview.cpp:34