@@ -214,6 +214,23 @@ void FilterGraph::clear() | |||||
changed(); | changed(); | ||||
} | } | ||||
void FilterGraph::clearKeepingInternals() | |||||
{ | |||||
if (panel != nullptr) | |||||
panel->closeAllCurrentlyOpenWindows(); | |||||
graph.clear(); | |||||
InternalPluginFormat internalFormat; | |||||
addFilter (internalFormat.getDescriptionFor (InternalPluginFormat::audioInputFilter), 0.5f, 0.1f); | |||||
addFilter (internalFormat.getDescriptionFor (InternalPluginFormat::midiInputFilter), 0.25f, 0.1f); | |||||
addFilter (internalFormat.getDescriptionFor (InternalPluginFormat::audioOutputFilter), 0.5f, 0.9f); | |||||
addFilter (internalFormat.getDescriptionFor (InternalPluginFormat::midiOutputFilter), 0.25f, 0.9f); | |||||
changed(); | |||||
} | |||||
//============================================================================== | //============================================================================== | ||||
String FilterGraph::getDocumentTitle() | String FilterGraph::getDocumentTitle() | ||||
{ | { | ||||
@@ -81,6 +81,7 @@ public: | |||||
uint32 destFilterUID, int destFilterChannel); | uint32 destFilterUID, int destFilterChannel); | ||||
void clear(); | void clear(); | ||||
void clearKeepingInternals(); | |||||
//============================================================================== | //============================================================================== | ||||
@@ -1084,9 +1084,6 @@ GraphDocumentComponent::GraphDocumentComponent (FilterGraph& g) | |||||
{ | { | ||||
addAndMakeVisible (graphPanel = new GraphEditorPanel (graph)); | addAndMakeVisible (graphPanel = new GraphEditorPanel (graph)); | ||||
// listen for audio/midi count change | |||||
//deviceManager->addChangeListener (graphPanel); | |||||
//keyState.addListener (&graphPlayer.getMidiMessageCollector()); | //keyState.addListener (&graphPlayer.getMidiMessageCollector()); | ||||
addAndMakeVisible (keyboardComp = new MidiKeyboardComponent (keyState, | addAndMakeVisible (keyboardComp = new MidiKeyboardComponent (keyState, | ||||
@@ -1103,9 +1100,6 @@ GraphDocumentComponent::~GraphDocumentComponent() | |||||
{ | { | ||||
graph.setPanel(nullptr); | graph.setPanel(nullptr); | ||||
// listen for audio/midi count change | |||||
//deviceManager->removeChangeListener (graphPanel); | |||||
deleteAllChildren(); | deleteAllChildren(); | ||||
//keyState.removeListener (&graphPlayer.getMidiMessageCollector()); | //keyState.removeListener (&graphPlayer.getMidiMessageCollector()); | ||||
@@ -92,9 +92,6 @@ MainHostWindow::MainHostWindow (AudioPluginFormatManager& fm, FilterGraph& graph | |||||
setVisible (true); | setVisible (true); | ||||
InternalPluginFormat internalFormat; | |||||
internalFormat.getAllTypes (internalTypes); | |||||
ScopedPointer<XmlElement> savedPluginList (appProperties.getUserSettings()->getXmlValue ("pluginList")); | ScopedPointer<XmlElement> savedPluginList (appProperties.getUserSettings()->getXmlValue ("pluginList")); | ||||
if (savedPluginList != nullptr) | if (savedPluginList != nullptr) | ||||
@@ -222,7 +219,7 @@ void MainHostWindow::menuItemSelected (int menuItemID, int /*topLevelMenuIndex*/ | |||||
if (menuItemID == 250) | if (menuItemID == 250) | ||||
{ | { | ||||
if (graphEditor != nullptr) | if (graphEditor != nullptr) | ||||
graphEditor->graph.clear(); | |||||
graphEditor->graph.clearKeepingInternals(); | |||||
} | } | ||||
else if (menuItemID >= 100 && menuItemID < 200) | else if (menuItemID >= 100 && menuItemID < 200) | ||||
{ | { | ||||
@@ -263,19 +260,11 @@ void MainHostWindow::createPlugin (const PluginDescription* desc, int x, int y) | |||||
void MainHostWindow::addPluginsToMenu (PopupMenu& m) const | void MainHostWindow::addPluginsToMenu (PopupMenu& m) const | ||||
{ | { | ||||
for (int i = 0; i < internalTypes.size(); ++i) | |||||
m.addItem (i + 1, internalTypes.getUnchecked(i)->name); | |||||
m.addSeparator(); | |||||
knownPluginList.addToMenu (m, pluginSortMethod); | knownPluginList.addToMenu (m, pluginSortMethod); | ||||
} | } | ||||
const PluginDescription* MainHostWindow::getChosenType (const int menuID) const | const PluginDescription* MainHostWindow::getChosenType (const int menuID) const | ||||
{ | { | ||||
if (menuID >= 1 && menuID < 1 + internalTypes.size()) | |||||
return internalTypes [menuID - 1]; | |||||
return knownPluginList.getType (knownPluginList.getIndexChosenByMenu (menuID)); | return knownPluginList.getType (knownPluginList.getIndexChosenByMenu (menuID)); | ||||
} | } | ||||
@@ -83,7 +83,6 @@ private: | |||||
//============================================================================== | //============================================================================== | ||||
AudioPluginFormatManager& formatManager; | AudioPluginFormatManager& formatManager; | ||||
OwnedArray <PluginDescription> internalTypes; | |||||
KnownPluginList knownPluginList; | KnownPluginList knownPluginList; | ||||
KnownPluginList::SortMethod pluginSortMethod; | KnownPluginList::SortMethod pluginSortMethod; | ||||