These were documented in src/scripts/lib initially because the settings-manager
scripts used to be also there and it made sense to keep them close together.
Autoswitch should make sure the saved headset profile always has an
input route. Check this on loading/saving it, otherwise reselect it.
Headset mode profile without mic used to make some sense when it wasn't
using the loopback node (ie. easy way to disable it), but now with the
loopback node this doesn't make sense any more and it's confusing if it
occurs, so we shouldn't allow it.
Profile autoswitch should support also A2DP profiles with input route,
so the loopback should not assume the source node is SCO one.
Also fix handling of AG SCO output stream nodes, which should not be
hidden as internal.
The wp_settings_delete_all() API internally uses wp_metadata_clear() to clear
all the keys in the persistent-sm-settings metadata object. This call emits
the metadata changed signal with both 'key' and 'value' set to NULL. When that
happens, we need to clear all settings from the state file.
It is possible that a node is destroyed while the select-target
event is ongoing. In that case, the next hook to run will likely crash.
Fix this by cancelling events automatically when their subject
is a session-item associated with a node, as soon as the node is destroyed.
See !619
A smart filter should be considered "targetless" (i.e. interpose on
streams going to default target) only if filter.smart.target is not set.
Currently any smart filter with specified target not found is considered
such, which is wrong. This causes misbehavior, such as all recording
streams going to the bluetooth dummy source.
Fix this by doing it correctly.
Reset back to the session item's "configured" state instead of clearing
the si properties completely. This allows the "session-item-removed"
event to be dispatched with all the original properties of the node
intact, for constraint matching purposes.
Fixes#588
And name the loopback source node the same as bluez source without 'internal'
prefix. This keeps consistency with input/output node names when switching
bluetooth profiles.
Like WirePlumber 0.4.17, we need to mark the current routes as 'active' if they
were previously not active as soon as we detect it. This avoids a possible
infinite loop that restores the routes and saves them constantly, which happens
when the device's Route param has changed more than once before the event
'select-routes' is triggered.
The boolean values of properties in rules are strings in JSON config files and
they will retain the same type when they are translated to Lua.
Use cutils.parseBool() function when they have to be interpreted as bools.
Fixes: #586
The absence of parenthesis confuses the gobject-introspection parser
for some reason, making it emit WP_BASE_DIRS_FLAG_SUBDIR_WIREPLUMBER
multiple times in the .gir file
Define WP_USE_LOCAL_LOG_TOPIC_IN_G_LOG in project scope, so that we always
use this feature in our codebase without causing problems for other projects.
Fixes#571
This is needed for some devices that expose both Headset and Speaker nodes, so
that the applications are automatically linked to the Headset node or Speakers
node automatically when plugging and unplugging a headset.