Mixer: Add commandline option for specifying the OSC port to use.
This commit is contained in:
parent
53f077ee88
commit
d959b54f6a
|
@ -384,8 +384,12 @@ Mixer::Mixer ( int X, int Y, int W, int H, const char *L ) :
|
||||||
update_menu();
|
update_menu();
|
||||||
|
|
||||||
load_options();
|
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();
|
osc_endpoint->url();
|
||||||
|
|
||||||
|
|
|
@ -95,6 +95,8 @@ public:
|
||||||
|
|
||||||
void announce ( const char *nash_url );
|
void announce ( const char *nash_url );
|
||||||
|
|
||||||
|
void init_osc ( const char* osc_port );
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
bool command_save ( void );
|
bool command_save ( void );
|
||||||
|
|
|
@ -137,8 +137,11 @@ main ( int argc, char **argv )
|
||||||
|
|
||||||
o->callback( (Fl_Callback*)cb_main, main_window );
|
o->callback( (Fl_Callback*)cb_main, main_window );
|
||||||
o->show( argc, argv );
|
o->show( argc, argv );
|
||||||
|
// o->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *osc_port = NULL;
|
||||||
|
|
||||||
{
|
{
|
||||||
int r = argc - 1;
|
int r = argc - 1;
|
||||||
int i = 1;
|
int i = 1;
|
||||||
|
@ -150,6 +153,7 @@ main ( int argc, char **argv )
|
||||||
{
|
{
|
||||||
MESSAGE( "Using instance name \"%s\"", argv[i+1] );
|
MESSAGE( "Using instance name \"%s\"", argv[i+1] );
|
||||||
instance_name = argv[i+1];
|
instance_name = argv[i+1];
|
||||||
|
--r;
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -157,6 +161,20 @@ main ( int argc, char **argv )
|
||||||
FATAL( "Missing instance name" );
|
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 ) )
|
else if ( !strncmp( argv[i], "--", 2 ) )
|
||||||
{
|
{
|
||||||
WARNING( "Unrecognized option: %s", argv[i] );
|
WARNING( "Unrecognized option: %s", argv[i] );
|
||||||
|
@ -177,6 +195,8 @@ main ( int argc, char **argv )
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mixer->init_osc( osc_port );
|
||||||
|
|
||||||
Fl::run();
|
Fl::run();
|
||||||
|
|
||||||
delete main_window;
|
delete main_window;
|
||||||
|
|
Loading…
Reference in New Issue