Browse Source

JACK doesn't like it if you set a slow-sync callback and don't act like a slow-sync client...

tags/non-daw-v1.1.0
Jonathan Moore Liles 15 years ago
parent
commit
b559a0ed7b
5 changed files with 13 additions and 29 deletions
  1. +0
    -18
      Mixer/Engine/Engine.C
  2. +0
    -3
      Mixer/Engine/Engine.H
  3. +1
    -1
      Timeline/main.C
  4. +5
    -3
      nonlib/JACK/Client.C
  5. +7
    -4
      nonlib/JACK/Client.H

+ 0
- 18
Mixer/Engine/Engine.C View File

@@ -74,24 +74,6 @@ Engine::buffer_size ( nframes_t )
return 0;
}

int Engine::sync ( jack_transport_state_t, jack_position_t * )
{
return 0;
}

void
Engine::timebase ( jack_transport_state_t, jack_nframes_t, jack_position_t *, int )
{


}

void
Engine::timebase ( jack_transport_state_t, jack_nframes_t, jack_position_t * )
{

}

/* THREAD: RT */
int
Engine::process ( nframes_t nframes )


+ 0
- 3
Mixer/Engine/Engine.H View File

@@ -39,10 +39,7 @@ class Engine : public JACK::Client, public Mutex

void shutdown ( void );
int process ( nframes_t nframes );
int sync ( jack_transport_state_t state, jack_position_t *pos );
int xrun ( void );
void timebase ( jack_transport_state_t state, jack_nframes_t nframes, jack_position_t *pos );
void timebase ( jack_transport_state_t state, jack_nframes_t nframes, jack_position_t *pos, int new_pos );
void freewheel ( bool yes );
int buffer_size ( nframes_t nframes );
void thread_init ( void );


+ 1
- 1
Timeline/main.C View File

@@ -136,7 +136,7 @@ main ( int argc, char **argv )

const char *jack_name;

if ( ! ( jack_name = engine->init( APP_NAME ) ) )
if ( ! ( jack_name = engine->init( APP_NAME, JACK::Client::SLOW_SYNC | JACK::Client::TIMEBASE_MASTER ) ) )
FATAL( "Could not connect to JACK!" );

timeline->sample_rate( engine->sample_rate() );


+ 5
- 3
nonlib/JACK/Client.C View File

@@ -113,7 +113,7 @@ namespace JACK
/** Connect to JACK using client name /client_name/. Return a static
* pointer to actual name as reported by JACK */
const char *
Client::init ( const char *client_name )
Client::init ( const char *client_name, unsigned int opts )
{
if (( _client = jack_client_open ( client_name, (jack_options_t)0, NULL )) == 0 )
return NULL;
@@ -128,9 +128,11 @@ namespace JACK

/* FIXME: should we wait to register this until after the project
has been loaded (and we have disk threads running)? */
set_callback( sync );
if ( opts & SLOW_SYNC )
set_callback( sync );

jack_set_timebase_callback( _client, 0, &Client::timebase, this );
if ( opts & TIMEBASE_MASTER )
jack_set_timebase_callback( _client, 0, &Client::timebase, this );

jack_on_shutdown( _client, &Client::shutdown, this );



+ 7
- 4
nonlib/JACK/Client.H View File

@@ -31,7 +31,6 @@ namespace JACK
class Port;
class Client
{

std::list <JACK::Port*> _active_ports;

jack_client_t *_client;
@@ -46,11 +45,11 @@ namespace JACK
static int process ( nframes_t nframes, void *arg );
virtual int process ( nframes_t nframes ) = 0;
static int sync ( jack_transport_state_t state, jack_position_t *pos, void *arg );
virtual int sync ( jack_transport_state_t state, jack_position_t *pos ) = 0;
virtual int sync ( jack_transport_state_t, jack_position_t * ) { return 1; }
static int xrun ( void *arg );
virtual int xrun ( void ) = 0;
static void timebase ( jack_transport_state_t state, jack_nframes_t nframes, jack_position_t *pos, int new_pos, void *arg );
virtual void timebase ( jack_transport_state_t state, jack_nframes_t nframes, jack_position_t *pos, int new_pos ) = 0;
virtual void timebase ( jack_transport_state_t, jack_nframes_t, jack_position_t *, int ) { }
static void freewheel ( int yes, void *arg );
virtual void freewheel ( bool yes ) = 0;
static int buffer_size ( nframes_t nframes, void *arg );
@@ -75,6 +74,10 @@ namespace JACK

public:

enum options { DEFAULT = 0,
SLOW_SYNC = 1 << 0,
TIMEBASE_MASTER = 1 << 1 };

jack_client_t * jack_client ( void ) { return _client; }

void port_added ( JACK::Port * p );
@@ -83,7 +86,7 @@ namespace JACK
Client ( );
virtual ~Client ( );

const char * init ( const char *client_name );
const char * init ( const char *client_name, unsigned int opts = 0 );
const char * name ( const char * );

nframes_t nframes ( void ) const { return jack_get_buffer_size( _client ); }


Loading…
Cancel
Save