service/pipewire: avoid overloading devices with volume changes

Wait until in-flight changes have been responded to before sending more.
This commit is contained in:
outfoxxed 2024-08-27 19:56:17 -07:00
parent c60871a7fb
commit 79b22af093
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E
4 changed files with 140 additions and 71 deletions

View file

@ -28,6 +28,12 @@ public:
bool setVolumes(qint32 routeDevice, const QVector<float>& volumes);
bool setMuted(qint32 routeDevice, bool muted);
void waitForDevice();
[[nodiscard]] bool waitingForDevice() const;
signals:
void deviceReady();
private slots:
void polled();
@ -44,6 +50,8 @@ private:
bool
setRouteProps(qint32 routeDevice, const std::function<void*(spa_pod_builder*)>& propsCallback);
bool mWaitingForDevice = false;
bool deviceResponded = false;
SpaHook listener;
};