summaryrefslogtreecommitdiff
path: root/gtk2_ardour/plugin_selector.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-05-01 16:27:11 +0200
committerRobin Gareus <robin@gareus.org>2016-05-01 16:27:11 +0200
commit13b9476f4018090d71ba22aa031e0213a6b521ab (patch)
tree17ae9a72ea59e3d03a78fd5a315eab46640e4d56 /gtk2_ardour/plugin_selector.cc
parente6b95a3d6577b6f66bcaaab6f795483bfc9ab6ed (diff)
fix plugin-creator display for non LADSPA plugins
e.g. "u-he"
Diffstat (limited to 'gtk2_ardour/plugin_selector.cc')
-rw-r--r--gtk2_ardour/plugin_selector.cc41
1 files changed, 24 insertions, 17 deletions
diff --git a/gtk2_ardour/plugin_selector.cc b/gtk2_ardour/plugin_selector.cc
index 6d9c6ff7af..4845ba706c 100644
--- a/gtk2_ardour/plugin_selector.cc
+++ b/gtk2_ardour/plugin_selector.cc
@@ -404,18 +404,23 @@ PluginSelector::refiller (const PluginInfoList& plugs, const::std::string& filte
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;
@@ -791,23 +796,25 @@ PluginSelector::create_by_creator_menu (ARDOUR::PluginInfoList& all_plugs)
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;