#include <algorithm>
-#include <gtkmm/table.h>
-#include <gtkmm/stock.h>
#include <gtkmm/button.h>
+#include <gtkmm/comboboxtext.h>
+#include <gtkmm/frame.h>
+#include <gtkmm/messagedialog.h>
#include <gtkmm/notebook.h>
+#include <gtkmm/stock.h>
+#include <gtkmm/table.h>
-#include <gtkmm2ext/utils.h>
-
+#include "gtkmm2ext/utils.h"
#include "pbd/convert.h"
+#include "widgets/tooltips.h"
#include "ardour/plugin_manager.h"
#include "ardour/plugin.h"
#include "plugin_selector.h"
#include "gui_thread.h"
-#include "tooltips.h"
#include "pbd/i18n.h"
using namespace PBD;
using namespace Gtk;
using namespace std;
-using namespace ARDOUR_UI_UTILS;
+using namespace ArdourWidgets;
static const char* _filter_mode_strings[] = {
N_("Name contains"),
btn_remove_clicked();
}
+static bool is_analyzer (const PluginInfoPtr& info) {
+ // Anaylsis, Analyzer are for backwards compatibility (vst cache)
+ return info->in_category ("Analyser") || info->in_category ("Anaylsis") || info->in_category ("Analyzer");
+}
+
+static bool is_util (const PluginInfoPtr& info) {
+ // all MIDI plugins which are not Instruments are Utils.
+ return info->in_category ("Utility") || info->in_category ("MIDI") || info->in_category ("Generator");
+}
+
bool
PluginSelector::show_this_plugin (const PluginInfoPtr& info, const std::string& filterstr)
{
if (_show_instruments == Gtkmm2ext::Off && info->is_instrument()) {
return false;
}
- if (_show_analysers == Gtkmm2ext::Off && info->in_category ("Analyser")) {
+ if (_show_analysers == Gtkmm2ext::Off && is_analyzer (info)) {
return false;
}
- if (_show_utils == Gtkmm2ext::Off && info->in_category ("Utility")) {
+ if (_show_utils == Gtkmm2ext::Off && is_util (info)) {
return false;
}
if (_show_instruments == Gtkmm2ext::ExplicitActive && info->is_instrument()) {
exp_ok = true;
}
- if (_show_analysers == Gtkmm2ext::ExplicitActive && info->in_category ("Analyser")) {
+ if (_show_analysers == Gtkmm2ext::ExplicitActive && is_analyzer(info)) {
exp_ok = true;
}
- if (_show_utils == Gtkmm2ext::ExplicitActive && info->in_category ("Utility")) {
+ if (_show_utils == Gtkmm2ext::ExplicitActive && is_util (info)) {
exp_ok = true;
}
if (_show_instruments == Gtkmm2ext::ExplicitActive || _show_analysers == Gtkmm2ext::ExplicitActive || _show_utils == Gtkmm2ext::ExplicitActive) {
case LXVST:
compstr = X_("LXVST");
break;
+ case MacVST:
+ compstr = X_("MacVST");
+ break;
case Lua:
compstr = X_("Lua");
break;
lv2_refiller (filterstr);
vst_refiller (filterstr);
lxvst_refiller (filterstr);
+ mac_vst_refiller (filterstr);
au_refiller (filterstr);
lua_refiller (filterstr);
#endif
}
+void
+#ifdef MACVST_SUPPORT
+PluginSelector::mac_vst_refiller (const std::string& filterstr)
+#else
+PluginSelector::mac_vst_refiller (const std::string&)
+#endif
+{
+#ifdef MACVST_SUPPORT
+ refiller (manager.mac_vst_plugin_info(), filterstr, "MacVST");
+#endif
+}
+
void
#ifdef AUDIOUNIT_SUPPORT
PluginSelector::au_refiller (const std::string& filterstr)
PluginPtr p = load_plugin (pp);
if (p) {
plugins.push_back (p);
- } else {
- MessageDialog msg (string_compose (_("The plugin \"%1\" could not be loaded\n\nSee the Log window for more details (maybe)"), pp->name));
- msg.run ();
- }
+ } else {
+ MessageDialog msg (string_compose (_("The plugin \"%1\" could not be loaded\n\nSee the Log window for more details (maybe)"), pp->name));
+ msg.run ();
+ }
}
if (interested_object && !plugins.empty()) {
finish = !interested_object->use_plugins (plugins);
- }
+ }
break;
}
struct PluginMenuCompareByCreator {
- bool operator() (PluginInfoPtr a, PluginInfoPtr b) const {
- int cmp;
-
- cmp = cmp_nocase_utf8 (a->creator, b->creator);
-
- if (cmp < 0) {
- return true;
- } else if (cmp == 0) {
- /* same creator ... compare names */
- if (cmp_nocase_utf8 (a->name, b->name) < 0) {
- return true;
- }
- }
- return false;
- }
+ bool operator() (PluginInfoPtr a, PluginInfoPtr b) const {
+ int cmp;
+
+ cmp = cmp_nocase_utf8 (a->creator, b->creator);
+
+ if (cmp < 0) {
+ return true;
+ } else if (cmp == 0) {
+ /* same creator ... compare names */
+ if (cmp_nocase_utf8 (a->name, b->name) < 0) {
+ return true;
+ }
+ }
+ return false;
+ }
};
struct PluginMenuCompareByName {
- bool operator() (PluginInfoPtr a, PluginInfoPtr b) const {
- int cmp;
-
- cmp = cmp_nocase_utf8 (a->name, b->name);
-
- if (cmp < 0) {
- return true;
- } else if (cmp == 0) {
- /* same name ... compare type */
- if (a->type < b->type) {
- return true;
- }
- }
- return false;
- }
+ bool operator() (PluginInfoPtr a, PluginInfoPtr b) const {
+ int cmp;
+
+ cmp = cmp_nocase_utf8 (a->name, b->name);
+
+ if (cmp < 0) {
+ return true;
+ } else if (cmp == 0) {
+ /* same name ... compare type */
+ if (a->type < b->type) {
+ return true;
+ }
+ }
+ return false;
+ }
};
struct PluginMenuCompareByCategory {
- bool operator() (PluginInfoPtr a, PluginInfoPtr b) const {
- int cmp;
-
- cmp = cmp_nocase_utf8 (a->category, b->category);
-
- if (cmp < 0) {
- return true;
- } else if (cmp == 0) {
- /* same category ... compare names */
- if (cmp_nocase_utf8 (a->name, b->name) < 0) {
- return true;
- }
- }
- return false;
- }
+ bool operator() (PluginInfoPtr a, PluginInfoPtr b) const {
+ int cmp;
+
+ cmp = cmp_nocase_utf8 (a->category, b->category);
+
+ if (cmp < 0) {
+ return true;
+ } else if (cmp == 0) {
+ /* same category ... compare names */
+ if (cmp_nocase_utf8 (a->name, b->name) < 0) {
+ return true;
+ }
+ }
+ return false;
+ }
};
/** @return Plugin menu. The caller should not delete it */
#ifdef LXVST_SUPPORT
all_plugs.insert (all_plugs.end(), manager.lxvst_plugin_info().begin(), manager.lxvst_plugin_info().end());
#endif
+#ifdef MACVST_SUPPORT
+ all_plugs.insert (all_plugs.end(), manager.mac_vst_plugin_info().begin(), manager.mac_vst_plugin_info().end());
+#endif
#ifdef AUDIOUNIT_SUPPORT
all_plugs.insert (all_plugs.end(), manager.au_plugin_info().begin(), manager.au_plugin_info().end());
#endif
items.push_back (MenuElem (_("By Category"), *manage (by_category)));
}
+string
+GetPluginTypeStr(PluginInfoPtr info)
+{
+ string type;
+
+ switch (info->type) {
+ case LADSPA:
+ type = X_(" (LADSPA)");
+ break;
+ case AudioUnit:
+ type = X_(" (AU)");
+ break;
+ case LV2:
+ type = X_(" (LV2)");
+ break;
+ case Windows_VST:
+ case LXVST:
+ case MacVST:
+ type = X_(" (VST)");
+ break;
+ case Lua:
+ type = X_(" (Lua)");
+ break;
+ }
+
+ return type;
+}
+
Gtk::Menu*
PluginSelector::create_favs_menu (PluginInfoList& all_plugs)
{
for (PluginInfoList::const_iterator i = all_plugs.begin(); i != all_plugs.end(); ++i) {
if (manager.get_status (*i) == PluginManager::Favorite) {
- MenuElem elem ((*i)->name, (sigc::bind (sigc::mem_fun (*this, &PluginSelector::plugin_chosen_from_menu), *i)));
+ string typ = GetPluginTypeStr(*i);
+ MenuElem elem ((*i)->name + typ, (sigc::bind (sigc::mem_fun (*this, &PluginSelector::plugin_chosen_from_menu), *i)));
elem.get_child()->set_use_underline (false);
favs->items().push_back (elem);
}
creator_submenu_map.insert (pair<std::string,Menu*> (creator, submenu));
submenu->set_name("ArdourContextMenu");
}
- MenuElem elem ((*i)->name, (sigc::bind (sigc::mem_fun (*this, &PluginSelector::plugin_chosen_from_menu), *i)));
+ string typ = GetPluginTypeStr(*i);
+ MenuElem elem ((*i)->name+typ, (sigc::bind (sigc::mem_fun (*this, &PluginSelector::plugin_chosen_from_menu), *i)));
elem.get_child()->set_use_underline (false);
submenu->items().push_back (elem);
}
category_submenu_map.insert (pair<std::string,Menu*> (category, submenu));
submenu->set_name("ArdourContextMenu");
}
- MenuElem elem ((*i)->name, (sigc::bind (sigc::mem_fun (*this, &PluginSelector::plugin_chosen_from_menu), *i)));
+ string typ = GetPluginTypeStr(*i);
+ MenuElem elem ((*i)->name + typ, (sigc::bind (sigc::mem_fun (*this, &PluginSelector::plugin_chosen_from_menu), *i)));
elem.get_child()->set_use_underline (false);
submenu->items().push_back (elem);
}