From 17e7ad0ad620eafb4b8a1ada04194683ebe691aa Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Sun, 8 Sep 2013 19:22:58 -0700 Subject: [PATCH] Mixer: Add global command to swap signal and fader views, move signal/fader button to free up vertical space in layout. --- mixer/src/Mixer.C | 16 ++++++++++++++++ mixer/src/Mixer.H | 2 +- mixer/src/Mixer_Strip.C | 31 ++++++++++++++++++++++--------- mixer/src/Mixer_Strip.H | 1 + 4 files changed, 40 insertions(+), 10 deletions(-) diff --git a/mixer/src/Mixer.C b/mixer/src/Mixer.C index 2cb0b10..9ec7adc 100644 --- a/mixer/src/Mixer.C +++ b/mixer/src/Mixer.C @@ -354,6 +354,10 @@ void Mixer::cb_menu(Fl_Widget* o) { { fl_theme_chooser(); } + else if ( ! strcmp( picked, "&Mixer/Swap &Fader//Signal View" ) ) + { + command_toggle_fader_view(); + } else if ( ! strcmp( picked, "&Help/&About" ) ) { About_Dialog ab( PIXMAP_PATH "/non-mixer/icon-256x256.png" ); @@ -523,6 +527,8 @@ Mixer::Mixer ( int X, int Y, int W, int H, const char *L ) : o->add( "&Mixer/&Import Strip" ); o->add( "&Mixer/Paste", FL_CTRL + 'v', 0, 0 ); o->add( "&Mixer/&Spatialization Console", FL_F + 8, 0, 0, FL_MENU_TOGGLE ); + o->add( "&Mixer/Swap &Fader//Signal View", FL_ALT + 'f', 0, 0, FL_MENU_TOGGLE ); +// o->add( "&Mixer/&Signal View", FL_ALT + 's', 0, 0, FL_MENU_TOGGLE ); o->add( "&Remote Control/Start Learning", FL_F + 9, 0, 0 ); o->add( "&Remote Control/Stop Learning", FL_F + 10, 0, 0 ); o->add( "&Remote Control/Send State" ); @@ -1188,6 +1194,16 @@ Mixer::maybe_auto_connect_output ( Module::Port *p ) /* Commands */ /************/ +void +Mixer::command_toggle_fader_view ( void ) +{ + for ( int i = 0; i < mixer_strips->children(); i++ ) + { + Mixer_Strip *s = ((Mixer_Strip*)mixer_strips->child(i)); + s->command_toggle_fader_view(); + } +} + void Mixer::command_clear_mappings ( void ) { diff --git a/mixer/src/Mixer.H b/mixer/src/Mixer.H index 845f22a..c86109b 100644 --- a/mixer/src/Mixer.H +++ b/mixer/src/Mixer.H @@ -161,7 +161,7 @@ public: public: - void edit_translations ( void ); + void command_toggle_fader_view ( void ); void command_clear_mappings ( void ); void command_new ( void ); bool command_save ( void ); diff --git a/mixer/src/Mixer_Strip.C b/mixer/src/Mixer_Strip.C index 77a5418..8c3460a 100644 --- a/mixer/src/Mixer_Strip.C +++ b/mixer/src/Mixer_Strip.C @@ -595,6 +595,7 @@ Mixer_Strip::init ( ) o->color2(FL_CYAN); } { Fl_Choice* o = group_choice = new Fl_Choice(61, 183, 45, 22); + o->tooltip( "Create or assign group" ); o->labeltype(FL_NO_LABEL); o->labelsize(10); o->textsize(10); @@ -602,15 +603,20 @@ Mixer_Strip::init ( ) o->value(0); o->callback( ((Fl_Callback*)cb_handle), this ); } - { Fl_Flip_Button* o = tab_button = new Fl_Flip_Button(61, 183, 45, 22, "fader/signal"); - o->type(1); - o->labelsize( 14 ); - o->callback( ((Fl_Callback*)cb_handle), this ); - o->when(FL_WHEN_RELEASE); - } - { Controller_Module *o = mute_controller = new Controller_Module( true ); - o->pad( false ); - o->size( 45, 22 ); + { Fl_Scalepack *o = new Fl_Scalepack( 0,0, 45, 22 ); + o->type( FL_HORIZONTAL ); + { Fl_Flip_Button* o = tab_button = new Fl_Flip_Button(61, 183, 45, 22, "Fadr/Signl"); + o->tooltip( "Switch between fader and signal views" ); + o->type(1); + o->labelsize( 10 ); + o->callback( ((Fl_Callback*)cb_handle), this ); + o->when(FL_WHEN_RELEASE); + } + { Controller_Module *o = mute_controller = new Controller_Module( true ); + o->pad( false ); + o->size( 45, 22 ); + } + o->end(); } o->end(); } @@ -1197,6 +1203,13 @@ Mixer_Strip::number ( void ) const /* Commands */ /************/ +void +Mixer_Strip::command_toggle_fader_view ( void ) +{ + tab_button->value( ! tab_button->value() ); + tab_button->do_callback(); +} + void Mixer_Strip::command_move_left ( void ) { diff --git a/mixer/src/Mixer_Strip.H b/mixer/src/Mixer_Strip.H index df30a1b..ce7967a 100644 --- a/mixer/src/Mixer_Strip.H +++ b/mixer/src/Mixer_Strip.H @@ -177,6 +177,7 @@ public: int number ( void ) const; static bool import_strip ( const char *filename ); + void command_toggle_fader_view ( void ); void command_move_left ( void ); void command_move_right ( void ); void command_close ( void );