@@ -6,9 +6,6 @@ | |||||
; General | ; General | ||||
* allow deletion and renumbering of individual patterns and phrases. | * 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 | * add mode for disconnected operation. This is especially important | ||||
for the situation where there is a timebase master when Non is | 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 | started that exits before Non is closed, resulting in a lack of BBT | ||||
@@ -85,7 +85,7 @@ void | |||||
Canvas::handle_event_change ( void ) | Canvas::handle_event_change ( void ) | ||||
{ | { | ||||
/* mark the song as dirty and pass the signal on */ | /* mark the song as dirty and pass the signal on */ | ||||
song.dirty( true ); | |||||
song.set_dirty(); | |||||
signal_draw(); | signal_draw(); | ||||
} | } | ||||
@@ -914,6 +914,8 @@ Canvas::h_zoom ( float n ) | |||||
m.vp->w = max( 32, min( (int)(m.vp->w * n), 256 ) ); | m.vp->w = max( 32, min( (int)(m.vp->w * n), 256 ) ); | ||||
resize_grid(); | resize_grid(); | ||||
song.set_dirty(); | |||||
} | } | ||||
void | void | ||||
@@ -928,6 +930,9 @@ Canvas::v_zoom_fit ( void ) | |||||
m.vp->y = 0; | m.vp->y = 0; | ||||
resize_grid(); | resize_grid(); | ||||
song.set_dirty(); | |||||
} | } | ||||
/** adjust vertical zoom (* n) */ | /** 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 ) ); | m.vp->h = max( 1, min( (int)(m.vp->h * n), m.maxh ) ); | ||||
resize_grid(); | resize_grid(); | ||||
song.set_dirty(); | |||||
} | } | ||||
void | void | ||||
@@ -784,6 +784,8 @@ Grid::resolution ( unsigned int n ) | |||||
DEBUG( "%d setting resolution to %d", n, _ppqn ); | DEBUG( "%d setting resolution to %d", n, _ppqn ); | ||||
signal_events_change(); | signal_events_change(); | ||||
signal_settings_change(); | |||||
} | } | ||||
int | int | ||||
@@ -804,6 +806,8 @@ Grid::name ( char *s ) | |||||
if ( _name ) free ( _name ); | if ( _name ) free ( _name ); | ||||
_name = s; | _name = s; | ||||
signal_settings_change(); | |||||
} | } | ||||
const char * | const char * | ||||
@@ -818,6 +822,8 @@ Grid::notes ( char *s ) | |||||
if ( _notes ) free ( _notes ); | if ( _notes ) free ( _notes ); | ||||
_notes = s; | _notes = s; | ||||
signal_settings_change(); | |||||
} | } | ||||
char * | char * | ||||
@@ -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 &" ); | system( "x-www-browser http://non.tuxfamily.org &" ); | ||||
\#else | \#else | ||||
fl_open_uri( "http://non.tuxfamily.org" ); | fl_open_uri( "http://non.tuxfamily.org" ); | ||||
\#endif} selected | |||||
\#endif} | |||||
xywh {178 554 188 30} color 14 labeltype SHADOW_LABEL labelcolor 6 | xywh {178 554 188 30} color 14 labeltype SHADOW_LABEL labelcolor 6 | ||||
} | } | ||||
Fl_Return_Button {} { | 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_draw.connect( sigc::mem_fun( this, &O_Canvas::draw_notes ) ); | ||||
_c->signal_resize.connect( sigc::mem_fun( this, &O_Canvas::clear ) ); | _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 | Function {click_to_focus()} {open return_type bool | ||||
} { | } { | ||||
@@ -1645,7 +1647,7 @@ return r;} {} | |||||
} | } | ||||
widget_class Triggers {open | widget_class Triggers {open | ||||
xywh {429 76 1278 1003} type Double resizable | |||||
xywh {397 42 1278 1003} type Double resizable | |||||
code0 {populate();} | code0 {populate();} | ||||
code1 {\#include <Fl/Fl_Dial.H>} | code1 {\#include <Fl/Fl_Dial.H>} | ||||
class Fl_Group visible | class Fl_Group visible | ||||
@@ -113,6 +113,8 @@ load_song ( const char *name ) | |||||
song.filename = strdup( name ); | song.filename = strdup( name ); | ||||
song.dirty( false ); | |||||
return true; | return true; | ||||
} | } | ||||
@@ -151,6 +153,8 @@ main ( int argc, char **argv ) | |||||
init_song(); | init_song(); | ||||
pattern::signal_create_destroy.connect( mem_fun( phrase_c, &Canvas::v_zoom_fit ) ); | 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 ) ) | if ( ! lash.init( &argc, &argv ) ) | ||||
WARNING( "error initializing LASH" ); | WARNING( "error initializing LASH" ); | ||||
@@ -170,6 +174,8 @@ main ( int argc, char **argv ) | |||||
else | else | ||||
ASSERTION( "Either the version of JACK you are using does pass BBT information, or the current timebase master does not provide it." ); | 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" ); | MESSAGE( "Initializing GUI" ); | ||||
init_colors(); | init_colors(); | ||||
@@ -104,12 +104,24 @@ struct song_settings | |||||
_dirty = b; | _dirty = b; | ||||
if ( b ) | if ( b ) | ||||
{ | |||||
MESSAGE( "song is now dirty" ); | |||||
signal_dirty(); | signal_dirty(); | ||||
} | |||||
else | else | ||||
{ | |||||
MESSAGE( "song is now clean" ); | |||||
signal_clean(); | signal_clean(); | ||||
} | |||||
} | } | ||||
} | } | ||||
void | |||||
set_dirty ( void ) | |||||
{ | |||||
dirty( true ); | |||||
} | |||||
struct { | struct { | ||||
int feel; | int feel; | ||||
float probability; | float probability; | ||||
@@ -71,6 +71,8 @@ sequence::unlock ( void ) | |||||
_rd = _rw; | _rd = _rw; | ||||
_rw = NULL; | _rw = NULL; | ||||
song.set_dirty(); | |||||
} | } | ||||
void | void | ||||
@@ -426,6 +428,8 @@ sequence::name ( const char *s ) | |||||
if ( _name ) free( _name ); | if ( _name ) free( _name ); | ||||
_name = strdup( s ); | _name = strdup( s ); | ||||
song.set_dirty(); | |||||
} | } | ||||
char * | char * | ||||
@@ -440,4 +444,6 @@ sequence::notes ( const char *s ) | |||||
if ( _notes ) free( _notes ); | if ( _notes ) free( _notes ); | ||||
_notes = strdup( s ); | _notes = strdup( s ); | ||||
song.set_dirty(); | |||||
} | } |