#include "ardour/plugin_manager.h"
#include "ardour/plugin.h"
+#include "ardour/utils.h"
#include "ardour_ui.h"
#include "plugin_selector.h"
in_row_change = false;
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());
build_plugin_menu ();
plugin_model = Gtk::ListStore::create (plugin_columns);
string::size_type pos = 0;
/* stupid LADSPA creator strings */
-
+#ifdef PLATFORM_WINDOWS
+ 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;
- creator = creator.substr (0, pos);
+#endif
+ // 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);
newrow[plugin_columns.creator] = creator;
PluginSelector::btn_update_clicked()
{
manager.refresh ();
- refill();
}
void
bool operator() (PluginInfoPtr a, PluginInfoPtr b) const {
int cmp;
- cmp = strcasecmp (a->creator.c_str(), b->creator.c_str());
+ cmp = cmp_nocase_utf8 (a->creator, b->creator);
if (cmp < 0) {
return true;
} else if (cmp == 0) {
/* same creator ... compare names */
- if (strcasecmp (a->name.c_str(), b->name.c_str()) < 0) {
+ if (cmp_nocase_utf8 (a->name, b->name) < 0) {
return true;
}
}
bool operator() (PluginInfoPtr a, PluginInfoPtr b) const {
int cmp;
- cmp = strcasecmp (a->name.c_str(), b->name.c_str());
+ cmp = cmp_nocase_utf8 (a->name, b->name);
if (cmp < 0) {
return true;
bool operator() (PluginInfoPtr a, PluginInfoPtr b) const {
int cmp;
- cmp = strcasecmp (a->category.c_str(), b->category.c_str());
+ cmp = cmp_nocase_utf8 (a->category, b->category);
if (cmp < 0) {
return true;
} else if (cmp == 0) {
/* same category ... compare names */
- if (strcasecmp (a->name.c_str(), b->name.c_str()) < 0) {
+ if (cmp_nocase_utf8 (a->name, b->name) < 0) {
return true;
}
}
/* stupid LADSPA creator strings */
string::size_type pos = 0;
+#ifdef PLATFORM_WINDOWS
+ while (pos < creator.length() && creator[pos]>(-2) && creator[pos]<256 && (isprint (creator[pos]))) ++pos;
+#else
while (pos < creator.length() && (isalnum (creator[pos]) || isspace (creator[pos]))) ++pos;
- creator = creator.substr (0, pos);
+#endif
+
+ // 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);
+ }
SubmenuMap::iterator x;
Gtk::Menu* submenu;