Ejemplo n.º 1
0
const Image Project::getSmallIcon()
{
    Item icon (getMainGroup().findItemWithID (getSmallIconImageItemID().toString()));

    if (icon.isValid())
        return ImageCache::getFromFile (icon.getFile());

    return Image();
}
Ejemplo n.º 2
0
void Project::setMissingDefaultValues()
{
    if (! projectRoot.hasProperty (ComponentBuilder::idProperty))
        projectRoot.setProperty (ComponentBuilder::idProperty, createAlphaNumericUID(), nullptr);

    // Create main file group if missing
    if (! projectRoot.getChildWithName (Tags::projectMainGroup).isValid())
    {
        Item mainGroup (*this, ValueTree (Tags::projectMainGroup));
        projectRoot.addChild (mainGroup.state, 0, 0);
    }

    getMainGroup().initialiseMissingProperties();

    if (getDocumentTitle().isEmpty())
        setTitle ("Juce Project");

    if (! projectRoot.hasProperty (Ids::projectType))
        getProjectTypeValue() = ProjectType::getGUIAppTypeName();

    if (! projectRoot.hasProperty (Ids::version))
        getVersionValue() = "1.0.0";

    updateOldStyleConfigList();
    moveOldPropertyFromProjectToAllExporters (Ids::bigIcon);
    moveOldPropertyFromProjectToAllExporters (Ids::smallIcon);

    for (Project::ExporterIterator exporter (*this); exporter.next();)
        if (exporter->getNumConfigurations() == 0)
            exporter->createDefaultConfigs();

    if (! projectRoot.getChildWithName (Tags::exporters).isValid())
        createDefaultExporters();

    getProjectType().setMissingProjectProperties (*this);

    if (! projectRoot.hasProperty (Ids::bundleIdentifier))
        setBundleIdentifierToDefault();

    if (! projectRoot.getChildWithName (Tags::modulesGroup).isValid())
        addDefaultModules (false);
}
Ejemplo n.º 3
0
void Project::setMissingDefaultValues()
{
    if (! projectRoot.hasProperty (Ids::ID))
        projectRoot.setProperty (Ids::ID, createAlphaNumericUID(), nullptr);

    // Create main file group if missing
    if (! projectRoot.getChildWithName (Ids::MAINGROUP).isValid())
    {
        Item mainGroup (*this, ValueTree (Ids::MAINGROUP), false);
        projectRoot.addChild (mainGroup.state, 0, 0);
    }

    getMainGroup().initialiseMissingProperties();

    if (getDocumentTitle().isEmpty())
        setTitle ("JUCE Project");

    if (! projectRoot.hasProperty (Ids::projectType))
        getProjectTypeValue() = ProjectType_GUIApp::getTypeName();

    if (! projectRoot.hasProperty (Ids::version))
        getVersionValue() = "1.0.0";

    updateOldStyleConfigList();
    moveOldPropertyFromProjectToAllExporters (Ids::bigIcon);
    moveOldPropertyFromProjectToAllExporters (Ids::smallIcon);

    if (getProjectType().isAudioPlugin())
        setMissingAudioPluginDefaultValues();

    getModules().sortAlphabetically();

    if (getBundleIdentifier().toString().isEmpty())
        getBundleIdentifier() = getDefaultBundleIdentifier();

    if (shouldIncludeBinaryInAppConfig() == var::null)
        shouldIncludeBinaryInAppConfig() = true;

    ProjucerApplication::getApp().updateNewlyOpenedProject (*this);
}
Ejemplo n.º 4
0
void Project::setMissingDefaultValues()
{
    if (! projectRoot.hasProperty (Ids::ID))
        projectRoot.setProperty (Ids::ID, createAlphaNumericUID(), nullptr);

    // Create main file group if missing
    if (! projectRoot.getChildWithName (Tags::projectMainGroup).isValid())
    {
        Item mainGroup (*this, ValueTree (Tags::projectMainGroup));
        projectRoot.addChild (mainGroup.state, 0, 0);
    }

    getMainGroup().initialiseMissingProperties();

    if (getDocumentTitle().isEmpty())
        setTitle ("JUCE Project");

    if (! projectRoot.hasProperty (Ids::projectType))
        getProjectTypeValue() = ProjectType::getGUIAppTypeName();

    if (! projectRoot.hasProperty (Ids::version))
        getVersionValue() = "1.0.0";

    updateOldStyleConfigList();
    moveOldPropertyFromProjectToAllExporters (Ids::bigIcon);
    moveOldPropertyFromProjectToAllExporters (Ids::smallIcon);

    getProjectType().setMissingProjectProperties (*this);

    if (! projectRoot.getChildWithName (Tags::modulesGroup).isValid())
        addDefaultModules (false);

    if (getBundleIdentifier().toString().isEmpty())
        getBundleIdentifier() = getDefaultBundleIdentifier();

    IntrojucerApp::getApp().updateNewlyOpenedProject (*this);
}
Ejemplo n.º 5
0
//==============================================================================
void Project::setTitle (const String& newTitle)
{
    projectRoot.setProperty (Ids::name, newTitle, getUndoManagerFor (projectRoot));
    getMainGroup().getNameValue() = newTitle;
}
Ejemplo n.º 6
0
void Project::findAllImageItems (OwnedArray<Project::Item>& items)
{
    findImages (getMainGroup(), items);
}
Ejemplo n.º 7
0
void Project::setMissingDefaultValues()
{
    if (! projectRoot.hasProperty (Ids::id_))
        projectRoot.setProperty (Ids::id_, createAlphaNumericUID(), 0);

    // Create main file group if missing
    if (! projectRoot.getChildWithName (Tags::projectMainGroup).isValid())
    {
        Item mainGroup (*this, ValueTree (Tags::projectMainGroup));
        projectRoot.addChild (mainGroup.getNode(), 0, 0);
    }

    getMainGroup().initialiseNodeValues();

    if (getDocumentTitle().isEmpty())
        setTitle ("Juce Project");

    if (! projectRoot.hasProperty (Ids::projectType))
        getProjectType() = application;

    if (! projectRoot.hasProperty (Ids::version))
        getVersion() = "1.0.0";

    if (! projectRoot.hasProperty (Ids::juceLinkage))
        getJuceLinkageModeValue() = useAmalgamatedJuceViaMultipleTemplates;

    const String juceFolderPath (getRelativePathForFile (StoredSettings::getInstance()->getLastKnownJuceFolder()));

    // Create configs group
    if (! projectRoot.getChildWithName (Tags::configurations).isValid())
    {
        projectRoot.addChild (ValueTree (Tags::configurations), 0, 0);
        createDefaultConfigs();
    }

    if (! projectRoot.getChildWithName (Tags::exporters).isValid())
        createDefaultExporters();

    const String sanitisedProjectName (CodeHelpers::makeValidIdentifier (getProjectName().toString(), false, true, false));

    if (! projectRoot.hasProperty (Ids::buildVST))
    {
        shouldBuildVST() = true;
        shouldBuildRTAS() = false;
        shouldBuildAU() = true;

        getPluginName() = getProjectName().toString();
        getPluginDesc() = getProjectName().toString();
        getPluginManufacturer() = "yourcompany";
        getPluginManufacturerCode() = "Manu";
        getPluginCode() = "Plug";
        getPluginChannelConfigs() = "{1, 1}, {2, 2}";
        getPluginIsSynth() = false;
        getPluginWantsMidiInput() = false;
        getPluginProducesMidiOut() = false;
        getPluginSilenceInProducesSilenceOut() = false;
        getPluginTailLengthSeconds() = 0;
        getPluginEditorNeedsKeyFocus() = false;
        getPluginAUExportPrefix() = sanitisedProjectName + "AU";
        getPluginAUCocoaViewClassName() = sanitisedProjectName + "AU_V1";
        getPluginRTASCategory() = String::empty;
    }

    if (! projectRoot.hasProperty (Ids::bundleIdentifier))
        setBundleIdentifierToDefault();
}