MCPcopy Create free account
hub / github.com/asb2m10/dexed / getStateInformation

Method getStateInformation

Source/PluginData.cpp:312–375  ·  view source on GitHub ↗

==============================================================================

Source from the content-addressed store, hash-verified

310
311//==============================================================================
312void DexedAudioProcessor::getStateInformation(MemoryBlock& destData) {
313 // You should use this method to store your parameters in the memory block.
314 // You could do that either as raw data, or use the XML or ValueTree classes
315 // as intermediaries to make it easy to save and load complex data.
316
317 // used to SAVE plugin state
318
319 XmlElement dexedState("dexedState");
320 XmlElement *dexedBlob = dexedState.createNewChildElement("dexedBlob");
321
322 dexedState.setAttribute("cutoff", fx.uiCutoff);
323 dexedState.setAttribute("reso", fx.uiReso);
324 dexedState.setAttribute("gain", fx.uiGain);
325 dexedState.setAttribute("currentProgram", currentProgram);
326 dexedState.setAttribute("engineType", (int) engineType);
327 dexedState.setAttribute("masterTune", controllers.masterTune);
328 //TRACE("saving opswitch %s", controllers.opSwitch);
329 dexedState.setAttribute("opSwitch", controllers.opSwitch);
330 dexedState.setAttribute("transpose12AsScale", controllers.transpose12AsScale ? 1 : 0 );
331 dexedState.setAttribute("mpeEnabled", controllers.mpeEnabled ? 1 : 0 );
332 dexedState.setAttribute("mpePitchBendRange", controllers.mpePitchBendRange );
333 dexedState.setAttribute("monoMode", monoMode ? 1 : 0);
334 dexedState.setAttribute("portamento", controllers.portamento_cc);
335 dexedState.setAttribute("glissando", controllers.portamento_gliss_cc ? 1 : 0);
336
337 char mod_cfg[15];
338 controllers.wheel.setConfig(mod_cfg);
339 dexedState.setAttribute("wheelMod", mod_cfg);
340 controllers.foot.setConfig(mod_cfg);
341 dexedState.setAttribute("footMod", mod_cfg);
342 controllers.breath.setConfig(mod_cfg);
343 dexedState.setAttribute("breathMod", mod_cfg);
344 controllers.at.setConfig(mod_cfg);
345 dexedState.setAttribute("aftertouchMod", mod_cfg);
346
347 if( currentSCLData.size() > 1 || currentKBMData.size() > 1 )
348 {
349 auto tuningx = dexedState.createNewChildElement("dexedTuning" );
350 auto sclx = tuningx->createNewChildElement("scl");
351 sclx->addTextElement(currentSCLData);
352 auto kbmx = tuningx->createNewChildElement("kbm");
353 kbmx->addTextElement(currentKBMData);
354 }
355
356 if ( activeFileCartridge.exists() )
357 dexedState.setAttribute("activeFileCartridge", activeFileCartridge.getFullPathName());
358
359 NamedValueSet blobSet;
360 blobSet.set("sysex", var((void *) currentCart.getVoiceSysex(), 4104));
361 blobSet.set("program", var((void *) &data, 161));
362
363 blobSet.copyToXmlAttributes(*dexedBlob);
364
365 XmlElement *midiCC = dexedState.createNewChildElement("midiCC");
366 HashMap<int, Ctrl *>::Iterator i(mappedMidiCC);
367 while(i.next()) {
368 XmlElement *ccMapping = midiCC->createNewChildElement("mapping");
369 ccMapping->setAttribute("cc", i.getKey());

Callers

nothing calls this directly

Calls 4

setConfigMethod · 0.80
setMethod · 0.80
getVoiceSysexMethod · 0.80
getValueMethod · 0.80

Tested by

no test coverage detected