From 713f3ef4765875d98f9e672175539e1e08f5832a Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Sun, 25 Mar 2012 16:30:30 -0700 Subject: [PATCH] Sequencer: Clean up GUI. --- sequencer/src/gui/ui.fl | 356 +++++++++++++++++++++------------------- 1 file changed, 185 insertions(+), 171 deletions(-) diff --git a/sequencer/src/gui/ui.fl b/sequencer/src/gui/ui.fl index 05486c7..7635244 100644 --- a/sequencer/src/gui/ui.fl +++ b/sequencer/src/gui/ui.fl @@ -28,6 +28,18 @@ decl {\#include } {public local decl {\#include "FL/About_Dialog.H"} {private local } +decl {class Fl_Scalepack;} {public local +} + +decl {class Fl_Sometimes_Input;} {public local +} + +decl {\#include "FL/Fl_Scalepack.H"} {private local +} + +decl {\#include "FL/Fl_Sometimes_Input.H"} {private local +} + decl {\#include } {private local } @@ -44,7 +56,7 @@ decl {\#include "../NSM.H"} {private local } decl {extern NSM_Client *nsm;} {private local -} +} decl {extern UI *ui;} {private local } @@ -189,11 +201,12 @@ if ( Fl::event() == FL_SHORTCUT && Fl::event_key() == FL_Escape ) return; if ( maybe_save_song() ) - quit();} open - xywh {783 174 865 800} type Double box PLASTIC_UP_BOX color 37 resizable xclass non size_range {600 420 0 0} visible + quit();} open selected + xywh {365 131 865 805} type Double color 38 resizable + code0 {o->color( FL_BACKGROUND_COLOR );} xclass non size_range {700 509 0 0} visible } { Fl_Menu_Bar menu_bar {open - xywh {0 0 869 30} color 37 + xywh {0 0 865 30} color 37 } { Submenu {} { label {&File} open @@ -419,9 +432,7 @@ config.follow_playhead = val ? true : false;} } MenuItem {} { label {&About} - callback { - -About_Dialog ab( PIXMAP_PATH "/non-sequencer/icon-256x256.png" ); + callback {About_Dialog ab( PIXMAP_PATH "/non-sequencer/icon-256x256.png" ); ab.logo_box->label( VERSION ); @@ -438,6 +449,142 @@ ab.run();} } } } + Fl_Group {} {open + xywh {0 30 865 70} + } { + Fl_Pack {} { + label Meter open + xywh {220 68 175 27} type HORIZONTAL labeltype NO_LABEL labelsize 9 align 0 + code0 {o->spacing( 3 );} + } { + Fl_Box {} { + label {BPM:} + xywh {220 68 35 27} resizable + } + Fl_Value_Input {} { + callback {transport.set_beats_per_minute( o->value() );} + xywh {265 68 55 27} when 8 + code1 {transport.signal_tempo_change.connect( sigc::mem_fun( o, static_cast(&Fl_Valuator::value) ) );} + code2 {o->value( transport.beats_per_minute );} + } + Fl_Value_Input {} { + callback {transport.set_beats_per_bar( o->value() );} + xywh {325 68 26 27} + code0 {transport.signal_bpb_change.connect( sigc::mem_fun( o, static_cast(&Fl_Valuator::value) ) );} + code1 {o->value( transport.beats_per_bar );} + } + Fl_Box {} { + label {/} + xywh {346 68 19 27} + } + Fl_Value_Input {} { + callback {transport.set_beat_type( o->value() );} + xywh {365 68 24 27} + code0 {transport.signal_beat_change.connect( sigc::mem_fun( o, static_cast(&Fl_Valuator::value) ) );} + code1 {o->value( transport.beat_type );} + } + } + Fl_Pack vmetro_widget { + label Metronome + xywh {395 34 461 60} type HORIZONTAL box UP_BOX color 40 selection_color 48 labelsize 33 align 0 resizable + code0 {\#include "widgets.H"} + code1 {o->box( FL_NO_BOX );} + class Visual_Metronome + } {} + Fl_Pack transport_controls_group {open + xywh {10 32 152 42} type HORIZONTAL + code0 {o->spacing( 2 );} + class Fl_Scalepack + } { + Fl_Button play_button { + label {@>} + callback {transport.toggle();} + xywh {10 34 43 3} shortcut 0x20 labeltype ENGRAVED_LABEL + } + Fl_Button rec_button { + label {@circle} + callback {transport.recording = o->value(); + + +if ( o->value() ) +{ + if ( config.record_mode == NEW ) + { + pattern *p = new pattern; + p->length( -1 ); + + pattern_c->grid( p ); + } + + ((pattern*)pattern_c->grid())->record( 0 ); + + o->labelcolor( FL_RED ); +} +else +{ + pattern::recording()->record_stop(); + + o->labelcolor( FL_WHITE ); +}} + xywh {60 34 43 3} type Toggle shortcut 0x80072 selection_color 47 labeltype ENGRAVED_LABEL when 1 + } + Fl_Button home_button { + label {@|<} + callback {transport.locate( 0 );} + xywh {110 34 43 3} shortcut 0xff50 labeltype ENGRAVED_LABEL + } + } + Fl_Choice record_mode_menu { + label {&Record Mode} + callback {if ( ! transport.recording ) + config.record_mode = (record_mode_e)o->value(); +else + o->value( config.record_mode );} open + xywh {171 41 100 27} box PLASTIC_DOWN_BOX down_box BORDER_BOX color 37 labelsize 9 align 1 + } { + MenuItem {} { + label Merge + xywh {15 15 40 25} + } + MenuItem {} { + label Overwrite + xywh {25 25 40 25} + } + MenuItem {} { + label Layer + xywh {35 35 40 25} + } + MenuItem {} { + label New + xywh {45 45 40 25} + } + } + Fl_Choice playback_mode_menu { + label {Playback &Mode} open + xywh {285 41 100 26} box PLASTIC_DOWN_BOX down_box BORDER_BOX color 37 labelsize 9 align 1 + } { + MenuItem {} { + label Pattern + callback {song.play_mode = PATTERN;} + xywh {5 5 40 25} + } + MenuItem {} { + label Sequence + callback {song.play_mode = SEQUENCE;} + xywh {15 15 40 25} + } + MenuItem {} { + label Trigger + callback {song.play_mode = TRIGGER;} + xywh {25 25 40 25} + } + MenuItem {} { + label Queue + callback {song.play_mode = QUEUE;} + xywh {0 0 40 24} + } + } + } Fl_Tabs tabs { callback {((Fl_Group*)o->value())->child( 0 )->take_focus(); @@ -459,13 +606,13 @@ else edit_menu->activate(); } -menu_bar->redraw();} open selected - xywh {0 76 868 701} color 37 labeltype SHADOW_LABEL labelsize 19 when 1 +menu_bar->redraw();} open + xywh {0 76 865 701} color 37 labeltype SHADOW_LABEL labelsize 19 when 1 resizable code0 {canvas_background_color = fl_rgb_color( 18, 18, 18 );} } { Fl_Group sequence_tab { label Sequence open - xywh {0 98 868 674} color 37 hide resizable + xywh {0 98 862 674} color 37 hide resizable code0 {update_sequence_widgets();} } { Fl_Group {} {open @@ -593,7 +740,7 @@ if ( playlist->length() ) } Fl_Group phrase_tab { label Phrase open - xywh {0 98 868 674} color 37 hide + xywh {0 98 865 674} color 37 code0 {update_phrase_widgets();} } { Fl_Box phrase_canvas_widget { @@ -605,7 +752,7 @@ if ( playlist->length() ) class O_Canvas } Fl_Group {} {open - xywh {10 703 854 60} + xywh {5 697 859 72} } { Fl_Input phrase_name_field { label {name:} @@ -613,20 +760,23 @@ if ( playlist->length() ) // if the name changed.. update_sequence_widgets();} - xywh {10 703 144 25} color 36 align 20 textcolor 32 + xywh {5 704 155 24} box ROUNDED_BOX color 49 labelfont 2 labelcolor 55 align 20 textcolor 32 + code0 {o->up_box( FL_ROUNDED_BOX );} + class Fl_Sometimes_Input } Fl_Spinner phrase_number_spinner { + label {Phrase:} callback {phrase *p = ((phrase *)phrase_c->grid())->by_number( o->value() ); if ( p ) phrase_c->grid( p ); o->maximum( phrase::phrases() );} - xywh {164 703 40 25} color 36 labeltype NO_LABEL when 1 + xywh {165 704 55 24} color 36 labelsize 9 align 1 when 1 } Fl_Light_Button phrase_mute_button { label Mute - xywh {10 740 88 23} color 37 hide + xywh {5 740 93 23} color 37 hide } Fl_Light_Button phrase_solo_button { label Solo @@ -635,14 +785,14 @@ o->maximum( phrase::phrases() );} Fl_Text_Editor phrase_notes_edit { label {Notes:} callback {phrase_c->grid()->notes( o->buffer()->text() );} - xywh {211 713 653 46} selection_color 48 labelsize 12 textcolor 94 resizable + xywh {235 709 620 58} selection_color 48 labelsize 12 textcolor 94 resizable code0 {o->buffer( phrase_notes_buffer = new Fl_Text_Buffer );} } } } Fl_Group pattern_tab { label Pattern open - xywh {0 98 868 674} color 37 + xywh {0 98 865 674} color 37 hide code0 {update_pattern_widgets();} } { Fl_Box pattern_canvas_widget { @@ -655,21 +805,24 @@ o->maximum( phrase::phrases() );} class O_Canvas } Fl_Group {} {open - xywh {4 694 858 77} + xywh {0 694 865 78} } { Fl_Input pattern_name_field { label {name:} callback {pattern_c->grid()->name( strdup( o->value() ) );} - xywh {10 703 144 25} color 0 align 20 when 1 textcolor 32 + xywh {5 704 155 24} box ROUNDED_BOX color 49 align 20 when 1 textfont 2 textcolor 55 + code0 {o->up_box( FL_ROUNDED_BOX );} + class Fl_Sometimes_Input } Fl_Spinner pattern_number_spinner { + label {Pattern:} callback {pattern *p = ((pattern *)pattern_c->grid())->by_number( o->value() ); if ( p ) pattern_c->grid( p ); o->maximum( pattern::patterns() );} - xywh {164 703 40 25} color 36 labeltype NO_LABEL when 1 + xywh {165 704 55 24} color 36 labelsize 9 align 1 when 1 code0 {o->maximum( 1 );} code1 {// pattern::signal_create_destroy.connect( sigc::mem_fun( o, static_cast(&Fl_Spinner::maximum) ) );} } @@ -682,7 +835,7 @@ g->mode( g->mode() == MUTE ? PLAY : MUTE ); o->value( g->mode() == MUTE ); pattern_solo_button->value( 0 );} - xywh {10 738 90 23} type Normal color 37 + xywh {10 738 65 25} type Normal color 37 } Fl_Light_Button pattern_solo_button { label Solo @@ -693,16 +846,16 @@ g->mode( g->mode() == SOLO ? PLAY : SOLO ); o->value( g->mode() == SOLO ); pattern_mute_button->value( 0 );} - xywh {110 738 91 23} type Normal color 37 + xywh {80 738 65 25} type Normal color 37 } Fl_Text_Editor pattern_notes_edit { label {Notes:} callback {pattern_c->grid()->notes( o->buffer()->text() );} - xywh {214 713 243 48} selection_color 48 labelsize 12 textcolor 94 resizable + xywh {230 713 227 48} selection_color 48 labelsize 12 textcolor 94 resizable code0 {o->buffer( pattern_notes_buffer = new Fl_Text_Buffer );} } Fl_Group pattern_settings_group {open - xywh {458 694 400 77} + xywh {458 694 400 78} } { Fl_Spinner pattern_channel_spinner { label Channel @@ -915,153 +1068,11 @@ pattern_c->changed_mapping();} } } Fl_Group {} {open - xywh {0 29 865 67} - } { - Fl_Pack {} { - label Meter open - xywh {5 41 200 26} type HORIZONTAL labelsize 9 - code0 {o->spacing( 3 );} - } { - Fl_Box {} { - label {BPM:} - xywh {5 41 35 26} resizable - } - Fl_Value_Input {} { - callback {transport.set_beats_per_minute( o->value() );} - xywh {45 41 55 24} when 8 - code1 {transport.signal_tempo_change.connect( sigc::mem_fun( o, static_cast(&Fl_Valuator::value) ) );} - code2 {o->value( transport.beats_per_minute );} - } - Fl_Value_Input {} { - callback {transport.set_beats_per_bar( o->value() );} - xywh {105 41 26 24} - code0 {transport.signal_bpb_change.connect( sigc::mem_fun( o, static_cast(&Fl_Valuator::value) ) );} - code1 {o->value( transport.beats_per_bar );} - } - Fl_Box {} { - label {/} - xywh {126 41 19 24} - } - Fl_Value_Input {} { - callback {transport.set_beat_type( o->value() );} - xywh {140 41 24 24} - code0 {transport.signal_beat_change.connect( sigc::mem_fun( o, static_cast(&Fl_Valuator::value) ) );} - code1 {o->value( transport.beat_type );} - } - Fl_Box {} { - xywh {165 63 40 4} labeltype NO_LABEL - } - } - Fl_Pack vmetro_widget { - label Metronome - xywh {210 35 400 60} type HORIZONTAL box UP_BOX color 40 selection_color 48 labelsize 33 align 0 resizable - code0 {\#include "widgets.H"} - code1 {o->box( FL_NO_BOX );} - class Visual_Metronome - } {} - Fl_Pack transport_controls_group { - xywh {615 44 139 42} type HORIZONTAL - code0 {o->spacing( 2 );} - } { - Fl_Button play_button { - label {@>} - callback {transport.toggle();} - xywh {665 45 34 41} shortcut 0x20 labeltype ENGRAVED_LABEL - } - Fl_Button rec_button { - label {@circle} - callback {transport.recording = o->value(); - - -if ( o->value() ) -{ - if ( config.record_mode == NEW ) - { - pattern *p = new pattern; - p->length( -1 ); - - pattern_c->grid( p ); - } - - ((pattern*)pattern_c->grid())->record( 0 ); - - o->labelcolor( FL_RED ); -} -else -{ - pattern::recording()->record_stop(); - - o->labelcolor( FL_WHITE ); -}} - xywh {709 45 45 41} type Toggle shortcut 0x80072 selection_color 47 labeltype ENGRAVED_LABEL when 1 - } - Fl_Button home_button { - label {@|<} - callback {transport.locate( 0 );} - xywh {615 45 40 41} shortcut 0xff50 labeltype ENGRAVED_LABEL - } - } - Fl_Choice record_mode_menu { - label {&Record Mode} - callback {if ( ! transport.recording ) - config.record_mode = (record_mode_e)o->value(); -else - o->value( config.record_mode );} open - xywh {760 40 100 20} box PLASTIC_DOWN_BOX down_box BORDER_BOX color 37 labelsize 9 align 1 - } { - MenuItem {} { - label Merge - xywh {15 15 40 25} - } - MenuItem {} { - label Overwrite - xywh {25 25 40 25} - } - MenuItem {} { - label Layer - xywh {35 35 40 25} - } - MenuItem {} { - label New - xywh {45 45 40 25} - } - } - Fl_Choice playback_mode_menu { - label {Playback &Mode} open - xywh {760 74 100 21} box PLASTIC_DOWN_BOX down_box BORDER_BOX color 37 labelsize 9 align 1 - } { - MenuItem {} { - label Pattern - callback {song.play_mode = PATTERN;} - xywh {5 5 40 25} - } - MenuItem {} { - label Sequence - callback {song.play_mode = SEQUENCE;} - xywh {15 15 40 25} - } - MenuItem {} { - label Trigger - callback {song.play_mode = TRIGGER;} - xywh {25 25 40 25} - } - MenuItem {} { - label Queue - callback {song.play_mode = QUEUE;} - xywh {0 0 40 24} - } - } - Fl_Box sm_indicator { - label SM selected - xywh {805 6 50 17} box ROUNDED_BOX color 50 labelcolor 3 deactivate - } - } - Fl_Group {} {open - xywh {-1 772 869 33} + xywh {0 776 865 31} } { Fl_Box status { label status - xywh {0 776 783 25} box UP_BOX align 84 + xywh {1 776 782 31} box UP_BOX align 84 code0 {o->label( NULL );} } Fl_Box transport_state { @@ -1081,7 +1092,7 @@ if ( s != o->label() ) else o->color( fl_darker( FL_GREEN ) ); }} - xywh {781 776 87 25} box THIN_UP_BOX align 64 + xywh {783 776 82 31} box THIN_UP_BOX align 64 } } Fl_Group pan_indicators {open @@ -1104,6 +1115,10 @@ if ( s != o->label() ) xywh {460 692 30 18} hide } } + Fl_Box sm_indicator { + label SM + xywh {810 7 50 13} box ROUNDED_BOX color 50 labelcolor 3 deactivate + } } } Function {make_seq_window()} {open @@ -1591,8 +1606,7 @@ _flags |= FL_DAMAGE_SCROLL;} {} } Function {draw_playhead( void )} {open return_type void } { - code { - if ( _c && _c->playhead_moved() ) + code {if ( _c && _c->playhead_moved() ) { damage( FL_DAMAGE_USER1 ); }} {}