Mixer/Plugin_Chooser: Fix corruption of name display.

pull/116/head
Jonathan Moore Liles 2013-09-24 21:39:10 -07:00
parent 200bfe91ca
commit 504b77f6c7
3 changed files with 18 additions and 18 deletions

View File

@ -62,8 +62,8 @@ Plugin_Chooser::search ( const char *name, const char *author, const char *categ
{ {
Plugin_Module::Plugin_Info *p = &(*i); Plugin_Module::Plugin_Info *p = &(*i);
if ( strcasestr( p->name, name ) && if ( strcasestr( p->name.c_str(), name ) &&
strcasestr( p->author, author ) ) strcasestr( p->author.c_str(), author ) )
{ {
if ( ! if ( !
((( ( ninputs == 0 || ninputs == p->audio_inputs || ( ninputs == 1 && p->audio_inputs == 2 ) ) ) && ((( ( 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 ( strcmp( category, "Any" ) )
{ {
if ( !p->category && strcmp( category, "Unclassified" )) if ( !p->category.c_str() && strcmp( category, "Unclassified" ))
continue; continue;
if (strncmp( p->category, category, strlen( category ))) if (strncmp( p->category.c_str(), category, strlen( category )))
continue; continue;
} }
@ -178,11 +178,11 @@ void Plugin_Table::draw_cell(TableContext context,
break; break;
case 1: case 1:
a = FL_ALIGN_LEFT; a = FL_ALIGN_LEFT;
s2 = _plugin_rows[R]->name; s2 = _plugin_rows[R]->name.c_str();
break; break;
case 2: case 2:
a = FL_ALIGN_LEFT; a = FL_ALIGN_LEFT;
s2 = _plugin_rows[R]->author; s2 = _plugin_rows[R]->author.c_str();
break; break;
case 3: case 3:
s2 = _plugin_rows[R]->type; s2 = _plugin_rows[R]->type;
@ -340,7 +340,7 @@ Plugin_Chooser::load_categories ( void )
i != _plugins.end(); i != _plugins.end();
i++ ) i++ )
{ {
if ( i->category ) if ( i->category.c_str() )
{ {
categories.push_back(i->category); categories.push_back(i->category);
} }

View File

@ -306,8 +306,8 @@ Plugin_Module::get_all_plugins ( void )
// pi[j].path = i->Name.c_str(); // pi[j].path = i->Name.c_str();
pi.path = NULL; pi.path = NULL;
pi.id = i->UniqueID; pi.id = i->UniqueID;
pi.author = i->Maker.c_str(); pi.author = i->Maker;
pi.name = i->Name.c_str(); pi.name = i->Name;
pi.audio_inputs = i->AudioInputs; pi.audio_inputs = i->AudioInputs;
pi.audio_outputs = i->AudioOutputs; pi.audio_outputs = i->AudioOutputs;
pi.category = "Unclassified"; pi.category = "Unclassified";
@ -325,7 +325,7 @@ Plugin_Module::get_all_plugins ( void )
{ {
if ( j->id == i->UniqueID ) if ( j->id == i->UniqueID )
{ {
j->category = i->Category.c_str(); j->category = i->Category;
} }
} }
} }

View File

@ -31,13 +31,14 @@ class Plugin_Module : public Module {
public: public:
struct Plugin_Info class Plugin_Info
{ {
public:
const char *path; const char *path;
unsigned long id; unsigned long id;
const char *name; std::string name;
const char *author; std::string author;
const char *category; std::string category;
int audio_inputs; int audio_inputs;
int audio_outputs; int audio_outputs;
const char *type; const char *type;
@ -47,17 +48,16 @@ public:
{ {
path = 0; path = 0;
id = 0; id = 0;
name = 0;
author = 0;
category = 0;
audio_inputs = 0; audio_inputs = 0;
audio_outputs = 0; audio_outputs = 0;
type = "LADSPA"; type = "LADSPA";
favorite = 0; favorite = 0;
} }
bool operator< ( const Plugin_Info &rhs ) { bool operator< ( const Plugin_Info &rhs ) {
return strcmp( name, rhs.name ) < 1; return strcmp( name.c_str(), rhs.name.c_str() ) < 1;
} }
}; };