Esempio n. 1
0
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;
}
Esempio n. 2
0
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);
            }
        }
    }
}
Esempio n. 3
0
ValueTree AudioProcessorValueTreeState::copyState()
{
    ScopedLock lock (valueTreeChanging);

    flushParameterValuesToValueTree();

    return state.createCopy();
}
Esempio n. 4
0
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);
}
Esempio n. 5
0
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;
}