Example #1
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);
        }
    }
}
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();
        }
    }
}
Example #3
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();
}
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);
		}
	}
}
Example #5
0
static JucerDocument* createDocument (SourceCodeDocument* cpp)
{
    CodeDocument& codeDoc = cpp->getCodeDocument();

    ScopedPointer<XmlElement> xml (JucerDocument::pullMetaDataFromCppFile (codeDoc.getAllContent()));

    if (xml == nullptr || ! xml->hasTagName (JucerDocument::jucerCompXmlTag))
        return nullptr;

    const String docType (xml->getStringAttribute ("documentType"));

    ScopedPointer<JucerDocument> newDoc;

    if (docType.equalsIgnoreCase ("Button"))
        newDoc = new ButtonDocument (cpp);

    if (docType.equalsIgnoreCase ("Component") || docType.isEmpty())
        newDoc = new ComponentDocument (cpp);

    if (newDoc != nullptr && newDoc->reloadFromDocument())
        return newDoc.release();

    return nullptr;
}