Browse Source

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

tags/non-daw-v1.2.0
Jonathan Moore Liles 11 years ago
parent
commit
cf5c557c2f
3 changed files with 31 additions and 6 deletions
  1. +5
    -1
      FL/Fl_Flowpack.H
  2. +25
    -5
      mixer/src/Module_Parameter_Editor.C
  3. +1
    -0
      mixer/src/Module_Parameter_Editor.H

+ 5
- 1
FL/Fl_Flowpack.H View File

@@ -166,7 +166,11 @@ public:

if ( _flow )
{
Y += LH + _vspacing;
if ( _flowdown )
Y += LH + _vspacing;
else
Y += RH + _vspacing;

X += LW + _hspacing;
}
else


+ 25
- 5
mixer/src/Module_Parameter_Editor.C 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();
}



+ 1
- 0
mixer/src/Module_Parameter_Editor.H 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 );


Loading…
Cancel
Save