2 Copyright (C) 2001 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
31 string GTK_ARDOUR::session_name = "";
32 string GTK_ARDOUR::jack_client_name = "ardour";
33 bool GTK_ARDOUR::show_key_actions = false;
34 bool GTK_ARDOUR::no_splash = true;
35 bool GTK_ARDOUR::just_version = false;
36 bool GTK_ARDOUR::use_vst = true;
37 bool GTK_ARDOUR::new_session = false;
38 char* GTK_ARDOUR::curvetest_file = 0;
39 bool GTK_ARDOUR::try_hw_optimization = true;
41 using namespace GTK_ARDOUR;
44 print_help (const char *execname)
46 cout << _("Usage: ") << execname << "\n"
47 << _(" -v, --version Show version information\n")
48 << _(" -h, --help Print this message\n")
49 << _(" -b, --bindings Print all possible keyboard binding names\n")
50 << _(" -n, --show-splash Show splash screen\n")
51 << _(" -c, --name name Use a specific jack client name, default is ardour\n")
52 << _(" -N, --new session-name Create a new session from the command line\n")
53 << _(" -o, --use-hw-optimizations Try to use h/w specific optimizations\n")
55 << _(" -V, --novst Do not use VST support\n")
57 << _(" [session-name] Name of session to load\n")
58 << _(" -C, --curvetest filename Curve algorithm debugger\n")
59 << _(" -g, --gtktheme Allow GTK to load a theme\n")
66 GTK_ARDOUR::parse_opts (int argc, char *argv[])
69 const char *optstring = "U:hbvVnoc:C:N:g";
70 const char *execname = strrchr (argv[0], '/');
78 const struct option longopts[] = {
79 { "version", 0, 0, 'v' },
80 { "help", 0, 0, 'h' },
81 { "bindings", 0, 0, 'b' },
82 { "show-splash", 0, 0, 'n' },
83 { "name", 1, 0, 'c' },
84 { "novst", 0, 0, 'V' },
86 { "no-hw-optimizations", 0, 0, 'O' },
87 { "curvetest", 1, 0, 'C' },
88 { "gtktheme", 0, 0, 'g' },
96 c = getopt_long (argc, argv, optstring, longopts, &option_index);
111 print_help (execname);
115 show_key_actions = true;
124 session_name = optarg;
128 try_hw_optimization = false;
134 #endif /* VST_SUPPORT */
138 jack_client_name = optarg;
142 curvetest_file = optarg;
146 return print_help(execname);
152 cerr << "Illogical combination: you can either create a new session, or a load an existing session but not both!" << endl;
153 return print_help(execname);
155 session_name = argv[optind++];