MCPcopy Create free account
hub / github.com/ChiyukiGana/Quickinput / exec

Method exec

source/src/scriptinterpreter.cpp:2023–2036  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2021*/
2022struct QiFunc_osc_send : public QiFunc
2023{
2024 QiFunc_osc_send() : QiFunc(3, ~size_t(0)) {}
2025 QiVar exec(const std::vector<QiVar>& args, QiScriptInterpreter*) const override
2026 {
2027 try
2028 {
2029 constexpr size_t MTU_SIZE = 1536;
2030 UdpTransmitSocket socket(IpEndpointName(args[0].toString().c_str(), args[1].toInteger()));
2031 char buffer[MTU_SIZE];
2032 osc::OutboundPacketStream output(buffer, MTU_SIZE);
2033 output << osc::BeginMessage(args[2].toString().c_str());
2034 for (size_t i = 3; i < args.size(); i++)
2035 {
2036 const QiVar& val = args[i];
2037 if (val.type() == QiVar::Type::t_bool) output << val.toBool();
2038 else if (val.type() == QiVar::Type::t_int) output << static_cast<osc::int32>(val.toInteger());
2039 else if (val.type() == QiVar::Type::t_num) output << static_cast<float>(val.toNumber());

Callers

nothing calls this directly

Calls 5

thisMutexMethod · 0.80
propertyMethod · 0.80
endMethod · 0.80
findMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected