George Kiagiadakis
b46587393c
lua: change the "wireplumber.interactive" property to "wireplumber.daemon"
...
with inverted semantics
2021-04-22 13:48:06 +03:00
George Kiagiadakis
4d5959ffdb
lua: add WpObject get_active/supported_features() bindings
2021-04-13 19:34:07 +03:00
George Kiagiadakis
7c617742a9
lua: add g_get_real/monotonic_time() bindings
...
Useful to tag objects with their creation time
2021-04-13 19:33:06 +03:00
George Kiagiadakis
21dccd5edb
lua: add a Debug.dump_table() utility function
...
Prints a table recursively with print()
2021-04-09 15:52:17 +03:00
George Kiagiadakis
28ff1061f5
lua: add a Core.require_api() utility function
...
This function loads and enables "api" plugins and makes them
available in the specified callback. This is intended to be used
by interactive scripts in order to get access to "api" plugins
such as the new "default-nodes-api" and "mixer-api"
2021-04-09 15:52:17 +03:00
Julian Bouzas
317550a7bd
m-lua-scripting: add object manager get_n_objects API
2021-04-08 14:07:05 -04:00
George Kiagiadakis
0ecefcb55d
policy-node: use default-nodes-api plugin
2021-03-31 13:10:13 +03:00
George Kiagiadakis
fd2ddffdd7
lua: s/Feature.Object.ALL/Features.ALL/
...
It looks nicer to have groups of features in 'Features.'
instead of 'Feature.'
2021-03-29 18:35:35 +03:00
Julian Bouzas
06c12fe7c2
m-lua-scripting: add get_associated_proxy session item Lua API
2021-03-26 16:16:02 -04:00
Julian Bouzas
3aef916d51
session-item: add _register and _remove API
...
Allows using object managers to listen for registered items
2021-03-18 14:30:11 -04:00
Julian Bouzas
120aab04ae
session-item: refactor and inherit from WpObject
...
This adds WP_SESSION_ITEM_FEATURE_ACTIVE and WP_SESSION_ITEM_FEATURE_EXPORTED
features, so _activate and _export APIs have been removed. Modules and unit
tests have also been updated.
2021-03-18 14:30:05 -04:00
Julian Bouzas
12b2c00d0b
lib: remove WpEndpointStream API
...
Add all that goes with it.
2021-03-18 12:10:37 -04:00
Julian Bouzas
1b5980476b
m-lua-script: add object_deactivate API
2021-03-15 07:52:57 -04:00
Julian Bouzas
003afc3e7b
m-lua-script: add closure for object_activate API
2021-03-15 07:52:55 -04:00
Julian Bouzas
ab04334448
m-lua-scripting: add WpSessionBin add API
...
Needed when adding streams to softdsp endpoints
2021-03-04 14:18:41 -05:00
George Kiagiadakis
15a74052a1
lua/api: add Link() constructor
2021-03-03 13:15:13 +02:00
George Kiagiadakis
79ba66e46b
lua/api: default Constraint type always to pw-global
...
now that interest is declared on G_TYPE_OBJECT by default
(in optional Interest function arguments), this conditional default
no longer works as expected...
besides, it may be confusing to have a different default depending
on the interest type
2021-03-02 18:26:34 +02:00
George Kiagiadakis
9399f3db66
lua/api: simplify & improve session_item_configure
2021-03-02 14:39:00 +02:00
George Kiagiadakis
a4ec7538bc
lua/api: make the type optional when declaring Interest as a function argument
...
it makes no sense to specify the type when calling, for instance,
session:lookup_endpoint() or similar functions
it also makes it easier to use iterate or lookup in the object
manager, when we already know the type of the objects that the om
contains
2021-03-02 14:08:43 +02:00
George Kiagiadakis
905636dc8d
lua/api: improve getting optional Interest arguments
...
Add the ability to construct an Interest argument without
using the Interest keyword, so instead of:
om:lookup(Interest { type = "session" })
we can now write:
om:lookup { type = "session" }
... and also remove lookup_filtered from ObjectManager
2021-03-02 13:11:54 +02:00
Julian Bouzas
862e253607
m-lua-scripting: add get_n_streams endpoint API
2021-03-01 13:14:57 -05:00
Julian Bouzas
2052eb2b1f
m-lua-scripting: add lookup session API
...
Also improves session API to accept object interests.
2021-03-01 13:14:57 -05:00
George Kiagiadakis
5b4fe3cd85
lua/pod: don't crash on parsing objects with unknown keys, just ignore them
2021-03-01 17:57:32 +02:00
George Kiagiadakis
51e24c58b5
m-lua-scripting/pod: retrieve Ids in Array & Choice as strings, if possible
...
When an Array or Choice that contains Spa:Id appears as a value for an object
field, it is possible to retrieve the Id type from that object field type.
2021-02-23 13:56:38 +02:00
George Kiagiadakis
5302700c6d
m-lua-scripting/pod: s/id_type/object_id/ as commented on !125
2021-02-23 12:47:24 +02:00
Julian Bouzas
bd65f9578d
m-lua-scripting: add support for choices when creating object pods
2021-02-23 10:41:46 +00:00
Julian Bouzas
0694889245
m-lua-scripting: refactor array and choice pod constructors to accept Id names
2021-02-23 10:41:46 +00:00
Julian Bouzas
910ff838e4
m-lua-scripting: allow constructing pod Ids with the Id name
2021-02-23 10:41:46 +00:00
Julian Bouzas
cd2e648b3c
m-lua-scripting: set id_type field when parsing pod objects
2021-02-23 10:41:46 +00:00
Julian Bouzas
2465088c5a
m-lua-scripting: set pod_type and value_type fieds when parsing non-primitive pods
2021-02-23 10:41:46 +00:00
Julian Bouzas
8fa6116786
m-lua-scripting: start indices from 1 when parsing pods
...
For consistency with LUA
2021-02-23 10:41:46 +00:00
George Kiagiadakis
d6ea7ffe76
lua/api: fix client update_permissions()
...
* the type checks were wrong, it was requiring the key to be string
and the value integer
* add the ability to use "any" or "all" for a key, saving us the trouble
of passing -1 from lua (int64) into a uint32 (ugh!)
* use a GArray instead of manual malloc/realloc
* allocate the array as late as possible, to minimize the risk of leaking
its memory if we hit luaL_error()
2021-02-18 16:41:42 +02:00
George Kiagiadakis
6c85b8958d
lua/api: log using a debug category unique for the calling script file
...
filename: foo.lua -> category: script/foo
2021-02-18 12:52:39 +02:00
George Kiagiadakis
cb8a8936aa
lua/api: ensure the function name in the debug output is non-null
...
NULL crashes the journald writer
2021-02-18 12:24:01 +02:00
Raghavendra
c791ed3a62
m-lua-scripting: add WpPipewireObject api
2021-02-16 20:15:13 +05:30
George Kiagiadakis
dacf19d9c7
wplua: improve gvariant <-> lua conversion functions
...
* Add more generic lua -> gvariant conversion
* Cleanup the gvariant -> lua function and rename it
2021-02-15 14:43:18 +02:00
George Kiagiadakis
41a4c89a41
lua/config: load split config files in alphanumeric order
2021-02-13 11:55:00 +02:00
George Kiagiadakis
807103e9df
lua/api: add wp_object_interest_matches() binding
2021-02-13 11:55:00 +02:00
Julian Bouzas
f693e1a4c7
m-lua-scripting: add WpClient LUA api
2021-02-12 14:28:32 -05:00
George Kiagiadakis
a0fb8872a2
lua/pod: optimize push_primitive_values()
2021-02-05 20:15:32 +02:00
George Kiagiadakis
e916ff6b76
lua/pod: simplify spa_pod_object_new()
2021-02-05 19:49:25 +02:00
George Kiagiadakis
38039bdfe1
lua/pod: optimize lookups in primitive_lua_type and fix some mistakes
...
Use the numeric values of the spa types instead of their string representation
2021-02-05 19:33:55 +02:00
George Kiagiadakis
2ca3564b67
lua/pod: lookup the object type and values table only once when constructing objects
2021-02-05 19:23:09 +02:00
George Kiagiadakis
33e546d79b
lua/pod: convert Id object fields to strings, if possible
2021-02-05 18:58:02 +02:00
Julian Bouzas
dc2ad1f25d
rename all foo_iterate APIs to foo_new_iterator
...
Avoids confusion with LUA iterate API
2021-02-05 11:33:23 -05:00
George Kiagiadakis
d0113e54cb
m-lua-scripting/pod: push pod constructors using luaL_newlib instead of manually
2021-02-05 12:11:15 +02:00
George Kiagiadakis
148a33187e
m-lua-scripting/api: fix om:lookup() to return nil when no object was found
2021-02-05 12:03:41 +02:00
George Kiagiadakis
d94b0a2f0c
scripts: add suspend-node.lua to replace m-node-suspension
...
... plus the necessary API for it to work
2021-02-05 12:03:07 +02:00
Julian Bouzas
81163a52c0
m-lua-scripting: add WpSpaPod api
2021-02-05 08:47:27 +00:00
George Kiagiadakis
651b4b7377
m-lua-scripting/api: add wp_object_manager_iterate_filtered()
2021-02-04 17:31:25 +02:00