Browse Source

Add some framework for freewheeling mode.

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
2695f9eed5
3 changed files with 33 additions and 2 deletions
  1. +26
    -0
      Timeline/Engine.C
  2. +5
    -0
      Timeline/Engine.H
  3. +2
    -2
      Timeline/TLE.fl

+ 26
- 0
Timeline/Engine.C View File

@@ -30,6 +30,7 @@


Engine::Engine ( ) Engine::Engine ( )
{ {
_freewheeling = false;
_client = NULL; _client = NULL;
_buffers_dropped = 0; _buffers_dropped = 0;
_xruns = 0; _xruns = 0;
@@ -63,6 +64,12 @@ Engine::timebase ( jack_transport_state_t state, jack_nframes_t nframes, jack_po
((Engine*)arg)->timebase( state, nframes, pos, new_pos ); ((Engine*)arg)->timebase( state, nframes, pos, new_pos );
} }


void
Engine::freewheel ( int starting, void *arg )
{
((Engine*)arg)->freewheel( starting );
}



void void
@@ -82,6 +89,16 @@ Engine::xrun ( void )
return 0; return 0;
} }


/* THREAD: RT */
void
Engine::freewheel ( bool starting )
{
_freewheeling = starting;

if ( _freewheeling )
FATAL( "Freewheeling mode is unimplemented" );
}

/* THREAD: RT */ /* THREAD: RT */
/** This is the jack slow-sync callback. */ /** This is the jack slow-sync callback. */
int int
@@ -185,6 +202,14 @@ Engine::process ( nframes_t nframes )
} }




/** enter or leave freehweeling mode */
void
Engine::freewheeling ( bool yes )
{
if ( jack_set_freewheel( _client, yes ) )
WARNING( "Unkown error while setting freewheeling mode" );
}

int int
Engine::init ( void ) Engine::init ( void )
{ {
@@ -195,6 +220,7 @@ Engine::init ( void )


set_callback( process ); set_callback( process );
set_callback( xrun ); set_callback( xrun );
set_callback( freewheel );


/* FIXME: should we wait to register this until after the project /* FIXME: should we wait to register this until after the project
has been loaded (and we have disk threads running)? */ has been loaded (and we have disk threads running)? */


+ 5
- 0
Timeline/Engine.H View File

@@ -43,6 +43,7 @@ class Engine : public Mutex
int _buffers_dropped; /* buffers dropped because of locking */ int _buffers_dropped; /* buffers dropped because of locking */
nframes_t _sample_rate; nframes_t _sample_rate;
volatile int _xruns; volatile int _xruns;
volatile bool _freewheeling;


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 );
@@ -52,6 +53,8 @@ class Engine : public Mutex
int xrun ( void ); int xrun ( void );
static void timebase ( jack_transport_state_t state, jack_nframes_t nframes, jack_position_t *pos, int new_pos, void *arg ); static void timebase ( jack_transport_state_t state, jack_nframes_t nframes, jack_position_t *pos, int new_pos, void *arg );
void timebase ( jack_transport_state_t state, jack_nframes_t nframes, jack_position_t *pos, int new_pos ); void timebase ( jack_transport_state_t state, jack_nframes_t nframes, jack_position_t *pos, int new_pos );
static void freewheel ( int yes, void *arg );
void freewheel ( bool yes );


Engine ( const Engine &rhs ); Engine ( const Engine &rhs );
Engine & operator = ( const Engine &rhs ); Engine & operator = ( const Engine &rhs );
@@ -76,6 +79,8 @@ public:
nframes_t sample_rate ( void ) const { return _sample_rate; } nframes_t sample_rate ( void ) const { return _sample_rate; }
int xruns ( void ) const { return _xruns; }; int xruns ( void ) const { return _xruns; };
int dropped ( void ) const { return _buffers_dropped; } int dropped ( void ) const { return _buffers_dropped; }
bool freehweeling ( void ) const { return _freewheeling; }
void freewheeling ( bool yes );


float cpu_load ( void ) const { return jack_cpu_load( _client ); } float cpu_load ( void ) const { return jack_cpu_load( _client ); }
}; };


+ 2
- 2
Timeline/TLE.fl View File

@@ -185,7 +185,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.
}} selected
}}
xywh {10 10 40 25} xywh {10 10 40 25}
} }
MenuItem {} { MenuItem {} {
@@ -203,7 +203,7 @@ Loggable::compact();}
xywh {0 0 74 25} deactivate xywh {0 0 74 25} deactivate
} { } {
MenuItem {} { MenuItem {} {
label Project
label Project selected
xywh {0 0 40 25} xywh {0 0 40 25}
} }
MenuItem {} { MenuItem {} {


Loading…
Cancel
Save