Browse Source

Tweak Timeline<->Mixer discovery handshake.

tags/non-daw-v1.2.0
Jonathan Moore Liles 13 years ago
parent
commit
a480a93ba4
5 changed files with 34 additions and 18 deletions
  1. +21
    -11
      mixer/src/Mixer.C
  2. +1
    -1
      mixer/src/NSM.C
  3. +2
    -0
      mixer/src/main.C
  4. +1
    -1
      timeline/src/NSM.C
  5. +9
    -5
      timeline/src/Timeline.C

+ 21
- 11
mixer/src/Mixer.C View File

@@ -100,19 +100,29 @@ Mixer::reply_to_finger ( lo_message msg )
int argc = lo_message_get_argc( msg );
lo_arg **argv = lo_message_get_argv( msg );

if ( argc < 1 )
return;

lo_address to = lo_address_new_from_url( &argv[0]->s );
if ( argc >= 4 )
{
const char *url = &argv[0]->s;
const char *name = &argv[1]->s;
const char *version = &argv[2]->s;
const char *id = &argv[3]->s;

osc_endpoint->send( to,
"/non/hello",
osc_endpoint->url(),
APP_NAME,
VERSION,
instance_name );
MESSAGE( "Discovered NON peer %s (%s) @ %s with ID \"%s\"", name, version, url, id );
MESSAGE( "Registering Signals" );

lo_address_free( to );
lo_address to = lo_address_new_from_url( &argv[0]->s );
osc_endpoint->send( to,
"/non/hello",
osc_endpoint->url(),
APP_NAME,
VERSION,
instance_name );
mixer->osc_endpoint->hello( url );
lo_address_free( to );
}
}

void


+ 1
- 1
mixer/src/NSM.C View File

@@ -43,7 +43,7 @@ NSM_Client::command_broadcast ( const char *path, lo_message msg )
int argc = lo_message_get_argc( msg );
// lo_arg **argv = lo_message_get_argv( msg );

if ( argc == 1 && !strcmp( path, "/non/finger" ) )
if ( !strcmp( path, "/non/hello" ) )
{
mixer->reply_to_finger( msg );
return 0;


+ 2
- 0
mixer/src/main.C View File

@@ -285,6 +285,8 @@ main ( int argc, char **argv )
}
}

mixer->say_hello();

Fl::add_check( check_sigterm );

Fl::run();


+ 1
- 1
timeline/src/NSM.C View File

@@ -99,7 +99,7 @@ command_broadcast ( const char *path, lo_message msg, void *userdata )
int argc = lo_message_get_argc( msg );
// lo_arg **argv = lo_message_get_argv( msg );

if ( argc == 1 && !strcmp( path, "/non/finger" ) )
if ( !strcmp( path, "/non/hello" ) )
{
timeline->reply_to_finger( msg );
return 0;


+ 9
- 5
timeline/src/Timeline.C View File

@@ -1755,6 +1755,8 @@ Timeline::reply_to_finger ( lo_message msg )
VERSION,
instance_name );

osc->hello( &argv[0]->s );

lo_address_free( reply );
}

@@ -1787,12 +1789,14 @@ Timeline::discover_peers ( void )
{
lo_message m = lo_message_new();
lo_message_add_string( m, "/non/finger" );
lo_message_add_string( m, osc->url() );

nsm_send_broadcast( nsm, m );
lo_message_add( m, "sssss",
"/non/hello",
osc->url(),
APP_NAME,
VERSION,
instance_name );
lo_message_free( m );
nsm_send_broadcast( nsm, m );
}
}



Loading…
Cancel
Save