Mixer: Don't lose panner settings when toggling Spatializer Advanced Options.

This commit is contained in:
Jonathan Moore Liles 2013-09-02 11:35:32 -07:00
parent b3a9d0be1d
commit cf5c557c2f
3 changed files with 31 additions and 6 deletions

View File

@ -166,7 +166,11 @@ public:
if ( _flow )
{
if ( _flowdown )
Y += LH + _vspacing;
else
Y += RH + _vspacing;
X += LW + _hspacing;
}
else

View File

@ -107,6 +107,8 @@ Module_Parameter_Editor::Module_Parameter_Editor ( Module *module ) : Fl_Double_
{ Fl_Flowpack *o = control_pack = new Fl_Flowpack( 50, 0, w() - 100, h() );
/* o->box( FL_ROUNDED_BOX ); */
/* o->color( FL_GRAY ); */
o->type( FL_HORIZONTAL );
o->flow( true );
o->vspacing( 10 );
o->hspacing( 10 );
o->end();
@ -159,8 +161,8 @@ Module_Parameter_Editor::make_controls ( void )
Module::Port *p = &module->control_input[i];
if ( !p->hints.visible )
continue;
/* if ( !p->hints.visible ) */
/* continue; */
if ( !strcasecmp( "Azimuth", p->name() ) &&
180.0f == p->hints.maximum &&
@ -309,6 +311,10 @@ Module_Parameter_Editor::make_controls ( void )
o->size( flg->w(), flg->h() + bound->h() );
o->init_sizes();
}
if (! p->hints.visible )
o->hide();
control_pack->add( o );
}
@ -326,8 +332,6 @@ Module_Parameter_Editor::make_controls ( void )
o->align(FL_ALIGN_TOP);
o->when(FL_WHEN_CHANGED);
o->label( "Spatialization" );
o->align(FL_ALIGN_TOP);
o->labelsize( 10 );
_callback_data.push_back( callback_data( this, azimuth_port_number, elevation_port_number, radius_port_number ) );
@ -351,6 +355,7 @@ Module_Parameter_Editor::make_controls ( void )
controls_by_port[radius_port_number] = o;
}
update_control_visibility();
int width = control_pack->max_width() + 100;
int height = control_pack->h() + 50;
@ -363,6 +368,20 @@ Module_Parameter_Editor::make_controls ( void )
size_range( width, height, width, height );
}
void
Module_Parameter_Editor::update_control_visibility ( void )
{
for ( unsigned int i = 0; i < _module->control_input.size(); ++i )
{
const Module::Port *p = &_module->control_input[i];
if ( p->hints.visible )
controls_by_port[i]->parent()->parent()->show();
else
controls_by_port[i]->parent()->parent()->hide();
}
}
void
Module_Parameter_Editor::cb_value_handle ( Fl_Widget *w, void *v )
{
@ -472,7 +491,8 @@ Module_Parameter_Editor::handle_control_changed ( Module::Port *p )
void
Module_Parameter_Editor::reload ( void )
{
make_controls();
// make_controls();
update_control_visibility();
redraw();
}

View File

@ -66,6 +66,7 @@ class Module_Parameter_Editor : public Fl_Double_Window
};
void update_control_visibility ( void );
static void cb_button_handle ( Fl_Widget *w, void *v );
static void cb_value_handle ( Fl_Widget *w, void *v );
static void cb_panner_value_handle ( Fl_Widget *w, void *v );