File indexing completed on 2024-09-29 09:22:58
0001 /* 0002 * SPDX-FileCopyrightText: 2015 David Rosca <nowrep@gmail.com> 0003 * 0004 * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0005 */ 0006 0007 #ifndef MEDIAPLAYERINTERFACE_H 0008 #define MEDIAPLAYERINTERFACE_H 0009 0010 #include "object.h" 0011 0012 #include <QDBusAbstractAdaptor> 0013 0014 class QDBusObjectPath; 0015 0016 class MediaPlayerObject : public QObject 0017 { 0018 public: 0019 explicit MediaPlayerObject(const QDBusObjectPath &path, QObject *parent = nullptr); 0020 }; 0021 0022 class MediaPlayerInterface : public QDBusAbstractAdaptor, public Object 0023 { 0024 Q_OBJECT 0025 Q_CLASSINFO("D-Bus Interface", "org.bluez.MediaPlayer1") 0026 Q_PROPERTY(QString Name READ name) 0027 Q_PROPERTY(QString Equalizer READ equalizer WRITE setEqualizer) 0028 Q_PROPERTY(QString Repeat READ repeat WRITE setRepeat) 0029 Q_PROPERTY(QString Shuffle READ shuffle WRITE setShuffle) 0030 Q_PROPERTY(QString Status READ status) 0031 Q_PROPERTY(QVariantMap Track READ track) 0032 Q_PROPERTY(quint32 Position READ position) 0033 Q_PROPERTY(QDBusObjectPath Device READ device) 0034 0035 public: 0036 explicit MediaPlayerInterface(const QDBusObjectPath &path, const QVariantMap &properties, QObject *parent = nullptr); 0037 0038 QString name() const; 0039 0040 QString equalizer() const; 0041 void setEqualizer(const QString &equalizer); 0042 0043 QString repeat() const; 0044 void setRepeat(const QString &repeat); 0045 0046 QString shuffle() const; 0047 void setShuffle(const QString &shuffle); 0048 0049 QString status() const; 0050 0051 QVariantMap track() const; 0052 0053 quint32 position() const; 0054 0055 QDBusObjectPath device() const; 0056 0057 public Q_SLOTS: 0058 void Play(); 0059 void Pause(); 0060 void Stop(); 0061 void Next(); 0062 void Previous(); 0063 void FastForward(); 0064 void Rewind(); 0065 }; 0066 0067 #endif // MEDIAPLAYERINTERFACE_H