void StoredSettings::Apply(void)
{
	if(tree_root.getNumProperties() == 0){
		//We'll set various settings at the first start-up.
		//初回起動時にプロパティーを設定する
		tree_root.setProperty(Identifiers::RecentFiles, var(list.toString()), nullptr);

		tree_root.setProperty(Identifiers::Languages, var("en"), nullptr);
		tree_root.addChild(ValueTree(Identifiers::RecentSearches), -1, nullptr);
		tree_root.addChild(ValueTree(Identifiers::RecentReplaces), -1, nullptr);
	}

	list.restoreFromString(tree_root.getProperty(Identifiers::RecentFiles));
	list.removeNonExistentFiles();

	const String LANG_NAME = tree_root.getProperty(Identifiers::Languages);
	if(LANG_NAME != String("en")){
		File lang_file = File::getSpecialLocation(File::currentApplicationFile).getParentDirectory().getChildFile(String("languages/") + LANG_NAME + String(".txt"));
		LocalisedStrings::setCurrentMappings(new LocalisedStrings(lang_file));
		if(LANG_NAME == String("ja")){
			// UI表示フォントを日本語表示可能なものに変更する
			LookAndFeel::getDefaultLookAndFeel().setDefaultSansSerifTypefaceName(L"メイリオ");
		}
	}
	Desktop::getInstance().getComponent(0)->repaint();
}
ProjectExporter* ProjectExporter::createNewExporter (Project& project, const int index)
{
    ProjectExporter* exp = nullptr;

    switch (index)
    {
        case 0:     exp = new XCodeProjectExporter      (project, ValueTree (XCodeProjectExporter     ::getValueTreeTypeName (false)), false); break;
        case 1:     exp = new XCodeProjectExporter      (project, ValueTree (XCodeProjectExporter     ::getValueTreeTypeName (true)), true); break;
        case 2:     exp = new MSVCProjectExporterVC2005 (project, ValueTree (MSVCProjectExporterVC2005::getValueTreeTypeName())); break;
        case 3:     exp = new MSVCProjectExporterVC2008 (project, ValueTree (MSVCProjectExporterVC2008::getValueTreeTypeName())); break;
        case 4:     exp = new MSVCProjectExporterVC2010 (project, ValueTree (MSVCProjectExporterVC2010::getValueTreeTypeName())); break;
        case 5:     exp = new MSVCProjectExporterVC2012 (project, ValueTree (MSVCProjectExporterVC2012::getValueTreeTypeName())); break;
        case 6:     exp = new MSVCProjectExporterVC2013 (project, ValueTree (MSVCProjectExporterVC2013::getValueTreeTypeName())); break;
        case 7:     exp = new MakefileProjectExporter   (project, ValueTree (MakefileProjectExporter  ::getValueTreeTypeName())); break;
        case 8:     exp = new AndroidProjectExporter    (project, ValueTree (AndroidProjectExporter   ::getValueTreeTypeName())); break;
        case 9:     exp = new CodeBlocksProjectExporter (project, ValueTree (CodeBlocksProjectExporter::getValueTreeTypeName())); break;

        default:    jassertfalse; return 0;
    }

    File juceFolder (ModuleList::getLocalModulesFolder (&project));
    File target (exp->getTargetFolder());

    if (FileHelpers::shouldPathsBeRelative (juceFolder.getFullPathName(), project.getFile().getFullPathName()))
        exp->getJuceFolderValue() = FileHelpers::getRelativePathFrom (juceFolder, project.getFile().getParentDirectory());
    else
        exp->getJuceFolderValue() = juceFolder.getFullPathName();

    exp->createDefaultConfigs();

    return exp;
}
示例#3
0
ProjectExporter* ProjectExporter::createNewExporter (Project& project, const int index)
{
    ProjectExporter* exp = nullptr;

    switch (index)
    {
        case 0:     exp = new XCodeProjectExporter      (project, ValueTree (XCodeProjectExporter     ::getValueTreeTypeName (false)), false); break;
        case 1:     exp = new XCodeProjectExporter      (project, ValueTree (XCodeProjectExporter     ::getValueTreeTypeName (true)), true); break;
        case 2:     exp = new MSVCProjectExporterVC2005 (project, ValueTree (MSVCProjectExporterVC2005::getValueTreeTypeName())); break;
        case 3:     exp = new MSVCProjectExporterVC2008 (project, ValueTree (MSVCProjectExporterVC2008::getValueTreeTypeName())); break;
        case 4:     exp = new MSVCProjectExporterVC2010 (project, ValueTree (MSVCProjectExporterVC2010::getValueTreeTypeName())); break;
        case 5:     exp = new MSVCProjectExporterVC2012 (project, ValueTree (MSVCProjectExporterVC2012::getValueTreeTypeName())); break;
        case 6:     exp = new MSVCProjectExporterVC2013 (project, ValueTree (MSVCProjectExporterVC2013::getValueTreeTypeName())); break;
        case 7:     exp = new MakefileProjectExporter   (project, ValueTree (MakefileProjectExporter  ::getValueTreeTypeName())); break;
        case 8:     exp = new AndroidProjectExporter    (project, ValueTree (AndroidProjectExporter   ::getValueTreeTypeName())); break;
        case 9:     exp = new CodeBlocksProjectExporter (project, ValueTree (CodeBlocksProjectExporter::getValueTreeTypeName())); break;

        default:    jassertfalse; return 0;
    }

    exp->createDefaultConfigs();
    exp->createDefaultModulePaths();

    return exp;
}
示例#4
0
    ValueTree getOrCreateChildWithName (const Identifier& typeToMatch, UndoManager* undoManager)
    {
        for (auto* s : children)
            if (s->type == typeToMatch)
                return ValueTree (*s);

        auto newObject = new SharedObject (typeToMatch);
        addChild (newObject, -1, undoManager);
        return ValueTree (*newObject);
    }
示例#5
0
    ValueTree getChildWithName (const Identifier& typeToMatch) const
    {
        for (int i = 0; i < children.size(); ++i)
        {
            SharedObject* const s = children.getObjectPointerUnchecked (i);
            if (s->type == typeToMatch)
                return ValueTree (s);
        }

        return ValueTree();
    }
示例#6
0
ValueTree ValueTree::SharedObject::getOrCreateChildWithName (const Identifier& typeToMatch, UndoManager* undoManager)
{
    for (int i = 0; i < children.size(); ++i)
        if (children.getUnchecked(i)->type == typeToMatch)
            return ValueTree (static_cast <SharedObject*> (children.getUnchecked(i)));

    SharedObject* const newObject = new SharedObject (typeToMatch);
    addChild (newObject, -1, undoManager);
    return ValueTree (newObject);

}
示例#7
0
    ValueTree getChildWithProperty (const Identifier& propertyName, const var& propertyValue) const
    {
        for (int i = 0; i < children.size(); ++i)
        {
            SharedObject* const s = children.getObjectPointerUnchecked (i);
            if (s->properties[propertyName] == propertyValue)
                return ValueTree (s);
        }

        return ValueTree();
    }
ProjectExporter* ProjectExporter::createNewExporter (Project& project, const int index)
{
    ProjectExporter* exp = nullptr;

    switch (index)
    {
        case 0:     exp = new XCodeProjectExporter      (project, ValueTree (XCodeProjectExporter::getValueTreeTypeName (false)), false); break;
        case 1:     exp = new XCodeProjectExporter      (project, ValueTree (XCodeProjectExporter::getValueTreeTypeName (true)), true); break;
        case 2:     exp = new MSVCProjectExporterVC6    (project, ValueTree (MSVCProjectExporterVC6::getValueTreeTypeName())); break;
        case 3:     exp = new MSVCProjectExporterVC2005 (project, ValueTree (MSVCProjectExporterVC2005::getValueTreeTypeName())); break;
        case 4:     exp = new MSVCProjectExporterVC2008 (project, ValueTree (MSVCProjectExporterVC2008::getValueTreeTypeName())); break;
        case 5:     exp = new MSVCProjectExporterVC2010 (project, ValueTree (MSVCProjectExporterVC2010::getValueTreeTypeName())); break;
        case 6:     exp = new MakefileProjectExporter   (project, ValueTree (MakefileProjectExporter::getValueTreeTypeName())); break;
        case 7:     exp = new AndroidProjectExporter    (project, ValueTree (AndroidProjectExporter::getValueTreeTypeName())); break;
        default:    jassertfalse; return 0;
    }

    File juceFolder (StoredSettings::getInstance()->getLastKnownJuceFolder());
    File target (exp->getTargetFolder());

    if (FileHelpers::shouldPathsBeRelative (juceFolder.getFullPathName(), project.getFile().getFullPathName()))
        exp->getJuceFolder() = juceFolder.getRelativePathFrom (project.getFile().getParentDirectory());
    else
        exp->getJuceFolder() = juceFolder.getFullPathName();

    exp->createLibraryModules();
    return exp;
}
示例#9
0
    ValueTree getOrCreateChildWithName (const Identifier& typeToMatch, UndoManager* undoManager)
    {
        for (int i = 0; i < children.size(); ++i)
        {
            SharedObject* const s = children.getObjectPointerUnchecked (i);
            if (s->type == typeToMatch)
                return ValueTree (s);
        }

        SharedObject* const newObject = new SharedObject (typeToMatch);
        addChild (newObject, -1, undoManager);
        return ValueTree (newObject);

    }
示例#10
0
void BenderClientOptions::setDefaultOptions()
{
    benderPropertiesTree = ValueTree("bender-properties");
    benderPropertiesTree.setProperty ("destinationAddress", "localhost", nullptr);
    benderPropertiesTree.setProperty ("destinationPort", "9666", nullptr);
    benderPropertiesTree.setProperty ("localDataPort", "9667", nullptr);
}
示例#11
0
void RemoteChannels::buttonClicked(Button* a_button)
{
  if      (a_button == this->expandButton)
    toggleExpandChannels() ;
  else if (a_button == this->ignoreButton)
    this->subscriptions.addChild(ValueTree(this->configStore.getType()) , -1  , nullptr) ;
}
//==============================================================================
void ITunesLibrary::setLibraryTree (ValueTree& newTreeToUse)
{
    if (! newTreeToUse.isValid()) 
        newTreeToUse = ValueTree (MusicColumns::libraryIdentifier);

    libraryTree = newTreeToUse;
}
示例#13
0
void OnlineUnlockStatus::load()
{
    MemoryBlock mb;
    mb.fromBase64Encoding (getState());

    if (mb.getSize() > 0)
        status = ValueTree::readFromGZIPData (mb.getData(), mb.getSize());
    else
        status = ValueTree (stateTagName);

    StringArray localMachineNums (getLocalMachineIDs());

    if (machineNumberAllowed (StringArray ("1234"), localMachineNums))
        status.removeProperty (unlockedProp, nullptr);

    KeyFileUtils::KeyFileData data;
    data = KeyFileUtils::getDataFromKeyFile (KeyFileUtils::getXmlFromKeyFile (status[keyfileDataProp], getPublicKey()));

    if (data.keyFileExpires)
    {
        if (! doesProductIDMatch (data.appID))
            status.removeProperty (expiryTimeProp, nullptr);

        if (! machineNumberAllowed (data.machineNumbers, localMachineNums))
            status.removeProperty (expiryTimeProp, nullptr);
    }
    else
    {
        if (! doesProductIDMatch (data.appID))
            status.removeProperty (unlockedProp, nullptr);

        if (! machineNumberAllowed (data.machineNumbers, localMachineNums))
            status.removeProperty (unlockedProp, nullptr);
    }
}
示例#14
0
Project::Item Project::createNewGroup()
{
    Item item (*this, ValueTree (Tags::group));
    item.initialiseNodeValues();
    item.getName() = "New Group";
    return item;
}
//==============================================================================
ZenAutoTrimAudioProcessor::ZenAutoTrimAudioProcessor()
{
	// #TODO: bitwig parameter text showing normalized instead of in db
	undoManager = new UndoManager();
	params = new ZenAudioProcessorValueTreeState(*this, undoManager);
	
	gainParam = params->createAndAddDecibelParameter(gainParamID, "Gain", -96.0f, 18.0f, 0.0f);
	targetGainParam = params->createAndAddDecibelParameter(targetGainParamID, "TargetGain", -96.0f, 18.0f, -18.0f);
	autoGainEnableParam = params->createAndAddBoolParameter(autoGainEnableParamID, "AutoGain", false);
	bypassParam = params->createAndAddBoolParameter(bypassParamID, "Bypass", false);
	targetTypeParam = params->createAndAddIntParameter(targetTypeParamID, "Target Type", 0, CalibrationTarget::targetCount, CalibrationTarget::Peak);
	rmsWindowTimeParam = params->createAndAddIntParameter(rmsWindowTimeParamID, "RMS Window Time", 10, 5000, CalibrationTimeInMS::time300ms);

	params->state = ValueTree("ZenAutoTrim");

#ifdef JUCE_DEBUG
	//// #TODO: Change this to use Juce SharedResourcePointer - https://forum.juce.com/t/juce-singleton-implementation-confusion/17847/6
	//debugWindow = ZenDebugEditor::getInstance();
	//debugWindow->setSize(650, 400);
	////Open in bottom right corner
	//debugWindow->setTopLeftPosition(1900 - debugWindow->getWidth(), 1040 - debugWindow->getHeight());
	//// #TODO: add JUCE REF COUNTED OBJECT to zen GUI

#ifdef JUCE_MSVC  //Visual Studio mem leak diagnostics settings 
	_CrtSetDbgFlag(0); //Turn off VS memory dump output
	//_crtBreakAlloc = 5389;	//Break on this memory allocation number (When Debug)
#endif
#endif
}
示例#16
0
    ValueTree getChildWithName (const Identifier& typeToMatch) const
    {
        for (auto* s : children)
            if (s->type == typeToMatch)
                return ValueTree (s);

        return {};
    }
示例#17
0
Project::Item Project::Item::createGroup (Project& project, const String& name, const String& uid)
{
    Item group (project, ValueTree (Tags::group));
    group.setID (uid);
    group.initialiseMissingProperties();
    group.getNameValue() = name;
    return group;
}
示例#18
0
    ValueTree getChildWithProperty (const Identifier& propertyName, const var& propertyValue) const
    {
        for (auto* s : children)
            if (s->properties[propertyName] == propertyValue)
                return ValueTree (s);

        return {};
    }
示例#19
0
Project::Item Project::Item::createGroup (Project& project, const String& name, const String& uid, bool isModuleCode)
{
    Item group (project, ValueTree (Ids::GROUP), isModuleCode);
    group.setID (uid);
    group.initialiseMissingProperties();
    group.getNameValue() = name;
    return group;
}
示例#20
0
ValueTree ValueTree::SharedObject::getChildWithName (const Identifier& typeToMatch) const
{
    for (int i = 0; i < children.size(); ++i)
        if (children.getUnchecked(i)->type == typeToMatch)
            return ValueTree (static_cast <SharedObject*> (children.getUnchecked(i)));

    return ValueTree::invalid;
}
示例#21
0
ValueTree ValueTree::SharedObject::getChildWithProperty (const Identifier& propertyName, const var& propertyValue) const
{
    for (int i = 0; i < children.size(); ++i)
        if (children.getUnchecked(i)->getProperty (propertyName) == propertyValue)
            return ValueTree (static_cast <SharedObject*> (children.getUnchecked(i)));

    return ValueTree::invalid;
}
示例#22
0
void CtrlrPanelLayerList::addLayer()
{
	if (owner.getEditor())
	{
		owner.getEditor()->getCanvas()->addLayer(ValueTree());
	}
	layerList->updateContent();
}
示例#23
0
ValueTree ValueTree::getSibling (const int delta) const
{
    if (object == 0 || object->parent == 0)
        return invalid;

    const int index = object->parent->indexOf (*this) + delta;
    return ValueTree (static_cast <SharedObject*> (object->parent->children [index]));
}
示例#24
0
//==============================================================================
void BeatboxVoxAudioProcessor::setupParameters()
{
	processorState.createAndAddParameter(paramOSDNoiseRatio,
	                                     "OSD Noise Ratio",
	                                     String(),
	                                     NormalisableRange<float>(0.01f, 1.0f, 0.01f),
	                                     0.5f,
	                                     nullptr,
	                                     nullptr);

	processorState.addParameterListener(paramOSDNoiseRatio, this);


	processorState.createAndAddParameter(paramOSDMeanCoeff,
	                                     "OSD Mean Coefficient",
	                                     String(),
	                                     NormalisableRange<float>(0.01f, 2.0f, 0.01f),
	                                     0.8f,
	                                     nullptr,
	                                     nullptr);

	processorState.addParameterListener(paramOSDMeanCoeff, this);


	processorState.createAndAddParameter(paramOSDMedianCoeff,
	                                     "OSD Median Coefficient",
	                                     String(),
	                                     NormalisableRange<float>(0.01f, 2.0f, 0.01f),
	                                     0.8f,
	                                     nullptr,
	                                     nullptr);

	processorState.addParameterListener(paramOSDMedianCoeff, this);


	processorState.createAndAddParameter(paramOSDMsBetweenOnsets,
	                                     "OSD Ms Between Onsets",
	                                     String("ms"),
	                                     NormalisableRange<float>(0.0f, 200.0f, 5.0f),
	                                     70.0f,
	                                     nullptr,
	                                     nullptr);

	processorState.addParameterListener(paramOSDMsBetweenOnsets, this);


	processorState.state = ValueTree(Identifier("BeatboxVox"));

	auto onsetDetectMeanCallback = [this] (float newMeanCoeff) { this->classifier.setOSDMeanCoeff(newMeanCoeff); };
	auto onsetDetectMedianCallback = [this] (float newMedianCoeff) { this->classifier.setOSDMedianCoeff(newMedianCoeff); };
	auto onsetDetectNoiseCallback = [this] (float newNoiseRatio) { this->classifier.setOSDNoiseRatio(newNoiseRatio); };
	auto onsetDetectMsBetweenCallback = [this] (float newMsBetweenOnsets) { this->classifier.setOSDMsBetweenOnsets(static_cast<int>(newMsBetweenOnsets)); };

	paramCallbacks.insert(std::make_pair(paramOSDMeanCoeff, onsetDetectMeanCallback));
	paramCallbacks.insert(std::make_pair(paramOSDMedianCoeff, onsetDetectMedianCallback));
	paramCallbacks.insert(std::make_pair(paramOSDNoiseRatio, onsetDetectNoiseCallback));
	paramCallbacks.insert(std::make_pair(paramOSDMsBetweenOnsets, onsetDetectMsBetweenCallback));
}
示例#25
0
AssetTree::Item
AssetTree::Item::createGroup (AssetTree& tree, const String& name, const String& uid)
{
    Item group (tree, ValueTree (Slugs::group));
    group.setId (uid);
    group.setMissingProperties();
    group.getNameValue() = name;
    return group;
}
示例#26
0
Project::Item Project::createNewItem (const File& file)
{
    Item item (*this, ValueTree (Tags::file));
    item.initialiseNodeValues();
    item.getName() = file.getFileName();
    item.getShouldCompileValue() = file.hasFileExtension ("cpp;mm;c;m;cc;cxx");
    item.getShouldAddToResourceValue() = shouldBeAddedToBinaryResourcesByDefault (file);
    return item;
}
示例#27
0
//==============================================================================
ValueTree Project::getJuceConfigNode()
{
    ValueTree configNode = projectRoot.getChildWithName (Tags::configGroup);

    if (! configNode.isValid())
    {
        configNode = ValueTree (Tags::configGroup);
        projectRoot.addChild (configNode, -1, 0);
    }

    return configNode;
}
示例#28
0
//==============================================================================
ValueTree Project::getExporters()
{
    ValueTree exporters (projectRoot.getChildWithName (Tags::exporters));

    if (! exporters.isValid())
    {
        projectRoot.addChild (ValueTree (Tags::exporters), 0, getUndoManagerFor (projectRoot));
        exporters = getExporters();
    }

    return exporters;
}
ValueTree ZenAudioProcessorValueTreeState::getOrCreateChildValueTree(const String& paramID)
{
	ValueTree v(state.getChildWithProperty(idPropertyID, paramID));

	if (!v.isValid())
	{
		v = ValueTree(valueType);
		v.setProperty(idPropertyID, paramID, undoManager);
		state.addChild(v, -1, undoManager);
	}

	return v;
}
示例#30
0
Value AppearanceSettings::getColourValue (const String& colourName)
{
    ValueTree c (settings.getChildWithProperty (Ids::name, colourName));

    if (! c.isValid())
    {
        c = ValueTree ("COLOUR");
        c.setProperty (Ids::name, colourName, nullptr);
        settings.addChild (c, -1, nullptr);
    }

    return c.getPropertyAsValue (Ids::colour, nullptr);
}