void free(NodeId node) { beginMessage(); oscPacket() .openMessage("/node/free", 1) .int32(node.id()) .closeMessage(); m_engine->nodeIdAllocator().free(node.id()); }
GroupId group(GroupId parent) { beginMessage(); const int32_t nodeId = m_engine->nodeIdAllocator().alloc(); oscPacket() .openMessage("/group/new", 3) .int32(nodeId) .int32(parent.id()) .int32(0) // add action .closeMessage(); return GroupId(nodeId); }
SynthId synth(const char* synthDef, GroupId parent, const std::vector<float>& controls, const std::list<Value>& options=std::list<Value>()) { beginMessage(); const int32_t nodeId = m_engine->nodeIdAllocator().alloc(); oscPacket() .openMessage("/synth/new", 4 + OSCPP::Tags::array(controls.size()) + OSCPP::Tags::array(options.size())) .string(synthDef) .int32(nodeId) .int32(parent.id()) .int32(0) .putArray(controls.begin(), controls.end()); oscPacket().openArray(); for (const auto& x : options) { x.put(oscPacket()); } oscPacket().closeArray(); oscPacket().closeMessage(); return SynthId(nodeId); }