mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-05-05 05:28:01 +02:00
lua: add new Client.update_properties() API
This allows Lua scripts to update properties of other clients.
This commit is contained in:
parent
bf082964d4
commit
7f495b63eb
1 changed files with 13 additions and 0 deletions
|
|
@ -1247,6 +1247,18 @@ client_update_permissions (lua_State *L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
client_update_properties (lua_State *L)
|
||||
{
|
||||
WpClient *client = wplua_checkobject (L, 1, WP_TYPE_CLIENT);
|
||||
|
||||
luaL_checktype (L, 2, LUA_TTABLE);
|
||||
WpProperties *properties = wplua_table_to_properties (L, 2);
|
||||
|
||||
wp_client_update_properties (client, properties);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
client_send_error (lua_State *L)
|
||||
{
|
||||
|
|
@ -1260,6 +1272,7 @@ client_send_error (lua_State *L)
|
|||
|
||||
static const luaL_Reg client_methods[] = {
|
||||
{ "update_permissions", client_update_permissions },
|
||||
{ "update_properties", client_update_properties },
|
||||
{ "send_error", client_send_error },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue