Hi @daniel
I am working with @sletz to try to streamline some of the process of going from Faust to Juce to PGM.
I am able to view the controls in the editor and I can change them. I am able to save the xml file. The xml file contents appear to make sense relative to the changes I made.
However, when I load the xml file, I just see the default layout again.
Also, it is not clear to me what the “Edit” button does. At one point when the canvas was blank it turned it all orange, but I couldn’t figure out what that means or how to make it happen again.
Any suggestions?
Here is a “grep” of all “magic” in the Faust CPP. One thing to note is that Faust puts everything into a single CPP file so it’s not straightforward, e.g. to delete the PluginEditor.cpp and .h.
};
#endif
// Using the PluginGuiMagic project (https://foleysfinest.com/developer/pluginguimagic/)
#if defined(PLUGIN_MAGIC)
class FaustPlugInAudioProcessor : public foleys::MagicProcessor, private juce::Timer
{
public:
juce::AudioProcessorValueTreeState treeState{ *this, nullptr };
FaustPlugInAudioProcessor();
JuceGUI fJuceGUI;
};
#ifndef PLUGIN_MAGIC
FaustPlugInAudioProcessor::FaustPlugInAudioProcessor()
: juce::AudioProcessor (getBusesProperties()), fParameterUI(this)
#else
FaustPlugInAudioProcessor::FaustPlugInAudioProcessor()
: foleys::MagicProcessor (getBusesProperties()), fParameterUI(this)
#endif
{
bool midi_sync = false;
int nvoices = 0;
mydsp* tmp_dsp = new mydsp();
MidiMeta::analyse(tmp_dsp, midi_sync, nvoices);
delete tmp_dsp;
#ifdef PLUGIN_MAGIC
auto defaultGUI = magicState.createDefaultGUITree();
magicState.setGuiValueTree(defaultGUI);
#endif
#ifdef JUCE_POLY
assert(nvoices > 0);
fSynth = std::make_unique<FaustSynthesiser>();
(FAUSTFLOAT**)buffer.getArrayOfWritePointers());
#endif
}
//==============================================================================
#ifndef PLUGIN_MAGIC
bool FaustPlugInAudioProcessor::hasEditor() const
{
return true;
}
juce::AudioProcessorEditor* FaustPlugInAudioProcessor::createEditor()
{
// You add the XML into BinaryData later. At the beginning just leave those
// arguments out and you get a default generated editor.
return new foleys::MagicPluginEditor(magicState, BinaryData::magic_xml, BinaryData::magic_xmlSize);
// return new FaustPlugInAudioProcessorEditor (*this);
}
//==============================================================================
void FaustPlugInAudioProcessor::getStateInformation (juce::MemoryBlock& destData)
Problem #1, eek, I left out the magicState…
Will continue to debug.