File indexing completed on 2024-04-28 15:17:54

0001 /*
0002  * BluezQt - Asynchronous Bluez wrapper library
0003  *
0004  * SPDX-FileCopyrightText: 2015 David Rosca <nowrep@gmail.com>
0005  *
0006  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007  */
0008 
0009 #ifndef BLUEZQT_MEDIAPLAYER_P_H
0010 #define BLUEZQT_MEDIAPLAYER_P_H
0011 
0012 #include <QObject>
0013 
0014 #include "bluezmediaplayer1.h"
0015 #include "dbusproperties.h"
0016 #include "mediaplayer.h"
0017 
0018 namespace BluezQt
0019 {
0020 typedef org::bluez::MediaPlayer1 BluezMediaPlayer;
0021 typedef org::freedesktop::DBus::Properties DBusProperties;
0022 
0023 class MediaPlayerPrivate : public QObject
0024 {
0025     Q_OBJECT
0026 
0027 public:
0028     explicit MediaPlayerPrivate(const QString &path, const QVariantMap &properties);
0029 
0030     void init(const QVariantMap &properties);
0031 
0032     QDBusPendingReply<> setDBusProperty(const QString &name, const QVariant &value);
0033     void propertiesChanged(const QString &interface, const QVariantMap &changed, const QStringList &invalidated);
0034 
0035     MediaPlayerTrack variantToTrack(const QVariant &variant) const;
0036 
0037     QWeakPointer<MediaPlayer> q;
0038     BluezMediaPlayer *m_bluezMediaPlayer;
0039     DBusProperties *m_dbusProperties;
0040 
0041     QString m_path;
0042     QString m_name;
0043     MediaPlayer::Equalizer m_equalizer;
0044     MediaPlayer::Repeat m_repeat;
0045     MediaPlayer::Shuffle m_shuffle;
0046     MediaPlayer::Status m_status;
0047     MediaPlayerTrack m_track;
0048     quint32 m_position;
0049 };
0050 
0051 } // namespace BluezQt
0052 
0053 #endif // BLUEZQT_MEDIAPLAYER_P_H