From dbc75e074912fc3647899711e838d4e5b675e175 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 24 Oct 2009 13:26:26 +0000 Subject: [PATCH] start of a nominal debug tracing system, with 64 bits available for flags; track notes by region in MidiPlaylist, and resolve them if they are left hanging at region boundaries. note: MIDI playback is still not working 100% though its better now. git-svn-id: svn://localhost/ardour2/branches/3.0@5902 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/opts.cc | 49 +++++++++++++++++++++++++++++++++- gtk2_ardour/route_time_axis.cc | 1 + 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/opts.cc b/gtk2_ardour/opts.cc index 5d95c4e8a9..917d2a49d7 100644 --- a/gtk2_ardour/opts.cc +++ b/gtk2_ardour/opts.cc @@ -18,9 +18,11 @@ */ #include +#include #include #include +#include "ardour/debug.h" #include "ardour/session.h" #include "opts.h" @@ -54,6 +56,7 @@ print_help (const char *execname) << _(" -b, --bindings Print all possible keyboard binding names\n") << _(" -c, --name Use a specific jack client name, default is ardour\n") << _(" -d, --disable-plugins Disable all plugins in an existing session\n") + << _(" -D, --debug 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") << _(" -N, --new session-name Create a new session from the command line\n") @@ -71,10 +74,47 @@ 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"; +} + +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; + } + + 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 = "U:hSbvVnOdc:C:m:N:k:p:E:"; + const char *optstring = "bc:C:dD:hk:E:m:N:nOp:SU:vV"; const char *execname = strrchr (argv[0], '/'); if (getenv ("ARDOUR_SAE")) { @@ -92,6 +132,7 @@ ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[]) { "version", 0, 0, 'v' }, { "help", 0, 0, 'h' }, { "bindings", 0, 0, 'b' }, + { "debug", 1, 0, 'D' }, { "show-splash", 0, 0, 'n' }, { "menus", 1, 0, 'm' }, { "name", 1, 0, 'c' }, @@ -134,6 +175,12 @@ ARDOUR_COMMAND_LINE::parse_opts (int argc, char *argv[]) ARDOUR::Session::set_disable_all_loaded_plugins (true); break; + case 'D': + if (parse_debug_options (optarg)) { + exit (0); + } + break; + case 'm': menus_file = optarg; break; diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index e21e1f734a..cc39c6fb80 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -123,6 +123,7 @@ RouteTimeAxisView::RouteTimeAxisView (PublicEditor& ed, Session& sess, boost::sh playlist_menu = 0; playlist_action_menu = 0; automation_action_menu = 0; + mode_menu = 0; _view = 0; if (!_route->is_hidden()) { -- 2.30.2