Commit Graph

21 Commits

Author SHA1 Message Date
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
bcb4e80723 m-std-event-source: use type-specific event names and multiple object managers
It is better to have type-specific event names to minimize the amount
of constraint string matches we do on hooks, as most hooks (if not all)
are interested on specific types of objects only.

Similarly, use a different object manager for each object type to
minimize the performance impact of iterations and lookups, as all
such actions are interested in only 1 object type every time.

Port all existing hooks to the new event names and the get-object-manager API.
2023-04-17 07:48:18 -04:00
George Kiagiadakis
24db3fe24a event-hook: rewrite the hook priorities enum
Hooks need to have a priority relative to the event they are executed on,
so it does not make much sense to have all kinds of different priorities
based also on the event type and/or the module where they are defined.
Also, it wouldn't be acceptable to have such an enumeration on the public API.
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
Julian Bouzas
a76e780b4b docs: update new configuration file names 2023-04-17 07:47:09 -04:00
Ashok Sidipotu
cc36ea2fac m-default-profile: Adjust style and update summary. 2023-04-17 07:47:09 -04:00
Ashok Sidipotu
d57e387f75 event-hooks: give unique names to event hooks 2023-04-17 07:47:09 -04:00
Ashok Sidipotu
695b99f0e8 device-profiles: Port to event-stack 2023-04-17 07:47:09 -04:00
Ashok Sidipotu
78c2e3167a device-profiles: Add summary 2023-04-17 07:47:09 -04:00
Julian Bouzas
b3446efa16 config: port device-activation module to policy-device.profile.lua
Because all wireplumber policies are in Lua.
2022-02-16 13:37:40 -05:00
Julian Bouzas
4997e2eb19 m-default-profile: only store the default profile if the save flag is present
Also refactors module to use params-changed signal.
2021-12-20 09:54:05 +00:00
George Kiagiadakis
38f7483793 state: remove support for groups and propagate save errors
There is no real use for groups in our API. Just use the name of
the file as the default group and be done with it...
Storing multiple groups with this API is problematic because it
forces flushing the file to disk multiple times, one for each group,
and it's just more performant if we use a prefix in the keys
to implement some form of logical separation.

This commit also makes the GKeyFile a temporary object. As we
always load the file from the file system in _load()
and we always replace its contents with a new dictionary in _save(),
there is no point in keeping the keyfile's internal data structures
stored in memory.

Save errors are now also propagated to adhere to the programming
practices of GObject
2021-06-04 18:36:19 +03:00
Julian Bouzas
1f65012abf m-default-profiles: finalize parent when plugin is destroyed 2021-06-03 14:53:00 -04:00
Julian Bouzas
2218b5613e m-default-profile: log error message when failed to get current profile 2021-05-20 10:51:49 -04:00
Julian Bouzas
c3338458e5 m-default-profile: use sync API to enum available profiles 2021-05-18 09:59:18 -04:00
George Kiagiadakis
0d072874a1 lib: introduce WpComponentLoader and remove WpModule
The component loader is a more generic and extensible mechanism
of loading components; modules are one type of component...
The idea is to make scripts and config files also be components,
loaded by plugins that inherit WpComponentLoader
2021-02-03 17:16:51 +02:00
George Kiagiadakis
f61e292959 plugin: inherit from WpObject
* use the activate/deactivate system from WpObject,
  which allows async activation and error reporting
* drop 'module' property, use 'core' from WpObject
2021-02-03 17:16:51 +02:00
George Kiagiadakis
3762388831 spa-type: refactor
* Use a more complete API to introspect SPA types
* Avoid the need for the Tables enumeration; the tables
  are now registered with a string
* Avoid the need for initialization, work directly on spa_types
  and other static data
* Allow working with Object pods that are not Params;
  the PARAMS table was previously hardcoded in the pod implementation
* Add a different dynamic type registration system, closer to
  how spa type works. The only regression is that we can no longer
  register additional custom object fields (custom SPA_PROP_* for example),
  but this feature can be re-added later
2021-01-15 16:30:01 +02:00
Julian Bouzas
bef0b178ed state: use GKeyFile API to keep state in disk 2021-01-08 14:34:13 -05:00
George Kiagiadakis
a2181fc3f4 Merge remote-tracking branch 'origin/master' into next 2020-12-01 11:16:13 +02:00
Julian Bouzas
af70cac05f modules: add module to store device profiles each time they change 2020-11-13 14:20:54 -05:00