test-utils: align style
This commit is contained in:

committed by
Julian Bouzas

parent
c7c06351f7
commit
9a0f8647ac
@@ -25,7 +25,7 @@ SimpleEventHook {
|
|||||||
local lnkbl = event:get_subject ()
|
local lnkbl = event:get_subject ()
|
||||||
local name = lnkbl.properties ["node.name"]
|
local name = lnkbl.properties ["node.name"]
|
||||||
|
|
||||||
if tu.linkables_ready () and name ~= "stream-node" then
|
if tu.linkablesReady () and name ~= "stream-node" then
|
||||||
tu.createStreamNode ("playback")
|
tu.createStreamNode ("playback")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@@ -24,7 +24,7 @@ SimpleEventHook {
|
|||||||
execute = function (event)
|
execute = function (event)
|
||||||
local lnkbl = event:get_subject ()
|
local lnkbl = event:get_subject ()
|
||||||
local name = lnkbl.properties ["node.name"]
|
local name = lnkbl.properties ["node.name"]
|
||||||
if tu.linkables_ready () and name ~= "stream-node" then
|
if tu.linkablesReady () and name ~= "stream-node" then
|
||||||
tu.createStreamNode ("capture")
|
tu.createStreamNode ("capture")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@@ -26,7 +26,7 @@ SimpleEventHook {
|
|||||||
local lnkbl = event:get_subject ()
|
local lnkbl = event:get_subject ()
|
||||||
local name = lnkbl.properties ["node.name"]
|
local name = lnkbl.properties ["node.name"]
|
||||||
|
|
||||||
if tu.linkables_ready () and name ~= "stream-node" then
|
if tu.linkablesReady () and name ~= "stream-node" then
|
||||||
tu.createStreamNode ("playback")
|
tu.createStreamNode ("playback")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@@ -26,7 +26,7 @@ SimpleEventHook {
|
|||||||
local lnkbl = event:get_subject ()
|
local lnkbl = event:get_subject ()
|
||||||
local name = lnkbl.properties ["node.name"]
|
local name = lnkbl.properties ["node.name"]
|
||||||
|
|
||||||
if tu.linkables_ready () and name ~= "stream-node" then
|
if tu.linkablesReady () and name ~= "stream-node" then
|
||||||
tu.createStreamNode ("capture")
|
tu.createStreamNode ("capture")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@@ -27,7 +27,7 @@ SimpleEventHook {
|
|||||||
execute = function (event)
|
execute = function (event)
|
||||||
local lnkbl = event:get_subject ()
|
local lnkbl = event:get_subject ()
|
||||||
local name = lnkbl.properties ["node.name"]
|
local name = lnkbl.properties ["node.name"]
|
||||||
if tu.linkables_ready () and name ~= "stream-node" then
|
if tu.linkablesReady () and name ~= "stream-node" then
|
||||||
local props = {
|
local props = {
|
||||||
["target.object"] = tu.lnkbls ["defined-device-node"].properties ["node.id"]
|
["target.object"] = tu.lnkbls ["defined-device-node"].properties ["node.id"]
|
||||||
}
|
}
|
||||||
|
@@ -27,7 +27,7 @@ SimpleEventHook {
|
|||||||
execute = function (event)
|
execute = function (event)
|
||||||
local lnkbl = event:get_subject ()
|
local lnkbl = event:get_subject ()
|
||||||
local name = lnkbl.properties ["node.name"]
|
local name = lnkbl.properties ["node.name"]
|
||||||
if tu.linkables_ready () and name ~= "stream-node" then
|
if tu.linkablesReady () and name ~= "stream-node" then
|
||||||
local props = {
|
local props = {
|
||||||
["target.object"] = tonumber (tu.lnkbls ["defined-device-node"].properties ["node.id"]),
|
["target.object"] = tonumber (tu.lnkbls ["defined-device-node"].properties ["node.id"]),
|
||||||
}
|
}
|
||||||
|
@@ -27,7 +27,7 @@ SimpleEventHook {
|
|||||||
execute = function (event)
|
execute = function (event)
|
||||||
local lnkbl = event:get_subject ()
|
local lnkbl = event:get_subject ()
|
||||||
local name = lnkbl.properties ["node.name"]
|
local name = lnkbl.properties ["node.name"]
|
||||||
if tu.linkables_ready () and name ~= "stream-node" then
|
if tu.linkablesReady () and name ~= "stream-node" then
|
||||||
local props = {
|
local props = {
|
||||||
["target.object"] = tu.lnkbls ["defined-device-node"].properties ["node.name"]
|
["target.object"] = tu.lnkbls ["defined-device-node"].properties ["node.name"]
|
||||||
}
|
}
|
||||||
|
@@ -27,7 +27,7 @@ SimpleEventHook {
|
|||||||
execute = function (event)
|
execute = function (event)
|
||||||
local lnkbl = event:get_subject ()
|
local lnkbl = event:get_subject ()
|
||||||
local name = lnkbl.properties ["node.name"]
|
local name = lnkbl.properties ["node.name"]
|
||||||
if tu.linkables_ready () and name ~= "stream-node" then
|
if tu.linkablesReady () and name ~= "stream-node" then
|
||||||
local props = {
|
local props = {
|
||||||
["target.object"] = tu.lnkbls ["defined-device-node"].properties ["node.id"]
|
["target.object"] = tu.lnkbls ["defined-device-node"].properties ["node.id"]
|
||||||
}
|
}
|
||||||
|
@@ -27,7 +27,7 @@ SimpleEventHook {
|
|||||||
execute = function (event)
|
execute = function (event)
|
||||||
local lnkbl = event:get_subject ()
|
local lnkbl = event:get_subject ()
|
||||||
local name = lnkbl.properties ["node.name"]
|
local name = lnkbl.properties ["node.name"]
|
||||||
if tu.linkables_ready () and name ~= "stream-node" then
|
if tu.linkablesReady () and name ~= "stream-node" then
|
||||||
local props = {
|
local props = {
|
||||||
["target.object"] = tonumber (tu.lnkbls ["defined-device-node"].properties ["node.id"]),
|
["target.object"] = tonumber (tu.lnkbls ["defined-device-node"].properties ["node.id"]),
|
||||||
}
|
}
|
||||||
|
@@ -27,7 +27,7 @@ SimpleEventHook {
|
|||||||
execute = function (event)
|
execute = function (event)
|
||||||
local lnkbl = event:get_subject ()
|
local lnkbl = event:get_subject ()
|
||||||
local name = lnkbl.properties ["node.name"]
|
local name = lnkbl.properties ["node.name"]
|
||||||
if tu.linkables_ready () and name ~= "stream-node" then
|
if tu.linkablesReady () and name ~= "stream-node" then
|
||||||
local props = {
|
local props = {
|
||||||
["target.object"] = tu.lnkbls ["defined-device-node"].properties ["node.name"]
|
["target.object"] = tu.lnkbls ["defined-device-node"].properties ["node.name"]
|
||||||
}
|
}
|
||||||
|
@@ -27,7 +27,7 @@ SimpleEventHook {
|
|||||||
execute = function (event)
|
execute = function (event)
|
||||||
local lnkbl = event:get_subject ()
|
local lnkbl = event:get_subject ()
|
||||||
local name = lnkbl.properties ["node.name"]
|
local name = lnkbl.properties ["node.name"]
|
||||||
if tu.linkables_ready () and name ~= "stream-node" then
|
if tu.linkablesReady () and name ~= "stream-node" then
|
||||||
local props = {
|
local props = {
|
||||||
["node.target"] = tu.lnkbls ["defined-device-node"].properties ["node.id"]
|
["node.target"] = tu.lnkbls ["defined-device-node"].properties ["node.id"]
|
||||||
}
|
}
|
||||||
|
@@ -27,7 +27,7 @@ SimpleEventHook {
|
|||||||
execute = function (event)
|
execute = function (event)
|
||||||
local lnkbl = event:get_subject ()
|
local lnkbl = event:get_subject ()
|
||||||
local name = lnkbl.properties ["node.name"]
|
local name = lnkbl.properties ["node.name"]
|
||||||
if tu.linkables_ready () and name ~= "stream-node" then
|
if tu.linkablesReady () and name ~= "stream-node" then
|
||||||
local props = {
|
local props = {
|
||||||
["node.target"] = tu.lnkbls ["defined-device-node"].properties ["node.id"]
|
["node.target"] = tu.lnkbls ["defined-device-node"].properties ["node.id"]
|
||||||
}
|
}
|
||||||
|
@@ -28,12 +28,12 @@ SimpleEventHook {
|
|||||||
local lnkbl = event:get_subject ()
|
local lnkbl = event:get_subject ()
|
||||||
local name = lnkbl.properties ["node.name"]
|
local name = lnkbl.properties ["node.name"]
|
||||||
|
|
||||||
if tu.linkables_ready () and name ~= "stream-node" then
|
if tu.linkablesReady () and name ~= "stream-node" then
|
||||||
-- all linkables created execept stream-node
|
-- all linkables created execept stream-node
|
||||||
tu.createStreamNode ("playback")
|
tu.createStreamNode ("playback")
|
||||||
elseif tu.linkables_ready () and tu.lnkbls ["stream-node"] then
|
elseif tu.linkablesReady () and tu.lnkbls ["stream-node"] then
|
||||||
-- when "stream-node" linkable is ready
|
-- when "stream-node" linkable is ready
|
||||||
tu.set_target_in_metadata ("target.node", "defined-device-node")
|
tu.setTargetInMetadata ("target.node", "defined-device-node")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}:register ()
|
}:register ()
|
||||||
@@ -51,8 +51,8 @@ SimpleEventHook {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
execute = function (event)
|
execute = function (event)
|
||||||
if tu.linkables_ready () then
|
if tu.linkablesReady () then
|
||||||
tu.set_target_in_metadata ("target.node", "defined-device-node")
|
tu.setTargetInMetadata ("target.node", "defined-device-node")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}:register ()
|
}:register ()
|
||||||
|
@@ -28,12 +28,12 @@ SimpleEventHook {
|
|||||||
local lnkbl = event:get_subject ()
|
local lnkbl = event:get_subject ()
|
||||||
local name = lnkbl.properties ["node.name"]
|
local name = lnkbl.properties ["node.name"]
|
||||||
|
|
||||||
if tu.linkables_ready () and name ~= "stream-node" then
|
if tu.linkablesReady () and name ~= "stream-node" then
|
||||||
-- all linkables created execept stream-node
|
-- all linkables created execept stream-node
|
||||||
tu.createStreamNode ("capture")
|
tu.createStreamNode ("capture")
|
||||||
elseif tu.linkables_ready () and tu.lnkbls ["stream-node"] then
|
elseif tu.linkablesReady () and tu.lnkbls ["stream-node"] then
|
||||||
-- when "stream-node" linkable is ready
|
-- when "stream-node" linkable is ready
|
||||||
tu.set_target_in_metadata ("target.node", "defined-device-node")
|
tu.setTargetInMetadata ("target.node", "defined-device-node")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}:register ()
|
}:register ()
|
||||||
|
@@ -28,12 +28,12 @@ SimpleEventHook {
|
|||||||
local lnkbl = event:get_subject ()
|
local lnkbl = event:get_subject ()
|
||||||
local name = lnkbl.properties ["node.name"]
|
local name = lnkbl.properties ["node.name"]
|
||||||
|
|
||||||
if tu.linkables_ready () and name ~= "stream-node" then
|
if tu.linkablesReady () and name ~= "stream-node" then
|
||||||
-- all linkables created execept stream-node
|
-- all linkables created execept stream-node
|
||||||
tu.createStreamNode ("playback")
|
tu.createStreamNode ("playback")
|
||||||
elseif tu.linkables_ready () and tu.lnkbls ["stream-node"] then
|
elseif tu.linkablesReady () and tu.lnkbls ["stream-node"] then
|
||||||
-- when "stream-node" linkable is ready
|
-- when "stream-node" linkable is ready
|
||||||
tu.set_target_in_metadata ("target.object", "defined-device-node")
|
tu.setTargetInMetadata ("target.object", "defined-device-node")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}:register ()
|
}:register ()
|
||||||
|
@@ -28,12 +28,12 @@ SimpleEventHook {
|
|||||||
local lnkbl = event:get_subject ()
|
local lnkbl = event:get_subject ()
|
||||||
local name = lnkbl.properties ["node.name"]
|
local name = lnkbl.properties ["node.name"]
|
||||||
|
|
||||||
if tu.linkables_ready () and name ~= "stream-node" then
|
if tu.linkablesReady () and name ~= "stream-node" then
|
||||||
-- all linkables created execept stream-node
|
-- all linkables created execept stream-node
|
||||||
tu.createStreamNode ("capture")
|
tu.createStreamNode ("capture")
|
||||||
elseif tu.linkables_ready () and tu.lnkbls ["stream-node"] then
|
elseif tu.linkablesReady () and tu.lnkbls ["stream-node"] then
|
||||||
-- when "stream-node" linkable is ready
|
-- when "stream-node" linkable is ready
|
||||||
tu.set_target_in_metadata ("target.object", "defined-device-node")
|
tu.setTargetInMetadata ("target.object", "defined-device-node")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}:register ()
|
}:register ()
|
||||||
|
@@ -29,15 +29,15 @@ SimpleEventHook {
|
|||||||
local lnkbl = event:get_subject ()
|
local lnkbl = event:get_subject ()
|
||||||
local name = lnkbl.properties ["node.name"]
|
local name = lnkbl.properties ["node.name"]
|
||||||
|
|
||||||
if tu.linkables_ready () and name ~= "stream-node" then
|
if tu.linkablesReady () and name ~= "stream-node" then
|
||||||
-- all linkables created execept stream-node
|
-- all linkables created execept stream-node
|
||||||
local props = {
|
local props = {
|
||||||
["target.object"] = tu.lnkbls ["defined-device-node-in-props"].properties ["node.id"]
|
["target.object"] = tu.lnkbls ["defined-device-node-in-props"].properties ["node.id"]
|
||||||
}
|
}
|
||||||
tu.createStreamNode ("playback", props)
|
tu.createStreamNode ("playback", props)
|
||||||
elseif tu.linkables_ready () and tu.lnkbls ["stream-node"] then
|
elseif tu.linkablesReady () and tu.lnkbls ["stream-node"] then
|
||||||
-- when "stream-node" linkable is ready
|
-- when "stream-node" linkable is ready
|
||||||
tu.set_target_in_metadata ("target.object", "defined-device-node-in-metadata")
|
tu.setTargetInMetadata ("target.object", "defined-device-node-in-metadata")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}:register ()
|
}:register ()
|
||||||
|
@@ -29,15 +29,15 @@ SimpleEventHook {
|
|||||||
local lnkbl = event:get_subject ()
|
local lnkbl = event:get_subject ()
|
||||||
local name = lnkbl.properties ["node.name"]
|
local name = lnkbl.properties ["node.name"]
|
||||||
|
|
||||||
if tu.linkables_ready () and name ~= "stream-node" then
|
if tu.linkablesReady () and name ~= "stream-node" then
|
||||||
-- all linkables created execept stream-node
|
-- all linkables created execept stream-node
|
||||||
local props = {
|
local props = {
|
||||||
["target.object"] = tu.lnkbls ["defined-device-node-in-props"].properties ["node.id"]
|
["target.object"] = tu.lnkbls ["defined-device-node-in-props"].properties ["node.id"]
|
||||||
}
|
}
|
||||||
tu.createStreamNode ("capture", props)
|
tu.createStreamNode ("capture", props)
|
||||||
elseif tu.linkables_ready () and tu.lnkbls ["stream-node"] then
|
elseif tu.linkablesReady () and tu.lnkbls ["stream-node"] then
|
||||||
-- when "stream-node" linkable is ready
|
-- when "stream-node" linkable is ready
|
||||||
tu.set_target_in_metadata ("target.object", "defined-device-node-in-metadata")
|
tu.setTargetInMetadata ("target.object", "defined-device-node-in-metadata")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}:register ()
|
}:register ()
|
||||||
|
@@ -90,12 +90,12 @@ u.metadata = cu.default_metadata_om:lookup ()
|
|||||||
assert (u.metadata ~= nil)
|
assert (u.metadata ~= nil)
|
||||||
|
|
||||||
-- update the defined target for stream session item in metadata.
|
-- update the defined target for stream session item in metadata.
|
||||||
function u.set_target_in_metadata (prop, target_node_name)
|
function u.setTargetInMetadata (prop, target_node_name)
|
||||||
u.metadata:set (u.lnkbls ["stream-node"].properties ["node.id"], prop,
|
u.metadata:set (u.lnkbls ["stream-node"].properties ["node.id"], prop,
|
||||||
"Spa:Id", u.lnkbls [target_node_name].properties ["node.id"])
|
"Spa:Id", u.lnkbls [target_node_name].properties ["node.id"])
|
||||||
end
|
end
|
||||||
|
|
||||||
function u.linkables_ready ()
|
function u.linkablesReady ()
|
||||||
local count = 0
|
local count = 0
|
||||||
for k, v in pairs (u.lnkbls) do
|
for k, v in pairs (u.lnkbls) do
|
||||||
if v then
|
if v then
|
||||||
|
Reference in New Issue
Block a user