forked from quickshell/quickshell
service/pipewire: refactor defaults and metadata handling
This commit is contained in:
parent
7f9762be53
commit
f889f08901
11 changed files with 455 additions and 144 deletions
|
|
@ -11,6 +11,7 @@
|
|||
#include <qlogging.h>
|
||||
#include <qloggingcategory.h>
|
||||
#include <qobject.h>
|
||||
#include <qstringview.h>
|
||||
#include <qtmetamacros.h>
|
||||
#include <qtypes.h>
|
||||
|
||||
|
|
@ -143,7 +144,7 @@ void PwRegistry::onGlobal(
|
|||
meta->initProps(props);
|
||||
|
||||
self->metadata.emplace(id, meta);
|
||||
meta->bind();
|
||||
emit self->metadataAdded(meta);
|
||||
} else if (strcmp(type, PW_TYPE_INTERFACE_Link) == 0) {
|
||||
auto* link = new PwLink();
|
||||
link->init(self, id, permissions);
|
||||
|
|
@ -199,4 +200,14 @@ void PwRegistry::onLinkGroupDestroyed(QObject* object) {
|
|||
this->linkGroups.removeOne(group);
|
||||
}
|
||||
|
||||
PwNode* PwRegistry::findNodeByName(QStringView name) const {
|
||||
if (name.isEmpty()) return nullptr;
|
||||
|
||||
for (auto* node: this->nodes.values()) {
|
||||
if (node->name == name) return node;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
} // namespace qs::service::pipewire
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue