service/pipewire: add registry and node ready properties

This commit is contained in:
outfoxxed 2025-01-14 15:08:29 -08:00
parent 8b6aa624a2
commit 6d8022b709
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E
8 changed files with 137 additions and 8 deletions

View file

@ -14,6 +14,14 @@
namespace qs::service::pipewire {
class SpaHook {
public:
explicit SpaHook();
void remove();
spa_hook hook;
};
class PwCore: public QObject {
Q_OBJECT;
@ -23,6 +31,7 @@ public:
Q_DISABLE_COPY_MOVE(PwCore);
[[nodiscard]] bool isValid() const;
[[nodiscard]] qint32 sync(quint32 id) const;
pw_loop* loop = nullptr;
pw_context* context = nullptr;
@ -30,12 +39,18 @@ public:
signals:
void polled();
void synced(quint32 id, qint32 seq);
private slots:
void poll();
private:
static const pw_core_events EVENTS;
static void onSync(void* data, quint32 id, qint32 seq);
QSocketNotifier notifier;
SpaHook listener;
};
template <typename T>
@ -49,12 +64,4 @@ public:
T* object;
};
class SpaHook {
public:
explicit SpaHook();
void remove();
spa_hook hook;
};
} // namespace qs::service::pipewire