Commit Graph

12 Commits

Author SHA1 Message Date
George Kiagiadakis
cb243eea6d common-utils: avoid crashing when a rules section is not defined in the config 2023-11-15 12:57:41 +02:00
George Kiagiadakis
299e671ffa scripts: switch to using JsonUtils.match_rules_apply_properties()
Note: this requires all existing config files to be modified to follow
pipewire's rules syntax, with an "actions" object wrapping the
"update-props" object.
2023-11-07 16:36:49 +02:00
Ashok Sidipotu
80554fe1c7 common-utils.lua: remove metadata object managers 2023-04-17 07:48:18 -04:00
Ashok Sidipotu
0d73c34c68 common-utils: add a null check for default-nodes query
common-utils is a singleton common resource, it cannot depend on the order in
which the components are loaded.
2023-04-17 07:48:18 -04:00
Julian Bouzas
d2123827f7 scripts: use the event stack to handle virtual session items
This removes both the policy-virtual-client.lua and policy-virtual-device.lua
scripts, and creates a new linking/find-virtual-target.lua script to link
clients with virtual session items if one of them can be found. In addition to
this, this patch also ports the policy-virtual-client-links.lua into a new
scripts/rescan-virtual-links.lua to use the event stack. The idea is for the
scripts/link-target.lua to create all links but only activate non virtual links,
and for the scripts/rescan-virtual-links.lua to activate/deactivate virtual
links based on role priorities.
2023-04-17 07:48:18 -04:00
Julian Bouzas
360e0b3eaf scripts: use WpConf API to get configuration values
This patch also moves nested configuration objects that are not considered
settings from the wireplumber.settings section to its own configuration
section (eg the rules array, the spa plugin properties, etc...). This allows
those objects to be merged with other same sections defined in other files.
2023-04-17 07:48:18 -04:00
Julian Bouzas
ed79e9a4d0 alsa.lua: use default rules if none are defined 2023-04-17 07:48:18 -04:00
Julian Bouzas
048a975818 common-utils.lua: use different timeout callbacks for different states
This allows saving different states at the same time.
2023-04-17 07:48:18 -04:00
Ashok Sidipotu
6762de3990 policy-{bluetooth|device-profile|device-routes}.lua: Optimize for Event stack
- Sharpen the hooks.
- Make settings live, apply them when they are changed.
- Move some of the common functions to common_utils.lua
2023-04-17 07:47:09 -04:00
Ashok Sidipotu
335fe69461 restore-stream.lua: optimize for event-stack
- Sharpen the hooks.
- Make settings live, apply them when they are changed.
- Move common funtions to common-utils.lua
2023-04-17 07:47:09 -04:00
Ashok Sidipotu
a5a6300662 policy-node.lua: fix the session items unhandling 2023-04-17 07:47:09 -04:00
Ashok Sidipotu
72536261e9 policy-node.lua: Second round of cleanup.
- WirePlumber Lua now facilitates Lua libraries/modules, utilize this and create
  modules. Add some tests around this functionality.
- Create policy-hooks.lua containing all the hooks to find-target events
- Create policy-utils.lua module and push all the policy utility functions to it.
- Create common-utils.lua module and push the common utility functions to it.
- Remove all the above functionality from policy-node.lua and clean it up.
2023-04-17 07:47:09 -04:00