diff --git a/TODO b/TODO index 81fe333..77d9c50 100644 --- a/TODO +++ b/TODO @@ -5,6 +5,7 @@ ; General +* show playback progress on playlist. * per phrase tempo setting? Perhaps a percentage of global tempo? * add channel field to event list widget (but channel bits in pattern event lists are currently meaningless.) diff --git a/canvas.C b/canvas.C index 0137ee5..1a4d1ef 100644 --- a/canvas.C +++ b/canvas.C @@ -89,24 +89,13 @@ Canvas::handle_event_change ( void ) } /** change grid to /g/, returns TRUE if new grid size differs from old */ -bool +void Canvas::grid ( Grid *g ) { - bool r = false; - - if ( m.grid ) - { - } - m.grid = g; if ( ! g ) - return false; - - if ( m.vp ) - if ( m.vp->w != g->viewport.w || - m.vp->h != g->viewport.h ) - r = true; + return; m.vp = &g->viewport; @@ -114,11 +103,11 @@ Canvas::grid ( Grid *g ) DEBUG( "viewport: %s", s ); free( s ); - m.mapping_drawn = m.ruler_drawn = false; + m.ruler_drawn = false; resize_grid(); - _update_row_mapping(); + changed_mapping(); m.shape = m.grid->draw_shape(); @@ -129,8 +118,6 @@ Canvas::grid ( Grid *g ) signal_draw(); signal_settings_change(); - - return r; } /** keep row compaction tables up-to-date */ diff --git a/canvas.H b/canvas.H index e23098c..618d945 100644 --- a/canvas.H +++ b/canvas.H @@ -124,7 +124,7 @@ public: void handle_event_change ( void ); void set ( int x, int y ); - bool grid ( Grid *g ); + void grid ( Grid *g ); void changed_mapping ( void ); Grid * grid ( void ); void resize ( void ); diff --git a/gui/ui.fl b/gui/ui.fl index ba8678d..2cb7d2e 100644 --- a/gui/ui.fl +++ b/gui/ui.fl @@ -636,18 +636,18 @@ if ( 0 == strncmp( picked, "Scale", strlen( "Scale" ) ) ) pattern_c->changed_mapping(); pattern_key_combo->activate(); -}} +}} open selected xywh {609 734 30 24} labeltype NO_LABEL code0 {update_mapping_menu();} } { - Submenu mapping_instrument_menu { - label Instrument open - xywh {10 10 74 25} - } {} Submenu mapping_scale_menu { label Scale open xywh {25 25 74 25} } {} + Submenu mapping_instrument_menu { + label Instrument open + xywh {10 10 74 25} + } {} } Fl_Choice pattern_key_combo { label {&Key} @@ -1058,8 +1058,7 @@ if ( g->notes() ) else pattern_notes_buffer->text( strdup( "" ) );} {} } - Function {update_phrase_widgets()} {open - } { + Function {update_phrase_widgets()} {} { code {phrase *g = (phrase *)phrase_c->grid(); if ( ! g ) @@ -1075,8 +1074,7 @@ if ( g->notes() ) else phrase_notes_buffer->text( strdup( "" ) );} {} } - Function {update_sequence_widgets()} {open - } { + Function {update_sequence_widgets()} {} { code {if ( playlist->notes() ) sequence_notes_buffer->text( playlist->notes() ); else @@ -1121,17 +1119,22 @@ o->value( val ); free( s );} {} } - Function {update_mapping_menu()} {} { + Function {update_mapping_menu()} {open + } { code {char **sa = Instrument::listing(); -for ( int i = 0; sa[i]; i++ ) +if ( sa ) { - char pat[512]; - snprintf( pat, 512, "Instrument/%s", sa[i] ); - mapping_menu->add( pat, 0, 0, 0, 0 ); - free( sa[i] ); + + for ( int i = 0; sa[i]; i++ ) + { + char pat[512]; + snprintf( pat, 512, "Instrument/%s", sa[i] ); + mapping_menu->add( pat, 0, 0, 0, 0 ); + free( sa[i] ); + } + free( sa ); } -free( sa ); sa = Scale::listing(); for ( int i = 0; sa[i]; i++ ) @@ -1151,7 +1154,7 @@ free( sa );} {} if ( phrase_c->grid() ) ui->update_phrase_widgets();} {} } - Function {find_numeric_menu_item( const Fl_Menu_Item *menu, int n )} {open return_type {static int} + Function {find_numeric_menu_item( const Fl_Menu_Item *menu, int n )} {return_type {static int} } { code {for ( unsigned int i = 0; menu[i].text; i++ ) { @@ -1161,7 +1164,7 @@ if ( phrase_c->grid() ) return 0;} {} } - Function {save_dialog( const char *name )} {open return_type void + Function {save_dialog( const char *name )} {return_type void } { code {if ( ! name ) { @@ -1183,7 +1186,7 @@ return 0;} {} if ( ! save_song( name ) ) fl_alert( "Could not save song" );} {} } - Function {show_help_dialog( const char *file )} {open return_type void + Function {show_help_dialog( const char *file )} {return_type void } { code {char pat[256]; @@ -1198,10 +1201,9 @@ help->load( pat ); help->show(); // FIXME: need to delete it somehow. -// help->show(1, argv);} {selected - } +// help->show(1, argv);} {} } - Function {maybe_save_song()} {open return_type bool + Function {maybe_save_song()} {return_type bool } { code {if ( song.dirty ) { @@ -1222,7 +1224,7 @@ help->show(); return true;} {} } - Function {switch_to_pattern( int n )} {open return_type void + Function {switch_to_pattern( int n )} {return_type void } { code {pattern *p = pattern::pattern_by_number( n ); diff --git a/pattern.C b/pattern.C index 818aac7..6c7d5ff 100644 --- a/pattern.C +++ b/pattern.C @@ -53,7 +53,8 @@ pattern::pattern ( void ) d->length = x_to_ts( _bpb * _ppqn * _bars ); - mapping.open( Mapping::INSTRUMENT, "Default" ); +// mapping.open( Mapping::INSTRUMENT, "Default" ); + mapping.open( Mapping::SCALE, "Major" ); _add();