save global state when quitting BEFORE we stop the engine, so that global MIDI ports...
[ardour.git] / gtk2_ardour / opts.cc
index 883d8d584555b82de861ddd5504dc003d09fc901..1392cb3f4829ba40c90acfe5a251aa06cbc3fda6 100644 (file)
@@ -44,6 +44,7 @@ string ARDOUR_COMMAND_LINE::keybindings_path = ""; /* empty means use builtin de
 Glib::ustring ARDOUR_COMMAND_LINE::menus_file = "ardour.menus";
 bool ARDOUR_COMMAND_LINE::finder_invoked_ardour = false;
 string ARDOUR_COMMAND_LINE::immediate_save;
+string ARDOUR_COMMAND_LINE::jack_session_uuid;
 
 using namespace ARDOUR_COMMAND_LINE;
 
@@ -59,7 +60,7 @@ print_help (const char *execname)
             << _("  -d, --disable-plugins       Disable all plugins in an existing session\n")
             << _("  -D, --debug <options>       Set debug flags. Use \"-D list\" to see available options\n")
             << _("  -n, --show-splash           Show splash screen\n")
-            << _("  -m, --menus file            Use \"file\" for Ardour menus\n")
+            << _("  -m, --menus file            Use \"file\" to define menus\n")
             << _("  -N, --new session-name      Create a new session from the command line\n")
             << _("  -O, --no-hw-optimizations   Disable h/w specific optimizations\n")
             << _("  -S, --sync                  Draw the gui synchronously \n")
@@ -74,72 +75,6 @@ print_help (const char *execname)
 
 }
 
-static void
-list_debug_options ()
-{
-       cerr << _("The following debug options are available. Separate multipe options with commas.\nNames are case-insensitive and can be abbreviated.") << "\n\n";
-       cerr << "\tMidiSourceIO\n";
-       cerr << "\tMidiPlaylistIO\n";
-       cerr << "\tMidiDiskstreamIO\n";
-       cerr << "\tSnapBBT\n";
-       cerr << "\tConfiguration\n";
-       cerr << "\tLatency\n";
-       cerr << "\tGraph\n";
-       cerr << "\tDestruction\n";
-}
-
-static int
-parse_debug_options (const char* str)
-{
-       char* p;
-       char* sp;
-       uint64_t bits = 0;
-       char* copy = strdup (str);
-
-       p = strtok_r (copy, ",", &sp);
-
-       while (p) {
-               if (strcasecmp (p, "list") == 0) {
-                       list_debug_options ();
-                       free (copy);
-                       return 1;
-               }
-
-               if (strcasecmp (p, "all") == 0) {
-                       ARDOUR::set_debug_bits (~0ULL);
-                       free (copy);
-                       return 0;
-               }
-
-               if (strncasecmp (p, "midisourceio", strlen (p)) == 0) {
-                       bits |= ARDOUR::DEBUG::MidiSourceIO;
-               } else if (strncasecmp (p, "midiplaylistio", strlen (p)) == 0) {
-                       bits |= ARDOUR::DEBUG::MidiPlaylistIO;
-               } else if (strncasecmp (p, "mididiskstreamio", strlen (p)) == 0) {
-                       bits |= ARDOUR::DEBUG::MidiDiskstreamIO;
-               } else if (strncasecmp (p, "snapbbt", strlen (p)) == 0) {
-                       bits |= ARDOUR::DEBUG::SnapBBT;
-               } else if (strncasecmp (p, "configuration", strlen (p)) == 0) {
-                       bits |= ARDOUR::DEBUG::Configuration;
-               } else if (strncasecmp (p, "latency", strlen (p)) == 0) {
-                       bits |= ARDOUR::DEBUG::Latency;
-               } else if (strncasecmp (p, "processors", strlen (p)) == 0) {
-                       bits |= ARDOUR::DEBUG::Processors;
-               } else if (strncasecmp (p, "graph", strlen (p)) == 0) {
-                       bits |= ARDOUR::DEBUG::Graph;
-               } else if (strncasecmp (p, "destruction", strlen (p)) == 0) {
-                       bits |= ARDOUR::DEBUG::Destruction;
-               }
-
-               p = strtok_r (0, ",", &sp);
-       }
-       
-       free (copy);
-       ARDOUR::set_debug_bits (bits);
-       return 0;
-}
-
-
 int
 ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[])
 {
@@ -171,6 +106,7 @@ ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[])
                { "sync", 0, 0, 'S' },
                { "curvetest", 1, 0, 'C' },
                { "save", 1, 0, 'E' },
+               { "uuid", 1, 0, 'U' },
                { 0, 0, 0, 0 }
        };
 
@@ -205,7 +141,7 @@ ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[])
                        break;
 
                case 'D':
-                       if (parse_debug_options (optarg)) {
+                       if (PBD::parse_debug_options (optarg)) {
                                exit (0);
                        }
                        break;
@@ -258,6 +194,9 @@ ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[])
                        immediate_save = optarg;
                        break;
 
+               case 'U':
+                       jack_session_uuid = optarg;
+
                default:
                        return print_help(execname);
                }