diff --git a/src/wrapasvst3.cpp b/src/wrapasvst3.cpp index 2e081662..7a2e011d 100644 --- a/src/wrapasvst3.cpp +++ b/src/wrapasvst3.cpp @@ -461,7 +461,6 @@ Vst::UnitID ClapAsVst3::getOrCreateUnitInfo(const char* modulename) } else { - // the unit needs to be created Steinberg::Vst::String128 name; std::string u8name(path[i]); if (VST3::StringConvert::convert(u8name, name)) @@ -581,10 +580,14 @@ void ClapAsVst3::setupParameters(const clap_plugin_t* plugin, const clap_plugin_ units.clear(); { - Vst::String128 rootname(STR16("root")); - Vst::Unit* newunit = new Vst::Unit(rootname, Vst::kNoParentUnitId, - Vst::kRootUnitId); // a new unit without a program list - addUnit(newunit); + Vst::UnitInfo rootInfo; + rootInfo.id = Vst::kRootUnitId; + rootInfo.parentUnitId = Vst::kNoParentUnitId; + rootInfo.programListId = Vst::kNoProgramListId; + VST3::StringConvert::convert(std::string("Root"), rootInfo.name); + + auto rootUnit = new Vst::Unit(rootInfo); + addUnit(rootUnit); } auto numparams = params->count(plugin);