Make spatialization mode of controller_module more robust.
This commit is contained in:
parent
93a6d878f2
commit
6ac4106a6c
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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…
Reference in New Issue