BluezQt

declarativemediaplayer.h
1 /*
2  * BluezQt - Asynchronous Bluez wrapper library
3  *
4  * SPDX-FileCopyrightText: 2015 David Rosca <[email protected]>
5  *
6  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7  */
8 
9 #ifndef DECLARATIVEMEDIAPLAYER_H
10 #define DECLARATIVEMEDIAPLAYER_H
11 
12 #include <QJsonObject>
13 
14 #include "mediaplayer.h"
15 
16 class DeclarativeMediaPlayer : public QObject
17 {
18  Q_OBJECT
19  Q_PROPERTY(QString name READ name NOTIFY nameChanged)
20  Q_PROPERTY(BluezQt::MediaPlayer::Equalizer equalizer READ equalizer WRITE setEqualizer NOTIFY equalizerChanged)
21  Q_PROPERTY(BluezQt::MediaPlayer::Repeat repeat READ repeat WRITE setRepeat NOTIFY repeatChanged)
22  Q_PROPERTY(BluezQt::MediaPlayer::Shuffle shuffle READ shuffle WRITE setShuffle NOTIFY shuffleChanged)
23  Q_PROPERTY(BluezQt::MediaPlayer::Status status READ status NOTIFY statusChanged)
24  Q_PROPERTY(QJsonObject track READ track NOTIFY trackChanged)
25  Q_PROPERTY(quint32 position READ position NOTIFY positionChanged)
26 
27 public:
28  explicit DeclarativeMediaPlayer(BluezQt::MediaPlayerPtr mediaPlayer, QObject *parent = nullptr);
29 
30  QString name() const;
31 
32  BluezQt::MediaPlayer::Equalizer equalizer() const;
33  void setEqualizer(BluezQt::MediaPlayer::Equalizer equalizer);
34 
36  void setRepeat(BluezQt::MediaPlayer::Repeat repeat);
37 
39  void setShuffle(BluezQt::MediaPlayer::Shuffle shuffle);
40 
42 
43  QJsonObject track() const;
44 
45  quint32 position() const;
46 
47 public Q_SLOTS:
48  BluezQt::PendingCall *play();
52  BluezQt::PendingCall *previous();
53  BluezQt::PendingCall *fastForward();
54  BluezQt::PendingCall *rewind();
55 
56 Q_SIGNALS:
57  void nameChanged(const QString &name);
58  void equalizerChanged(BluezQt::MediaPlayer::Equalizer equalizer);
59  void repeatChanged(BluezQt::MediaPlayer::Repeat repeat);
60  void shuffleChanged(BluezQt::MediaPlayer::Shuffle shuffle);
61  void statusChanged(BluezQt::MediaPlayer::Status status);
62  void trackChanged(const QJsonObject &track);
63  void positionChanged(quint32 position);
64 
65 private:
66  void updateTrack();
67 
68  BluezQt::MediaPlayerPtr m_mediaPlayer;
69  QJsonObject m_track;
70 };
71 
72 #endif // DECLARATIVEMEDIAPLAYER_H
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Equalizer
Equalizer state.
Definition: mediaplayer.h:42
Q_SLOTSQ_SLOTS
void stop(Ekos::AlignState mode)
QAction * repeat(const QObject *recvr, const char *slot, QObject *parent)
Repeat
Repeat state.
Definition: mediaplayer.h:51
NETWORKMANAGERQT_EXPORT NetworkManager::Status status()
void shuffle(T &container)
Q_SCRIPTABLE Q_NOREPLY void pause()
Q_SIGNALSQ_SIGNALS
Shuffle
Shuffle state.
Definition: mediaplayer.h:64
QString name(StandardShortcut id)
const QList< QKeySequence > & next()
Status
Player status.
Definition: mediaplayer.h:75
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sun Sep 25 2022 04:19:10 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.