mirror of
https://git.outfoxxed.me/quickshell/quickshell.git
synced 2025-11-06 19:14:57 +11:00
service/pipewire: set device node volumes with device object
Fixes discrepancies between pulse and qs volumes, and volumes not persisting across reboot or vt switches.
This commit is contained in:
parent
b40d4147e0
commit
c60871a7fb
9 changed files with 380 additions and 74 deletions
|
|
@ -2,6 +2,7 @@
|
|||
#include <cstring>
|
||||
|
||||
#include <pipewire/core.h>
|
||||
#include <pipewire/device.h>
|
||||
#include <pipewire/extensions/metadata.h>
|
||||
#include <pipewire/link.h>
|
||||
#include <pipewire/node.h>
|
||||
|
|
@ -14,6 +15,7 @@
|
|||
#include <qtypes.h>
|
||||
|
||||
#include "core.hpp"
|
||||
#include "device.hpp"
|
||||
#include "link.hpp"
|
||||
#include "metadata.hpp"
|
||||
#include "node.hpp"
|
||||
|
|
@ -114,6 +116,7 @@ void PwBindableObjectRef::onObjectDestroyed() {
|
|||
}
|
||||
|
||||
void PwRegistry::init(PwCore& core) {
|
||||
this->core = &core;
|
||||
this->object = pw_core_get_registry(core.core, PW_VERSION_REGISTRY, 0);
|
||||
pw_registry_add_listener(this->object, &this->listener.hook, &PwRegistry::EVENTS, this);
|
||||
}
|
||||
|
|
@ -156,6 +159,12 @@ void PwRegistry::onGlobal(
|
|||
|
||||
self->nodes.emplace(id, node);
|
||||
emit self->nodeAdded(node);
|
||||
} else if (strcmp(type, PW_TYPE_INTERFACE_Device) == 0) {
|
||||
auto* device = new PwDevice();
|
||||
device->init(self, id, permissions);
|
||||
device->initProps(props);
|
||||
|
||||
self->devices.emplace(id, device);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue