Fix ordering of LASH/JACK initialization.

Signed-off-by: Jonathan Moore Liles <j.liles@unix.net>
This commit is contained in:
Juuso Alasuutari 2008-07-30 02:30:32 +03:00 committed by Jonathan Moore Liles
parent 7d8423bbaf
commit e1d13ce083
5 changed files with 21 additions and 18 deletions

View File

@ -412,7 +412,7 @@ schedule:
return 0;
}
int
const char *
midi_init ( void )
{
MESSAGE( "Initializing Jack MIDI" );
@ -421,7 +421,7 @@ midi_init ( void )
/* return 0; */
if (( client = jack_client_open ( APP_NAME, (jack_options_t)0, NULL )) == 0 )
return 0;
return NULL;
/* create output ports */
for ( int i = 0; i < MAX_PORT; i++ )
@ -484,7 +484,7 @@ midi_init ( void )
MESSAGE( "Waiting for JACK..." );
usleep( 500000 );
return 1;
return (const char *) jack_get_client_name(client);
}
void

View File

@ -11,6 +11,6 @@ midievent * midi_input_event ( int port );
void midi_output_event ( int port, const midievent *e );
void midi_output_event ( int port, const midievent *e, tick_t duration );
void midi_all_sound_off ( void );
int midi_init ( void );
const char * midi_init ( void );
void midi_shutdown ( void );
void midi_output_immediate_event ( int port, const midievent *e );

View File

@ -27,7 +27,7 @@
#ifndef HAVE_LASH
Lash::Lash ( ) {}
bool Lash::init ( int *argc, char ***argv ) { return true; }
bool Lash::init ( int *argc, char ***argv, const char *jack_name ) { return true; }
void Lash::process ( void ) {}
#else
@ -38,7 +38,7 @@ Lash::Lash ( )
}
bool
Lash::init ( int *argc, char ***argv )
Lash::init ( int *argc, char ***argv, const char *jack_name )
{
MESSAGE( "Initializing LASH" );
@ -47,7 +47,7 @@ Lash::init ( int *argc, char ***argv )
return false;
/* register name */
lash_jack_client_name( _client, APP_NAME );
lash_jack_client_name( _client, jack_name );
lash_event_t *e = lash_event_new_with_type( LASH_Client_Name );
lash_event_set_string( e, APP_TITLE );

View File

@ -34,7 +34,7 @@ class Lash
public:
Lash ( );
bool init ( int *argc, char ***argv );
bool init ( int *argc, char ***argv, const char *jack_name );
void process ( void );
};

View File

@ -167,17 +167,10 @@ main ( int argc, char **argv )
pattern::signal_create_destroy.connect( mem_fun( song, &song_settings::set_dirty ) );
phrase::signal_create_destroy.connect( mem_fun( song, &song_settings::set_dirty ) );
if ( ! lash.init( &argc, &argv ) )
WARNING( "error initializing LASH" );
const char *jack_name;
if ( argc > 1 )
{
/* maybe a filename on the commandline */
if ( ! load_song( argv[ 1 ] ) )
ASSERTION( "Could not load song \"%s\" specified on command line", argv[ 1 ] );
}
if ( ! midi_init() )
jack_name = midi_init();
if ( ! jack_name )
ASSERTION( "Could not initialize MIDI system! (is Jack running and with MIDI ports enabled?)" );
if ( ! transport.valid )
@ -188,6 +181,16 @@ main ( int argc, char **argv )
ASSERTION( "Either the version of JACK you are using does pass BBT information, or the current timebase master does not provide it." );
}
if ( ! lash.init( &argc, &argv, jack_name ) )
WARNING( "error initializing LASH" );
if ( argc > 1 )
{
/* maybe a filename on the commandline */
if ( ! load_song( argv[ 1 ] ) )
ASSERTION( "Could not load song \"%s\" specified on command line", argv[ 1 ] );
}
song.dirty( false );
MESSAGE( "Initializing GUI" );