diff --git a/Timeline/LASH.C b/Timeline/LASH.C index 9f97d44..2e007d1 100644 --- a/Timeline/LASH.C +++ b/Timeline/LASH.C @@ -34,16 +34,29 @@ #include "Project.H" #include "TLE.H" // all this just for quit() +#include + extern TLE *tle; #include "debug.h" +const float lash_poll_interval = 0.2f; + +void +LASH::timer_cb ( void *v ) +{ + ((LASH*)v)->poll(); + Fl::repeat_timeout( lash_poll_interval, &LASH::timer_cb, v ); +} + LASH::LASH ( ) { + Fl::add_timeout( lash_poll_interval, &LASH::timer_cb, this ); } LASH::~LASH ( ) { + Fl::remove_timeout( &LASH::timer_cb ); } bool diff --git a/Timeline/LASH.H b/Timeline/LASH.H index 8e23ed3..7ea93f0 100644 --- a/Timeline/LASH.H +++ b/Timeline/LASH.H @@ -24,6 +24,8 @@ class LASH : public LASH_Client { + static void timer_cb ( void *v ); + public: LASH ( ); diff --git a/Timeline/LASH_Client.C b/Timeline/LASH_Client.C index 6f15ed4..5681399 100644 --- a/Timeline/LASH_Client.C +++ b/Timeline/LASH_Client.C @@ -56,6 +56,9 @@ LASH_Client::init ( const char *jack_name, const char *long_name, int *argc, cha void LASH_Client::poll ( void ) { + if ( ! _client ) + return; + lash_event_t *e; while ( ( e = lash_get_event( _client ) ) ) diff --git a/Timeline/TLE.fl b/Timeline/TLE.fl index 1812f4a..6005e61 100644 --- a/Timeline/TLE.fl +++ b/Timeline/TLE.fl @@ -35,7 +35,8 @@ decl {\#include } {} decl {\#include } {} -decl {\#include } {} +decl {\#include } {selected +} decl {extern char project_display_name[256];} {global } @@ -697,7 +698,7 @@ with fast, light, reliable alternatives.} Fl_Box {} { label {the Non-DAW (Digital Audio Workstation)} xywh {-1 1 499 115} align 16 - code0 {o->image( new Fl_PNG_Image( INSTALL_PREFIX "/share/pixmaps/non-daw/logo.png" ) );} + code0 {o->image( Fl_Shared_Image::get( INSTALL_PREFIX "/share/pixmaps/non-daw/logo.png" ) );} } } } diff --git a/Timeline/main.C b/Timeline/main.C index f1444e4..4d90f4a 100644 --- a/Timeline/main.C +++ b/Timeline/main.C @@ -85,16 +85,6 @@ ensure_dirs ( void ) return r == 0 || errno == EEXIST; } -const float lash_poll_interval = 0.2f; - -static void -lash_cb ( void *arg ) -{ - lash->poll(); - - Fl::repeat_timeout( lash_poll_interval, lash_cb, 0 ); -} - #include int @@ -139,8 +129,6 @@ main ( int argc, char **argv ) lash->init( APP_NAME, APP_TITLE, &argc, &argv ); - Fl::add_timeout( lash_poll_interval, lash_cb, 0 ); - if ( argc > 1 ) if ( ! Project::open( argv[ 1 ] ) ) FATAL( "Could not open project specified on command line" );