diff options
| author | Gregor Kleen <gkleen@yggdrasil.li> | 2026-10-21 15:05:50 +0200 |
|---|---|---|
| committer | Gregor Kleen <gkleen@yggdrasil.li> | 2026-10-21 15:05:50 +0200 |
| commit | ebccb33b4eb60a07e667332665181ba9ad352615 (patch) | |
| tree | 14947c3add7677919250265616f9ab4f5f6b071b /overlays/quickshell/pipewire.patch | |
| parent | f2c90589d4d4d6c1f101c969d1363729171b3115 (diff) | |
| download | nixos-ebccb33b4eb60a07e667332665181ba9ad352615.tar nixos-ebccb33b4eb60a07e667332665181ba9ad352615.tar.gz nixos-ebccb33b4eb60a07e667332665181ba9ad352615.tar.bz2 nixos-ebccb33b4eb60a07e667332665181ba9ad352615.tar.xz nixos-ebccb33b4eb60a07e667332665181ba9ad352615.zip | |
...
Diffstat (limited to 'overlays/quickshell/pipewire.patch')
| -rw-r--r-- | overlays/quickshell/pipewire.patch | 127 |
1 files changed, 64 insertions, 63 deletions
diff --git a/overlays/quickshell/pipewire.patch b/overlays/quickshell/pipewire.patch index b94a2691..8c5a4c1e 100644 --- a/overlays/quickshell/pipewire.patch +++ b/overlays/quickshell/pipewire.patch | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | diff --git i/src/services/pipewire/device.cpp w/src/services/pipewire/device.cpp | 1 | diff --git c/src/services/pipewire/device.cpp i/src/services/pipewire/device.cpp |
| 2 | index 616e7d0..0c55008 100644 | 2 | index 61079a1..7246a67 100644 |
| 3 | --- i/src/services/pipewire/device.cpp | 3 | --- c/src/services/pipewire/device.cpp |
| 4 | +++ w/src/services/pipewire/device.cpp | 4 | +++ i/src/services/pipewire/device.cpp |
| 5 | @@ -3,6 +3,7 @@ | 5 | @@ -3,6 +3,7 @@ |
| 6 | #include <cstdint> | 6 | #include <cstdint> |
| 7 | #include <functional> | 7 | #include <functional> |
| @@ -21,7 +21,7 @@ index 616e7d0..0c55008 100644 | |||
| 21 | 21 | ||
| 22 | #include "../../core/logcat.hpp" | 22 | #include "../../core/logcat.hpp" |
| 23 | #include "core.hpp" | 23 | #include "core.hpp" |
| 24 | @@ -46,6 +49,25 @@ void PwDevice::unbindHooks() { | 24 | @@ -46,6 +51,25 @@ void PwDevice::unbindHooks() { |
| 25 | this->mWaitingForDevice = false; | 25 | this->mWaitingForDevice = false; |
| 26 | } | 26 | } |
| 27 | 27 | ||
| @@ -47,7 +47,7 @@ index 616e7d0..0c55008 100644 | |||
| 47 | const pw_device_events PwDevice::EVENTS = { | 47 | const pw_device_events PwDevice::EVENTS = { |
| 48 | .version = PW_VERSION_DEVICE_EVENTS, | 48 | .version = PW_VERSION_DEVICE_EVENTS, |
| 49 | .info = &PwDevice::onInfo, | 49 | .info = &PwDevice::onInfo, |
| 50 | @@ -71,6 +93,11 @@ void PwDevice::onInfo(void* data, const pw_device_info* info) { | 50 | @@ -71,6 +95,11 @@ void PwDevice::onInfo(void* data, const pw_device_info* info) { |
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | break; | 53 | break; |
| @@ -59,7 +59,7 @@ index 616e7d0..0c55008 100644 | |||
| 59 | } | 59 | } |
| 60 | } | 60 | } |
| 61 | } | 61 | } |
| 62 | @@ -97,6 +124,15 @@ void PwDevice::onParam( | 62 | @@ -97,6 +126,15 @@ void PwDevice::onParam( |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | self->addDeviceIndexPairs(param); | 65 | self->addDeviceIndexPairs(param); |
| @@ -75,7 +75,7 @@ index 616e7d0..0c55008 100644 | |||
| 75 | } | 75 | } |
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | @@ -145,6 +181,21 @@ void PwDevice::polled() { | 78 | @@ -159,6 +197,21 @@ void PwDevice::polled() { |
| 79 | return false; | 79 | return false; |
| 80 | }); | 80 | }); |
| 81 | } | 81 | } |
| @@ -97,7 +97,7 @@ index 616e7d0..0c55008 100644 | |||
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | bool PwDevice::setVolumes(qint32 routeDevice, const QVector<float>& volumes) { | 99 | bool PwDevice::setVolumes(qint32 routeDevice, const QVector<float>& volumes) { |
| 100 | @@ -182,6 +233,15 @@ bool PwDevice::setMuted(qint32 routeDevice, bool muted) { | 100 | @@ -196,6 +249,15 @@ bool PwDevice::setMuted(qint32 routeDevice, bool muted) { |
| 101 | }); | 101 | }); |
| 102 | } | 102 | } |
| 103 | 103 | ||
| @@ -113,7 +113,7 @@ index 616e7d0..0c55008 100644 | |||
| 113 | void PwDevice::waitForDevice() { this->mWaitingForDevice = true; } | 113 | void PwDevice::waitForDevice() { this->mWaitingForDevice = true; } |
| 114 | bool PwDevice::waitingForDevice() const { return this->mWaitingForDevice; } | 114 | bool PwDevice::waitingForDevice() const { return this->mWaitingForDevice; } |
| 115 | 115 | ||
| 116 | @@ -222,4 +282,24 @@ bool PwDevice::setRouteProps( | 116 | @@ -236,4 +298,24 @@ bool PwDevice::setRouteProps( |
| 117 | return true; | 117 | return true; |
| 118 | } | 118 | } |
| 119 | 119 | ||
| @@ -138,10 +138,10 @@ index 616e7d0..0c55008 100644 | |||
| 138 | +} | 138 | +} |
| 139 | + | 139 | + |
| 140 | } // namespace qs::service::pipewire | 140 | } // namespace qs::service::pipewire |
| 141 | diff --git i/src/services/pipewire/device.hpp w/src/services/pipewire/device.hpp | 141 | diff --git c/src/services/pipewire/device.hpp i/src/services/pipewire/device.hpp |
| 142 | index 1a1f705..ee64858 100644 | 142 | index f973b18..7cff16f 100644 |
| 143 | --- i/src/services/pipewire/device.hpp | 143 | --- c/src/services/pipewire/device.hpp |
| 144 | +++ w/src/services/pipewire/device.hpp | 144 | +++ i/src/services/pipewire/device.hpp |
| 145 | @@ -1,6 +1,7 @@ | 145 | @@ -1,6 +1,7 @@ |
| 146 | #pragma once | 146 | #pragma once |
| 147 | 147 | ||
| @@ -150,7 +150,7 @@ index 1a1f705..ee64858 100644 | |||
| 150 | 150 | ||
| 151 | #include <pipewire/core.h> | 151 | #include <pipewire/core.h> |
| 152 | #include <pipewire/device.h> | 152 | #include <pipewire/device.h> |
| 153 | @@ -17,6 +18,20 @@ | 153 | @@ -16,6 +17,20 @@ |
| 154 | 154 | ||
| 155 | namespace qs::service::pipewire { | 155 | namespace qs::service::pipewire { |
| 156 | 156 | ||
| @@ -170,8 +170,8 @@ index 1a1f705..ee64858 100644 | |||
| 170 | + | 170 | + |
| 171 | class PwDevice; | 171 | class PwDevice; |
| 172 | 172 | ||
| 173 | class PwDevice: public PwBindable<pw_device, PW_TYPE_INTERFACE_Device, PW_VERSION_DEVICE> { | 173 | // Forward declare to avoid circular dependency with node.hpp |
| 174 | @@ -25,6 +40,12 @@ class PwDevice: public PwBindable<pw_device, PW_TYPE_INTERFACE_Device, PW_VERSIO | 174 | @@ -27,6 +42,12 @@ class PwDevice: public PwBindable<pw_device, PW_TYPE_INTERFACE_Device, PW_VERSIO |
| 175 | public: | 175 | public: |
| 176 | void bindHooks() override; | 176 | void bindHooks() override; |
| 177 | void unbindHooks() override; | 177 | void unbindHooks() override; |
| @@ -184,9 +184,9 @@ index 1a1f705..ee64858 100644 | |||
| 184 | 184 | ||
| 185 | bool setVolumes(qint32 routeDevice, const QVector<float>& volumes); | 185 | bool setVolumes(qint32 routeDevice, const QVector<float>& volumes); |
| 186 | bool setMuted(qint32 routeDevice, bool muted); | 186 | bool setMuted(qint32 routeDevice, bool muted); |
| 187 | @@ -32,9 +53,16 @@ public: | 187 | @@ -37,10 +58,17 @@ public: |
| 188 | void waitForDevice(); | 188 | [[nodiscard]] bool tryLoadVolumeProps(qint32 routeDevice, PwVolumeProps& volumeProps); |
| 189 | [[nodiscard]] bool waitingForDevice() const; | 189 | [[nodiscard]] bool hasRouteDevice(qint32 routeDevice) const; |
| 190 | 190 | ||
| 191 | + void setProfile(qint32 profileIndex); | 191 | + void setProfile(qint32 profileIndex); |
| 192 | + | 192 | + |
| @@ -195,13 +195,14 @@ index 1a1f705..ee64858 100644 | |||
| 195 | + | 195 | + |
| 196 | signals: | 196 | signals: |
| 197 | void deviceReady(); | 197 | void deviceReady(); |
| 198 | void routeVolumesChanged(qint32 routeDevice, const PwVolumeProps& volumeProps); | 198 | void |
| 199 | routeVolumesChanged(qint32 routeDevice, const qs::service::pipewire::PwVolumeProps& volumeProps); | ||
| 199 | + void profilesChanged(QList<PwProfile> profiles); | 200 | + void profilesChanged(QList<PwProfile> profiles); |
| 200 | + void currentProfileChanged(PwProfile profile); | 201 | + void currentProfileChanged(PwProfile profile); |
| 201 | 202 | ||
| 202 | private slots: | 203 | private slots: |
| 203 | void polled(); | 204 | void polled(); |
| 204 | @@ -49,6 +77,11 @@ private: | 205 | @@ -56,6 +84,11 @@ private: |
| 205 | QList<qint32> stagingIndexes; | 206 | QList<qint32> stagingIndexes; |
| 206 | void addDeviceIndexPairs(const spa_pod* param); | 207 | void addDeviceIndexPairs(const spa_pod* param); |
| 207 | 208 | ||
| @@ -213,11 +214,11 @@ index 1a1f705..ee64858 100644 | |||
| 213 | bool | 214 | bool |
| 214 | setRouteProps(qint32 routeDevice, const std::function<void*(spa_pod_builder*)>& propsCallback); | 215 | setRouteProps(qint32 routeDevice, const std::function<void*(spa_pod_builder*)>& propsCallback); |
| 215 | 216 | ||
| 216 | diff --git i/src/services/pipewire/node.cpp w/src/services/pipewire/node.cpp | 217 | diff --git c/src/services/pipewire/node.cpp i/src/services/pipewire/node.cpp |
| 217 | index 3e68149..4721a58 100644 | 218 | index 2811833..25e1f8d 100644 |
| 218 | --- i/src/services/pipewire/node.cpp | 219 | --- c/src/services/pipewire/node.cpp |
| 219 | +++ w/src/services/pipewire/node.cpp | 220 | +++ i/src/services/pipewire/node.cpp |
| 220 | @@ -145,6 +145,10 @@ void PwNode::initProps(const spa_dict* props) { | 221 | @@ -146,6 +146,10 @@ void PwNode::initProps(const spa_dict* props) { |
| 221 | this->type = PwNodeType::VideoSink; | 222 | this->type = PwNodeType::VideoSink; |
| 222 | } else if (strcmp(mediaClass, "Video/Source") == 0) { | 223 | } else if (strcmp(mediaClass, "Video/Source") == 0) { |
| 223 | this->type = PwNodeType::VideoSource; | 224 | this->type = PwNodeType::VideoSource; |
| @@ -228,11 +229,11 @@ index 3e68149..4721a58 100644 | |||
| 228 | } | 229 | } |
| 229 | } | 230 | } |
| 230 | 231 | ||
| 231 | diff --git i/src/services/pipewire/node.hpp w/src/services/pipewire/node.hpp | 232 | diff --git c/src/services/pipewire/node.hpp i/src/services/pipewire/node.hpp |
| 232 | index 0d4c92e..ee6f223 100644 | 233 | index d96525a..4f44c8d 100644 |
| 233 | --- i/src/services/pipewire/node.hpp | 234 | --- c/src/services/pipewire/node.hpp |
| 234 | +++ w/src/services/pipewire/node.hpp | 235 | +++ i/src/services/pipewire/node.hpp |
| 235 | @@ -144,6 +144,8 @@ public: | 236 | @@ -145,6 +145,8 @@ public: |
| 236 | // This is equivalent to the media class `Video/Sink` and is composed of the | 237 | // This is equivalent to the media class `Video/Sink` and is composed of the |
| 237 | // @@PwNodeType.Video and @@PwNodeType.Sink flags. | 238 | // @@PwNodeType.Video and @@PwNodeType.Sink flags. |
| 238 | VideoSink = Video | Sink, | 239 | VideoSink = Video | Sink, |
| @@ -241,11 +242,11 @@ index 0d4c92e..ee6f223 100644 | |||
| 241 | }; | 242 | }; |
| 242 | Q_ENUM(Flag); | 243 | Q_ENUM(Flag); |
| 243 | Q_DECLARE_FLAGS(Flags, Flag); | 244 | Q_DECLARE_FLAGS(Flags, Flag); |
| 244 | diff --git i/src/services/pipewire/qml.cpp w/src/services/pipewire/qml.cpp | 245 | diff --git c/src/services/pipewire/qml.cpp i/src/services/pipewire/qml.cpp |
| 245 | index 9efb17e..921d12a 100644 | 246 | index e4424c1..407096b 100644 |
| 246 | --- i/src/services/pipewire/qml.cpp | 247 | --- c/src/services/pipewire/qml.cpp |
| 247 | +++ w/src/services/pipewire/qml.cpp | 248 | +++ i/src/services/pipewire/qml.cpp |
| 248 | @@ -9,6 +9,9 @@ | 249 | @@ -8,6 +8,9 @@ |
| 249 | #include <qtypes.h> | 250 | #include <qtypes.h> |
| 250 | #include <qvariant.h> | 251 | #include <qvariant.h> |
| 251 | 252 | ||
| @@ -255,7 +256,7 @@ index 9efb17e..921d12a 100644 | |||
| 255 | #include "../../core/model.hpp" | 256 | #include "../../core/model.hpp" |
| 256 | #include "connection.hpp" | 257 | #include "connection.hpp" |
| 257 | #include "defaults.hpp" | 258 | #include "defaults.hpp" |
| 258 | @@ -54,6 +57,12 @@ Pipewire::Pipewire(QObject* parent): QObject(parent) { | 259 | @@ -53,6 +56,12 @@ Pipewire::Pipewire(QObject* parent): QObject(parent) { |
| 259 | 260 | ||
| 260 | QObject::connect(&connection->registry, &PwRegistry::nodeAdded, this, &Pipewire::onNodeAdded); | 261 | QObject::connect(&connection->registry, &PwRegistry::nodeAdded, this, &Pipewire::onNodeAdded); |
| 261 | 262 | ||
| @@ -268,7 +269,7 @@ index 9efb17e..921d12a 100644 | |||
| 268 | for (auto* link: connection->registry.links.values()) { | 269 | for (auto* link: connection->registry.links.values()) { |
| 269 | this->onLinkAdded(link); | 270 | this->onLinkAdded(link); |
| 270 | } | 271 | } |
| 271 | @@ -123,6 +132,19 @@ void Pipewire::onNodeRemoved(QObject* object) { | 272 | @@ -115,6 +124,19 @@ void Pipewire::onNodeRemoved(QObject* object) { |
| 272 | this->mNodes.removeObject(iface); | 273 | this->mNodes.removeObject(iface); |
| 273 | } | 274 | } |
| 274 | 275 | ||
| @@ -288,7 +289,7 @@ index 9efb17e..921d12a 100644 | |||
| 288 | ObjectModel<PwLinkIface>* Pipewire::links() { return &this->mLinks; } | 289 | ObjectModel<PwLinkIface>* Pipewire::links() { return &this->mLinks; } |
| 289 | 290 | ||
| 290 | void Pipewire::onLinkAdded(PwLink* link) { | 291 | void Pipewire::onLinkAdded(PwLink* link) { |
| 291 | @@ -357,6 +379,8 @@ QVariantMap PwNodeIface::properties() const { | 292 | @@ -352,6 +374,8 @@ QVariantMap PwNodeIface::properties() const { |
| 292 | 293 | ||
| 293 | PwNodeAudioIface* PwNodeIface::audio() const { return this->audioIface; } | 294 | PwNodeAudioIface* PwNodeIface::audio() const { return this->audioIface; } |
| 294 | 295 | ||
| @@ -297,7 +298,7 @@ index 9efb17e..921d12a 100644 | |||
| 297 | PwNodeIface* PwNodeIface::instance(PwNode* node) { | 298 | PwNodeIface* PwNodeIface::instance(PwNode* node) { |
| 298 | if (node == nullptr) return nullptr; | 299 | if (node == nullptr) return nullptr; |
| 299 | 300 | ||
| 300 | @@ -481,4 +505,42 @@ void PwObjectTracker::objectDestroyed(QObject* object) { | 301 | @@ -476,4 +500,42 @@ void PwObjectTracker::objectDestroyed(QObject* object) { |
| 301 | emit this->objectsChanged(); | 302 | emit this->objectsChanged(); |
| 302 | } | 303 | } |
| 303 | 304 | ||
| @@ -340,10 +341,10 @@ index 9efb17e..921d12a 100644 | |||
| 340 | +} | 341 | +} |
| 341 | + | 342 | + |
| 342 | } // namespace qs::service::pipewire | 343 | } // namespace qs::service::pipewire |
| 343 | diff --git i/src/services/pipewire/qml.hpp w/src/services/pipewire/qml.hpp | 344 | diff --git c/src/services/pipewire/qml.hpp i/src/services/pipewire/qml.hpp |
| 344 | index e3489a1..e5e1891 100644 | 345 | index 93c4844..87cbcb3 100644 |
| 345 | --- i/src/services/pipewire/qml.hpp | 346 | --- c/src/services/pipewire/qml.hpp |
| 346 | +++ w/src/services/pipewire/qml.hpp | 347 | +++ i/src/services/pipewire/qml.hpp |
| 347 | @@ -12,11 +12,13 @@ | 348 | @@ -12,11 +12,13 @@ |
| 348 | #include "../../core/model.hpp" | 349 | #include "../../core/model.hpp" |
| 349 | #include "link.hpp" | 350 | #include "link.hpp" |
| @@ -378,13 +379,13 @@ index e3489a1..e5e1891 100644 | |||
| 378 | @@ -159,7 +164,9 @@ signals: | 379 | @@ -159,7 +164,9 @@ signals: |
| 379 | 380 | ||
| 380 | private slots: | 381 | private slots: |
| 381 | void onNodeAdded(PwNode* node); | 382 | void onNodeAdded(qs::service::pipewire::PwNode* node); |
| 382 | + void onDeviceAdded(PwDevice* node); | 383 | + void onDeviceAdded(PwDevice* node); |
| 383 | void onNodeRemoved(QObject* object); | 384 | void onNodeRemoved(QObject* object); |
| 384 | + void onDeviceRemoved(QObject* object); | 385 | + void onDeviceRemoved(QObject* object); |
| 385 | void onLinkAdded(PwLink* link); | 386 | void onLinkAdded(qs::service::pipewire::PwLink* link); |
| 386 | void onLinkRemoved(QObject* object); | 387 | void onLinkRemoved(QObject* object); |
| 387 | void onLinkGroupAdded(PwLinkGroup* group); | 388 | void onLinkGroupAdded(qs::service::pipewire::PwLinkGroup* group); |
| 388 | @@ -167,6 +174,7 @@ private slots: | 389 | @@ -167,6 +174,7 @@ private slots: |
| 389 | 390 | ||
| 390 | private: | 391 | private: |
| @@ -454,11 +455,11 @@ index e3489a1..e5e1891 100644 | |||
| 454 | ///! A connection between pipewire nodes. | 455 | ///! A connection between pipewire nodes. |
| 455 | /// Note that there is one link per *channel* of a connection between nodes. | 456 | /// Note that there is one link per *channel* of a connection between nodes. |
| 456 | /// You usually want @@PwLinkGroup. | 457 | /// You usually want @@PwLinkGroup. |
| 457 | diff --git i/src/services/pipewire/registry.cpp w/src/services/pipewire/registry.cpp | 458 | diff --git c/src/services/pipewire/registry.cpp i/src/services/pipewire/registry.cpp |
| 458 | index c08fc1d..50c6d7a 100644 | 459 | index 4b670b1..4295874 100644 |
| 459 | --- i/src/services/pipewire/registry.cpp | 460 | --- c/src/services/pipewire/registry.cpp |
| 460 | +++ w/src/services/pipewire/registry.cpp | 461 | +++ i/src/services/pipewire/registry.cpp |
| 461 | @@ -196,6 +196,7 @@ void PwRegistry::onGlobal( | 462 | @@ -236,6 +236,7 @@ void PwRegistry::onGlobal( |
| 462 | device->initProps(props); | 463 | device->initProps(props); |
| 463 | 464 | ||
| 464 | self->devices.emplace(id, device); | 465 | self->devices.emplace(id, device); |
| @@ -466,7 +467,7 @@ index c08fc1d..50c6d7a 100644 | |||
| 466 | } | 467 | } |
| 467 | } | 468 | } |
| 468 | 469 | ||
| 469 | @@ -211,6 +212,9 @@ void PwRegistry::onGlobalRemoved(void* data, quint32 id) { | 470 | @@ -251,6 +252,9 @@ void PwRegistry::onGlobalRemoved(void* data, quint32 id) { |
| 470 | } else if (auto* node = self->nodes.value(id)) { | 471 | } else if (auto* node = self->nodes.value(id)) { |
| 471 | self->nodes.remove(id); | 472 | self->nodes.remove(id); |
| 472 | node->safeDestroy(); | 473 | node->safeDestroy(); |
| @@ -476,15 +477,15 @@ index c08fc1d..50c6d7a 100644 | |||
| 476 | } | 477 | } |
| 477 | } | 478 | } |
| 478 | 479 | ||
| 479 | diff --git i/src/services/pipewire/registry.hpp w/src/services/pipewire/registry.hpp | 480 | diff --git c/src/services/pipewire/registry.hpp i/src/services/pipewire/registry.hpp |
| 480 | index 8473f04..87e0766 100644 | 481 | index ec0a9ea..c9be65a 100644 |
| 481 | --- i/src/services/pipewire/registry.hpp | 482 | --- c/src/services/pipewire/registry.hpp |
| 482 | +++ w/src/services/pipewire/registry.hpp | 483 | +++ i/src/services/pipewire/registry.hpp |
| 483 | @@ -132,6 +132,7 @@ public: | 484 | @@ -133,6 +133,7 @@ public: |
| 484 | 485 | ||
| 485 | signals: | 486 | signals: |
| 486 | void nodeAdded(PwNode* node); | 487 | void nodeAdded(qs::service::pipewire::PwNode* node); |
| 487 | + void deviceAdded(PwDevice* node); | 488 | + void deviceAdded(PwDevice* node); |
| 488 | void linkAdded(PwLink* link); | 489 | void linkAdded(qs::service::pipewire::PwLink* link); |
| 489 | void linkGroupAdded(PwLinkGroup* group); | 490 | void linkGroupAdded(qs::service::pipewire::PwLinkGroup* group); |
| 490 | void metadataAdded(PwMetadata* metadata); | 491 | void metadataAdded(qs::service::pipewire::PwMetadata* metadata); |
