1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-07 04:10:08 +00:00

Made the plugin host demo close its plugin windows before attempting to quit.

This commit is contained in:
jules 2012-04-18 09:52:05 +01:00
parent eb028b7c33
commit a16aee5fa5
4 changed files with 75 additions and 93 deletions

View file

@ -61,8 +61,15 @@ void PluginWindow::closeCurrentlyOpenWindowsFor (const uint32 nodeId)
void PluginWindow::closeAllCurrentlyOpenWindows()
{
for (int i = activePluginWindows.size(); --i >= 0;)
delete activePluginWindows.getUnchecked(i);
if (activePluginWindows.size() > 0)
{
for (int i = activePluginWindows.size(); --i >= 0;)
delete activePluginWindows.getUnchecked(i);
Component dummyModalComp;
dummyModalComp.enterModalState();
MessageManager::getInstance()->runDispatchLoopUntil (50);
}
}
PluginWindow* PluginWindow::getWindowFor (AudioProcessorGraph::Node* node,
@ -84,9 +91,7 @@ PluginWindow* PluginWindow::getWindowFor (AudioProcessorGraph::Node* node,
}
if (useGenericView)
{
ui = new GenericAudioProcessorEditor (node->getProcessor());
}
if (ui != nullptr)
{
@ -701,8 +706,7 @@ private:
//==============================================================================
GraphEditorPanel::GraphEditorPanel (FilterGraph& graph_)
: graph (graph_),
draggingConnector (nullptr)
: graph (graph_)
{
graph.addChangeListener (this);
setOpaque (true);
@ -711,7 +715,7 @@ GraphEditorPanel::GraphEditorPanel (FilterGraph& graph_)
GraphEditorPanel::~GraphEditorPanel()
{
graph.removeChangeListener (this);
deleteAndZero (draggingConnector);
draggingConnector = nullptr;
deleteAllChildren();
}
@ -866,7 +870,6 @@ void GraphEditorPanel::beginConnectorDrag (const uint32 sourceFilterID, const in
const uint32 destFilterID, const int destFilterChannel,
const MouseEvent& e)
{
delete draggingConnector;
draggingConnector = dynamic_cast <ConnectorComponent*> (e.originalComponent);
if (draggingConnector == nullptr)
@ -897,9 +900,9 @@ void GraphEditorPanel::dragConnector (const MouseEvent& e)
if (pin != nullptr)
{
uint32 srcFilter = draggingConnector->sourceFilterID;
int srcChannel = draggingConnector->sourceFilterChannel;
int srcChannel = draggingConnector->sourceFilterChannel;
uint32 dstFilter = draggingConnector->destFilterID;
int dstChannel = draggingConnector->destFilterChannel;
int dstChannel = draggingConnector->destFilterChannel;
if (srcFilter == 0 && ! pin->isInput)
{
@ -938,11 +941,11 @@ void GraphEditorPanel::endDraggingConnector (const MouseEvent& e)
const MouseEvent e2 (e.getEventRelativeTo (this));
uint32 srcFilter = draggingConnector->sourceFilterID;
int srcChannel = draggingConnector->sourceFilterChannel;
int srcChannel = draggingConnector->sourceFilterChannel;
uint32 dstFilter = draggingConnector->destFilterID;
int dstChannel = draggingConnector->destFilterChannel;
int dstChannel = draggingConnector->destFilterChannel;
deleteAndZero (draggingConnector);
draggingConnector = nullptr;
PinComponent* const pin = findPinAt (e2.x, e2.y);