diff --git a/mixer/src/Plugin_Module.C b/mixer/src/Plugin_Module.C index 02b4920..57f3bb9 100644 --- a/mixer/src/Plugin_Module.C +++ b/mixer/src/Plugin_Module.C @@ -290,6 +290,12 @@ Plugin_Module::spawn_discover_thread ( void ) plugin_discover_thread->clone( &Plugin_Module::discover_thread, NULL ); } +void +Plugin_Module::join_discover_thread ( void ) +{ + plugin_discover_thread->join(); +} + /* return a list of available plugins */ Plugin_Module::Plugin_Info * Plugin_Module::get_all_plugins ( void ) diff --git a/mixer/src/Plugin_Module.H b/mixer/src/Plugin_Module.H index 15e85c0..e32cafc 100644 --- a/mixer/src/Plugin_Module.H +++ b/mixer/src/Plugin_Module.H @@ -91,6 +91,7 @@ private: public: static void spawn_discover_thread ( void ); + static void join_discover_thread ( void ); Plugin_Module ( ); virtual ~Plugin_Module(); diff --git a/mixer/src/Project.C b/mixer/src/Project.C index 608bfbd..e78e0aa 100644 --- a/mixer/src/Project.C +++ b/mixer/src/Project.C @@ -309,7 +309,10 @@ Project::create ( const char *name, const char *template_name ) } if ( chdir( name ) ) + { FATAL( "WTF? Cannot change to new project directory" ); + return false; + } // mkdir( "sources", 0777 ); creat( "snapshot", 0666 ); diff --git a/mixer/src/main.C b/mixer/src/main.C index 4d2b75e..f0b79cf 100644 --- a/mixer/src/main.C +++ b/mixer/src/main.C @@ -70,6 +70,8 @@ const double NSM_CHECK_INTERVAL = 0.25f; +const char COPYRIGHT[] = "Copyright (c) 2008-2012 Jonathan Moore Liles"; + char *user_config_dir; Mixer *mixer; NSM_Client *nsm; @@ -128,6 +130,8 @@ int main ( int argc, char **argv ) { + printf( "%s %s %s -- %s\n", APP_TITLE, VERSION, "", COPYRIGHT ); + #ifdef HAVE_XPM fl_open_display(); Pixmap p, mask; @@ -174,8 +178,6 @@ main ( int argc, char **argv ) Fl::lock(); - Plugin_Module::spawn_discover_thread(); - Fl_Double_Window *main_window; { @@ -198,7 +200,7 @@ main ( int argc, char **argv ) #ifdef HAVE_XPM o->icon((char *)p); #endif - o->show( argc, argv ); + o->show( 0, 0 ); } const char *osc_port = NULL; @@ -210,6 +212,7 @@ main ( int argc, char **argv ) static struct option long_options[] = { + { "help", no_argument, 0, '?' }, { "instance", required_argument, 0, 'i' }, { "osc-port", required_argument, 0, 'p' }, { 0, 0, 0, 0 } @@ -234,12 +237,14 @@ main ( int argc, char **argv ) instance_override = true; break; case '?': - printf( "Usage: %s [--osc-port portnum]\n\n", argv[0] ); + printf( "\nUsage: %s [--instance instance_name] [--osc-port portnum] [path_to_project]\n\n", argv[0] ); exit(0); break; } } + Plugin_Module::spawn_discover_thread(); + mixer->init_osc( osc_port ); char *nsm_url = getenv( "NSM_URL" ); @@ -264,6 +269,9 @@ main ( int argc, char **argv ) { if ( optind < argc ) { + MESSAGE( "Waiting for plugins..." ); + Plugin_Module::join_discover_thread(); + MESSAGE( "Loading \"%s\"", argv[optind] ); if ( ! mixer->command_load( argv[optind] ) ) @@ -272,7 +280,7 @@ main ( int argc, char **argv ) } } } - + Fl::add_check( check_sigterm ); Fl::run();