void Controller_Module::handle_control_changed ( Port *p ) { /* ignore changes initiated while mouse is over widget */ if ( type() == SPATIALIZATION ) { if ( Mixer::spatialization_console ) Mixer::spatialization_console->handle_control_changed( this ); } if ( contains( Fl::pushed() ) ) return; if ( p ) control_value = p->control_value(); if ( control->value() == control_value ) return; /* if ( control->value() != control_value ) */ /* { */ /* redraw(); */ /* } */ if ( type() == SPATIALIZATION ) { Panner *pan = (Panner*)control; pan->point( 0 )->azimuth( control_output[0].control_value() ); pan->point( 0 )->elevation( control_output[1].control_value() ); if ( control_output[2].connected() ) { // Port *pp = control_output[2].connected_port(); float v = control_output[2].control_value(); // float s = pp->hints.maximum - pp->hints.minimum; pan->point( 0 )->radius( v ); } if ( visible_r() ) pan->redraw(); } else { if ( type() == TOGGLE ) ((Fl_Button*)control)->value(control_value); else control->value(control_value); } }
int MenuBar::handle(int event) { const MenuItem* v; if (menu() && menu()->text) switch (event) { case FL_ENTER: case FL_LEAVE: return 1; case FL_PUSH: v = 0; J1: v = menu()->pulldown(x(), y(), w(), h(), v, this, 0, 1); picked(v); return 1; case FL_SHORTCUT: if (visible_r()) { v = menu()->find_shortcut(); if (v && v->submenu()) goto J1; } return test_shortcut() != 0; } return 0; }