Commit graph

971 commits

Author SHA1 Message Date
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
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
81d6f055a0 wplua: add GVariant dictionary conversion functions 2021-02-03 17:16:51 +02:00
George Kiagiadakis
a67116b0b9 wptoml: remove, it's not used anymore
and drop cpptoml dependency as well
2021-02-03 17:16:51 +02:00
George Kiagiadakis
1d0ecc3d88 daemon: refactor
* load config from a lua script
* use a WpTransition to organize the code
* activate plugins before lua scripts
* cleanup
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
29559b4065 wp: add wp_get_data_dir() 2021-02-03 17:16:51 +02:00
George Kiagiadakis
e52bd4468d src: move scripts to their own directory, install in $prefix/share/ 2021-02-03 17:16:51 +02:00
George Kiagiadakis
9fa17e04b4 object-interest: add a NOT_EQUALS verb 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
5647f0bf9e wplua: allow loading relative paths from wplua_load_path()
convert them to absolute before creating the URI
2021-02-03 17:16:51 +02:00
George Kiagiadakis
84f1b4b484 wplua: add g_autoptr support to lua_State 2021-02-03 17:16:51 +02:00
George Kiagiadakis
94d527e187 wplua: add flags to modify the sandbox behavior
with ISOLATE_ENV, it isolates the global environment between scripts
just like it did before; without it, it uses a common environment

with MINIMAL_STD, it restricts even further the available library
functions; useful for configuration files that don't need to do
actual scripting, just to define some tables
2021-02-03 17:16:51 +02:00
George Kiagiadakis
cb228637d6 wp: export functions to get the module & config dirs 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
c29d701e4b monitor-alsa: add device reservation logic 2021-01-26 17:24:52 +02:00
George Kiagiadakis
4a15ad05f3 spa-device: add an "object-removed" signal
This is useful for monitors to destroy the associated device reservation
object. And it may be useful for other things in the future...
2021-01-26 16:42:29 +02:00
George Kiagiadakis
13a56a7472 lua: add wp_plugin_find binding 2021-01-26 16:36:47 +02:00