Julian Bouzas
fdc8053d9f
scripts: add flatpak access lua script
...
Replaces old module-client-permissions module
2021-02-12 14:28:38 -05:00
Julian Bouzas
cbe90a5c75
wplua: handle more GVariant cases
2021-02-12 14:28:38 -05: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
55f186ccec
modules: remove m-node-suspension
2021-02-05 12:05:54 +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
George Kiagiadakis
ce66025846
node: change send_command() to take a string
...
Use the spa type system to locate the enumeration value that corresponds
to that string and send that
2021-02-05 11:05:26 +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
George Kiagiadakis
096a9b4c15
proxy: add a method to query the interface type
2021-02-04 16:51:25 +02:00
George Kiagiadakis
e0f1c8710f
daemon: add a mode to execute lua scripts from the command line
...
This can be useful for quick testing of scripts, or to build small
utilities that do something in pipewire utilizing our lua API
2021-02-04 16:44:56 +02:00
George Kiagiadakis
02142b899b
m-lua-scripting/api: add WpCore bindings
2021-02-04 13:52:24 +02:00
George Kiagiadakis
fb5706eacc
m-lua-scripting/api: fix access to core in session_item_new()
2021-02-03 18:02:03 +02:00
George Kiagiadakis
03b17bcb5f
m-lua-scripting/api: add WpImplSession bindings
2021-02-03 17:16:51 +02:00
George Kiagiadakis
f7c0f9cfc6
m-lua-scripting: pass component arguments to scripts
2021-02-03 17:16:51 +02:00
George Kiagiadakis
460ff6591d
wplua: allow exchanging arguments and results with scripts
2021-02-03 17:16:51 +02:00
George Kiagiadakis
ef9b6ef982
m-lua-scripting: use wplua_table_to_asv() instead of custom function
2021-02-03 17:16:51 +02:00
George Kiagiadakis
ddf7eb1ecb
m-lua-scripting: fixes
2021-02-03 17:16:51 +02:00
George Kiagiadakis
fc526af744
m-lua-scripting: allow queuing-in scripts without the plugin being activated
...
This allows us to load the scripts from the config file without
WpCore being connected yet. We can later activate the lua-scripting
plugin at the right moment to start processing the scripts.
2021-02-03 17:16:51 +02:00
George Kiagiadakis
2d2668100c
m-lua-scripting: refactor as a WpComponentLoader
...
also, add support for loading lua config files, denoted by the
"config/lua" component type
2021-02-03 17:16:51 +02: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
596990d718
modules: remove modules that are obsoleted by the lua scripts
...
+ their configuration
+ their unit tests
2021-01-30 12:58:26 +02:00
George Kiagiadakis
4abd779d69
modules: actually delete module-dbus-reservation.c
2021-01-27 18:13:06 +02:00
George Kiagiadakis
13a56a7472
lua: add wp_plugin_find binding
2021-01-26 16:36:47 +02:00
George Kiagiadakis
c78373b1fc
modules: delete the old dbus-reservation module
2021-01-26 16:28:22 +02:00
George Kiagiadakis
ef908439c4
modules: implement a new reserve-device module
...
This one offers API to interract on a lower level with
the D-Bus reservation API and uses GDBus high level bindings only.
Also, this one implements the full Acquire procedure, calling
RequestRelease() on the peer and requesting the name again with
REPLACE_EXISTING
2021-01-26 16:28:22 +02:00
Julian Bouzas
62f819013d
m-lua-scripting: add session item lua API
2021-01-22 10:04:37 -05:00
Julian Bouzas
823abe03ee
m-lua-scripting: fix reference count in object manager's lookup API
2021-01-21 07:47:08 -05:00
George Kiagiadakis
b8f8238fb4
lua: fix some nasty memory leaks
2021-01-21 09:42:07 +02:00
George Kiagiadakis
38f65ca960
m-lua-scripting: do stop the lua engine on deactivate()
...
deactivate() is normally called from WpCore's dispose() and
that's too late to convert a weak WpCore ref to a strong one,
so we cannot find the WpConfiguration and remove the engine.
So, keep a reference to the WpConfiguration earlier.
If the engine is not stopped on time, proxies on the export_core
are destroyed after their core and pipewire complains
2021-01-21 09:42:07 +02:00
George Kiagiadakis
b88ff15725
m-lua-scripting: add bindings required for device monitors
...
WpDevice, WpSpaDevice, WpNode, WpImplNode, WpObject and object features
2021-01-21 09:42:07 +02:00
George Kiagiadakis
c678cbed2c
impl-node: derive from WpProxy
2021-01-21 09:42:07 +02:00
George Kiagiadakis
18229e8265
spa-device: derive from WpProxy and manage child objects internally
...
port module-monitor to follow the changes
2021-01-21 09:42:07 +02:00
Julian Bouzas
9d6e220ec9
m-default-metadata: handle default nodes
2021-01-19 08:58:08 -05:00
George Kiagiadakis
aa93ecf793
spa-pod: add the ability to specify Id properties as strings
...
Use the unused 'K' format letter in the varargs builder & parser methods
2021-01-15 16:30:02 +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
d96c856f28
m-lua-scripting: handle default endpoints from the metadata
2021-01-15 08:59:13 -05:00
Julian Bouzas
7ec169f231
m-config-policy: handle default endpoints from the metadata
2021-01-15 08:58:52 -05:00
Julian Bouzas
9cb79dc3d6
modules: replace session-settings with default-metadata
2021-01-14 13:34:01 -05:00
Julian Bouzas
bef0b178ed
state: use GKeyFile API to keep state in disk
2021-01-08 14:34:13 -05:00
George Kiagiadakis
680b0a7d93
m-lua-scripting: expose session, endpoint, endpoint-link APIs
...
... and make WpIterator Lua-friendly so that it can be used
with the generic for loop
2020-12-22 11:35:04 +02:00
George Kiagiadakis
af01155093
Merge branch 'master' into next-lua
2020-12-21 18:56:52 +02:00