show() widgets explicitly, one little file at a time
[ardour.git] / gtk2_ardour / opts.cc
index 481fb0ddbe6198369b16889592a4a5a5bd7d059f..608f684fc9f41ef587cfa42862b17c57b65afab7 100644 (file)
@@ -15,7 +15,6 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id$
 */
 
 #include <getopt.h>
@@ -36,7 +35,8 @@ bool GTK_ARDOUR::just_version = false;
 bool GTK_ARDOUR::use_vst = true;
 bool GTK_ARDOUR::new_session = false;
 char* GTK_ARDOUR::curvetest_file = 0;
-bool GTK_ARDOUR::try_hw_optimization = false;
+bool GTK_ARDOUR::try_hw_optimization = true;
+string GTK_ARDOUR::keybindings_path = ""; /* empty means use builtin default */
 
 using namespace GTK_ARDOUR;
 
@@ -50,12 +50,14 @@ print_help (const char *execname)
             << _("  -n, --show-splash                Show splash screen\n")
             << _("  -c, --name  name                 Use a specific jack client name, default is ardour\n")
             << _("  -N, --new session-name           Create a new session from the command line\n")                       
-            << _("  -o, --use-hw-optimizations        Try to use h/w specific optimizations\n")
+            << _("  -O, --no-hw-optimizations        Disable h/w specific optimizations\n")
+            << _("  -S, --sync                    Draw the gui synchronously \n")
 #ifdef VST_SUPPORT
             << _("  -V, --novst                      Do not use VST support\n")
 #endif
             << _("  [session-name]                   Name of session to load\n")
             << _("  -C, --curvetest filename         Curve algorithm debugger\n")
+            << _("  -k, --keybindings filename       Name of key bindings to load (default is ~/.ardour2/ardour.bindings)\n")
                ;
        return 1;
 
@@ -65,7 +67,7 @@ int
 GTK_ARDOUR::parse_opts (int argc, char *argv[])
 
 {
-       const char *optstring = "U:hbvVnoc:C:N:";
+       const char *optstring = "U:hSbvVnOc:C:N:k:";
        const char *execname = strrchr (argv[0], '/');
 
        if (execname == 0) {
@@ -82,7 +84,8 @@ GTK_ARDOUR::parse_opts (int argc, char *argv[])
                { "name", 1, 0, 'c' },
                { "novst", 0, 0, 'V' },
                { "new", 1, 0, 'N' },
-               { "use-hw-optimizations", 0, 0, 'o' },
+               { "no-hw-optimizations", 0, 0, 'O' },
+               { "sync", 0, 0, 'O' },
                { "curvetest", 1, 0, 'C' },
                { 0, 0, 0, 0 }
        };
@@ -116,14 +119,18 @@ GTK_ARDOUR::parse_opts (int argc, char *argv[])
                case 'n':
                        no_splash = false;
                        break;
+               
+               case 'S':
+               //      ; just pass this through to gtk it will figure it out
+                       break;
 
                case 'N':
                        new_session = true;
                        session_name = optarg;
                        break;
 
-               case 'o':
-                       try_hw_optimization = true;
+               case 'O':
+                       try_hw_optimization = false;
                        break;
 
                case 'V':
@@ -140,15 +147,24 @@ GTK_ARDOUR::parse_opts (int argc, char *argv[])
                        curvetest_file = optarg;
                        break;
 
-               default:
+               case 'k':
+                       keybindings_path = optarg;
                        break;
+
+               default:
+                       return print_help(execname);
                }
        }
 
        if (optind < argc) {
+               if (new_session) {
+                       cerr << "Illogical combination: you can either create a new session, or a load an existing session but not both!" << endl;
+                       return print_help(execname);
+               }
                session_name = argv[optind++];
        }
 
+
        return 0;
 }