Mixer: Work around some quirks in hints of some plugins.

This commit is contained in:
Jonathan Moore Liles 2013-09-06 23:08:46 -07:00
parent 963d926659
commit 933bfe882a
3 changed files with 18 additions and 5 deletions

View File

@ -109,11 +109,14 @@ Fl_DialX::draw ( void )
if ( Fl::belowmouse() == this )
{
char s[10];
char s[128];
fl_font( FL_HELVETICA, 10 );
fl_font( FL_HELVETICA, 9 );
snprintf( s, sizeof( s ), "%.1f", value() );
char buf[128];
format(buf);
snprintf( s, sizeof( s ), buf, value() );
fl_color( FL_FOREGROUND_COLOR );
fl_draw( s, X, Y, S, S, FL_ALIGN_CENTER );

View File

@ -231,6 +231,11 @@ Module_Parameter_Editor::make_controls ( void )
o->selection_color( fc );
o->value( p->control_value() );
o->precision( 2 );
/* a couple of plugins have ridiculously small units */
if ( p->hints.maximum < 0.5f )
o->precision( 5 );
// o->step( fabs( ( o->maximum() - o->minimum() ) ) / 32.0f );
}
else
@ -260,6 +265,11 @@ Module_Parameter_Editor::make_controls ( void )
o->minimum( p->hints.maximum );
}
o->precision( 2 );
/* a couple of plugins have ridiculously small units */
if ( p->hints.maximum < 0.5f )
o->precision( 5 );
o->textsize( 8 );
o->box( FL_NO_BOX );
o->slider( FL_UP_BOX );

View File

@ -625,8 +625,8 @@ Plugin_Module::load ( unsigned long id )
if (LADSPA_IS_HINT_INTEGER(HintDesc)) {
if ( p.hints.ranged &&
0 == p.hints.minimum &&
1 == p.hints.maximum )
0 == (int)p.hints.minimum &&
1 == (int)p.hints.maximum )
p.hints.type = Port::Hints::BOOLEAN;
else
p.hints.type = Port::Hints::INTEGER;