Commit Graph

16 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
374e4ecaff m-standard-event-source: simplify push_event, removing the subject_type
This avoids having to determine the subject type prior to pushing
an event from lua code and makes the call more convenient

Also add a debug statement to trace calls to push_event
2023-04-17 07:48:18 -04:00
George Kiagiadakis
55122b84b4 m-standard-event-source: add "schedule-rescan" action signal
This can be used anywhere else in the codebase to push a "rescan-session"
event, making sure that there is only one such event pushed on the stack,
no matter how many times this is called.
2023-04-17 07:48:18 -04:00
George Kiagiadakis
e2b9cb0b5e m-standard-event-source: export the push_event function as an action signal 2023-04-17 07:48:18 -04:00
George Kiagiadakis
252c5b4935 m-standard-event-source: refactor around a central "push_event" function
Also redo some priorities and rename the object-changed event
to metadata-changed
2023-04-17 07:48:18 -04:00
George Kiagiadakis
79d8c9f5d9 m-standard-event-source: pass self as the event's source object 2023-04-17 07:48:18 -04:00
George Kiagiadakis
ab1668af15 m-standard-event-source: add object-manager property 2023-04-17 07:48:18 -04:00
George Kiagiadakis
b2f2e3f745 m-standard-event-source: add SiLink to the object type & priority list
Just to avoid warnings for now
2023-04-17 07:48:18 -04:00
George Kiagiadakis
48635cb780 m-standard-event-source: manage all kinds of session items in the om
So that we can also work with SiLink objects with this object manager
2023-04-17 07:48:18 -04:00
George Kiagiadakis
c0322cb34f m-standard-event-source: remove the devices object manager
That makes no sense to have. The only script that uses this can easily
be rewriten so that it uses object-added/removed instead.
2023-04-17 07:48:18 -04:00
Ashok Sidipotu
a5a6300662 policy-node.lua: fix the session items unhandling 2023-04-17 07:47:09 -04:00
Ashok Sidipotu
bc2d403396 policy-device-routes.lua: Port to event-stack 2023-04-17 07:47:09 -04:00
Ashok Sidipotu
a6b3f1c1fb m-standard-event-source: fix params of on-params-changed event 2023-04-17 07:47:09 -04:00
Ashok Sidipotu
f5f4acf95d m-standard-event-source: fix metadata changed evnt
Assign type and priority for metadata events
2023-04-17 07:47:09 -04:00
George Kiagiadakis
b62fdd8fef modules: add m-standard-event-source
An event source for standard pipewire events
2023-04-17 07:47:09 -04:00