//==============================================================================
void JenSx1000AudioProcessor::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.
    
    Program currentProgram("Current Program");
    
    currentProgram.vcoTune = vcoTuneParam->getValue();
    currentProgram.vcoOctave = vcoOctaveParam->getValue();
    currentProgram.vcoVibrato = vcoVibratoParam->getValue();
    currentProgram.vcoWaveform = vcoWaveformParam->getValue();
    currentProgram.vcoPulseWidth = vcoPulseWidthParam->getValue();
    currentProgram.vcoPWM = vcoPWMParam->getValue();
    currentProgram.vcoLevel = vcoLevelParam->getValue();
    currentProgram.vcoGlide = vcoGlideParam->getValue();
    currentProgram.lfoSpeed = lfoSpeedParam->getValue();
    currentProgram.vcfFrequency = vcfFrequencyParam->getValue();
    currentProgram.vcfResonance = vcfResonanceParam->getValue();
    currentProgram.vcfLFO = vcfLFOParam->getValue();
    currentProgram.vcfEnvLevel = vcfEnvLevelParam->getValue();
    currentProgram.vcfAttack = vcfAttackParam->getValue();
    currentProgram.vcfDecay = vcfDecayParam->getValue();
    currentProgram.vcfSustain = vcfSustainParam->getValue();
    currentProgram.vcfRelease = vcfReleaseParam->getValue();
    currentProgram.noiseNoise = noiseNoiseParam->getValue();
    currentProgram.noiseLevel = noiseLevelParam->getValue();
    currentProgram.vcaOutputVolume = vcaOutputVolumeParam->getValue();
    currentProgram.vcaAttack = vcaAttackParam->getValue();
    currentProgram.vcaDecay = vcaDecayParam->getValue();
    currentProgram.vcaSustain = vcaSustainParam->getValue();
    currentProgram.vcaRelease = vcaReleaseParam->getValue();
    
    copyXmlToBinary (currentProgram.getProgrameAsXmlElement(), destData);
}
Esempio n. 2
0
void VstPlugin::saveSettings( QDomDocument & _doc, QDomElement & _this )
{
	if( pluginWidget() != NULL )
	{
		_this.setAttribute( "guivisible", pluginWidget()->isVisible() );
	}

	// try to save all settings in a chunk
	QByteArray chunk = saveChunk();
	if( !chunk.isEmpty() )
	{
		_this.setAttribute( "chunk", QString( chunk.toBase64() ) );
	}
	else
	{
		// plugin doesn't seem to support chunks, therefore save
		// individual parameters
		const QMap<QString, QString> & dump = parameterDump();
		_this.setAttribute( "numparams", dump.size() );
		for( QMap<QString, QString>::const_iterator it = dump.begin();
							it != dump.end(); ++it )
		{
			_this.setAttribute( it.key(), it.value() );
		}
	}

	_this.setAttribute( "program", currentProgram() );
}