mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-05-05 03:08:13 +02:00
lua: add EventInterest convenience constructor for declaring interest on events
This commit is contained in:
parent
2cffd9177a
commit
d72f31e803
2 changed files with 7 additions and 2 deletions
|
|
@ -70,6 +70,11 @@ local function Constraint (spec)
|
|||
return debug.setmetatable(spec, { __name = "Constraint" })
|
||||
end
|
||||
|
||||
local function EventInterest(spec)
|
||||
spec.type = "event"
|
||||
return WpObjectInterest_new(spec)
|
||||
end
|
||||
|
||||
local function dump_table(t, indent)
|
||||
local indent_str = ""
|
||||
indent = indent or 1
|
||||
|
|
@ -201,6 +206,7 @@ SANDBOX_EXPORT = {
|
|||
Interest = WpObjectInterest_new,
|
||||
SessionItem = WpSessionItem_new,
|
||||
Constraint = Constraint,
|
||||
EventInterest = EventInterest,
|
||||
Device = WpDevice_new,
|
||||
SpaDevice = WpSpaDevice_new,
|
||||
Node = WpNode_new,
|
||||
|
|
|
|||
|
|
@ -22,8 +22,7 @@ local function check_results()
|
|||
end
|
||||
|
||||
local common_interests = {
|
||||
Interest {
|
||||
type = "event",
|
||||
EventInterest {
|
||||
Constraint { "event.type", "=", "test-event" },
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue