Commit graph

1093 commits

Author SHA1 Message Date
George Kiagiadakis
b3ff7347cd wplua: improve GVariant array conversion
* index array items from 1
* handle any kind of value, not just GVariant basic types
* unit test
2021-02-15 14:43:18 +02:00
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
413ff73bab wplua: remove VARDICT handling in gvariant->lua conversion
G_VARIANT_TYPE_DICTIONARY also catches the VARDICT case
2021-02-15 14:43:18 +02:00
George Kiagiadakis
4fdccf5292 config: mimick media-session's v4l2-monitor.conf 2021-02-15 14:43:18 +02:00
George Kiagiadakis
100e6dc360 monitor-v4l2: copy properties and rules logic from media-session 2021-02-15 14:43:18 +02:00
George Kiagiadakis
989708a880 config: immitate media-session's bluez-monitor.conf 2021-02-15 14:43:18 +02:00
George Kiagiadakis
d9bf776cb8 monitor-bluez: copy all properties and the rules functionality from media-session 2021-02-13 11:55:00 +02:00
George Kiagiadakis
41a4c89a41 lua/config: load split config files in alphanumeric order 2021-02-13 11:55:00 +02:00
George Kiagiadakis
0196b49453 tests/lua: test monitor configuration rules code 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
George Kiagiadakis
47b6417bbe object-interest: allow matching against WpProperties objects 2021-02-13 11:55:00 +02:00
Julian Bouzas
b1e1e5ced0 scripts: add portal access script
Includes a plugin to handle the portal permission store dbus interface
2021-02-12 14:28:45 -05:00
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
6376bc6e4b Revert "meson: relax meson version dependency when building with system lua"
meson can't find project options before executing the project() command :(

This reverts commit 8bff0cc630.
2021-02-11 16:14:40 +02:00
George Kiagiadakis
8bff0cc630 meson: relax meson version dependency when building with system lua 2021-02-11 16:07:16 +02:00
George Kiagiadakis
a0fb8872a2 lua/pod: optimize push_primitive_values() 2021-02-05 20:15:32 +02:00
George Kiagiadakis
6039223642 tests/wplua: set WIREPLUMBER_CONFIG_DIR to an invalid directory
... because loading a script first looks in that directory, so it's
easy to make tests break by a conflicting file in the system config dir,
for instance, /etc/wireplumber/scripts/pod.lua
2021-02-05 19:49:52 +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
7b37b31af9 wplua: fix enum <-> lua conversion
Sometimes the GEnumClass is not instantiated, so _peek() doesn't work
We need to acquire a strong ref to make sure it is
2021-02-05 12:00:24 +02:00
George Kiagiadakis
7ca6717ff9 create-endpoint.lua: fix some issues 2021-02-05 11:58:53 +02:00
George Kiagiadakis
2efa85e3fd create-endpoint.lua: fix indentation 2021-02-05 11:33:15 +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
b32072a2ed tests: wplua: add pod.lua script to validate pod API 2021-02-05 08:47:27 +00:00
George Kiagiadakis
b58eff2b69 tests: wplua: add a script tester to validate lua scripts 2021-02-05 08:47:27 +00:00
Julian Bouzas
81163a52c0 m-lua-scripting: add WpSpaPod api 2021-02-05 08:47:27 +00:00
Julian Bouzas
a634bf88fd wplua: fix vtables lookup in boxed __index function 2021-02-05 08:47:27 +00:00
George Kiagiadakis
e3a60c6233 examples: add an example interactive lua script 2021-02-04 17:32:59 +02: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
1bd8e31872 meson: bump version 2021-02-03 17:25:55 +02:00
George Kiagiadakis
36598aede4 meson: remove C++ support, there's no C++ code anymore 2021-02-03 17:18:41 +02:00
George Kiagiadakis
2142fffc0e monitor-alsa: simplify reserve-device connection logic
Because of the new design of the daemon and the async activation of plugins,
the reserve-device plugin connects to d-bus before monitor-alsa is executed
and therefore there is no need to wait for the connection
2021-02-03 17:16:51 +02:00
George Kiagiadakis
88f59f07cb monitor-alsa: receive script configuration from config.lua 2021-02-03 17:16:51 +02:00
George Kiagiadakis
c00a706998 scripts: add static-sessions.lua
Replaces the old create-session wireplumber.conf commands
2021-02-03 17:16:51 +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
1c0f0b8684 wplua: pass SANDBOX_CONFIG as a script argument
avoids keeping it forever as a global
2021-02-03 17:16:51 +02:00