diff --git a/Mixer/Mixer.C b/Mixer/Mixer.C index b661c66..15737c9 100644 --- a/Mixer/Mixer.C +++ b/Mixer/Mixer.C @@ -84,6 +84,10 @@ void Mixer::cb_menu(Fl_Widget* o) { { Project::save(); } + if (! strcmp( picked, "&Project/&Quit") ) + { + quit(); + } else if ( !strcmp( picked, "&Mixer/&Add Strip" ) ) { new_strip(); @@ -164,6 +168,15 @@ void Mixer::add ( Mixer_Strip *ms ) // redraw(); } +void +Mixer::quit ( void ) +{ + /* TODO: save project? */ + + while ( Fl::first_window() ) Fl::first_window()->hide(); +} + + void Mixer::insert ( Mixer_Strip *ms, Mixer_Strip *before ) { diff --git a/Mixer/Mixer.H b/Mixer/Mixer.H index 439ddf5..b9bbe9e 100644 --- a/Mixer/Mixer.H +++ b/Mixer/Mixer.H @@ -64,6 +64,7 @@ public: bool contains ( Mixer_Strip *ms ); bool save ( void ); + void quit ( void ); Mixer ( int X, int Y, int W, int H, const char *L ); virtual ~Mixer(); diff --git a/Mixer/main.C b/Mixer/main.C index d7675c1..4f929f5 100644 --- a/Mixer/main.C +++ b/Mixer/main.C @@ -59,6 +59,10 @@ Fl_Single_Window *main_window; #include +static void cb_main ( Fl_Widget *w, void *v ) +{ +} + int main ( int argc, char **argv ) { @@ -98,17 +102,19 @@ main ( int argc, char **argv ) engine = new Engine(); - engine->init( "Non-Mixer" ); - Fl_Single_Window *o = main_window = new Fl_Single_Window( 1024, 768, "Mixer" ); { - Fl_Widget *o = mixer = new Mixer( 0, 0, main_window->w(), main_window->h(), NULL ); - Fl_Group::current()->resizable(o); - } - o->end(); + Fl_Single_Window *o = main_window = new Fl_Single_Window( 1024, 768, "Mixer" ); + { + Fl_Widget *o = mixer = new Mixer( 0, 0, main_window->w(), main_window->h(), NULL ); + Fl_Group::current()->resizable(o); + } + o->end(); - o->show( argc, argv ); + o->callback( cb_main, main_window ); + o->show( argc, argv ); + } { engine->lock(); @@ -123,9 +129,9 @@ main ( int argc, char **argv ) MESSAGE( "Loading \"%s\"", argv[1] ); if ( int err = Project::open( argv[1] ) ) - { - fl_alert( "Error opening project specified on commandline: %s", Project::errstr( err ) ); - } + { + fl_alert( "Error opening project specified on commandline: %s", Project::errstr( err ) ); + } } else {