Notify user when JACK disconnects us.
This commit is contained in:
parent
635acb78e1
commit
957eed1f15
|
@ -33,6 +33,7 @@
|
||||||
Engine::Engine ( ) : _thread( "RT" )
|
Engine::Engine ( ) : _thread( "RT" )
|
||||||
{
|
{
|
||||||
_freewheeling = false;
|
_freewheeling = false;
|
||||||
|
_zombified = false;
|
||||||
_client = NULL;
|
_client = NULL;
|
||||||
_buffers_dropped = 0;
|
_buffers_dropped = 0;
|
||||||
_xruns = 0;
|
_xruns = 0;
|
||||||
|
@ -254,6 +255,19 @@ Engine::thread_init ( void )
|
||||||
_thread.set( "RT" );
|
_thread.set( "RT" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
Engine::shutdown ( void *arg )
|
||||||
|
{
|
||||||
|
((Engine*)arg)->shutdown();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Engine::shutdown ( void )
|
||||||
|
{
|
||||||
|
_zombified = true;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
Engine::init ( void )
|
Engine::init ( void )
|
||||||
{
|
{
|
||||||
|
@ -274,6 +288,8 @@ Engine::init ( void )
|
||||||
|
|
||||||
jack_set_timebase_callback( _client, 0, &Engine::timebase, this );
|
jack_set_timebase_callback( _client, 0, &Engine::timebase, this );
|
||||||
|
|
||||||
|
jack_on_shutdown( _client, &Engine::shutdown, this );
|
||||||
|
|
||||||
jack_activate( _client );
|
jack_activate( _client );
|
||||||
|
|
||||||
_sample_rate = frame_rate();
|
_sample_rate = frame_rate();
|
||||||
|
|
|
@ -49,7 +49,11 @@ class Engine : public Mutex
|
||||||
nframes_t _sample_rate;
|
nframes_t _sample_rate;
|
||||||
volatile int _xruns;
|
volatile int _xruns;
|
||||||
volatile bool _freewheeling;
|
volatile bool _freewheeling;
|
||||||
|
volatile bool _zombified;
|
||||||
|
|
||||||
|
|
||||||
|
static void shutdown ( void *arg );
|
||||||
|
void shutdown ( void );
|
||||||
static int process ( nframes_t nframes, void *arg );
|
static int process ( nframes_t nframes, void *arg );
|
||||||
int process ( nframes_t nframes );
|
int process ( nframes_t nframes );
|
||||||
static int sync ( jack_transport_state_t state, jack_position_t *pos, void *arg );
|
static int sync ( jack_transport_state_t state, jack_position_t *pos, void *arg );
|
||||||
|
@ -90,6 +94,7 @@ public:
|
||||||
int dropped ( void ) const { return _buffers_dropped; }
|
int dropped ( void ) const { return _buffers_dropped; }
|
||||||
bool freewheeling ( void ) const { return _freewheeling; }
|
bool freewheeling ( void ) const { return _freewheeling; }
|
||||||
void freewheeling ( bool yes );
|
void freewheeling ( bool yes );
|
||||||
|
bool zombified ( void ) const { return _zombified; }
|
||||||
|
|
||||||
float cpu_load ( void ) const { return jack_cpu_load( _client ); }
|
float cpu_load ( void ) const { return jack_cpu_load( _client ); }
|
||||||
};
|
};
|
||||||
|
|
|
@ -161,9 +161,9 @@ Loggable::progress_callback( &TLE::progress_cb, this );} {}
|
||||||
} {
|
} {
|
||||||
Fl_Window main_window {
|
Fl_Window main_window {
|
||||||
label Timeline open
|
label Timeline open
|
||||||
xywh {177 137 1025 770} type Double resizable xclass Non_DAW visible
|
xywh {894 189 1025 770} type Double resizable xclass Non_DAW visible
|
||||||
} {
|
} {
|
||||||
Fl_Menu_Bar menubar {open
|
Fl_Menu_Bar menubar {
|
||||||
xywh {0 0 1024 25}
|
xywh {0 0 1024 25}
|
||||||
} {
|
} {
|
||||||
Submenu {} {
|
Submenu {} {
|
||||||
|
@ -696,7 +696,16 @@ if ( timeline->total_playback_xruns() )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
xruns_output->value( engine->xruns() );} {}
|
xruns_output->value( engine->xruns() );
|
||||||
|
|
||||||
|
static bool zombie = false;
|
||||||
|
|
||||||
|
if ( engine->zombified() && ! zombie )
|
||||||
|
{
|
||||||
|
zombie = true;
|
||||||
|
fl_alert( "Disconnected from JACK!" );
|
||||||
|
}} {selected
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Function {update_cb( void *v )} {return_type {static void}
|
Function {update_cb( void *v )} {return_type {static void}
|
||||||
} {
|
} {
|
||||||
|
@ -825,8 +834,7 @@ update_progress( progress, pat, p );
|
||||||
|
|
||||||
progress->redraw();
|
progress->redraw();
|
||||||
|
|
||||||
Fl::check();} {selected
|
Fl::check();} {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue