Plugin Host Tweak


Hey Jules,

I’ve a tweak to the host that I would like to request - perhaps everybody can benefit from it: make the GraphEditorPanel instance listen to the AudioDeviceManager instance so that when I/O changes occur, the Audio Input and Audio Output filter nodes get refreshed right away.


GraphDocumentComponent::GraphDocumentComponent (AudioPluginFormatManager& formatManager,
                                                AudioDeviceManager* deviceManager_)
    : graph (formatManager), deviceManager (deviceManager_)
    addAndMakeVisible (graphPanel = new GraphEditorPanel (graph));

    deviceManager->addChangeListener (graphPanel); //Addition here
    deviceManager->removeAudioCallback (&graphPlayer);
    deviceManager->removeMidiInputCallback (String::empty, &graphPlayer.getMidiMessageCollector());

    deviceManager->removeChangeListener (graphPanel); //Addition here


Sure, will add that.


You’ve put the “deviceManager->addChangeListener (graphPanel);anddeviceManager->removeChangeListener (graphPanel);” within the constructor of GraphDocumentComponent… not really sure how that helps :smiley:

deviceManager->removeChangeListener (graphPanel);” should be in the destructor instead.


Doh! Will fix.