diff --git a/mixer/src/Plugin_Chooser.C b/mixer/src/Plugin_Chooser.C index c68d72e..19c9abb 100644 --- a/mixer/src/Plugin_Chooser.C +++ b/mixer/src/Plugin_Chooser.C @@ -62,8 +62,8 @@ Plugin_Chooser::search ( const char *name, const char *author, const char *categ { Plugin_Module::Plugin_Info *p = &(*i); - if ( strcasestr( p->name, name ) && - strcasestr( p->author, author ) ) + if ( strcasestr( p->name.c_str(), name ) && + strcasestr( p->author.c_str(), author ) ) { if ( ! ((( ( ninputs == 0 || ninputs == p->audio_inputs || ( ninputs == 1 && p->audio_inputs == 2 ) ) ) && @@ -80,10 +80,10 @@ Plugin_Chooser::search ( const char *name, const char *author, const char *categ if ( strcmp( category, "Any" ) ) { - if ( !p->category && strcmp( category, "Unclassified" )) + if ( !p->category.c_str() && strcmp( category, "Unclassified" )) continue; - if (strncmp( p->category, category, strlen( category ))) + if (strncmp( p->category.c_str(), category, strlen( category ))) continue; } @@ -178,11 +178,11 @@ void Plugin_Table::draw_cell(TableContext context, break; case 1: a = FL_ALIGN_LEFT; - s2 = _plugin_rows[R]->name; + s2 = _plugin_rows[R]->name.c_str(); break; case 2: a = FL_ALIGN_LEFT; - s2 = _plugin_rows[R]->author; + s2 = _plugin_rows[R]->author.c_str(); break; case 3: s2 = _plugin_rows[R]->type; @@ -340,7 +340,7 @@ Plugin_Chooser::load_categories ( void ) i != _plugins.end(); i++ ) { - if ( i->category ) + if ( i->category.c_str() ) { categories.push_back(i->category); } diff --git a/mixer/src/Plugin_Module.C b/mixer/src/Plugin_Module.C index 09126a1..0dee078 100644 --- a/mixer/src/Plugin_Module.C +++ b/mixer/src/Plugin_Module.C @@ -306,8 +306,8 @@ Plugin_Module::get_all_plugins ( void ) // pi[j].path = i->Name.c_str(); pi.path = NULL; pi.id = i->UniqueID; - pi.author = i->Maker.c_str(); - pi.name = i->Name.c_str(); + pi.author = i->Maker; + pi.name = i->Name; pi.audio_inputs = i->AudioInputs; pi.audio_outputs = i->AudioOutputs; pi.category = "Unclassified"; @@ -325,7 +325,7 @@ Plugin_Module::get_all_plugins ( void ) { if ( j->id == i->UniqueID ) { - j->category = i->Category.c_str(); + j->category = i->Category; } } } diff --git a/mixer/src/Plugin_Module.H b/mixer/src/Plugin_Module.H index 9ce0028..5fdfa9a 100644 --- a/mixer/src/Plugin_Module.H +++ b/mixer/src/Plugin_Module.H @@ -31,13 +31,14 @@ class Plugin_Module : public Module { public: - struct Plugin_Info + class Plugin_Info { + public: const char *path; unsigned long id; - const char *name; - const char *author; - const char *category; + std::string name; + std::string author; + std::string category; int audio_inputs; int audio_outputs; const char *type; @@ -47,17 +48,16 @@ public: { path = 0; id = 0; - name = 0; - author = 0; - category = 0; + audio_inputs = 0; audio_outputs = 0; type = "LADSPA"; favorite = 0; } + bool operator< ( const Plugin_Info &rhs ) { - return strcmp( name, rhs.name ) < 1; + return strcmp( name.c_str(), rhs.name.c_str() ) < 1; } };