Browse Source

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

tags/non-daw-v1.2.0
Jonathan Moore Liles 9 years ago
parent
commit
933bfe882a
3 changed files with 18 additions and 5 deletions
  1. +6
    -3
      FL/Fl_DialX.C
  2. +10
    -0
      mixer/src/Module_Parameter_Editor.C
  3. +2
    -2
      mixer/src/Plugin_Module.C

+ 6
- 3
FL/Fl_DialX.C 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 );


+ 10
- 0
mixer/src/Module_Parameter_Editor.C 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
@@ -259,6 +264,11 @@ Module_Parameter_Editor::make_controls ( void )
o->maximum( p->hints.minimum );
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 );


+ 2
- 2
mixer/src/Plugin_Module.C 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;


Loading…
Cancel
Save