Mixer: Add commandline option for specifying the OSC port to use.

pull/3/head
Jonathan Moore Liles 2012-02-08 10:39:03 -08:00
parent 53f077ee88
commit d959b54f6a
3 changed files with 27 additions and 1 deletions

View File

@ -384,8 +384,12 @@ Mixer::Mixer ( int X, int Y, int W, int H, const char *L ) :
update_menu();
load_options();
}
osc_endpoint = new OSC::Endpoint();
void
Mixer::init_osc ( const char *osc_port )
{
osc_endpoint = new OSC::Endpoint(osc_port);
osc_endpoint->url();

View File

@ -95,6 +95,8 @@ public:
void announce ( const char *nash_url );
void init_osc ( const char* osc_port );
public:
bool command_save ( void );

View File

@ -137,8 +137,11 @@ main ( int argc, char **argv )
o->callback( (Fl_Callback*)cb_main, main_window );
o->show( argc, argv );
// o->show();
}
const char *osc_port = NULL;
{
int r = argc - 1;
int i = 1;
@ -150,6 +153,7 @@ main ( int argc, char **argv )
{
MESSAGE( "Using instance name \"%s\"", argv[i+1] );
instance_name = argv[i+1];
--r;
++i;
}
else
@ -157,6 +161,20 @@ main ( int argc, char **argv )
FATAL( "Missing instance name" );
}
}
else if ( !strcmp( argv[i], "--osc-port" ) )
{
if ( r > 1 )
{
MESSAGE( "Using OSC port \"%s\"", argv[i+1] );
osc_port = argv[i+1];
--r;
++i;
}
else
{
FATAL( "Missing OSC port" );
}
}
else if ( !strncmp( argv[i], "--", 2 ) )
{
WARNING( "Unrecognized option: %s", argv[i] );
@ -177,6 +195,8 @@ main ( int argc, char **argv )
}
mixer->init_osc( osc_port );
Fl::run();
delete main_window;