mirror of
https://github.com/kavishdevar/librepods.git
synced 2026-03-17 19:52:31 +00:00
[Linux] Use DBus for following media playback change
This commit is contained in:
committed by
Tim Gromeyer
parent
5754dbfb16
commit
38d6f8ceae
24
linux/media/playerstatuswatcher.h
Normal file
24
linux/media/playerstatuswatcher.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <QDBusInterface>
|
||||
#include <QDBusServiceWatcher>
|
||||
|
||||
class PlayerStatusWatcher : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit PlayerStatusWatcher(const QString &playerService, QObject *parent = nullptr);
|
||||
|
||||
signals:
|
||||
void playbackStatusChanged(const QString &status);
|
||||
|
||||
private slots:
|
||||
void onPropertiesChanged(const QString &interface, const QVariantMap &changed, const QStringList &);
|
||||
void onServiceOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner);
|
||||
|
||||
private:
|
||||
void updateStatus();
|
||||
QString m_playerService;
|
||||
QDBusInterface *m_iface;
|
||||
QDBusServiceWatcher *m_serviceWatcher;
|
||||
};
|
||||
Reference in New Issue
Block a user