diff --git a/TODO b/TODO index 0d036e8..0a97ffc 100644 --- a/TODO +++ b/TODO @@ -6,9 +6,6 @@ ; General * allow deletion and renumbering of individual patterns and phrases. -* dirty the song more often than just on note manipulation. Pattern - names, playlist chances, viewport size adjustments--all need to - dirty the song. * add mode for disconnected operation. This is especially important for the situation where there is a timebase master when Non is started that exits before Non is closed, resulting in a lack of BBT diff --git a/canvas.C b/canvas.C index ac7bb10..b6b1a67 100644 --- a/canvas.C +++ b/canvas.C @@ -85,7 +85,7 @@ void Canvas::handle_event_change ( void ) { /* mark the song as dirty and pass the signal on */ - song.dirty( true ); + song.set_dirty(); signal_draw(); } @@ -914,6 +914,8 @@ Canvas::h_zoom ( float n ) m.vp->w = max( 32, min( (int)(m.vp->w * n), 256 ) ); resize_grid(); + + song.set_dirty(); } void @@ -928,6 +930,9 @@ Canvas::v_zoom_fit ( void ) m.vp->y = 0; resize_grid(); + + song.set_dirty(); + } /** adjust vertical zoom (* n) */ @@ -937,6 +942,8 @@ Canvas::v_zoom ( float n ) m.vp->h = max( 1, min( (int)(m.vp->h * n), m.maxh ) ); resize_grid(); + + song.set_dirty(); } void diff --git a/grid.C b/grid.C index a7d6865..0cef5fb 100644 --- a/grid.C +++ b/grid.C @@ -784,6 +784,8 @@ Grid::resolution ( unsigned int n ) DEBUG( "%d setting resolution to %d", n, _ppqn ); signal_events_change(); + + signal_settings_change(); } int @@ -804,6 +806,8 @@ Grid::name ( char *s ) if ( _name ) free ( _name ); _name = s; + + signal_settings_change(); } const char * @@ -818,6 +822,8 @@ Grid::notes ( char *s ) if ( _notes ) free ( _notes ); _notes = s; + + signal_settings_change(); } char * diff --git a/gui/ui.fl b/gui/ui.fl index 06ec3c6..689ddb6 100644 --- a/gui/ui.fl +++ b/gui/ui.fl @@ -1008,7 +1008,7 @@ You should have received a copy of the GNU General Public License along with thi system( "x-www-browser http://non.tuxfamily.org &" ); \#else fl_open_uri( "http://non.tuxfamily.org" ); -\#endif} selected +\#endif} xywh {178 554 188 30} color 14 labeltype SHADOW_LABEL labelcolor 6 } Fl_Return_Button {} { @@ -1472,7 +1472,9 @@ _c->resize( x(), y(), w(), h() ); _c->signal_draw.connect( sigc::mem_fun( this, &O_Canvas::draw_notes ) ); _c->signal_resize.connect( sigc::mem_fun( this, &O_Canvas::clear ) ); -_c->signal_settings_change.connect( sigc::ptr_fun( &UI::update_canvas_widgets ) );} {} +_c->signal_settings_change.connect( sigc::ptr_fun( &UI::update_canvas_widgets ) ); +_c->signal_settings_change.connect( sigc::mem_fun( song, &song_settings::set_dirty ) );} {selected + } } Function {click_to_focus()} {open return_type bool } { @@ -1645,7 +1647,7 @@ return r;} {} } widget_class Triggers {open - xywh {429 76 1278 1003} type Double resizable + xywh {397 42 1278 1003} type Double resizable code0 {populate();} code1 {\#include } class Fl_Group visible diff --git a/main.C b/main.C index 93d3933..2982709 100644 --- a/main.C +++ b/main.C @@ -113,6 +113,8 @@ load_song ( const char *name ) song.filename = strdup( name ); + song.dirty( false ); + return true; } @@ -151,6 +153,8 @@ main ( int argc, char **argv ) init_song(); pattern::signal_create_destroy.connect( mem_fun( phrase_c, &Canvas::v_zoom_fit ) ); + pattern::signal_create_destroy.connect( mem_fun( song, &song_settings::set_dirty ) ); + phrase::signal_create_destroy.connect( mem_fun( song, &song_settings::set_dirty ) ); if ( ! lash.init( &argc, &argv ) ) WARNING( "error initializing LASH" ); @@ -170,6 +174,8 @@ main ( int argc, char **argv ) else ASSERTION( "Either the version of JACK you are using does pass BBT information, or the current timebase master does not provide it." ); + song.dirty( false ); + MESSAGE( "Initializing GUI" ); init_colors(); diff --git a/non.H b/non.H index adfb1a6..8e5790e 100644 --- a/non.H +++ b/non.H @@ -104,12 +104,24 @@ struct song_settings _dirty = b; if ( b ) + { + MESSAGE( "song is now dirty" ); signal_dirty(); + } else + { + MESSAGE( "song is now clean" ); signal_clean(); + } } } + void + set_dirty ( void ) + { + dirty( true ); + } + struct { int feel; float probability; diff --git a/sequence.C b/sequence.C index 9043d0b..8b34c37 100644 --- a/sequence.C +++ b/sequence.C @@ -71,6 +71,8 @@ sequence::unlock ( void ) _rd = _rw; _rw = NULL; + + song.set_dirty(); } void @@ -426,6 +428,8 @@ sequence::name ( const char *s ) if ( _name ) free( _name ); _name = strdup( s ); + + song.set_dirty(); } char * @@ -440,4 +444,6 @@ sequence::notes ( const char *s ) if ( _notes ) free( _notes ); _notes = strdup( s ); + + song.set_dirty(); }