当前位置: 首页>>代码示例>>C++>>正文


C++ XmlElement::setAttribute方法代码示例

本文整理汇总了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);
}
开发者ID:jrigg,项目名称:DISTRHO-Ports,代码行数:28,代码来源:PluginProcessor.cpp

示例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);
    }

}
开发者ID:KepecsLab,项目名称:GUI,代码行数:25,代码来源:VisualizerEditor.cpp

示例3: getStateInformation

//==============================================================================
void DemoJuceFilter::getStateInformation (MemoryBlock& destData)
{
	XmlElement xmlState (T("faust"));
	xmlState.setAttribute (T("pluginVersion"), 1);
	xmlState.setAttribute (T("pluginName"), getName());
	copyXmlToBinary (xmlState, destData);
}
开发者ID:remymuller,项目名称:faust2juce,代码行数:8,代码来源:DemoJuceFilter.cpp

示例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);
}
开发者ID:christianscheuer,项目名称:jivemodular,代码行数:28,代码来源:XSynthJuceFilter.cpp

示例5: XmlElement

//------------------------------------------------------------------------------
XmlElement *MidiAppMapping::getXml() const
{
	XmlElement *retval = new XmlElement("MidiAppMapping");

	retval->setAttribute("cc", cc);
	retval->setAttribute("commandId", id);

	return retval;
}
开发者ID:eriser,项目名称:guitareffectvst,代码行数:10,代码来源:MidiMappingManager.cpp

示例6: saveEditorParameters

void FilterEditor::saveEditorParameters(XmlElement* xml)
{

    xml->setAttribute("Type", "FilterEditor");

    XmlElement* textLabelValues = xml->createNewChildElement("VALUES");
    textLabelValues->setAttribute("HighCut",lastHighCutString);
    textLabelValues->setAttribute("LowCut",lastLowCutString);
}
开发者ID:,项目名称:,代码行数:9,代码来源:

示例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());

}
开发者ID:jerlich,项目名称:GUI,代码行数:9,代码来源:ControlPanel.cpp

示例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;
}
开发者ID:eriser,项目名称:guitareffectvst,代码行数:11,代码来源:OscMappingManager.cpp

示例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
}
开发者ID:Amcut,项目名称:pizmidi,代码行数:10,代码来源:ZoomingShiftingComponent.cpp

示例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());
    
}
开发者ID:awidge,项目名称:GUI,代码行数:10,代码来源:RecordControlEditor.cpp

示例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);
}
开发者ID:BrainDamage,项目名称:ambix,代码行数:28,代码来源:PluginProcessor.cpp

示例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));
}
开发者ID:410pfeliciano,项目名称:plugin-GUI,代码行数:12,代码来源:FileReaderEditor.cpp

示例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();
}
开发者ID:jsvennevid,项目名称:tbl-4edges,代码行数:53,代码来源:OutXmlSerializer.cpp

示例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));
}
开发者ID:furio,项目名称:pyplasm,代码行数:13,代码来源:jucer_UtilityFunctions.cpp

示例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());
}
开发者ID:eliezyer,项目名称:plugin-GUI,代码行数:13,代码来源:FilterEditor.cpp


注:本文中的XmlElement::setAttribute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。