Browse Source

Make load progress work for projects loaded from the command line too.

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
e86ef478c0
3 changed files with 29 additions and 15 deletions
  1. +3
    -1
      Timeline/Loggable.C
  2. +21
    -11
      Timeline/TLE.fl
  3. +5
    -3
      Timeline/main.C

+ 3
- 1
Timeline/Loggable.C View File

@@ -120,6 +120,9 @@ Loggable::replay ( FILE *fp )
_progress_callback( current * 100 / total, _progress_callback_arg ); _progress_callback( current * 100 / total, _progress_callback_arg );
} }


if ( _progress_callback )
_progress_callback( 0, _progress_callback_arg );

return true; return true;
} }


@@ -127,7 +130,6 @@ Loggable::replay ( FILE *fp )
bool bool
Loggable::close ( void ) Loggable::close ( void )
{ {

DMESSAGE( "closing journal and destroying all journaled objects" ); DMESSAGE( "closing journal and destroying all journaled objects" );


if ( ! _fp ) if ( ! _fp )


+ 21
- 11
Timeline/TLE.fl View File

@@ -103,7 +103,7 @@ main_window->show();


Fl::lock(); Fl::lock();


Fl::run();} {}
// Fl::run();} {}
} }
Function {TLE()} {open Function {TLE()} {open
} { } {
@@ -152,7 +152,10 @@ asprintf( &path, "%s/options", user_config_dir );
free( path ); free( path );




menubar->add( "&Timeline", 0, 0, const_cast< Fl_Menu_Item *>( timeline->menu->menu() ), FL_SUBMENU_POINTER );} {}
menubar->add( "&Timeline", 0, 0, const_cast< Fl_Menu_Item *>( timeline->menu->menu() ), FL_SUBMENU_POINTER );


Loggable::progress_callback( &TLE::progress_cb, this );} {}
} }
Function {make_window()} {open Function {make_window()} {open
} { } {
@@ -191,9 +194,6 @@ main_window->redraw();}
if ( ! name ) if ( ! name )
return; return;
progress->show();
timeline->hide();
Loggable::progress_callback( progress_cb, this );


if ( ! Project::validate( name ) ) if ( ! Project::validate( name ) )
{ {
@@ -204,9 +204,7 @@ else if ( ! Project::open( name ) )
fl_alert( "Could not open \\"%s\\" as a Non-DAW project!", name ); fl_alert( "Could not open \\"%s\\" as a Non-DAW project!", name );
// we are in a somewhar ambiguous state now with no project open. // we are in a somewhar ambiguous state now with no project open.
}
progress->hide();
timeline->show();}
}} selected
xywh {10 10 40 25} xywh {10 10 40 25}
} }
MenuItem {} { MenuItem {} {
@@ -679,8 +677,7 @@ project_name->redraw();} {}


snprintf( s, 5, "%d%%", (int)v ); snprintf( s, 5, "%d%%", (int)v );


p->label( s );} {selected
}
p->label( s );} {}
} }
Function {update_status()} {open Function {update_status()} {open
} { } {
@@ -807,7 +804,20 @@ exit( 0 );} {}
} }
Function {progress_cb( int p, void *arg )} {open return_type {static void} Function {progress_cb( int p, void *arg )} {open return_type {static void}
} { } {
code {Fl_Progress *progress = ((TLE*)arg)->progress;
code {((TLE*)arg)->progress_cb( p );} {}
}
Function {progress_cb( int p )} {open return_type void
} {
code {if ( ! progress->visible() )
{
timeline->hide();
progress->show();
}
else if ( 0 == p )
{
timeline->show();
progress->hide();
}


static char pat[10]; static char pat[10];




+ 5
- 3
Timeline/main.C View File

@@ -135,15 +135,17 @@ main ( int argc, char **argv )


lash->init( APP_NAME, APP_TITLE, &argc, &argv ); lash->init( APP_NAME, APP_TITLE, &argc, &argv );


MESSAGE( "Starting GUI" );

tle->run();

if ( argc > 1 ) if ( argc > 1 )
if ( ! Project::open( argv[ 1 ] ) ) if ( ! Project::open( argv[ 1 ] ) )
FATAL( "Could not open project specified on command line" ); FATAL( "Could not open project specified on command line" );


/* FIXME: open project in /tmp if none is given? */ /* FIXME: open project in /tmp if none is given? */


MESSAGE( "Starting GUI" );

tle->run();
Fl::run();


MESSAGE( "Your fun is over" ); MESSAGE( "Your fun is over" );
} }

Loading…
Cancel
Save