本文整理汇总了C++中ValueTree类的典型用法代码示例。如果您正苦于以下问题:C++ ValueTree类的具体用法?C++ ValueTree怎么用?C++ ValueTree使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ValueTree类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getValueTreePath
static void getValueTreePath (ValueTree v, const ValueTree& topLevelTree, Array<int>& path)
{
while (v != topLevelTree)
{
ValueTree parent (v.getParent());
if (! parent.isValid())
break;
path.add (parent.indexOf (v));
v = parent;
}
}
示例2: sortGroup
static void sortGroup (ValueTree& state, bool keepGroupsAtStart, UndoManager* undoManager)
{
if (keepGroupsAtStart)
{
ItemSorterWithGroupsAtStart sorter;
state.sort (sorter, undoManager, true);
}
else
{
ItemSorter sorter;
state.sort (sorter, undoManager, true);
}
}
示例3: v
ValueTree AudioProcessorValueTreeState::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;
}
示例4: RestoreProperty
void StoredSettings::RestoreProperty(const Identifier& CategoryName, const Identifier& PropertyName, Value& Val)
{
ValueTree tree = (CategoryName == Identifiers::Category1) ? tree_root : tree_root.getOrCreateChildWithName(CategoryName, nullptr);
if(!tree.hasProperty(PropertyName)){
//If there isn't one then set a new one.
//プロパティーが存在しなければ、設定する
tree.setProperty(PropertyName, Val, nullptr);
}else{
//If the property already exists then just return it.
//存在していれば、そのプロパティーを参照する
Val.referTo(tree.getPropertyAsValue(PropertyName, nullptr));
}
}
示例5: loadTrackInfo
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);
}
}
示例6: MethodItem
ApiCollection::ClassCollection::ClassCollection(const ValueTree &api) :
classApi(api),
name(api.getType().toString())
{
for (int i = 0; i < api.getNumChildren(); i++)
{
items.add(new MethodItem(api.getChild(i), name));
addAndMakeVisible(items.getLast());
}
}
示例7: c
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);
}
示例8: parseFile
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 + "\"...");
}
}
示例9: DBG
void ScopeSync::applyConfiguration()
{
DBG("ScopeSync::applyConfiguration");
#ifdef __DLL_EFFECT__
scopeSyncAsync.toggleUpdateProcessing(false);
#endif
parameterController->toggleAsyncUpdates(false);
setGUIEnabled(false);
parameterController->endAllParameterChangeGestures();
systemError = String::empty;
systemErrorDetails = String::empty;
if (ScopeSyncApplication::inPluginContext())
parameterController->storeParameterValues();
parameterController->reset();
// Firstly create the BCMParameter entries for each of the Host Parameters
ValueTree parameterTree = configuration->getParameters();
for (int i = 0; i < parameterTree.getNumChildren(); i++)
parameterController->addParameter(parameterTree.getChild(i));
parameterController->setupHostParameters();
#ifndef __DLL_EFFECT__
pluginProcessor->updateHostDisplay();
#endif // __DLL_EFFECT__
#ifndef __DLL_EFFECT__
parameterController->restoreParameterValues();
#else
scopeSyncAsync.snapshot();
scopeSyncAsync.toggleUpdateProcessing(true);
#endif // __DLL_EFFECT__
UserSettings::getInstance()->updateConfigurationLibraryEntry(getConfigurationFile().getFullPathName(),
getConfigurationFile().getFileName(),
getConfigurationRoot());
setGUIReload(true);
if (configurationManagerWindow != nullptr)
{
configurationManagerWindow->refreshContent();
configurationManagerWindow->restoreWindowPosition();
}
parameterController->toggleAsyncUpdates(true);
}
示例10: wgs
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;
}
示例11: getOwner
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);
}
}
}
}
示例12: data
ValueTree ScannerManagerComponent::getForDocument()
{
ValueTree data ("SCANNERS");
for (unsigned i = 0; i < cues.size(); i++)
{
ValueTree cue ("CUE");
cue.setProperty ("x", cues[i]->getPosition(), nullptr);
data.addChild (cue, i, nullptr);
}
return data;
}
示例13: exporters
void Project::removeDefunctExporters()
{
ValueTree exporters (projectRoot.getChildWithName (Tags::exporters));
for (;;)
{
ValueTree oldVC6Exporter (exporters.getChildWithName ("MSVC6"));
if (oldVC6Exporter.isValid())
exporters.removeChild (oldVC6Exporter, nullptr);
else
break;
}
}
示例14: fc
bool MDLHelper::addOutputDSPVarIfNotExists(const MDLFile& mdlFile)
{
ValueTree mdlRoot = mdlFile.getMDLRoot();
bool outputDSPExists = false;
ValueTree fcb = mdlRoot.getOrCreateChildWithName(Objects::faustcodeblock, nullptr);
for (int i = 0; i < fcb.getNumChildren(); ++i)
{
ValueTree fc = fcb.getChild(i);
if (fc.hasProperty(Ids::value))
{
String fcStr = fc[Ids::value].toString();
if (fcStr.startsWith("outputDSP"))
{
outputDSPExists = true;
break;
}
}
}
if (!outputDSPExists)
{
ValueTree fc(Ids::faustcode);
fc.setProperty(Ids::value, "outputDSP=SAMlimiter:highpass(4,20.0);", nullptr);
fcb.addChild(fc, -1, nullptr);
return true;
}
return false;
}
示例15: c
StringArray AppearanceSettings::getColourNames() const
{
StringArray s;
for (int i = 0; i < settings.getNumChildren(); ++i)
{
const ValueTree c (settings.getChild(i));
if (c.hasType ("COLOUR"))
s.add (c [Ids::name]);
}
return s;
}