service/pipewire: add a way to set preferred default nodes

This commit is contained in:
outfoxxed 2024-09-24 01:59:01 -07:00
parent f889f08901
commit fdc78ae16f
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E
4 changed files with 107 additions and 13 deletions

View file

@ -143,11 +143,19 @@ PwNodeIface* Pipewire::defaultConfiguredAudioSink() const { // NOLINT
return PwNodeIface::instance(node);
}
void Pipewire::setDefaultConfiguredAudioSink(PwNodeIface* node) {
PwConnection::instance()->defaults.changeConfiguredSink(node ? node->node() : nullptr);
}
PwNodeIface* Pipewire::defaultConfiguredAudioSource() const { // NOLINT
auto* node = PwConnection::instance()->defaults.defaultConfiguredSource();
return PwNodeIface::instance(node);
}
void Pipewire::setDefaultConfiguredAudioSource(PwNodeIface* node) {
PwConnection::instance()->defaults.changeConfiguredSource(node ? node->node() : nullptr);
}
PwNodeIface* PwNodeLinkTracker::node() const { return this->mNode; }
void PwNodeLinkTracker::setNode(PwNodeIface* node) {