Browse Source

Mixer: Adjust threshold of boolean control via OSC. 'On' state is triggered at > half of maximum value.

tags/non-daw-v1.2.0
Jonathan Moore Liles 10 years ago
parent
commit
795249a612
1 changed files with 10 additions and 1 deletions
  1. +10
    -1
      mixer/src/Module.C

+ 10
- 1
mixer/src/Module.C View File

@@ -423,8 +423,14 @@ Module::Port::osc_control_change_exact ( float v, void *user_data )
f = p->hints.maximum;
else if ( f < p->hints.minimum )
f = p->hints.minimum;

if ( Hints::BOOLEAN == p->hints.type )
f = f > (p->hints.maximum - (p->hints.maximum - p->hints.minimum)) * 0.5f ?
p->hints.maximum :
p->hints.minimum;
}


p->control_value( f );

Fl::unlock();
@@ -451,8 +457,11 @@ Module::Port::osc_control_change_cv ( float v, void *user_data )

if ( p->hints.ranged )
{
if ( Hints::BOOLEAN == p->hints.type )
f = f > 0.5f ? p->hints.maximum : p->hints.minimum;

// scale value to range.
float scale = p->hints.maximum - p->hints.minimum;
float offset = p->hints.minimum;


Loading…
Cancel
Save