Mixer: Implement "quit" command.
This commit is contained in:
parent
6d6672e97a
commit
e4eea1c412
|
@ -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 )
|
||||
{
|
||||
|
|
|
@ -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();
|
||||
|
|
26
Mixer/main.C
26
Mixer/main.C
|
@ -59,6 +59,10 @@ Fl_Single_Window *main_window;
|
|||
|
||||
#include <signal.h>
|
||||
|
||||
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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue