foleys_gui_magic icon indicating copy to clipboard operation
foleys_gui_magic copied to clipboard

Unable to build example project: SignalGenerator

Open godofecht opened this issue 2 years ago • 1 comments

I get the following error: Use of class template 'juce::Component::SafePointer' requires template arguments

System: Mac OS M1 JUCE: 7.0.2

godofecht avatar Sep 21 '23 09:09 godofecht

Changing the line in juce::Component::SafePointerjuce::AudioProcessorEditor safeEditor (editor); worked for me.

in foleys_MagicProcessorState...

`void MagicProcessorState::setStateInformation (const void* data, int sizeInBytes, juce::AudioProcessorEditor* editor) { auto tree = juce::ValueTree::readFromData (data, size_t (sizeInBytes)); if (tree.isValid() == false) return;

auto newState = getValueTree();
if (newState.getType() != tree.getType())
    return;

newState.copyPropertiesAndChildrenFrom (tree, nullptr);

parameters.loadParameterValues (newState);

if (editor)
{
    int width, height;

    if (getLastEditorSize (width, height))
    {
        juce::Component::SafePointer<juce::AudioProcessorEditor> safeEditor (editor);
        juce::MessageManager::callAsync([safeEditor, width, height]
                                        {
            if (safeEditor)
                safeEditor->setSize (width, height);
                                        });
    }
}

}`

May I submit a PR?

godofecht avatar Sep 21 '23 10:09 godofecht