Fix up state save/load of location lock/glue settings.
[ardour.git] / gtk2_ardour / opts.cc
index 462a8ae7d5b4a15b7e2bd9b92d0cb6bc1feb99dc..e15df90fd5d5f065fd2c5f89644d0dc8197a54b9 100644 (file)
@@ -40,10 +40,13 @@ bool ARDOUR_COMMAND_LINE::use_vst = true;
 bool ARDOUR_COMMAND_LINE::new_session = false;
 char* ARDOUR_COMMAND_LINE::curvetest_file = 0;
 bool ARDOUR_COMMAND_LINE::try_hw_optimization = true;
+bool ARDOUR_COMMAND_LINE::no_connect_ports = false;
 string ARDOUR_COMMAND_LINE::keybindings_path = ""; /* empty means use builtin default */
 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;
+string ARDOUR_COMMAND_LINE::load_template;
 
 using namespace ARDOUR_COMMAND_LINE;
 
@@ -59,7 +62,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,51 +77,10 @@ print_help (const char *execname)
 
 }
 
-static void
-list_debug_options ()
-{
-       cerr << _("The following debug options are available. Their use is case-insensitive.") << "\n\n";
-       cerr << "\tMidiSourceIO\n";
-       cerr << "\tMidiPlaylistIO\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, "midisourceio") == 0) {
-                       bits |= ARDOUR::DEBUG::MidiSourceIO;
-               }
-               if (strcasecmp (p, "midiplaylistio") == 0) {
-                       bits |= ARDOUR::DEBUG::MidiPlaylistIO;
-               }
-
-               p = strtok_r (0, ",", &sp);
-       }
-       
-       free (copy);
-       ARDOUR::set_debug_bits (bits);
-       return 0;
-}
-
-
 int
 ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[])
 {
-       const char *optstring = "bc:C:dD:hk:E:m:N:nOp:SU:vV";
+       const char *optstring = "bc:C:dD:hk:E:m:N:nOp:PST:U:vV";
        const char *execname = strrchr (argv[0], '/');
 
        if (getenv ("ARDOUR_SAE")) {
@@ -146,6 +108,9 @@ 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' },
+               { "template", 1, 0, 'T' },
+               { "no-connect-ports", 0, 0, 'P' },
                { 0, 0, 0, 0 }
        };
 
@@ -180,7 +145,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;
@@ -201,6 +166,9 @@ ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[])
                case 'S':
                //      ; just pass this through to gtk it will figure it out
                        break;
+               case 'T':
+                       load_template = optarg;
+                       break;
 
                case 'N':
                        new_session = true;
@@ -211,6 +179,10 @@ ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[])
                        try_hw_optimization = false;
                        break;
 
+               case 'P':
+                       no_connect_ports = true;
+                       break;
+
                case 'V':
 #ifdef VST_SUPPORT
                        use_vst = false;
@@ -233,6 +205,10 @@ ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[])
                        immediate_save = optarg;
                        break;
 
+               case 'U':
+                       jack_session_uuid = optarg;
+                        break;
+
                default:
                        return print_help(execname);
                }