Plugin Host Tweak


#1

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.

GraphEditorPanel.cpp

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

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

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

#2

Sure, will add that.


#3

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.


#4

Doh! Will fix.


#5

Merci!