bool MDLParser::parseMDLX(const File& f, bool onlyExtras) { XmlElement* xml = XmlDocument::parse(f); if (xml != nullptr) { ValueTree mdlxTree = ValueTree::fromXml(*xml); if (onlyExtras) { ValueTree comments = mdlxTree.getChildWithName(Objects::comments); if(comments.isValid()) { mdlxTree.removeChild(comments, nullptr); ValueTree tmp1 = mdlxTree.createCopy(); ValueTree tmp2 = mdlFile.mdlRoot.createCopy(); tmp1.setProperty(Ids::mdlName, "", nullptr); tmp1.setProperty(Ids::mdlPath, "", nullptr); tmp2.setProperty(Ids::mdlName, "", nullptr); tmp2.setProperty(Ids::mdlPath, "", nullptr); if(tmp1.isEquivalentTo(tmp2)) mdlFile.mdlRoot.addChild(comments, -1, nullptr); } } else { mdlFile.mdlRoot = mdlxTree.createCopy(); } delete xml; return true; } return false; }
void Project::updateOldStyleConfigList() { ValueTree deprecatedConfigsList (projectRoot.getChildWithName (ProjectExporter::configurations)); if (deprecatedConfigsList.isValid()) { projectRoot.removeChild (deprecatedConfigsList, nullptr); for (Project::ExporterIterator exporter (*this); exporter.next();) { if (exporter->getNumConfigurations() == 0) { ValueTree newConfigs (deprecatedConfigsList.createCopy()); if (! exporter->isXcode()) { for (int j = newConfigs.getNumChildren(); --j >= 0;) { ValueTree config (newConfigs.getChild(j)); config.removeProperty (Ids::osxSDK, nullptr); config.removeProperty (Ids::osxCompatibility, nullptr); config.removeProperty (Ids::osxArchitecture, nullptr); } } exporter->settings.addChild (newConfigs, 0, nullptr); } } } }
ValueTree AudioProcessorValueTreeState::copyState() { ScopedLock lock (valueTreeChanging); flushParameterValuesToValueTree(); return state.createCopy(); }
static bool isGroupSorted (const ValueTree& state, bool keepGroupsAtStart) { if (state.getNumChildren() == 0) return false; if (state.getNumChildren() == 1) return true; ValueTree stateCopy (state.createCopy()); sortGroup (stateCopy, keepGroupsAtStart, nullptr); return stateCopy.isEquivalentTo (state); }
ValueTree SAMCompiler::getWgForJunct(ValueTree waveguides, ValueTree j) { ValueTree wgs(Objects::waveguides); for (int i = 0; i < waveguides.getNumChildren(); ++i) { ValueTree w = waveguides.getChild(i); if (w[Ids::startVertex] == j[Ids::identifier] || w[Ids::endVertex] == j[Ids::identifier]) { wgs.addChild(w.createCopy(), -1, nullptr); } } return wgs; }