Browse Source

Make spatialization mode of controller_module more robust.

tags/non-daw-v1.1.0
Jonathan Moore Liles 15 years ago
parent
commit
6ac4106a6c
2 changed files with 20 additions and 5 deletions
  1. +11
    -5
      mixer/src/Controller_Module.C
  2. +9
    -0
      mixer/src/Controller_Module.H

+ 11
- 5
mixer/src/Controller_Module.C View File

@@ -281,6 +281,7 @@ Controller_Module::connect_spatializer_to ( Module *m )
init_sizes();
}

_type = SPATIALIZATION;
return true;
}
}
@@ -300,6 +301,7 @@ Controller_Module::connect_to ( Port *p )
w = o;
o->value( p->control_value() );

_type = TOGGLE;
}
else if ( p->hints.type == Module::Port::Hints::INTEGER )
{
@@ -317,6 +319,8 @@ Controller_Module::connect_to ( Port *p )
o->maximum( p->hints.maximum );
}

_type = SPINNER;

o->value( p->control_value() );
}
else if ( p->hints.type == Module::Port::Hints::LOGARITHMIC )
@@ -340,6 +344,8 @@ Controller_Module::connect_to ( Port *p )
}

o->value( p->control_value() );

_type = SLIDER;
}
else
{
@@ -358,6 +364,7 @@ Controller_Module::connect_to ( Port *p )
o->value( p->control_value() );
}

_type = KNOB;
}

control_value = p->control_value();
@@ -490,7 +497,8 @@ Controller_Module::handle ( int m )
if ( test_press( FL_BUTTON3 ) )
{
/* context menu */
menu_popup( &menu() );
if ( type() != SPATIALIZATION )
menu_popup( &menu() );

return 1;
}
@@ -509,9 +517,8 @@ Controller_Module::handle_control_changed ( Port * )
if ( contains( Fl::pushed() ) )
return;

if ( control_output.size() > 1 )
if ( type() == SPATIALIZATION )
{
/* spatializer */
Panner *pan = (Panner*)control;

pan->point( 0 )->azimuth( control_output[0].control_value() );
@@ -534,9 +541,8 @@ Controller_Module::process ( nframes_t nframes )
{
THREAD_ASSERT( RT );

if ( control_output.size() > 1 )
if ( type() == SPATIALIZATION )
{
/* this is a spatializer controller... */
return;
}



+ 9
- 0
mixer/src/Controller_Module.H View File

@@ -46,9 +46,17 @@ public:

enum Mode { GUI, CV, OSC, MIDI };

enum Type { KNOB,
SLIDER,
SPINNER,
TOGGLE,
SPATIALIZATION };

Mode mode ( void ) const { return _mode; }
void mode ( Mode v );

Type type ( void ) const { return _type; }

Controller_Module ( bool is_default = false );
virtual ~Controller_Module ( );

@@ -90,6 +98,7 @@ private:

std::vector<JACK::Port> jack_input;
Mode _mode;
Type _type;

Fl_Valuator *control;



Loading…
Cancel
Save