Browse Source

Mixer: Implement "quit" command.

tags/non-daw-v1.1.0
Jonathan Moore Liles 15 years ago
parent
commit
e4eea1c412
3 changed files with 30 additions and 10 deletions
  1. +13
    -0
      Mixer/Mixer.C
  2. +1
    -0
      Mixer/Mixer.H
  3. +16
    -10
      Mixer/main.C

+ 13
- 0
Mixer/Mixer.C View File

@@ -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 )
{


+ 1
- 0
Mixer/Mixer.H View File

@@ -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();


+ 16
- 10
Mixer/main.C View File

@@ -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…
Cancel
Save