MCPcopy Create free account
hub / github.com/christophhart/HISE / callForMessage

Method callForMessage

hi_scripting/scripting/api/ScriptingApiObjects.cpp:7875–7905  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7873}
7874
7875void ScriptingObjects::GlobalRoutingManagerReference::OSCCallback::callForMessage(const OSCMessage& c)
7876{
7877 if (c.isEmpty())
7878 return;
7879
7880 auto getVar = [](const OSCArgument& a)
7881 {
7882 if (a.isFloat32())
7883 return var(a.getFloat32());
7884 if (a.isString())
7885 return var(a.getString());
7886 if (a.isInt32())
7887 return var(a.getInt32());
7888
7889 return var();
7890 };
7891
7892 if (c.size() == 1)
7893 args[1] = getVar(c[0]);
7894 else
7895 {
7896 auto newArray = Array<var>();
7897
7898 for (auto& a : c)
7899 newArray.add(getVar(a));
7900
7901 args[1] = var(newArray);
7902 }
7903
7904 callback.call(args, 2);
7905}
7906
7907bool ScriptingObjects::GlobalRoutingManagerReference::removeOSCCallback(String oscSubAddress)
7908{

Callers 1

oscMessageReceivedMethod · 0.80

Calls 11

varFunction · 0.85
isEmptyMethod · 0.45
isFloat32Method · 0.45
getFloat32Method · 0.45
isStringMethod · 0.45
getStringMethod · 0.45
isInt32Method · 0.45
getInt32Method · 0.45
sizeMethod · 0.45
addMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected