//============================================================================== 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); }
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); } }
//============================================================================== void DemoJuceFilter::getStateInformation (MemoryBlock& destData) { XmlElement xmlState (T("faust")); xmlState.setAttribute (T("pluginVersion"), 1); xmlState.setAttribute (T("pluginName"), getName()); copyXmlToBinary (xmlState, destData); }
//============================================================================== 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); }
//------------------------------------------------------------------------------ XmlElement *MidiAppMapping::getXml() const { XmlElement *retval = new XmlElement("MidiAppMapping"); retval->setAttribute("cc", cc); retval->setAttribute("commandId", id); return retval; }
void FilterEditor::saveEditorParameters(XmlElement* xml) { xml->setAttribute("Type", "FilterEditor"); XmlElement* textLabelValues = xml->createNewChildElement("VALUES"); textLabelValues->setAttribute("HighCut",lastHighCutString); textLabelValues->setAttribute("LowCut",lastLowCutString); }
void ControlPanel::saveStateToXml(XmlElement* xml) { XmlElement* controlPanelState = xml->createNewChildElement("CONTROLPANEL"); controlPanelState->setAttribute("isOpen",open); controlPanelState->setAttribute("prependText",prependText->getText()); controlPanelState->setAttribute("appendText",appendText->getText()); }
//------------------------------------------------------------------------------ XmlElement *OscAppMapping::getXml() const { XmlElement *retval = new XmlElement("OscAppMapping"); retval->setAttribute("address", address); retval->setAttribute("parameterIndex", parameter); retval->setAttribute("commandId", id); return retval; }
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 }
void RecordControlEditor::saveEditorParameters(XmlElement* xml) { XmlElement* info = xml->createNewChildElement("PARAMETERS"); info->setAttribute("Type", "RecordControlEditor"); info->setAttribute("Channel",availableChans->getSelectedId()); info->setAttribute("FileSaveOption",newFileToggleButton->getToggleState()); }
//============================================================================== 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); }
//------------------------------------------------------------------------------ XmlElement *OscMapping::getXml() const { XmlElement *retval = new XmlElement("OscMapping"); retval->setAttribute("pluginId", (int)getPluginId()); retval->setAttribute("parameter", getParameter()); retval->setAttribute("address", address); retval->setAttribute("parameterIndex", parameter); return retval; }
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)); }
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(); }
//------------------------------------------------------------------------------ XmlElement *MidiMapping::getXml() const { XmlElement *retval = new XmlElement(L"MidiMapping"); retval->setAttribute("pluginId", (int)getPluginId()); retval->setAttribute("parameter", getParameter()); retval->setAttribute("cc", cc); retval->setAttribute("latch", latched); retval->setAttribute("lowerBound", lowerBound); retval->setAttribute("upperBound", upperBound); return retval; }
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)); }
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()); }
void AudioEditor::saveStateToXml(XmlElement* xml) { XmlElement* audioEditorState = xml->createNewChildElement("AUDIOEDITOR"); audioEditorState->setAttribute("isMuted",muteButton->getToggleState()); audioEditorState->setAttribute("volume",volumeSlider->getValue()); audioEditorState->setAttribute("noiseGate",noiseGateSlider->getValue()); // String audioDeviceName = getAudioComponent()->deviceManager.getCurrentAudioDeviceType(); // audioEditorState->setAttribute("deviceType",audioDeviceName); }
XmlElement* ButtonDocument::createXml() const { XmlElement* const doc = JucerDocument::createXml(); for (int i = 0; i < 7; ++i) { XmlElement* e = paintRoutines [i]->createXml(); e->setAttribute ("buttonState", stateNames [i]); e->setAttribute ("enabled", paintStatesEnabled [i]); doc->addChildElement (e); } return doc; }
void PulsePalOutputEditor::saveCustomParameters(XmlElement* xml) { xml->setAttribute("Type", "PulsePalOutputEditor"); for (int i = 0; i < 4; i++) { XmlElement* outputXml = xml->createNewChildElement("OUTPUTCHANNEL"); outputXml->setAttribute("Number",i); outputXml->setAttribute("Trigger",channelTriggerInterfaces[i]->getTriggerChannel()); outputXml->setAttribute("Gate",channelTriggerInterfaces[i]->getGateChannel()); } }
//============================================================================== void SamplerProcessor::getStateInformation (MemoryBlock& destData) { // You should use this method to store your parameters in the memory block. // Here's an example of how you can use XML to make it easy and more robust: // Create an outer XML element.. XmlElement xml ("MYPLUGINSETTINGS"); // add some attributes to it.. xml.setAttribute ("uiWidth", lastUIWidth); xml.setAttribute ("uiHeight", lastUIHeight); // then use this helper function to stuff it into the binary blob and return it.. copyXmlToBinary (xml, destData); }
void OutXmlSerializer::pushGroup(const char* name, const char* type) { XmlElement* group = new XmlElement; group->setValue("group"); if (name) group->setAttribute("name",name); if (type) group->setAttribute("type",type); m_stack.pushBack(m_current); m_current->addChild(group); m_current = group; }
void FaustgenFactory::getStateInformation (XmlElement& xml) { xml.setAttribute ("version", FAUSTGEN_VERSION); if (fSourceCode.length()) { xml.setAttribute ("sourcecode", fSourceCode); } if (fDSPfactory) { std::string bitcode = writeDSPFactoryToBitcode(fDSPfactory); xml.setAttribute ("bitcode", String(bitcode)); } }
void PluginAudioProcessor::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. XmlElement xml ("SyzygrydSettings"); xml.setAttribute ("panelIndex", panelIndex); xml.setAttribute ("noteLength", sequencer->getNoteLength()); xml.setAttribute ("swingTicks", sequencer->getSwingTicks()); String state = SharedState::getInstance()->getStringPanelState (panelIndex); xml.setAttribute ("panelState", state); copyXmlToBinary (xml, destData); }
static XmlElement createKeyFileContent (const String& appName, const String& userEmail, const String& userName, const String& machineNumbers, const String& machineNumbersAttributeName) { XmlElement xml ("key"); xml.setAttribute ("user", userName); xml.setAttribute ("email", userEmail); xml.setAttribute (machineNumbersAttributeName, machineNumbers); xml.setAttribute ("app", appName); xml.setAttribute ("date", String::toHexString (Time::getCurrentTime().toMilliseconds())); return xml; }
XmlElement* THIS::toXmlElement(){ XmlElement* element = XmlParser::environment->newElement(getName()); std::string text=0; switch(axis){ case(X_UP):{ text = "X_UP"; break; } case(Y_UP):{ text = "Y_UP"; break; } case(Z_UP):{ text = "Z_UP"; break; } } element->setText(text); std::map<std::string,AbstractAttribute*>::iterator iter; iter = attributes.begin(); while(iter != attributes.end()){ element->setAttribute(iter->first,iter->second->toString()); iter++; } return element; }
//============================================================================== void Mcfx_convolverAudioProcessor::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 ("activePreset", activePreset); xml.setAttribute ("presetDir", presetDir.getFullPathName()); xml.setAttribute("ConvBufferSize", (int)_ConvBufferSize); // then use this helper function to stuff it into the binary blob and return it.. copyXmlToBinary (xml, destData); }
void pspRandomSystem::saveXml(juce::File xmlFile){ XmlElement* mainElement = new XmlElement("RandomTrajectory"); XmlElement* params = new XmlElement("parameterValues"); params->setAttribute("numParticles", (int)particles->size()); params->setAttribute("lxMin", (double)lx.min); params->setAttribute("lxMax", (double)lx.max); params->setAttribute("lyMin", (double)ly.min); params->setAttribute("lyMax", (double)ly.max); params->setAttribute("lzMin", (double)lz.min); params->setAttribute("lzMax", (double)lz.max); mainElement->addChildElement(params); mainElement->writeToFile(xmlFile, ""); mainElement->deleteAllChildElements(); delete mainElement; }
// ============================================================================================ XmlElement* InitComponent::createXmlSettings(AudioDeviceManager& adm) { XmlElement* res; try { res = new XmlElement ("DEVICESETUP"); } catch (std::bad_alloc) { return NULL; } AudioDeviceManager::AudioDeviceSetup adSetup; adm.getAudioDeviceSetup(adSetup); res->setAttribute ("deviceType", adm.getCurrentAudioDeviceType()); res->setAttribute ("audioOutputDeviceName", adSetup.outputDeviceName); res->setAttribute ("audioInputDeviceName", adSetup.inputDeviceName); res->setAttribute ("audioDeviceRate", adSetup.sampleRate); res->setAttribute ("audioDeviceBufferSize", adSetup.bufferSize); res->setAttribute ("audioDeviceInChans", adSetup.inputChannels.toString (2)); res->setAttribute ("audioDeviceOutChans", adSetup.outputChannels.toString (2)); return res; }
XmlElement* ComponentTypeHandler::createXmlFor (Component* comp, const ComponentLayout* layout) { XmlElement* e = new XmlElement (getXmlTagName()); e->setAttribute ("name", comp->getName()); e->setAttribute ("id", String::toHexString (getComponentId (comp))); e->setAttribute ("memberName", comp->getProperties() ["memberName"].toString()); e->setAttribute ("virtualName", comp->getProperties() ["virtualName"].toString()); e->setAttribute ("explicitFocusOrder", comp->getExplicitFocusOrder()); RelativePositionedRectangle pos (getComponentPosition (comp)); pos.updateFromComponent (*comp, layout); pos.applyToXml (*e); SettableTooltipClient* const ttc = dynamic_cast <SettableTooltipClient*> (comp); if (ttc != 0 && ttc->getTooltip().isNotEmpty()) e->setAttribute ("tooltip", ttc->getTooltip()); for (int i = 0; i < colours.size(); ++i) { if (comp->isColourSpecified (colours[i]->colourId)) { e->setAttribute (colours[i]->xmlTagName, colourToHex (comp->findColour (colours[i]->colourId))); } } return e; }