m-lua-scripting: set id_type field when parsing pod objects
This commit is contained in:

committed by
George Kiagiadakis

parent
2465088c5a
commit
cd2e648b3c
@@ -953,10 +953,8 @@ push_luapod (lua_State *L, WpSpaPod *pod, WpSpaIdValue field_idval)
|
|||||||
lua_newtable (L);
|
lua_newtable (L);
|
||||||
lua_pushstring (L, "Object");
|
lua_pushstring (L, "Object");
|
||||||
lua_setfield (L, -2, "pod_type");
|
lua_setfield (L, -2, "pod_type");
|
||||||
lua_pushstring (L, wp_spa_type_name (type));
|
|
||||||
lua_rawseti (L, -2, 1);
|
|
||||||
lua_pushstring (L, id_name);
|
lua_pushstring (L, id_name);
|
||||||
lua_rawseti (L, -2, 2);
|
lua_setfield (L, -2, "id_type");
|
||||||
it = wp_spa_pod_new_iterator (pod);
|
it = wp_spa_pod_new_iterator (pod);
|
||||||
lua_newtable (L);
|
lua_newtable (L);
|
||||||
for (; wp_iterator_next (it, &item); g_value_unset (&item)) {
|
for (; wp_iterator_next (it, &item); g_value_unset (&item)) {
|
||||||
|
@@ -85,8 +85,7 @@ pod = Pod.Object {
|
|||||||
}
|
}
|
||||||
val = pod:parse()
|
val = pod:parse()
|
||||||
assert (val.pod_type == "Object")
|
assert (val.pod_type == "Object")
|
||||||
assert (val[1] == "Spa:Pod:Object:Param:PortConfig")
|
assert (val.id_type == "PortConfig")
|
||||||
assert (val[2] == "PortConfig")
|
|
||||||
assert (val.properties.direction == "Input")
|
assert (val.properties.direction == "Input")
|
||||||
assert (val.properties.mode == "dsp")
|
assert (val.properties.mode == "dsp")
|
||||||
assert (val.properties.monitor)
|
assert (val.properties.monitor)
|
||||||
@@ -144,12 +143,12 @@ pod = Pod.Object {
|
|||||||
}
|
}
|
||||||
val = pod:parse()
|
val = pod:parse()
|
||||||
assert (val.pod_type == "Object")
|
assert (val.pod_type == "Object")
|
||||||
assert (val[1] == "Spa:Pod:Object:Param:PortConfig")
|
assert (val.id_type == "PortConfig")
|
||||||
assert (val[2] == "PortConfig")
|
|
||||||
assert (val.properties.direction == "Input")
|
assert (val.properties.direction == "Input")
|
||||||
assert (val.properties.mode == "dsp")
|
assert (val.properties.mode == "dsp")
|
||||||
assert (val.properties.monitor)
|
assert (val.properties.monitor)
|
||||||
assert (val.properties.format.pod_type == "Object")
|
assert (val.properties.format.pod_type == "Object")
|
||||||
|
assert (val.properties.format.id_type == "Format")
|
||||||
assert (val.properties.format.properties.mediaType == "audio")
|
assert (val.properties.format.properties.mediaType == "audio")
|
||||||
assert (val.properties.format.properties.mediaSubtype == "raw")
|
assert (val.properties.format.properties.mediaSubtype == "raw")
|
||||||
assert (val.properties.format.properties.rate == 48000)
|
assert (val.properties.format.properties.rate == 48000)
|
||||||
|
Reference in New Issue
Block a user