Esempio n. 1
0
StringArray CtrlrIDManager::getValuesArray(const ValueTree &cid)
{
    StringArray r;
    StringArray toks;

    if (cid.getProperty("defaults").toString().startsWith("@"))
    {
        toks.addTokens (constantsTree.getChildWithProperty ( "name", cid.getProperty("defaults").toString().fromFirstOccurrenceOf("@", false,true) ).getProperty("value").toString(), ",", "\'\"");
    }
    else
    {
        toks.addTokens (cid.getProperty("defaults").toString(),",","\'\"");
    }

    for (int i=0; i<toks.size(); i++)
    {
        StringArray pairs;
        pairs.addTokens (toks[i], "=", "\'\"");

        if (pairs.size() == 2)
        {
            r.add (pairs[1]);
        }
        else
        {
            r.add (toks[i]);
        }
    }

    return (r);
}
void CtrlrPanelCanvas::replaceComponent (CtrlrModulator &modulator, const String &targetComponentType)
{
	CtrlrComponent *oldComponent = modulator.getComponent();
	CtrlrComponent *newComponent = nullptr;

	/* detach the existing component so it doesn't get notified about anything, the pointer will be invalid */
    if (getOwner().getSelection())
    {
        getOwner().getSelection()->deselectAll();
        getOwner().getSelection()->dispatchPendingMessages();
        getOwner().getSelection()->removeChangeListener(oldComponent);
    }

	if (oldComponent)
	{
		/* keep a copy of the old properties, we need to find out if the component is in a group */
		ValueTree oldComponentProperties = oldComponent->getObjectTree().createCopy();

		modulator.setComponentType(targetComponentType, false);

		/* get the new component pointer and attach it */
		newComponent = modulator.getComponent();
        if (getOwner().getSelection())
            getOwner().getSelection()->addChangeListener (newComponent);

		addAndMakeVisibleNg (modulator.getComponent(), nullptr, true);

		/* attach the new component to any group components the old component was int */
		if (oldComponentProperties.hasProperty(Ids::componentGroupName))
		{
			CtrlrGroup *group = dynamic_cast<CtrlrGroup*>(owner.getOwner().getComponent(oldComponentProperties.getProperty(Ids::componentGroupName)));
			if (group)
			{
				group->setOwned (newComponent, true);
			}
		}

		if (oldComponentProperties.hasProperty(Ids::componentTabName))
		{
			CtrlrTabsComponent *tabs = dynamic_cast<CtrlrTabsComponent*>(owner.getOwner().getComponent(oldComponentProperties.getProperty(Ids::componentTabName)));
			if (tabs)
			{
				tabs->setOwned (newComponent, oldComponentProperties.getProperty(Ids::componentTabId), true);
			}
		}

		/* copy any old properties to the new component */
        for (int i=0; i<oldComponentProperties.getNumProperties(); i++)
		{
			const Identifier propName 	= oldComponentProperties.getPropertyName(i);
			const var propValue			= oldComponentProperties.getProperty(propName);

			if (propName != Ids::uiType)
			{
				if (newComponent->getObjectTree().hasProperty(propName))
					newComponent->setProperty (propName, propValue);
			}
		}
	}
}
Esempio n. 3
0
void ListBox::refreshFromValueTree (const ValueTree& state, ComponentBuilder&)
{
    ComponentBuilder::refreshBasicComponentProperties (*this, state);

    setRowHeight (state.getProperty (Ids::rowHeight, defaultListRowHeight));
    setOutlineThickness (state.getProperty (Ids::borderThickness, 0));
}
Esempio n. 4
0
void gradientFromProperty (Graphics &g, Rectangle<int> gradientBounds, const ValueTree &propertyHolder, const Identifier &gradientType, const Identifier &colour1, const Identifier &colour2)
{
	if ((int)propertyHolder.getProperty(gradientType) == 1)
	{
		g.setGradientFill (ColourGradient (VAR2COLOUR(propertyHolder.getProperty(colour1)),
										0.0f, 0.0f,
										VAR2COLOUR(propertyHolder.getProperty(colour2)),
										0.0f, (float) gradientBounds.getHeight(),
										false));
	}
	else if ((int)propertyHolder.getProperty(gradientType) == 2)
	{
		g.setGradientFill (ColourGradient (VAR2COLOUR(propertyHolder.getProperty(colour1)),
										0.0f, 0.0f,
										VAR2COLOUR(propertyHolder.getProperty(colour2)),
										(float) gradientBounds.getWidth(), 0.0f,
										false));
	}
	else if ((int)propertyHolder.getProperty(gradientType) == 3)
	{
		g.setGradientFill (ColourGradient (VAR2COLOUR(propertyHolder.getProperty(colour1)),
										gradientBounds.getWidth()/2.0f, gradientBounds.getHeight()/2.0f,
										VAR2COLOUR(propertyHolder.getProperty(colour2)),
										0.0f, 0.0f,
										true));
	}
	else
	{
		g.setColour (VAR2COLOUR(propertyHolder.getProperty(colour1)));
	}
}
void CtrlrPanelComponentProperties::refreshTargetModulationPropertyList (const ValueTree &sourceModulationTree)
{
	CtrlrModulator *target = owner.getOwner().getModulator (sourceModulationTree.getProperty (Ids::modulatorLinkedToModulator));

	if (target)
	{
		modulatorPropertyList.clear();
		modulatorPropertyList.add (COMBO_NONE_ITEM);

		if ((bool)sourceModulationTree.getProperty (Ids::modulatorLinkedToComponent) == true)
		{
			CtrlrComponent *c = target->getComponent();
			if (c)
			{
				for (int i=0; i<c->getComponentTree().getNumProperties(); i++)
				{
					modulatorPropertyList.add (c->getComponentTree().getPropertyName(i).toString());
				}
			}
		}
		else
		{
			for (int i=0; i<target->getModulatorTree().getNumProperties(); i++)
			{
				modulatorPropertyList.add (target->getModulatorTree().getPropertyName(i).toString());
			}
		}
	}
}
Esempio n. 6
0
void CtrlrTabsComponent::addTab(const ValueTree tabToAdd)
{
	ValueTree tabTree = tabToAdd;

	const int tabId = ctrlrTabs->getNumTabs();

	if (!tabTree.hasProperty(Ids::uiTabsTabIndex))
		tabTree.setProperty (Ids::uiTabsTabIndex, tabId, 0);

	if (!tabTree.hasProperty(Ids::uiTabsTabName))
		tabTree.setProperty (Ids::uiTabsTabName, "Tab "+String(tabId), 0);

	if (!tabTree.hasProperty(Ids::uiTabsTabContentBackgroundColour))
		tabTree.setProperty (Ids::uiTabsTabContentBackgroundColour, Colours::yellow.toString(), 0);

	if (!tabTree.hasProperty(Ids::uiTabsTabBackgroundColour))
		tabTree.setProperty (Ids::uiTabsTabBackgroundColour, Colours::lightgrey.toString(), 0);

	if (!tabTree.hasProperty(Ids::uiTabsTabBackgroundImage))
		tabTree.setProperty (Ids::uiTabsTabBackgroundImage, COMBO_NONE_ITEM, 0);

	if (!tabTree.hasProperty(Ids::uiTabsTabBackgroundImageLayout))
		tabTree.setProperty (Ids::uiTabsTabBackgroundImageLayout, 36, 0);

	if (!tabTree.hasProperty(Ids::uiTabsTabBackgroundImageAlpha))
		tabTree.setProperty (Ids::uiTabsTabBackgroundImageAlpha, 255, 0);

	ctrlrTabs->addTab (	tabTree.getProperty(Ids::uiTabsTabName).toString(),
						VAR2COLOUR(tabTree.getProperty(Ids::uiTabsTabBackgroundColour)),
						new CtrlrTabsContentComponent(tabTree, *this),
						true,
						tabTree.getProperty(Ids::uiTabsTabIndex));
}
Image CtrlrLuaMethodEditor::getIconForItem (const ValueTree &item) const
{
	if (item.hasType (Ids::luaMethod))
	{
		if ((int)item.getProperty (Ids::luaMethodSource) == (int)CtrlrLuaMethod::codeInProperty)
		{
			return (IMAGE(ico_unit_png));
		}

		if ((int)item.getProperty (Ids::luaMethodSource) == (int)CtrlrLuaMethod::codeInFile)
		{
			if (File(item.getProperty(Ids::luaMethodSourcePath)).existsAsFile())
			{
				return (IMAGE(ico_file_png));
			}
			else
			{
				return (IMAGE(ico_unknown_png));
			}
		}
	}
	else if (item.hasType (Ids::luaMethodGroup))
	{
		return (IMAGE(ico_folder_png));
	}
	else if (item.hasType (Ids::luaManagerMethods))
	{
		return (IMAGE(ico_box_png));
	}
	return (IMAGE(ico_unknown_png));
}
Esempio n. 8
0
void PlayList::valueTreePropertyChanged(ValueTree& tree, const Identifier& property)
{
    if (property==musicId) {
        musicname->setText(tree.getProperty(property), dontSendNotification);
    }
    else if (property==sublistId){
        sublistname->setText(tree.getProperty(property), dontSendNotification);
    }
}
Esempio n. 9
0
void TrackInfo::loadTrackInfo(ValueTree tags)
{	
   if (tags.hasType("ITEM")) {
	   title.setText (tags.getProperty(MusicColumns::columnNames[MusicColumns::Song].toString(), 0),dontSendNotification);
	   artist.setText (tags.getProperty(MusicColumns::columnNames[MusicColumns::Artist].toString(), 0),dontSendNotification);
	   album.setText (tags.getProperty(MusicColumns::columnNames[MusicColumns::Album].toString(), 0),dontSendNotification);
   }
	else {
		title.setText ("Song Title",dontSendNotification);
		artist.setText ("Artist",dontSendNotification);
        album.setText("Album", dontSendNotification);
	}
}
void UnityProjectBuilder::parseFile (ValueTree file, const File& sourceDir)
{
    const String path (file.getProperty (Ids::fileProp).toString());
    const File sourceFile (projectFile.getSiblingFile (path));
    const bool compile = bool (file.getProperty (Ids::compileProp));
    
    if (compile && isValidSourceFile (sourceFile))
    {
        file.setProperty (Ids::compileProp, false, nullptr);
        filesToAdd.add (sourceFile.getRelativePathFrom (sourceDir));
        logOutput ("Adding file \"" + path + "\"...");
    }
}
Esempio n. 11
0
void TrackMulti::saveEdits ()
{
    newArt = art.getCover();
    
    for (int counter = 0; counter < libraryIds.size(); counter++) {
        ValueTree currentTrack = filteredDataList.getChildWithProperty(MusicColumns::columnNames[MusicColumns::LibID], libraryIds[counter]);
        
        if (artist.getText() != String::empty)
        {
            currentTrack.setProperty(MusicColumns::columnNames[MusicColumns::Artist], artist.getText(), singletonUndoManager);
            TagReader::writeTag(MusicColumns::Artist, currentTrack);
        }
        if (album.getText() != String::empty)
        {
            currentTrack.setProperty(MusicColumns::columnNames[MusicColumns::Album], album.getText(), singletonUndoManager);
            TagReader::writeTag(MusicColumns::Album, currentTrack);
        }
        if (genre.getText() != String::empty)
        {
            currentTrack.setProperty(MusicColumns::columnNames[MusicColumns::Genre], genre.getText(), singletonUndoManager);
            TagReader::writeTag(MusicColumns::Genre, currentTrack);
        }
        if (label.getText() != String::empty)
        {
            currentTrack.setProperty(MusicColumns::columnNames[MusicColumns::Label], label.getText(), singletonUndoManager);
            TagReader::writeTag(MusicColumns::Label, currentTrack);
        }
        if (rating.getValue() > 0)
        {
            currentTrack.setProperty(MusicColumns::columnNames[MusicColumns::Rating], rating.getValue(), singletonUndoManager);
            TagReader::writeTag(MusicColumns::Rating, currentTrack);
        }
        
        if (newArt.isValid() && newArt.getWidth() >= 3)
        {
            File currentFile (currentTrack.getProperty(MusicColumns::columnNames[MusicColumns::Location]));
            //save album art
            TagReader::saveAlbumArt (currentFile, newArt, art.extension);
            artUpdateRequired = true;
        }
        
        currentTrack.setProperty(MusicColumns::columnNames[MusicColumns::Modified], Time::getCurrentTime().toMilliseconds(), 0);
        
        
        File selectedFile (currentTrack.getProperty(MusicColumns::columnNames[MusicColumns::Location]));
        selectedFile.setLastModificationTime(Time::getCurrentTime());
        
    }
    
}
Esempio n. 12
0
void CtrlrMIDILibrary::valueTreePropertyChanged (ValueTree &treeWhosePropertyHasChanged, const Identifier &property)
{
	if (!treeWhosePropertyHasChanged.hasType(Ids::midiLibrary))
		return;

	if (property == Ids::midiLibraryBank)
	{
		setCurrentBank(Uuid(getProperty(property)));
	}
	else if (property == Ids::midiLibraryProgram)
	{
		setCurrentProgram (Uuid(getProperty(property)), InheritFromLibrary);
	}
	else if (property == Ids::midiLibrarySnapshot)
	{
		setCurrentSnapshot (Uuid(getProperty(property)), InheritFromLibrary);
	}
	else if ((property == Ids::lsb || property == Ids::msb) && treeWhosePropertyHasChanged.hasType (Ids::midiLibraryBank))
	{
		BigInteger bi;
		bi.setBitRangeAsInt (0, 7, (int)treeWhosePropertyHasChanged.getProperty(Ids::lsb));
		bi.setBitRangeAsInt (7, 7, (int)treeWhosePropertyHasChanged.getProperty(Ids::msb));
		treeWhosePropertyHasChanged.setProperty (Ids::value, (int)bi.getBitRangeAsInt (0, 14), nullptr);
	}
}
Esempio n. 13
0
void CtrlrMIDIDevice::restoreState(const ValueTree &savedState)
{
	for (int i=0; i<savedState.getNumProperties(); i++)
	{
		deviceTree.setProperty (savedState.getPropertyName(i), savedState.getProperty(savedState.getPropertyName(i)), 0);
	}
}
Esempio n. 14
0
bool AppearanceSettings::readFromXML (const XmlElement& xml)
{
    if (xml.hasTagName (settings.getType().toString()))
    {
        const ValueTree newSettings (ValueTree::fromXml (xml));

        // we'll manually copy across the new properties to the existing tree so that
        // any open editors will be kept up to date..
        settings.copyPropertiesFrom (newSettings, nullptr);

        for (int i = settings.getNumChildren(); --i >= 0;)
        {
            ValueTree c (settings.getChild (i));

            const ValueTree newValue (newSettings.getChildWithProperty (Ids::name, c.getProperty (Ids::name)));

            if (newValue.isValid())
                c.copyPropertiesFrom (newValue, nullptr);
        }

        return true;
    }

    return false;
}
void UnityProjectBuilder::updateBuildDirectories()
{
    if (buildDir.isEmpty())
        return;
    
    ValueTree exportsTree (project.getChildWithName (Ids::exportFormats));
    
    if (! exportsTree.isValid())
        return;
    
    const int numExports = exportsTree.getNumChildren();
    
    for (int i = 0; i < numExports; ++i)
    {
        ValueTree exporter (exportsTree.getChild (i));
        
        if (exporter.hasProperty (Ids::targetFolderProp))
        {
            logOutput ("Updating exporter " + exporter.getType().toString());
            const String oldTarget (exporter.getProperty (Ids::targetFolderProp).toString());
            String newTarget (buildDir);
            
            if (oldTarget.containsChar ('/'))
                 newTarget << oldTarget.fromLastOccurrenceOf ("/", true, false);
                
            exporter.setProperty (Ids::targetFolderProp, newTarget, nullptr);
        }
    }
}
Esempio n. 16
0
bool ModulatorSamplerSoundPool::loadMonolithicData(const ValueTree &sampleMap, const Array<File>& monolithicFiles, OwnedArray<ModulatorSamplerSound> &sounds)
{
	jassert(!mc->getMainSynthChain()->areVoicesActive());

	clearUnreferencedMonoliths();

	loadedMonoliths.add(new MonolithInfoToUse(monolithicFiles));

	MonolithInfoToUse* hmaf = loadedMonoliths.getLast();

	try
	{
		hmaf->fillMetadataInfo(sampleMap);
	}
	catch (StreamingSamplerSound::LoadingError l)
	{
		String x;
		x << "Error at loading sample " << l.fileName << ": " << l.errorDescription;
		mc->getDebugLogger().logMessage(x);

#if USE_FRONTEND
		mc->sendOverlayMessage(DeactiveOverlay::State::CustomErrorMessage, x);
#else
		debugError(mc->getMainSynthChain(), x);
#endif
	}

	for (int i = 0; i < sampleMap.getNumChildren(); i++)
	{
		ValueTree sample = sampleMap.getChild(i);

		if (sample.getNumChildren() == 0)
		{
			String fileName = sample.getProperty("FileName").toString().fromFirstOccurrenceOf("{PROJECT_FOLDER}", false, false);
			StreamingSamplerSound* sound = new StreamingSamplerSound(hmaf, 0, i);
			pool.add(sound);
			sounds.add(new ModulatorSamplerSound(mc, sound, i));
		}
		else
		{
			StreamingSamplerSoundArray multiMicArray;

			for (int j = 0; j < sample.getNumChildren(); j++)
			{
				StreamingSamplerSound* sound = new StreamingSamplerSound(hmaf, j, i);
				pool.add(sound);
				multiMicArray.add(sound);
			}

			sounds.add(new ModulatorSamplerSound(mc, multiMicArray, i));
		}

		
	}


	sendChangeMessage();

	return true;
}
Array<int> ObjController::checkIfObjectHasLinks(const ValueTree& objTree) const
{
    Array<int> linkIndices;
    for (int i = 0; i < links.size(); i++)
    {
        const ValueTree linkTree = links.getUnchecked(i)->getData();

        if(linkTree.getProperty(Ids::startVertex) == objTree.getProperty(Ids::identifier) ||
           linkTree.getProperty(Ids::endVertex) == objTree.getProperty(Ids::identifier))
        {
            linkIndices.add(i);
        }
    }

    return linkIndices;
}
Esempio n. 18
0
void CtrlrMIDIBuffer::restoreState(const ValueTree &savedState)
{
	bufferSource->setSelectedId (savedState.getProperty (Ids::midiBufferEditorSource),dontSendNotification);

	if (bufferSource->getSelectedId() == 1)
	{
		document.replaceAllContent (savedState.getProperty(Ids::midiBufferEditorContent));
	}
	else if (bufferSource->getSelectedId() == 3)
	{
		loadTextFile(savedState.getProperty(Ids::midiBufferEditorFilePath).toString());
	}
	else if (bufferSource->getSelectedId() == 2)
	{
		loadBinFile(savedState.getProperty(Ids::midiBufferEditorFilePath).toString());
	}
}
Esempio n. 19
0
// Value tree GUI stuff
const String CtrlrLuaMethodEditor::getUniqueName (const ValueTree &item) const
{
	if (item.hasType (Ids::luaMethod))
	{
		return (item.getProperty(Ids::luaMethodName).toString());
	}
	if (item.hasType(Ids::luaMethodGroup))
	{
		return (item.getProperty (Ids::name).toString());
	}
	if (item.hasType(Ids::luaManagerMethods))
	{
		return ("LUA");
	}

	return ("Unknown");
}
Esempio n. 20
0
void StateWriter::setState (const void* data, int sizeInBytes)
{
    DBG("StateWriter::setState(): Loading state.")

    ValueTree settingsTree = ValueTree::readFromData (data, sizeInBytes);

    ValueTree libTree = settingsTree.getChildWithName ("library");
    library->setThreshold (libTree.getProperty ("threshold"));
    library->setReleaseTicks (libTree.getProperty ("release"));
    library->setVelocityScale (libTree.getProperty ("velocity"));

    ValueTree patternsTree = settingsTree.getChildWithName ("patterns");
    for (int i = 0; i < patternsTree.getNumChildren(); i++) {
        Pattern* pattern = library->getPattern (i);
        ValueTree patternTree = patternsTree.getChild (i);
        ValueTree instrumentsTree = patternTree.getChildWithName ("instruments");
        for (int j = 0; j < instrumentsTree.getNumChildren(); j++) {
            ValueTree instrumentTree = instrumentsTree.getChild (j);
            Instrument* instrument = pattern->getInstrumentAt (j);
            instrument->setIndex (instrumentTree.getProperty ("index"));
            instrument->setName (instrumentTree.getProperty ("name"));
            instrument->setNoteNumber (instrumentTree.getProperty ("noteNumber"));
        }
    }    
    
    ValueTree seqTree = settingsTree.getChildWithName ("sequencer");
    sequencer->setSequencerNum (seqTree.getProperty("sequencerNum"));
}
Esempio n. 21
0
void CtrlrMIDILibrary::attachItemToPopupMenu(const ValueTree &itemToAttach, PopupMenu &m, int &itemOffset)
{
	if (isContainer (itemToAttach))
	{
        PopupMenu subMenu;

        for (int topLevelIndex=0; topLevelIndex<itemToAttach.getNumChildren(); topLevelIndex++)
		{
			attachItemToPopupMenu (itemToAttach.getChild(topLevelIndex), subMenu, itemOffset);
		}

        m.addSubMenu (itemToAttach.getProperty(Ids::name).toString(), subMenu, true);
	}
	else
	{
		m.addItem (itemOffset++, itemToAttach.getProperty(Ids::name).toString(), (!itemToAttach.hasType(Ids::midiLibraryData) && (bool)itemToAttach.getProperty(Ids::midiLibraryCanSendItem)), isCurrentProgram(itemToAttach));
	}
}
Esempio n. 22
0
void BackendProcessor::setStateInformation(const void *data, int sizeInBytes)
{
	tempLoadingData.setSize(sizeInBytes);

	tempLoadingData.copyFrom(data, 0, sizeInBytes);

	

	auto f = [](Processor* p)
	{
		auto bp = dynamic_cast<BackendProcessor*>(p->getMainController());

		auto& tmp = bp->tempLoadingData;

		ValueTree v = ValueTree::readFromData(tmp.getData(), tmp.getSize());

		String fileName = v.getProperty("ProjectRootFolder", String());

		if (fileName.isNotEmpty())
		{
			File root(fileName);
			if (root.exists() && root.isDirectory())
			{
				GET_PROJECT_HANDLER(p).setWorkingProject(root, nullptr);

				bp->getSettingsObject().refreshProjectData();

			}
		}

		p->getMainController()->loadPresetFromValueTree(v);

		

		bp->editorInformation = JSON::parse(v.getProperty("InterfaceData", ""));

		tmp.reset();

		return SafeFunctionCall::OK;
	};

	getKillStateHandler().killVoicesAndCall(getMainSynthChain(), f, MainController::KillStateHandler::SampleLoadingThread);
}
Esempio n. 23
0
void GainMatcherVoiceStartModulator::restoreFromValueTree(const ValueTree &v)
{
	VoiceStartModulator::restoreFromValueTree(v);

	loadAttribute(UseTable, "UseTable");

	setConnectedCollectorId(v.getProperty("ConnectedId"));

	if (useTable) loadTable(table, "TableData");
}
Esempio n. 24
0
bool CtrlrMIDILibrary::transactionCanHandleType(const ValueTree &transactionState, const ValueTree transactionItem)
{
	StringArray types = StringArray::fromTokens (transactionState.getProperty(Ids::transCap).toString(), ",; ", "\"\'");
	for (int i=0; i<types.size(); i++)
	{
		if (types[i] == transactionItem.getType().toString())
			return (true);
	}

	return (false);
}
Esempio n. 25
0
Project::Item Project::Item::getOrCreateSubGroup (const String& name)
{
    for (int i = state.getNumChildren(); --i >= 0;)
    {
        const ValueTree child (state.getChild (i));
        if (child.getProperty (Ids::name) == name && child.hasType (Tags::group))
            return Item (project, child);
    }

    return addNewSubGroup (name, -1);
}
void StaticStreamViewport::StaticStreamComponent::valueTreePropertyChanged( ValueTree& treeWhosePropertyHasChanged, const Identifier& property )
{
	ScopedLock locker(lock);

	DBG("StaticStreamViewport::StaticStreamComponent::valueTreePropertyChanged " + treeWhosePropertyHasChanged.getType().toString() + " " + property.toString());

	if (Identifiers::Name == property)
	{
		repaint();
		return;
	}

	if (Identifiers::StreamID == property)
	{
		int64 streamID = tree[Identifiers::StreamID];
		streamIdEditor.setText(String::toHexString(streamID));
		return;
	}

	if (Identifiers::DestinationAddress == property)
	{
		int64 address64 = tree[Identifiers::DestinationAddress];
		MACAddress address(Int64ToMACAddress(address64));
		multicastAddressEditor.setText(address.toString());
		return;
	}

	if (Identifiers::ChannelCount == property)
	{
		channelsCombo.setSelectedId(tree[Identifiers::ChannelCount], dontSendNotification);
		return;
	}

	if (Identifiers::Subtype == property)
	{
		int subtype = tree[Identifiers::Subtype];
		clockReferenceButton.setToggleState(AVTP_SUBTYPE_CRS == subtype,dontSendNotification);
		setChannelsVisible();
		return;
	}

	if (Identifiers::Active == property)
	{
		enableControls(treeWhosePropertyHasChanged.getProperty(property));
		return;
	}

	if (Identifiers::AutoStart == property)
	{
		autoStartButton.setToggleState(treeWhosePropertyHasChanged[property],dontSendNotification);
		return;
	}
}
Esempio n. 27
0
void CtrlrLuaMethodEditor::restoreState(const ValueTree &savedState)
{
	restoreProperties (savedState, componentTree, nullptr);

	ScopedPointer <XmlElement> treeState(XmlDocument::parse (savedState.getProperty(Ids::luaMethodEditor).toString().upToLastOccurrenceOf(";", false, true)));

	if (treeState)
	{
		methodTree->restoreOpennessState (*treeState, true);
	}

	StringArray openedMethods;
	openedMethods.addTokens (savedState.getProperty(Ids::luaMethodEditor).toString().fromLastOccurrenceOf(";", false, true), ":", String::empty);

	for (int i=0; i<openedMethods.size(); i++)
	{
		setEditedMethod (Uuid (openedMethods[i]));
	}

	updateTabs();
}
Esempio n. 28
0
//[MiscUserCode] You can add your own definitions of your custom methods or any other code here...
void PageRemoteSensor::jobExecutionResult (const ValueTree jobResultData)
{
    MessageManagerLock mmlock;

    if (jobResultData.hasProperty(SunriseConfig::rsCurrent0))
    {
        current0Label->setValue ((int)jobResultData.getProperty(SunriseConfig::rsCurrent0), Amp);
    }

    if (jobResultData.hasProperty(SunriseConfig::rsCurrent1))
    {
        current1Label->setValue ((int)jobResultData.getProperty(SunriseConfig::rsCurrent1), Amp);
    }

    if (jobResultData.hasProperty(SunriseConfig::rsTemperature0))
    {
        temperatureLabel->setValue ((int)jobResultData.getProperty(SunriseConfig::rsTemperature0), Celsius);
    }

    if (jobResultData.hasProperty(SunriseConfig::rsPressure0))
    {
        pressureLabel->setValue ((int)jobResultData.getProperty(SunriseConfig::rsPressure0), HectoPascal);
    }

	if (jobResultData.hasProperty(SunriseConfig::rsTemperature1))
    {
        temperatureLabel2->setValue ((int)jobResultData.getProperty(SunriseConfig::rsTemperature1), Celsius);
    }

	if (jobResultData.hasProperty(SunriseConfig::rsHumidity0))
    {
        humidityLabel->setValue ((int)jobResultData.getProperty(SunriseConfig::rsHumidity0), Percent);
    }
}
Esempio n. 29
0
ApiCollection::MethodItem::MethodItem(const ValueTree &methodTree_, const String &className_) :
Item(String(className_ + "." + methodTree_.getProperty(Identifier("name")).toString()).toLowerCase()),
methodTree(methodTree_),
name(methodTree_.getProperty(Identifier("name")).toString()),
description(methodTree_.getProperty(Identifier("description")).toString()),
arguments(methodTree_.getProperty(Identifier("arguments")).toString()),
className(className_)
{
	setSize(380 - 16 - 8 - 24, ITEM_HEIGHT);

	auto extendedHelp = ExtendedApiDocumentation::getMarkdownText(className, name);

	if (extendedHelp.isNotEmpty())
	{
		parser = new MarkdownParser(extendedHelp);
		parser->setTextColour(Colours::white);
		parser->setDefaultTextSize(15.0f);
		parser->parse();
	}

	help = ApiHelpers::createAttributedStringFromApi(methodTree, className, true, Colours::white);
}
Esempio n. 30
0
void CtrlrLuaMethod::valueTreePropertyChanged (ValueTree &treeWhosePropertyHasChanged, const Identifier &property)
{
	if (property == Ids::luaMethodValid)
	{
		methodIsValid = (bool)treeWhosePropertyHasChanged.getProperty(property);
	}
	else if (property == Ids::luaMethodName)
	{
		if (methodCodeEditor)
		{
			methodCodeEditor->triggerAsyncUpdate();
		}
	}
}