本文整理汇总了C++中XmlElement::setAttribute方法的典型用法代码示例。如果您正苦于以下问题:C++ XmlElement::setAttribute方法的具体用法?C++ XmlElement::setAttribute怎么用?C++ XmlElement::setAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XmlElement
的用法示例。
在下文中一共展示了XmlElement::setAttribute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getStateInformation
//==============================================================================
void TheFunctionAudioProcessor::getStateInformation (MemoryBlock& destData)
{
// You should use this method to store your parameters in the memory block.
// You could do that either as raw data, or use the XML or ValueTree classes
// as intermediaries to make it easy to save and load complex data.
// Create an outer XML element..
XmlElement xml ("MYPLUGINSETTINGS");
// add some attributes to it..
// xml.setAttribute ("uiWidth", lastUIWidth);
// xml.setAttribute ("uiHeight", lastUIHeight);
//xml.setAttribute ("gain", gain);
// xml.setAttribute ("delay", delay);
xml.setAttribute ("gain", gain);
xml.setAttribute ("gainL", gainL);
xml.setAttribute ("gainR", gainR);
xml.setAttribute ("panL", panL);
xml.setAttribute ("panR", panR);
xml.setAttribute ("phaseL", phaseL);
xml.setAttribute ("phaseR", phaseR);
// then use this helper function to stuff it into the binary blob and return it..
copyXmlToBinary (xml, destData);
}
示例2: saveEditorParameters
void VisualizerEditor::saveEditorParameters(XmlElement* xml)
{
xml->setAttribute("Type", "Visualizer");
XmlElement* tabButtonState = xml->createNewChildElement("TAB");
tabButtonState->setAttribute("Active",tabSelector->getToggleState());
XmlElement* windowButtonState = xml->createNewChildElement("WINDOW");
windowButtonState->setAttribute("Active",windowSelector->getToggleState());
if (dataWindow != nullptr)
{
windowButtonState->setAttribute("x",dataWindow->getX());
windowButtonState->setAttribute("y",dataWindow->getY());
windowButtonState->setAttribute("width",dataWindow->getWidth());
windowButtonState->setAttribute("height",dataWindow->getHeight());
}
if (canvas != nullptr)
{
canvas->saveVisualizerParameters(xml);
}
}
示例3: getStateInformation
//==============================================================================
void DemoJuceFilter::getStateInformation (MemoryBlock& destData)
{
XmlElement xmlState (T("faust"));
xmlState.setAttribute (T("pluginVersion"), 1);
xmlState.setAttribute (T("pluginName"), getName());
copyXmlToBinary (xmlState, destData);
}
示例4: getStateInformation
//==============================================================================
void DemoJuceFilter::getStateInformation (MemoryBlock& destData)
{
// you can store your parameters as binary data if you want to or if you've got
// a load of binary to put in there, but if you're not doing anything too heavy,
// XML is a much cleaner way of doing it - here's an example of how to store your
// params as XML..
// create an outer XML element..
XmlElement xmlState (T("XSynthPatch"));
// add some attributes to it..
xmlState.setAttribute (T("pluginVersion"), 1);
xmlState.setAttribute (T("gainLevel"), gain);
xmlState.setAttribute (T("uiWidth"), lastUIWidth);
xmlState.setAttribute (T("uiHeight"), lastUIHeight);
// you could also add as many child elements as you need to here..
for (int i=0; i<getNumParameters(); i++)
{
xmlState.setAttribute (getParameterXMLName(i), getParameter(i));
DBG(String("Saved parameter ") + getParameterXMLName(i) + String(" as ") + String(getParameter(i)));
}
// then use this helper function to stuff it into the binary blob and return it..
copyXmlToBinary (xmlState, destData);
}
示例5: XmlElement
//------------------------------------------------------------------------------
XmlElement *MidiAppMapping::getXml() const
{
XmlElement *retval = new XmlElement("MidiAppMapping");
retval->setAttribute("cc", cc);
retval->setAttribute("commandId", id);
return retval;
}
示例6: saveEditorParameters
void FilterEditor::saveEditorParameters(XmlElement* xml)
{
xml->setAttribute("Type", "FilterEditor");
XmlElement* textLabelValues = xml->createNewChildElement("VALUES");
textLabelValues->setAttribute("HighCut",lastHighCutString);
textLabelValues->setAttribute("LowCut",lastLowCutString);
}
示例7: saveStateToXml
void ControlPanel::saveStateToXml(XmlElement* xml)
{
XmlElement* controlPanelState = xml->createNewChildElement("CONTROLPANEL");
controlPanelState->setAttribute("isOpen",open);
controlPanelState->setAttribute("prependText",prependText->getText());
controlPanelState->setAttribute("appendText",appendText->getText());
}
示例8: XmlElement
//------------------------------------------------------------------------------
XmlElement *OscAppMapping::getXml() const
{
XmlElement *retval = new XmlElement("OscAppMapping");
retval->setAttribute("address", address);
retval->setAttribute("parameterIndex", parameter);
retval->setAttribute("commandId", id);
return retval;
}
示例9: getXml
juce::XmlElement* ZoomingShiftingComponent::getXml(const String tagName) {
// Bouml preserved body begin 0004198D
XmlElement* state = new XmlElement(tagName);
state->setAttribute(T("xoff"),this->origin.getX());
state->setAttribute(T("yoff"),this->origin.getY());
state->setAttribute(T("xzoom"),this->zoomFactorX);
state->setAttribute(T("yzoom"),this->zoomFactorX);
return state;
// Bouml preserved body end 0004198D
}
示例10: saveEditorParameters
void RecordControlEditor::saveEditorParameters(XmlElement* xml)
{
XmlElement* info = xml->createNewChildElement("PARAMETERS");
info->setAttribute("Type", "RecordControlEditor");
info->setAttribute("Channel",availableChans->getSelectedId());
info->setAttribute("FileSaveOption",newFileToggleButton->getToggleState());
}
示例11: getStateInformation
//==============================================================================
void Ambix_converterAudioProcessor::getStateInformation (MemoryBlock& destData)
{
// You should use this method to store your parameters in the memory block.
// You could do that either as raw data, or use the XML or ValueTree classes
// as intermediaries to make it easy to save and load complex data.
// Create an outer XML element..
XmlElement xml ("MYPLUGINSETTINGS");
// add some attributes to it..
xml.setAttribute ("box_presets", box_presets_text);
xml.setAttribute("in_seq_param", in_seq_param);
xml.setAttribute("out_seq_param", out_seq_param);
xml.setAttribute("in_norm_param", in_norm_param);
xml.setAttribute("out_norm_param", out_norm_param);
xml.setAttribute("flip_cs_phase", flip_cs_phase);
xml.setAttribute("flip_param", flip_param);
xml.setAttribute("flop_param", flop_param);
xml.setAttribute("flap_param", flap_param);
xml.setAttribute("in_2d_param", in_2d);
xml.setAttribute("out_2d_param", out_2d);
// then use this helper function to stuff it into the binary blob and return it..
copyXmlToBinary (xml, destData);
}
示例12: saveCustomParameters
void FileReaderEditor::saveCustomParameters (XmlElement* xml)
{
xml->setAttribute ("Type", "FileReader");
XmlElement* childNode = xml->createNewChildElement ("FILENAME");
childNode->setAttribute ("path", fileReader->getFile());
childNode->setAttribute ("recording", recordSelector->getSelectedId());
childNode = xml->createNewChildElement ("TIME_LIMITS");
childNode->setAttribute ("start_time", (double)timeLimits->getTimeMilliseconds (0));
childNode->setAttribute ("stop_time", (double)timeLimits->getTimeMilliseconds (1));
}
示例13: process
void OutXmlSerializer::process(const char* name, Pointer* ptr, u32 elementSize)
{
XmlElement* data = new XmlElement;
data->setValue("data");
if (name)
data->setAttribute("name",name);
if ((&m_allocation.allocator()) != (&HeapAllocator::allocator()))
{
BufferStream temp;
temp << hex << setfill('0') << setw(8) << ptr->m_allocator->handle();
data->setAttribute("allocator",temp.string());
}
if (m_allocation.alignment() != SerializableAllocation::DefaultAlignment)
{
BufferStream temp;
temp << m_allocation.alignment();
data->setAttribute("align",temp.string());
}
if (ptr->m_count > 0)
{
BufferStream temp;
temp << ptr->m_count;
data->setAttribute("count",temp.string());
}
{
BufferStream temp;
temp << elementSize;
data->setAttribute("size",temp.string());
}
{
BufferStream temp;
Base64::encode(temp,ptr->m_objects,elementSize * ptr->m_count);
if (temp.buffer().count() > 0)
{
XmlText* text = zenic_new XmlText;
text->setValue(temp.string());
data->addChild(text);
}
}
ZENIC_ASSERT(m_current);
m_current->addChild(data);
m_allocation = SerializableAllocation();
}
示例14: applyToXml
void RelativePositionedRectangle::applyToXml (XmlElement& e) const
{
e.setAttribute ("pos", rect.toString());
if (relativeToX != 0)
e.setAttribute ("posRelativeX", String::toHexString (relativeToX));
if (relativeToY != 0)
e.setAttribute ("posRelativeY", String::toHexString (relativeToY));
if (relativeToW != 0)
e.setAttribute ("posRelativeW", String::toHexString (relativeToW));
if (relativeToH != 0)
e.setAttribute ("posRelativeH", String::toHexString (relativeToH));
}
示例15: saveCustomParameters
void FilterEditor::saveCustomParameters(XmlElement* xml)
{
xml->setAttribute("Type", "FilterEditor");
lastHighCutString = highCutValue->getText();
lastLowCutString = lowCutValue->getText();
XmlElement* textLabelValues = xml->createNewChildElement("VALUES");
textLabelValues->setAttribute("HighCut",lastHighCutString);
textLabelValues->setAttribute("LowCut",lastLowCutString);
textLabelValues->setAttribute("ApplyToADC", applyFilterOnADC->getToggleState());
}