Fixed wrong plugin being removed
This commit is contained in:
+28
-3
@@ -286,12 +286,27 @@ void IconMenu::menuInvocationCallback(int id, IconMenu* im)
|
||||
im->deletePluginStates();
|
||||
|
||||
int index = id - im->activePluginList.getNumTypes() - 3;
|
||||
PluginDescription plugin = *im->activePluginList.getType(index);
|
||||
String key = "pluginOrder-" + plugin.descriptiveName + plugin.version + plugin.pluginFormatName;
|
||||
std::vector<PluginDescription> timeSorted = im->getTimeSortedList();
|
||||
String key = "pluginOrder-" + timeSorted[index].descriptiveName + timeSorted[index].version + timeSorted[index].pluginFormatName;
|
||||
int unsortedIndex = 0;
|
||||
for (int i = 0; im->activePluginList.getNumTypes(); i++)
|
||||
{
|
||||
PluginDescription current = *im->activePluginList.getType(i);
|
||||
if (key.equalsIgnoreCase("pluginOrder-" + current.descriptiveName + current.version + current.pluginFormatName))
|
||||
{
|
||||
unsortedIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove plugin order
|
||||
getAppProperties().getUserSettings()->removeValue(key);
|
||||
getAppProperties().saveIfNeeded();
|
||||
im->activePluginList.removeType(index);
|
||||
|
||||
// Remove plugin from list
|
||||
im->activePluginList.removeType(unsortedIndex);
|
||||
|
||||
// Save current states
|
||||
im->savePluginStates();
|
||||
im->loadActivePlugins();
|
||||
}
|
||||
@@ -322,6 +337,16 @@ void IconMenu::menuInvocationCallback(int id, IconMenu* im)
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<PluginDescription> IconMenu::getTimeSortedList()
|
||||
{
|
||||
int time = 0;
|
||||
std::vector<PluginDescription> list;
|
||||
for (int i = 0; i < activePluginList.getNumTypes(); i++)
|
||||
list.push_back(getNextPluginOlderThanTime(time));
|
||||
return list;
|
||||
|
||||
}
|
||||
|
||||
void IconMenu::deletePluginStates()
|
||||
{
|
||||
for (int i = 0; i < activePluginList.getNumTypes(); i++)
|
||||
|
||||
@@ -31,6 +31,7 @@ private:
|
||||
void deletePluginStates();
|
||||
PluginDescription getNextPluginOlderThanTime(int &time);
|
||||
void removePluginsLackingInputOutput();
|
||||
std::vector<PluginDescription> getTimeSortedList();
|
||||
|
||||
AudioDeviceManager deviceManager;
|
||||
AudioPluginFormatManager formatManager;
|
||||
|
||||
Reference in New Issue
Block a user