Commit graph

20 commits

Author SHA1 Message Date
Julian Bouzas
d01441ca0a scripts: move filter-forward-format.lua from 'linking' to 'node' subdirectory
This is because 'filter-forward-format.lua' only configures nodes, and therefore
does not have anything to do with the linking logic. The setting has also been
renamed to 'node.filter.forward-format'.
2024-02-01 10:00:22 -05:00
George Kiagiadakis
eb2d6efcd4 state: add save_after_timeout() method to replace all custom timeout code
This was a common pattern that we had in many places, so it makes sense
to consolidate it.
2024-01-04 16:38:33 +02:00
George Kiagiadakis
679d660058 settings: tidy up node-related settings
* prefix all settings with "node."
* move settings-stream.lua to settings-node.lua
* move the "audio-no-dsp" setting to the node settings
* add more settings related to node features
* split the default stream volume into 2 settings, one for playback
  streams and one for capture streams
2023-11-15 18:16:52 +02:00
George Kiagiadakis
2f071a67be scripts: rename all foo-config libs to settings-foo
And also use the term 'settings' everywhere instead of 'config' to refer
to the options managed by the WpSettings architecture
2023-11-15 15:44:01 +02:00
George Kiagiadakis
d45c5eb623 s-create-item: add some debug logging 2023-11-07 16:36:49 +02:00
Julian Bouzas
f5a29981aa linking: use si_props for 'target.*' properties
This avoids indexing the Lua table every time the properties are accessed.
2023-11-02 16:09:48 +00:00
George Kiagiadakis
43aa2d4952 scripts: don't use 'local' for file-wide scoped variables
Since all scripts run in a sandbox with their own global environment,
it means that they don't interfere with each other's global variables.
Therefore, all file-wide variables can be declared global without
any change in behavior. In my understanding, it is better to do so
because this means that any code accessing those variables is going
to access them directly from the global environment table with a simple
lookup rather than having each variable referenced in the local closure
of each function separately.
2023-09-29 23:13:28 +03:00
Ashok Sidipotu
0dcd28e50f Lua scripts: replace "policy" with "linking" 2023-09-26 10:09:03 +03:00
Ashok Sidipotu
b0460d8050 src/scripts: add few comments 2023-06-22 16:28:56 +05:30
George Kiagiadakis
a0497b4256 Merge branch '0.4' into next 2023-06-21 20:59:04 +03:00
George Kiagiadakis
982bebe5aa scripts: use log topics 2023-05-19 20:12:08 +03: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
fb855b00cf Rename endpoint concept to virtual session item 2023-04-17 07:48:18 -04:00
George Kiagiadakis
dc196df239 m-std-event-source: fix state names in node-state-changed event
We need to use the enum nicknames ("idle"), not the enum names
("WP_NODE_STATE_IDLE"). This makes suspend-node work again.
2023-04-17 07:48:18 -04:00
George Kiagiadakis
28548e0933 scripts: move create-item.lua under node/ and modernize it 2023-04-17 07:48:18 -04:00
George Kiagiadakis
258d9f32e1 scripts: rename all hooks to follow a nicer naming scheme
Use the directory name and file name to construct the hook's name,
like a path. This way, when you see a hook name, it is clear where
to find that hook in the source code.
2023-04-17 07:48:18 -04:00
George Kiagiadakis
d8e461940f scripts: refactor restore-stream into node/state-stream
* Use more hooks and no custom object managers
* Use the settings manager for the config values
* Allow fully disabling the hooks when both restore-props and restore-target
  are disabled in the settings
* Change the format AND the name of the state file; use json directly
  in the values now that we can
2023-04-17 07:48:18 -04:00
George Kiagiadakis
e1a8c3459a scripts: remove priority from all hooks and set up some basic dependencies 2023-04-17 07:48:18 -04:00
George Kiagiadakis
b100bdda4a event-hook: remove the exec type property & enumeration
With the latest changes, we can implement the "after-events" type
with external code that pushes a very low priority event that is
the "rescan" event.
2023-04-17 07:48:18 -04:00
George Kiagiadakis
54b14d1a29 scripts: port suspend-node.lua to the event dispatcher architecture 2023-04-17 07:48:18 -04:00