digiKam
Loading...
Searching...
No Matches
audplayerwdg.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 : 2017-05-25
7 * Description : a widget to play audio track.
8 *
9 * SPDX-FileCopyrightText: 2017-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 include
18
19#include <QWidget>
20#include <QString>
21
22#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
23
24// QtMultimedia includes
25
26# include <QMediaPlayer>
27
28#else
29
30// QtAVPlayer includes
31
32# include "daudioplayer.h"
33
34#endif
35
36// Local includes
37
38#include "digikam_export.h"
39
40namespace Digikam
41{
42
43class DIGIKAM_EXPORT AudPlayerWdg : public QWidget
44{
45 Q_OBJECT
46
47public:
48
49 explicit AudPlayerWdg(QWidget* const parent = nullptr);
50 ~AudPlayerWdg() override;
51
52 void setAudioFile(const QString& afile);
53
54public Q_SLOTS:
55
56 void slotPlay();
57 void slotStop();
58
59private Q_SLOTS:
60
61 void slotTimeUpdaterTimeout(qint64);
62 void slotSetVolume(int);
63
64#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
65
66 void slotPlayerStateChanged(QMediaPlayer::PlaybackState);
67 void slotPlayerError(QMediaPlayer::Error, const QString&);
68
69#else
70
71 void slotPlayerStateChanged(QAVPlayer::State);
72 void slotPlayerError(QAVPlayer::Error, const QString&);
73
74#endif
75
76private:
77
78 void setZeroTime();
79
80private:
81
82 class Private;
83 Private* const d = nullptr;
84};
85
86} // namespace Digikam
Definition audplayerwdg.h:44
Definition datefolderview.cpp:34