예제 #1
0
void PitchedDelayAudioProcessor::setStateInformation (const void* data, int sizeInBytes)
{
	ScopedPointer<XmlElement> xml(getXmlFromBinary(data, sizeInBytes));

	if (xml != 0 && xml->getTagName() == "PitchedDelay")
	{
		const bool extendedsync = xml->hasAttribute("extended");

		for (int i=0; i<getNumParameters(); ++i)
		{
			const String paramName(getParameterName(i));

			float val = (float) xml->getDoubleAttribute(paramName, -1000);

			if (! extendedsync && paramName.contains("Sync"))
				val = val*7/9;

			if (! extendedsync && paramName.contains("PitchType"))
				val = val*5/8;			

			if (val > -1000)
				setParameterNotifyingHost(i, val);
		}

		const int curTab = xml->getIntAttribute("currentTab", -1000);
		showTooltips = xml->getIntAttribute("showtooltips") == 1;
		currentTab = curTab > -1000 ? curTab : 0;
	}


}
void DemoJuceFilter::setStateInformation (const void* data, int sizeInBytes)
{
    // use this helper function to get the XML from this binary blob..
    XmlElement* const xmlState = getXmlFromBinary (data, sizeInBytes);

    if (xmlState != 0)
    {
        // check that it's the right type of xml..
        if (xmlState->hasTagName (T("XSynthPatch")))
        {
            // ok, now pull out our parameters..
            gain = (float) xmlState->getDoubleAttribute (T("gainLevel"), gain);

            lastUIWidth = xmlState->getIntAttribute (T("uiWidth"), lastUIWidth);
            lastUIHeight = xmlState->getIntAttribute (T("uiHeight"), lastUIHeight);

         for (int i=0; i<getNumParameters(); i++)
         {
            DBG(String("Loading parameter ") + getParameterXMLName(i) + String(" to ") + String(xmlState->getDoubleAttribute(getParameterXMLName(i))));
               setParameter(i, xmlState->getDoubleAttribute(getParameterXMLName(i)));
         }


            sendChangeMessage (this);
        }

        delete xmlState;
    }
}
예제 #3
0
void OppressorPlugin::setStateInformation (const void* data, int sizeInBytes)
{
    // use this helper function to get the XML from this binary blob..
    XmlElement* const xmlState = getXmlFromBinary (data, sizeInBytes);

    if (xmlState != 0)
    {
        // check that it's the right type of xml..
        if (xmlState->hasTagName (T("OPPRESSORSETTINGS")))
        {
            // ok, now pull out our parameters..
     //       gain = (float) xmlState->getDoubleAttribute (T("gainLevel"), gain);
			setParameter(OppressorParMan::thresh,(float) xmlState->getDoubleAttribute (T("thresh"), 
				getParameter(OppressorParMan::thresh)));
			setParameter(OppressorParMan::ratio,(float) xmlState->getDoubleAttribute (T("ratio"), 
				getParameter(OppressorParMan::ratio)));
			setParameter(OppressorParMan::level,(float) xmlState->getDoubleAttribute (T("level"), 
				getParameter(OppressorParMan::level)));
			setParameter(OppressorParMan::attack,(float) xmlState->getDoubleAttribute (T("attack"), 
				getParameter(OppressorParMan::attack)));
			setParameter(OppressorParMan::release,(float) xmlState->getDoubleAttribute (T("release"), 
				getParameter(OppressorParMan::release)));
			setParameter(OppressorParMan::limiter,(float) xmlState->getDoubleAttribute (T("limiter"), 
				getParameter(OppressorParMan::limiter)));

            sendChangeMessage (this);
        }

        delete xmlState;
    }
}
예제 #4
0
void DemoJuceFilter::setStateInformation (const void* data, int sizeInBytes)
{
    XmlElement* const xmlState = getXmlFromBinary (data, sizeInBytes);
    if (xmlState != 0)
    {
        if (xmlState->hasTagName (T("BITMUNGLER")))
        {
			Logger::writeToLog (xmlState->createDocument (String::empty));

			xorProcessing = xmlState->getBoolAttribute (T("xorProcessing"));
			andProcessing = xmlState->getBoolAttribute (T("andProcessing"));
			clearProcessing = xmlState->getBoolAttribute (T("clearProcessing"));
			setProcessing = xmlState->getBoolAttribute (T("setProcessing"));

			unserializeArray (xmlState->getStringAttribute (T("xorBits")), xorBits);
			xorWith = xmlState->getBoolAttribute (T("xorWith"));

			unserializeArray (xmlState->getStringAttribute (T("andBits")), andBits);
			andWith = xmlState->getBoolAttribute (T("andWith"));

			unserializeArray (xmlState->getStringAttribute (T("setBits")), setBits);
			unserializeArray (xmlState->getStringAttribute (T("clearBits")), clearBits);
        }
        delete xmlState;
    }

	sendChangeMessage (this);
}
void DetunerPlugin::setStateInformation (const void* data, int sizeInBytes)
{
    // use this helper function to get the XML from this binary blob..
    XmlElement* const xmlState = getXmlFromBinary (data, sizeInBytes);

    if (xmlState != 0)
    {
        // check that it's the right type of xml..
        if (xmlState->hasTagName (T("DETUNERSETTINGS")))
        {
			
			setParameter(DetunerParMan::fine,(float) xmlState->getDoubleAttribute (T("fine"), 
				getParameter(DetunerParMan::fine)));
			setParameter(DetunerParMan::mix,(float) xmlState->getDoubleAttribute (T("mix"), 
				getParameter(DetunerParMan::mix)));
			setParameter(DetunerParMan::output,(float) xmlState->getDoubleAttribute (T("output"), 
				getParameter(DetunerParMan::output)));
			setParameter(DetunerParMan::chunk,(float) xmlState->getDoubleAttribute (T("chunk"), 
				getParameter(DetunerParMan::chunk)));
			//temppr = xmlState->getIntAttribute(T("default"));


            sendChangeMessage (this);
        }

        delete xmlState;
    }
	
}
예제 #6
0
void RingmodAudioProcessor::setStateInformation (const void* data, int sizeInBytes)
{
    // You should use this method to restore your parameters from this memory block,
    // whose contents will have been created by the getStateInformation() call.

    ScopedPointer<XmlElement> xmlState (getXmlFromBinary (data, sizeInBytes));
    
    if (xmlState != nullptr)
    {

        // make sure that it's actually our type of XML object..
        if (xmlState->hasTagName ("ringmodsettnigs"))
        {
            // ok, now pull out our parameters..
            setParameterNotifyingHost(MasterBypass,(float) xmlState->getDoubleAttribute ("Bypass", UserParams[MasterBypass]));
            setParameterNotifyingHost(Frequency,(float) xmlState->getDoubleAttribute ("Frequency", UserParams[Frequency]));
            setParameterNotifyingHost(ModSetting,(float)xmlState->getDoubleAttribute("ModSetting",UserParams[ModSetting]));
            setParameterNotifyingHost(Drive, (float)xmlState->getDoubleAttribute("Drive",UserParams[Drive]));
            setParameterNotifyingHost(LFOAmount, (float)xmlState->getDoubleAttribute("LFOAmount",UserParams[LFOAmount]));
            setParameterNotifyingHost(LFORate, (float)xmlState->getDoubleAttribute("LFORate",UserParams[LFORate]));
            setParameterNotifyingHost(LFOWaveType, (float)xmlState->getDoubleAttribute("LFOWaveType",UserParams[LFOWaveType]));
        }
    }

}
예제 #7
0
void IAAEffectProcessor::setStateInformation (const void* data, int sizeInBytes)
{
    auto xmlState = std::unique_ptr<XmlElement> (getXmlFromBinary (data, sizeInBytes));
    if (xmlState.get() != nullptr)
        if (xmlState->hasTagName (parameters.state.getType()))
            parameters.state = ValueTree::fromXml (*xmlState);
}
예제 #8
0
void Mcfx_convolverAudioProcessor::setStateInformation (const void* data, int sizeInBytes)
{
    // You should use this method to restore your parameters from this memory block,
    // whose contents will have been created by the getStateInformation() call.
    
    ScopedPointer<XmlElement> xmlState (getXmlFromBinary (data, sizeInBytes));
    
    if (xmlState != nullptr)
    {
        String newPresetDir;
        
        // make sure that it's actually our type of XML object..
        if (xmlState->hasTagName ("MYPLUGINSETTINGS"))
        {
            // ok, now pull out our parameters..
            activePreset  = xmlState->getStringAttribute("activePreset", "");
            
            newPresetDir = xmlState->getStringAttribute("presetDir", presetDir.getFullPathName());
            
            _ConvBufferSize = xmlState->getIntAttribute("ConvBufferSize", _ConvBufferSize);
        }
        
        if (activePreset.isNotEmpty()) {
            LoadPresetByName(activePreset);
        }
        
        File tempDir(newPresetDir);
        if (tempDir.exists()) {
            presetDir = tempDir;
            SearchPresets(presetDir);
        }
    }
}
예제 #9
0
void TheFunctionAudioProcessor::setStateInformation (const void* data, int sizeInBytes)
{
    // You should use this method to restore your parameters from this memory block,
    // whose contents will have been created by the getStateInformation() call.

	timeSinceChunkCalled = Time::getMillisecondCounter();
	 ScopedPointer<XmlElement> xmlState (getXmlFromBinary (data, sizeInBytes));

    if (xmlState != 0)
    {
        // make sure that it's actually our type of XML object..
        if (xmlState->hasTagName ("MYPLUGINSETTINGS"))
        {
            // ok, now pull out our parameters..
           // gain  = xmlState->getIntAttribute ("gain", gain);
            //lastUIHeight = xmlState->getIntAttribute ("uiHeight", lastUIHeight);

            gain  = (float) xmlState->getDoubleAttribute ("gain", gain);

			gainL  = (float) xmlState->getDoubleAttribute ("gainL", gainL);
			gainR  = (float) xmlState->getDoubleAttribute ("gainR", gainR);

			panL  = (float) xmlState->getDoubleAttribute ("panL", panL);
			panR  = (float) xmlState->getDoubleAttribute ("panR", panR);

			phaseL  = (float) xmlState->getDoubleAttribute ("phaseL", phaseL);
			phaseR  = (float) xmlState->getDoubleAttribute ("phaseR", phaseR);

           // delay = (float) xmlState->getDoubleAttribute ("delay", delay);
        }
    }
}
예제 #10
0
void Pfm2AudioProcessor::setStateInformation (const void* data, int sizeInBytes)
{
    // You should use this method to restore your parameters from this memory block,
    // whose contents will have been created by the getStateInformation() call.

    // This getXmlFromBinary() helper function retrieves our XML from the binary blob..
    ScopedPointer<XmlElement> xmlState (getXmlFromBinary (data, sizeInBytes));

    if (xmlState != nullptr)
    {
        String name = xmlState->getStringAttribute("presetName");
        for (int k=0; k<13; k++) {
            presetName[k] = 0;
        }
        for (int k=0; k<13 && name.toRawUTF8()[k] != 0; k++) {
            presetName[k] = name.toRawUTF8()[k];
        }
        if (pfm2Editor) {
            pfm2Editor->setPresetName(presetName);
        }
        printf(">>> PresetName : %s\n", presetName);
        // make sure that it's actually our type of XML object..
        if (xmlState->hasTagName ("PreenFM2AppStatus")) {
            
            for (int k=0; k<NUMBER_OF_PROGRAM; k++) {
                if (xmlState->getStringAttribute("Preset" + String(k)) != String::empty){
                    programName[k] = xmlState->getStringAttribute("Preset" + String(k));
                }
            }
            
            double value;
            for (int p=0; p< parameterSet.size(); p++) {
                if (p == nrpmIndex[2047]) continue;

                if (xmlState->getStringAttribute(teragon::Parameter::makeSafeName(parameterSet[p]->getName()).c_str()) != String::empty) {
                    value  = (float) xmlState->getDoubleAttribute (teragon::Parameter::makeSafeName(parameterSet[p]->getName()).c_str(), value);
                    parameterSet.setScaled(p, value, this);
                } else {
                    printf("Cannot set %d : %s\n", p, parameterSet[p]->getName().c_str());
                }
            }
            parameterSet.processRealtimeEvents();
			// If no UI we must set current
			currentMidiChannel = parameterSet[nrpmIndex[2045]]->getValue();
			
            // REDRAW UI
            for (int p=0; p< parameterSet.size(); p++) {
                const MidifiedFloatParameter* midifiedFP = dynamic_cast<const MidifiedFloatParameter*>(parameterSet[p]);
                if (midifiedFP != nullptr) {
					parametersToUpdateMutex.lock();
                    parametersToUpdate.insert(midifiedFP->getName().c_str());
					parametersToUpdateMutex.unlock();
                }
            }

            // Flush NRPN
            flushAllParametrsToNrpn();
        }
    }
}
예제 #11
0
void JuceDemoPluginAudioProcessor::setStateInformation(const void* data, int sizeInBytes)
{
    // You should use this method to restore your parameters from this memory block,
    // whose contents will have been created by the getStateInformation() call.

    // This getXmlFromBinary() helper function retrieves our XML from the binary blob..
    ScopedPointer<XmlElement> xmlState(getXmlFromBinary(data, sizeInBytes));

    if (xmlState != nullptr)
    {
        // make sure that it's actually our type of XML object..
        if (xmlState->hasTagName("MYPLUGINSETTINGS"))
        {
            // ok, now pull out our parameters..
            lastUIWidth = xmlState->getIntAttribute("uiWidth", lastUIWidth);
            lastUIHeight = xmlState->getIntAttribute("uiHeight", lastUIHeight);
            wetGain = (float)xmlState->getDoubleAttribute("wetGain", wetGain);
            delayAmount = (float)xmlState->getDoubleAttribute("delayAmount", delayAmount);
            delayTime = (float)xmlState->getDoubleAttribute("delayTime", delayTime);
            delayFeedbackAmount = (float)xmlState->getDoubleAttribute("delayFeedback", delayFeedbackAmount);
            pan = (float)xmlState->getDoubleAttribute("pan", pan);
            dryOn = (float)xmlState->getDoubleAttribute("dryOn", dryOn);
            midSide = (float)xmlState->getDoubleAttribute("midSide", midSide);
            roomSize = (float)xmlState->getDoubleAttribute("roomSize", roomSize);
			roomDamp = (float)xmlState->getDoubleAttribute("roomDamp", roomDamp);
            hpfFreq = (float)xmlState->getDoubleAttribute("hpfFreq", hpfFreq);
            hpfQ = (float)xmlState->getDoubleAttribute("hpfQ", hpfQ);
			saturationAmount = (float)xmlState->getDoubleAttribute("saturation",saturationAmount);
			midOn = (float)xmlState->getDoubleAttribute("midOn",midOn);
            lpfFreqValue = (float)xmlState->getDoubleAttribute("lpfFreq", lpfFreqValue);
            lpfQValue = (float)xmlState->getDoubleAttribute("lpfQ", lpfQValue);
        }
    }
}
void SignalProcessorAudioProcessor::setStateInformation (const void* data, int sizeInBytes)
{
        
    // Restore the parameters from this memory block,
    // whose contents will have been created by the getStateInformation() call.
    // This getXmlFromBinary() helper function retrieves our XML from the binary blob..
    ScopedPointer<XmlElement> xmlState (getXmlFromBinary (data, sizeInBytes));
    
    if (xmlState != nullptr)
    {
        // make sure that it's actually our type of XML object
        if (xmlState->hasTagName ("MYPLUGINSETTINGS"))
        {
            // now pull out our parameters..
            averagingBufferSize     = xmlState->getIntAttribute  ("averagingBufferSize", averagingBufferSize);
            fftAveragingWindow      = (float) xmlState->getDoubleAttribute ("fftAveragingWindow", fftAveragingWindow);
            inputSensitivity        = (float) xmlState->getDoubleAttribute ("inputSensitivity", inputSensitivity);
            sendTimeInfo            = xmlState->getBoolAttribute ("sendTimeInfo", sendTimeInfo);
            sendSignalLevel         = xmlState->getBoolAttribute ("sendSignalLevel", sendSignalLevel);
            sendImpulse             = xmlState->getBoolAttribute ("sendImpulse", sendImpulse);
            sendFFT                 = xmlState->getBoolAttribute ("sendFFT", sendFFT);
            channel                 = xmlState->getIntAttribute  ("channel", channel);
            monoStereo              = xmlState->getBoolAttribute ("monoStereo", monoStereo);
            logarithmicFFT          = xmlState->getBoolAttribute ("logarithmicFFT", logarithmicFFT);
            averageEnergyBufferSize = xmlState->getIntAttribute  ("averageEnergyBufferSize", averageEnergyBufferSize);
            sendOSC                 = xmlState->getBoolAttribute ("sendOSC", sendOSC);
            sendBinaryUDP           = xmlState->getBoolAttribute ("sendBinaryUDP", sendBinaryUDP);
            instantSigValGain       = (float) xmlState->getDoubleAttribute ("instantSigValGain", instantSigValGain);
            instantSigValNbOfSamplesSkipped = (float) xmlState->getDoubleAttribute ("instantSigValNbOfSamplesSkipped", instantSigValNbOfSamplesSkipped);
        }
    }
    
    //Build the default Signal Messages, and preallocate the char* which will receive their serialized data
    defineDefaultSignalMessages();
}
예제 #13
0
void Ambix_converterAudioProcessor::setStateInformation (const void* data, int sizeInBytes)
{
    // You should use this method to restore your parameters from this memory block,
    // whose contents will have been created by the getStateInformation() call.
    
    ScopedPointer<XmlElement> xmlState (getXmlFromBinary (data, sizeInBytes));
    
    if (xmlState != nullptr)
    {
        
        // make sure that it's actually our type of XML object..
        if (xmlState->hasTagName ("MYPLUGINSETTINGS"))
        {
            // ok, now pull out our parameters..
            
            box_presets_text = xmlState->getStringAttribute("box_presets", "");
            setParameterNotifyingHost(FlipCsParam, (float) xmlState->getDoubleAttribute("flip_cs_phase"));
            setParameterNotifyingHost(FlipParam, (float) xmlState->getDoubleAttribute("flip_param"));
            setParameterNotifyingHost(FlopParam, (float) xmlState->getDoubleAttribute("flop_param"));
            setParameterNotifyingHost(FlapParam, (float) xmlState->getDoubleAttribute("flap_param"));
            setParameterNotifyingHost(InSeqParam, (float) xmlState->getDoubleAttribute("in_seq_param"));
            setParameterNotifyingHost(OutSeqParam, (float) xmlState->getDoubleAttribute("out_seq_param"));
            setParameterNotifyingHost(InNormParam, (float) xmlState->getDoubleAttribute("in_norm_param"));
            setParameterNotifyingHost(OutNormParam, (float) xmlState->getDoubleAttribute("out_norm_param"));
            setParameterNotifyingHost(In2DParam, (float) xmlState->getDoubleAttribute("in_2d_param"));
            setParameterNotifyingHost(Out2DParam, (float) xmlState->getDoubleAttribute("out_2d_param"));
        }
        
        
    }
    
    // reset arrays...
    //setNormalizationScheme();
    //setChannelSequence();
}
예제 #14
0
void HoaToolsAudioProcessor::setStateInformation (const void* data, int sizeInBytes)
{
    char name[256];
    ScopedPointer<XmlElement> xmlState (getXmlFromBinary (data, sizeInBytes));

    if (xmlState != nullptr)
    {
        if (xmlState->hasTagName("HoaToolsSettings"))
        {
            setNumberOfSources(xmlState->getIntAttribute("NumberOfSources"));

            for (int i = 0; i < getNumberOfSources(); i++)
            {
                sprintf(name, "Abscissa%i", i);
                m_sources->sourceSetAbscissa(i, xmlState->getDoubleAttribute(name));
                sprintf(name, "Ordinate%i", i);
                m_sources->sourceSetOrdinate(i, xmlState->getDoubleAttribute(name));
            }
        }
    }

    AudioProcessorEditor* Editor = NULL;
    Editor = getActiveEditor();
    if(Editor)
    {
        Editor->repaint();
    }
}
예제 #15
0
void StocSynthAudioProcessor::setStateInformation (const void* data, int sizeInBytes)
{
    ScopedPointer<XmlElement> xmlState (getXmlFromBinary (data, sizeInBytes));

    if (xmlState != nullptr)
    {
        if (xmlState->hasTagName ("STOCSETTINGS"))
        {
            toneAmp = (float) xmlState->getDoubleAttribute("toneAmp", toneAmp);
            a135 = (float) xmlState->getDoubleAttribute("a135", a135);
            a246 = (float) xmlState->getDoubleAttribute("a246", a246);
            a789 = (float) xmlState->getDoubleAttribute("a789", a789);
            sub = (float) xmlState->getDoubleAttribute("sub", sub);
            var135 = (float) xmlState->getDoubleAttribute("var135", var135);
            var246 = (float) xmlState->getDoubleAttribute("var246", var246);
            var789 = (float) xmlState->getDoubleAttribute("var789", var789);
            pitch135 = (float) xmlState->getDoubleAttribute("pitch135", pitch135);
            pitch246 = (float) xmlState->getDoubleAttribute("pitch246", pitch246);
            pitch789 = (float) xmlState->getDoubleAttribute("pitch789", pitch789);
            cutoff = (float) xmlState->getDoubleAttribute("cutoff", cutoff);
            res = (float) xmlState->getDoubleAttribute("res", res);
            ampA = (float) xmlState->getDoubleAttribute("ampA", ampA);
            ampD = (float) xmlState->getDoubleAttribute("ampD", ampD);
            ampS = (float) xmlState->getDoubleAttribute("ampS", ampS);
            ampR = (float) xmlState->getDoubleAttribute("ampR", ampR);
            gain  = (float) xmlState->getDoubleAttribute ("gain", gain);
        }
    }
}
void AudioProcessorValueTreeStateDemoAudioProcessor::setStateInformation (const void* data, int sizeInBytes)
{
    DBG("Restore XML");
    // You should use this method to restore your parameters from this memory block,
    // whose contents will have been created by the getStateInformation() call.
    ScopedPointer<XmlElement> xmlState (getXmlFromBinary (data, sizeInBytes));
    parameters.state = ValueTree::fromXml(*xmlState);
    parameters.undoManager->clearUndoHistory();    
}
예제 #17
0
void Processor::setStateInformation (const void* data, int sizeInBytes)
{
  juce::ScopedPointer<juce::XmlElement> element(getXmlFromBinary(data, sizeInBytes));
  if (element)
  {
    const juce::File irDirectory = _settings.getImpulseResponseDirectory();
    LoadState(irDirectory, *element, *this);
  }
}
예제 #18
0
void CtrlrProcessor::setStateInformation (const void* data, int sizeInBytes)
{
	_DBG("CtrlrProcessor::setStateInformation");
	ScopedPointer<XmlElement> xmlState (getXmlFromBinary (data, sizeInBytes));

	if (xmlState)
	{
		setStateInformation (xmlState);
	}
}
예제 #19
0
void SuperSpreadAudioProcessor::setStateInformation (const void* data, int sizeInBytes)
{
    ScopedPointer<XmlElement> xml(getXmlFromBinary(data, sizeInBytes));

    if (xml != nullptr)
    {
        for (int i=0; i<getNumParameters(); ++i)
            setParameterNotifyingHost(i, static_cast<float> (xml->getDoubleAttribute(getParameterName(i), getParameter(i))));
    }
}
예제 #20
0
void Plugin::setStateInformation (const void* data, int sizeInBytes)
{
    //load bank from host
    XmlElement* const xml_state = getXmlFromBinary(data, sizeInBytes);
    if (xml_state != 0) {
        program_bank->loadBankFromXml(xml_state);
        setCurrentProgram(current_program);
        delete xml_state;
        editor_program_update_pending = true;
    }
}
예제 #21
0
// set state, including the view status, from a binary blob stored in host.
//
void MLPluginProcessor::setStateFromBlob (const void* data, int sizeInBytes)
{
	debug() << "setStateFromBlob: " << sizeInBytes << "bytes of XML data.\n";
	XmlElementPtr xmlState(getXmlFromBinary (data, sizeInBytes));
	if (xmlState)
	{
        bool setViewAttributes = true;
		setStateFromXML(*xmlState, setViewAttributes);
		mpLatestStateLoaded = xmlState;
	}
}
예제 #22
0
void BeatboxVoxAudioProcessor::setStateInformation(const void* data, int sizeInBytes)
{
	// You should use this method to restore your parameters from this memory block,
	// whose contents will have been created by the getStateInformation() call.
	std::unique_ptr<XmlElement> xmlState(getXmlFromBinary(data, sizeInBytes));

	if (xmlState.get() != nullptr)
	{
		if (xmlState->hasTagName(processorState.state.getType()))
			processorState.state = ValueTree::fromXml(*xmlState);
	}
}
예제 #23
0
void DemoJuceFilter::setStateInformation (const void* data, int sizeInBytes)
{
    XmlElement* const xmlState = getXmlFromBinary (data, sizeInBytes);
    if (xmlState != 0)
    {
        if (xmlState->hasTagName (T("MYPLUGINSETTINGS")))
        {
            sendChangeMessage (this);
        }
        delete xmlState;
    }
}
void LuftikusAudioProcessor::setStateInformation (const void* data, int sizeInBytes)
{
	ScopedPointer<XmlElement> xml(getXmlFromBinary(data, sizeInBytes));

	if (xml != nullptr)
	{
		for (int i=0; i<getNumParameters(); ++i)
			setParameterNotifyingHost(i, (float) xml->getDoubleAttribute(getParameterName(i).replace(" ", "_", false).replace(".", "-", false)));

		showTooltips = xml->getBoolAttribute("tooltips", true);
	}
}
예제 #25
0
void JuceBoxAudioProcessor::setStateInformation (const void* data, int sizeInBytes)
{
	Logger::writeToLog("- setStateInformation().");
	ScopedPointer<XmlElement> xmlState(getXmlFromBinary(data, sizeInBytes));
	if (xmlState) {
		if (xmlState->hasTagName("JuceBox")) {
			String sampleFilePath = xmlState->getStringAttribute("sampleFile");
			Logger::writeToLog("- sampleFile = " + sampleFilePath);
			sampleFile = sampleFilePath;
			loadSound();
			}
		}
}
예제 #26
0
void DemoJuceFilter::setStateInformation (const void* data, int sizeInBytes)
{ 
	XmlElement* const xmlState = getXmlFromBinary (data, sizeInBytes);
	if (xmlState != 0)
	{
		// check that it's the right type of xml..
		if (xmlState->hasTagName (T("faust")))
		{
			sendChangeMessage (this);
		}		
		delete xmlState;
	}
}
예제 #27
0
void JenSx1000AudioProcessor::setStateInformation (const void* data, int sizeInBytes)
{
    // You should use this method to restore your parameters from this memory block,
    // whose contents will have been created by the getStateInformation() call.
    
    Program* newProgram = new Program("New Program");
    
    ScopedPointer<XmlElement> xmlState (getXmlFromBinary (data, sizeInBytes));
    
    newProgram -> setProgramFromXml(xmlState);
    
    setProgram(newProgram);
    
    
}
예제 #28
0
void Tunefish4AudioProcessor::setStateInformation (const void* data, int sizeInBytes)
{
    ScopedPointer<XmlElement> xmlState (getXmlFromBinary (data, sizeInBytes));

    if (xmlState != nullptr)
    {
        // make sure that it's actually our type of XML object..
        if (xmlState->hasTagName ("TF4SETTINGS"))
        {
            for (eU32 i=0; i<TF_PARAM_COUNT; i++)
            {
                tf->params[i] = (float) xmlState->getDoubleAttribute (TF_NAMES[i], tf->params[i]);
            }
        }
    }
}
예제 #29
0
void InstanceProcessor::setStateInformation (const void* data, int sizeInBytes)
{
    ScopedPointer<XmlElement> xml(getXmlFromBinary(data, sizeInBytes));
    if(xml != nullptr)
    {
        if(xml->hasTagName("CamomileSettings"))
        {
            String name = xml->getStringAttribute("name");
            String path = xml->getStringAttribute("path");
            if(File::isAbsolutePath(path))
            {
                File file(path + File::separatorString + name);
                if(!file.exists())
                {
                    file = File(m_path + File::separatorString + name);
                    if(!file.exists())
                    {
                        file = File(File::getCurrentWorkingDirectory().getFullPathName() + File::separatorString + name);
                        if(!file.exists())
                        {
                            file = File(File::getSpecialLocation(juce::File::SpecialLocationType::userDocumentsDirectory).getFullPathName() + File::separatorString + name);
                            if(!file.exists())
                            {
                                file = File(path + File::separatorString + name);
                            }
                        }
                    }
                }
                loadPatch(name.toStdString(), path.toStdString());
            }
            
            XmlElement* params = xml->getChildByName(juce::StringRef("params"));
            if(params)
            {
                for(int i = 0; i < params->getNumAttributes(); i++)
                {
                    int index = getParameterIndex(params->getAttributeName(i));
                    if(index >= 0)
                    {
                        setParameterNotifyingHost(index, params->getAttributeValue(i).getDoubleValue());
                    }
                }
            }
        }
    }
}
예제 #30
0
//=============================================================================
void KawaMidSideAudioProcessor::setStateInformation (const void* data, int sizeInBytes)
{
    ScopedPointer<XmlElement> xmlState( getXmlFromBinary (data, sizeInBytes) );
    //=========================================================================
    if ( xmlState != nullptr )
    {
        if ( xmlState->hasTagName( "kawaMidSide_Parameter" ) )
        {
            bool isMideMode_ = xmlState->getBoolAttribute( "isMidMode", false );
            bool isDoubleMode_ = xmlState->getBoolAttribute( "isDoubleLevelMode", false );
            //=================================================================
            setDoubleLevelMode( isDoubleMode_ );
            setMidMode( isMideMode_ );
            //=================================================================
        }
    }
    //=========================================================================
}