Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Arun Raghavan
wireplumber
Commits
6ac566fc
Commit
6ac566fc
authored
Aug 14, 2021
by
Arun Raghavan
Browse files
m-lua-scripting: Add WpImplModule bindings
parent
b9b722c1
Pipeline
#381296
passed with stages
in 1 minute and 4 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
modules/module-lua-scripting/api.c
View file @
6ac566fc
...
...
@@ -1297,6 +1297,35 @@ static const luaL_Reg state_methods[] = {
{
NULL
,
NULL
}
};
/* ImplModule */
static
int
impl_module_new
(
lua_State
*
L
)
{
const
char
*
name
,
*
args
=
NULL
;
WpProperties
*
properties
=
NULL
;
name
=
luaL_checkstring
(
L
,
1
);
if
(
lua_type
(
L
,
2
)
!=
LUA_TNONE
)
args
=
luaL_checkstring
(
L
,
2
);
if
(
lua_type
(
L
,
3
)
!=
LUA_TNONE
)
{
luaL_checktype
(
L
,
3
,
LUA_TTABLE
);
properties
=
wplua_table_to_properties
(
L
,
2
);
}
WpImplModule
*
m
=
wp_impl_module_load
(
get_wp_export_core
(
L
),
name
,
args
,
properties
);
if
(
m
)
{
wplua_pushobject
(
L
,
m
);
return
1
;
}
else
{
return
0
;
}
}
void
wp_lua_scripting_api_init
(
lua_State
*
L
)
{
...
...
@@ -1352,6 +1381,8 @@ wp_lua_scripting_api_init (lua_State *L)
NULL
,
pipewire_object_methods
);
wplua_register_type_methods
(
L
,
WP_TYPE_STATE
,
state_new
,
state_methods
);
wplua_register_type_methods
(
L
,
WP_TYPE_IMPL_MODULE
,
impl_module_new
,
NULL
);
wplua_load_uri
(
L
,
URI_API
,
0
,
0
,
&
error
);
if
(
G_UNLIKELY
(
error
))
...
...
modules/module-lua-scripting/api.lua
View file @
6ac566fc
...
...
@@ -206,4 +206,5 @@ SANDBOX_EXPORT = {
Link
=
WpLink_new
,
Pod
=
WpSpaPod
,
State
=
WpState_new
,
ImplModule
=
WpImplModule_new
,
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment