Mixer: Avoid operations that would attempt to open the X display when running in noui mode.

Closes #104
This commit is contained in:
Jonathan Moore Liles 2014-02-10 21:32:43 -08:00
parent 13c3ca8eb8
commit 5d5b22afd4
3 changed files with 18 additions and 1 deletions

View File

@ -292,6 +292,13 @@ get_connections_for_ports ( std::vector<Module::Port> ports )
void void
JACK_Module::update_connection_status ( void ) JACK_Module::update_connection_status ( void )
{ {
/* do nothing when running in noui mode, as ->add will call some
* font measurement stuff which attempts to open the X display. */
if ( ! fl_display )
{
return;
}
std::list<std::string> output_names = get_connections_for_ports( aux_audio_output ); std::list<std::string> output_names = get_connections_for_ports( aux_audio_output );
std::list<std::string> input_names = get_connections_for_ports( aux_audio_input ); std::list<std::string> input_names = get_connections_for_ports( aux_audio_input );

View File

@ -45,11 +45,14 @@ Spatialization_Console::Spatialization_Console ( void ) : Fl_Double_Window( 850,
label( "Spatialization Console" ); label( "Spatialization Console" );
fl_font( FL_HELVETICA, 14 ); labelfont( FL_HELVETICA );
labelsize( 14 );
int padding = 48; int padding = 48;
int S = 802; int S = 802;
if ( fl_display )
/* don't open the display in noui mode... */
{ {
int sx, sy, sw, sh; int sx, sy, sw, sh;
@ -108,7 +111,12 @@ Spatialization_Console::set ( Log_Entry &e )
else if ( ! ( strcmp( s, ":shown" ) ) ) else if ( ! ( strcmp( s, ":shown" ) ) )
{ {
if ( atoi( v ) ) if ( atoi( v ) )
{
if ( fl_display )
{
show(); show();
}
}
else else
hide(); hide();
} }

View File

@ -131,6 +131,8 @@ main ( int argc, char **argv )
{ {
bool no_ui = false; bool no_ui = false;
fl_display = 0;
printf( "%s %s %s -- %s\n", APP_TITLE, VERSION, "", COPYRIGHT ); printf( "%s %s %s -- %s\n", APP_TITLE, VERSION, "", COPYRIGHT );
Thread::init(); Thread::init();