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();
}
예제 #2
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);
        }
    }
}
예제 #3
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();
    }
}
예제 #4
0
void SamplerProcessor::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);
        }
    }
}
예제 #5
0
void AutomizerAudioProcessor::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 != 0)
    {
        // make sure that it's actually our type of XML object..
        if(xmlState->hasTagName("AYOPLUGINSETTINGS"))
        {
            // ok, now pull out our parameters..
            lastUIWidth  = xmlState->getIntAttribute("uiWidth", lastUIWidth);
            lastUIHeight = xmlState->getIntAttribute("uiHeight", lastUIHeight);
            
            engine->outputGainPar   = (float)xmlState->getDoubleAttribute("OutputGain", engine->outputGainPar);
			engine->voice1GainPar   = (float)xmlState->getDoubleAttribute("Voice1Gain", engine->voice1GainPar);
			engine->voice2GainPar   = (float)xmlState->getDoubleAttribute("Voice2Gain", engine->voice2GainPar);
            engine->shiftTypePar    = (float)xmlState->getDoubleAttribute("PitchShiftType", engine->shiftTypePar);
            engine->transposePar    = (float)xmlState->getDoubleAttribute("Transpose", engine->transposePar);
			engine->panLPar         = (float)xmlState->getDoubleAttribute("PanVoice1",engine->panLPar);
			engine->panRPar         = (float)xmlState->getDoubleAttribute("PanVoice2", engine->panRPar);
			engine->keyPar          = (float)xmlState->getDoubleAttribute("Key", engine->keyPar);
			engine->scalePar        = (float)xmlState->getDoubleAttribute("Scale", engine->scalePar);
			engine->autotunePar     = (float)xmlState->getDoubleAttribute("Autotune", engine->autotunePar);
			engine->attackPar       = (float)xmlState->getDoubleAttribute("Attack", engine->attackPar);
			engine->referenceHzPar  = (float)xmlState->getDoubleAttribute("Reference", engine->referenceHzPar);	
			engine->shiftPar	    = (float)xmlState->getDoubleAttribute("TransposeOnOff", engine->shiftPar);	
			engine->rollOnPar		= (float)xmlState->getDoubleAttribute("RollOnOff", engine->rollOnPar);	
			engine->whiteningPar	= (float)xmlState->getDoubleAttribute("SpectralWhitening", engine->whiteningPar);	
			engine->harmonyPar		= (float)xmlState->getDoubleAttribute("SpectralShape", engine->harmonyPar);	
			engine->harm1AttackPar  = (float)xmlState->getDoubleAttribute("Harm1Attack", engine->harm1AttackPar);	
			engine->harm2AttackPar  = (float)xmlState->getDoubleAttribute("Harm2Attack", engine->harm2AttackPar);	
			engine->vDepth  = (float)xmlState->getDoubleAttribute("VibratoDepth", engine->vDepth);	
			engine->vRate  = (float)xmlState->getDoubleAttribute("Harm2Attack", engine->vRate);	
			engine->tunePar =  (float)xmlState->getDoubleAttribute("Tuning", engine->tunePar);	
		}
    }
}
예제 #6
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);

            offset->setValue ((float) xmlState->getDoubleAttribute ("gain", offset->getValue()));
            springConstant->setValue ((float) xmlState->getDoubleAttribute ("delay", springConstant->getValue()));
            velocityFactor->setValue ((float) xmlState->getDoubleAttribute ("velocity", velocityFactor->getValue()));
        }
    }
}
예제 #7
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 last window size..
            lastUIWidth  = xmlState->getIntAttribute ("uiWidth", lastUIWidth);
            lastUIHeight = xmlState->getIntAttribute ("uiHeight", lastUIHeight);

            // Now reload our parameters..
            for (int i = 0; i < getNumParameters(); ++i)
                if (AudioProcessorParameterWithID* p = dynamic_cast<AudioProcessorParameterWithID*> (getParameters().getUnchecked(i)))
                    p->setValueNotifyingHost ((float) xmlState->getDoubleAttribute (p->paramID, p->getValue()));
        }
    }
}
예제 #8
0
void Ambix_vmicAudioProcessor::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"))
        {
            for (int i=0; i < getNumParameters(); i++) {
                setParameter(i, xmlState->getDoubleAttribute(String(i)));
            }
            filter_sel_id_1 = xmlState->getIntAttribute("filter_sel_id_1", 0);
            filter_sel_id_2 = xmlState->getIntAttribute("filter_sel_id_2", 0);
        }
        
    }
}
void PluginAudioProcessor::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 != 0) {
		if (xmlState->hasTagName ("SyzygrydSettings")) {
			panelIndex = (int) xmlState->getIntAttribute ("panelIndex", panelIndex);

			float tmpFloat;
			tmpFloat = (float) xmlState->getDoubleAttribute ("noteLength", sequencer->getNoteLength());
			sequencer->setNoteLength (tmpFloat);

			tmpFloat = (float) xmlState->getDoubleAttribute ("swingTicks", sequencer->getSwingTicks());
			sequencer->setSwingTicks (tmpFloat);

         // XXX why do we get and then immediately set back to the same value?
			String state = SharedState::getInstance()->getStringPanelState (panelIndex);
			state = xmlState->getStringAttribute ("panelState", state);
			SharedState::getInstance()->setStringPanelState (panelIndex, state);
		}
	}
}