Skip to main content

fetchMaestroModule

Creates and returns the SDK's configured overlay modules, ready to be mounted in the host application's scene.

Overview​

Call fetchMaestroModule() after the panelsBuilt field fires to obtain any overlay modules the SDK has configured for the current event. Each returned module node is a self-contained component — append it to your own scene and observe every field listed in its fieldsToObserve property to receive events.

If no modules are configured for the current event, the function returns an empty array.

Syntax​

modules = m.lib.callFunc("fetchMaestroModule")

Parameters​

This function takes no parameters.

Returns​

An array of SceneGraph module nodes, or an empty array if no modules are active for the current event. Each node exposes a fieldsToObserve field listing the output fields your application must observe.

Example​

sub finishSetup()
' Observe panelsBuilt before setting config to avoid a race condition
m.lib.observeField("panelsBuilt", "handleMaestroModule")
end sub

sub handleMaestroModule()
if m.lib = invalid then return

modules = m.lib.callFunc("fetchMaestroModule")
if modules = invalid or modules.count() = 0 then return

if m.activeModules = invalid then m.activeModules = []

for each moduleNode in modules
if moduleNode = invalid then continue for

' Observe every field the module advertises
for each field in moduleNode.fieldsToObserve
moduleNode.observeFieldScoped(field, "handleModuleEvents")
end for

m.top.appendChild(moduleNode) ' mount in host scene
positionModule(moduleNode) ' set translation for your layout
m.activeModules.push(moduleNode)
end for
end sub

sub positionModule(moduleNode as object)
if moduleNode.subType() = "WhatJustHappenedModule"
moduleNode.translation = [71, 896] ' adjust to your layout
end if
end sub

' Teardown: remove all mounted modules from the scene
sub removeMaestroModules()
if m.activeModules = invalid then return
for each moduleNode in m.activeModules
if moduleNode <> invalid then m.top.removeChild(moduleNode)
end for
m.activeModules = []
end sub

Notes​

  • Call this function from the panelsBuilt observer — not before the SDK finishes building its panels.
  • Observe every field in moduleNode.fieldsToObserve. Omitting a field can prevent the module from functioning correctly.
  • When tearing down your video session, remove each active module from the scene using YOUR_SCENE_NODE.removeChild(moduleNode).
  • The function returns an empty array (not invalid) when no modules are configured.
  • See panelsBuilt for the correct integration entry point.