#include "gui_thread.h"
#include "tooltips.h"
-#include "i18n.h"
+#include "pbd/i18n.h"
using namespace ARDOUR;
using namespace PBD;
manager.PluginListChanged.connect (plugin_list_changed_connection, invalidator (*this), boost::bind (&PluginSelector::build_plugin_menu, this), gui_context());
manager.PluginListChanged.connect (plugin_list_changed_connection, invalidator (*this), boost::bind (&PluginSelector::refill, this), gui_context());
+ manager.PluginStatusesChanged.connect (plugin_list_changed_connection, invalidator (*this), boost::bind (&PluginSelector::build_plugin_menu, this), gui_context());
+ manager.PluginStatusesChanged.connect (plugin_list_changed_connection, invalidator (*this), boost::bind (&PluginSelector::refill, this), gui_context());
build_plugin_menu ();
plugin_model = Gtk::ListStore::create (plugin_columns);
plugin_display.set_headers_clickable (true);
plugin_display.set_reorderable (false);
plugin_display.set_rules_hint (true);
+ plugin_display.add_object_drag (plugin_columns.plugin.index(), "PluginInfoPtr");
+ plugin_display.set_drag_column (plugin_columns.name.index());
+
+ // setting a sort-column prevents re-ordering via Drag/Drop
+ plugin_model->set_sort_column (plugin_columns.name.index(), Gtk::SORT_ASCENDING);
CellRendererToggle* fav_cell = dynamic_cast<CellRendererToggle*>(plugin_display.get_column_cell_renderer (0));
fav_cell->property_activatable() = true;
filter_frame->show_all ();
+ HBox* side_by_side = manage (new HBox);
+ VBox* right_side = manage (new VBox);
+
table->attach (scroller, 0, 7, 0, 5);
table->attach (*filter_frame, 0, 7, 6, 7, FILL|EXPAND, FILL, 5, 5);
- table->attach(*btn_add, 1, 2, 7, 8, FILL, FILL, 5, 5);
- table->attach(*btn_remove, 5, 6, 7, 8, FILL, FILL, 5, 5);
- table->attach(ascroller, 0, 7, 8, 10);
+ right_side->pack_start (ascroller);
+
+ HBox* add_remove = manage (new HBox);
+ add_remove->pack_start (*btn_add, true, true);
+ add_remove->pack_start (*btn_remove, true, true);
+
+ right_side->pack_start (*add_remove, false, false);
+ right_side->set_size_request (200, -1);
+
+ side_by_side->pack_start (*table);
+ side_by_side->pack_start (*right_side);
add_button (Stock::CLOSE, RESPONSE_CLOSE);
add_button (_("Insert Plugin(s)"), RESPONSE_APPLY);
set_default_response (RESPONSE_APPLY);
set_response_sensitive (RESPONSE_APPLY, false);
- get_vbox()->pack_start (*table);
+ get_vbox()->pack_start (*side_by_side);
table->set_name("PluginSelectorTable");
plugin_display.set_name("PluginSelectorDisplay");
if (_show_instruments == Gtkmm2ext::Off && info->is_instrument()) {
return false;
}
- if (_show_analysers == Gtkmm2ext::Off && info->category == "Analyser") {
+ if (_show_analysers == Gtkmm2ext::Off && info->in_category ("Analyser")) {
return false;
}
- if (_show_utils == Gtkmm2ext::Off && info->category == "Utility") {
+ if (_show_utils == Gtkmm2ext::Off && info->in_category ("Utility")) {
return false;
}
if (_show_instruments == Gtkmm2ext::ExplicitActive && info->is_instrument()) {
exp_ok = true;
}
- if (_show_analysers == Gtkmm2ext::ExplicitActive && info->category == "Analyser") {
+ if (_show_analysers == Gtkmm2ext::ExplicitActive && info->in_category ("Analyser")) {
exp_ok = true;
}
- if (_show_utils == Gtkmm2ext::ExplicitActive && info->category == "Utility") {
+ if (_show_utils == Gtkmm2ext::ExplicitActive && info->in_category ("Utility")) {
exp_ok = true;
}
if (_show_instruments == Gtkmm2ext::ExplicitActive || _show_analysers == Gtkmm2ext::ExplicitActive || _show_utils == Gtkmm2ext::ExplicitActive) {
case LXVST:
compstr = X_("LXVST");
break;
+ case Lua:
+ compstr = X_("Lua");
+ break;
}
} else if (mode == _("Author contains")) {
vst_refiller (filterstr);
lxvst_refiller (filterstr);
au_refiller (filterstr);
+ lua_refiller (filterstr);
in_row_change = false;
}
string creator = (*i)->creator;
string::size_type pos = 0;
- /* stupid LADSPA creator strings */
+ if ((*i)->type == ARDOUR::LADSPA) {
+ /* stupid LADSPA creator strings */
#ifdef PLATFORM_WINDOWS
- while (pos < creator.length() && creator[pos] > -2 && creator[pos] < 256 && (isalnum (creator[pos]) || isspace (creator[pos]))) ++pos;
+ while (pos < creator.length() && creator[pos] > -2 && creator[pos] < 256 && (isalnum (creator[pos]) || isspace (creator[pos]))) ++pos;
#else
- while (pos < creator.length() && (isalnum (creator[pos]) || isspace (creator[pos]))) ++pos;
+ while (pos < creator.length() && (isalnum (creator[pos]) || isspace (creator[pos]))) ++pos;
#endif
+ } else {
+ pos = creator.length ();
+ }
// If there were too few characters to create a
// meaningful name, mark this creator as 'Unknown'
- if (creator.length()<2 || pos<3)
+ if (creator.length() < 2 || pos < 3) {
creator = "Unknown";
- else
+ } else{
creator = creator.substr (0, pos);
+ }
newrow[plugin_columns.creator] = creator;
refiller (manager.ladspa_plugin_info(), filterstr, "LADSPA");
}
+void
+PluginSelector::lua_refiller (const std::string& filterstr)
+{
+ refiller (manager.lua_plugin_info(), filterstr, "Lua");
+}
+
void
PluginSelector::lv2_refiller (const std::string& filterstr)
{
PluginInfoList all_plugs;
all_plugs.insert (all_plugs.end(), manager.ladspa_plugin_info().begin(), manager.ladspa_plugin_info().end());
+ all_plugs.insert (all_plugs.end(), manager.lua_plugin_info().begin(), manager.lua_plugin_info().end());
#ifdef WINDOWS_VST_SUPPORT
all_plugs.insert (all_plugs.end(), manager.windows_vst_plugin_info().begin(), manager.windows_vst_plugin_info().end());
#endif
if (manager.get_status (*i) == PluginManager::Hidden) continue;
string creator = (*i)->creator;
-
- /* stupid LADSPA creator strings */
string::size_type pos = 0;
+
+ if ((*i)->type == ARDOUR::LADSPA) {
+ /* stupid LADSPA creator strings */
#ifdef PLATFORM_WINDOWS
- while (pos < creator.length() && creator[pos]>(-2) && creator[pos]<256 && (isprint (creator[pos]))) ++pos;
+ while (pos < creator.length() && creator[pos] > -2 && creator[pos] < 256 && (isalnum (creator[pos]) || isspace (creator[pos]))) ++pos;
#else
- while (pos < creator.length() && (isalnum (creator[pos]) || isspace (creator[pos]))) ++pos;
+ while (pos < creator.length() && (isalnum (creator[pos]) || isspace (creator[pos]))) ++pos;
#endif
+ } else {
+ pos = creator.length ();
+ }
- // Check to see if we found any invalid characters.
- if (creator.length() != pos) {
- // If there were too few characters to create a
- // meaningful name, mark this creator as 'Unknown'
- if (pos<3)
- creator = "Unknown?";
- else
- creator = creator.substr (0, pos);
+ // If there were too few characters to create a
+ // meaningful name, mark this creator as 'Unknown'
+ if (creator.length() < 2 || pos < 3) {
+ creator = "Unknown";
+ } else{
+ creator = creator.substr (0, pos);
}
SubmenuMap::iterator x;
break;
default: assert(0); break; // not reached
}
+ /* impossible, but keep some compiles happy */
+ fatal << string_compose (_("programming error: %1"),
+ X_("Illegal Active State."))
+ << endmsg;
+ abort(); /*NOTREACHED*/
+ return Gtkmm2ext::Off;
}
static Gtkmm2ext::ActiveState prev_state (Gtkmm2ext::ActiveState s){
break;
default: assert(0); break; // not reached
}
+ /* impossible, but keep some compiles happy */
+ fatal << string_compose (_("programming error: %1"),
+ X_("Illegal Active State."))
+ << endmsg;
+ abort(); /*NOTREACHED*/
+ return Gtkmm2ext::Off;
}
bool