two more debug trace options
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 18 Nov 2009 17:23:34 +0000 (17:23 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 18 Nov 2009 17:23:34 +0000 (17:23 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@6123 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/opts.cc
libs/ardour/ardour/debug.h
libs/ardour/route.cc

index cd45bed9ffff08a26dcc2104aa327523f05c92b3..c35927dad898c951f95afd85f59cf70a48b95578 100644 (file)
@@ -83,6 +83,7 @@ list_debug_options ()
        cerr << "\tMidiDiskstreamIO\n";
        cerr << "\tSnapBBT\n";
        cerr << "\tConfiguration\n";
+       cerr << "\tLatency\n";
 }
 
 static int
@@ -118,6 +119,10 @@ parse_debug_options (const char* str)
                        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;
                }
 
                p = strtok_r (0, ",", &sp);
index d91b3c1449cbc3faecc5acea88a4128ec14e392e..926d5520d7e7a6cef7c9276a4d7da420a1006f7f 100644 (file)
@@ -39,7 +39,9 @@ namespace ARDOUR {
                        MidiPlaylistIO = 0x2,
                        MidiDiskstreamIO = 0x4,
                        SnapBBT = 0x8,
-                       Configuration = 0x10
+                       Configuration = 0x10,
+                       Latency = 0x20,
+                       Processors = 0x40
                };
        }
 
index 935d98e3e6c391cdf3d064d526698a126d6b4519..248d60ab679c75fe12db085314831ba64438f3bb 100644 (file)
@@ -36,6 +36,7 @@
 #include "ardour/buffer_set.h"
 #include "ardour/configuration.h"
 #include "ardour/cycle_timer.h"
+#include "ardour/debug.h"
 #include "ardour/delivery.h"
 #include "ardour/dB.h"
 #include "ardour/internal_send.h"
@@ -621,7 +622,7 @@ Route::muted() const
        return _mute_master->muted ();
 }
 
-#if 1
+#if 0
 static void
 dump_processors(const string& name, const list<boost::shared_ptr<Processor> >& procs)
 {
@@ -1399,13 +1400,19 @@ Route::configure_processors_unlocked (ProcessorStreams* err)
        list< pair<ChanCount,ChanCount> > configuration;
        uint32_t index = 0;
 
-       cerr << _name << " CONFIGURE PROCESSORS\n";
-       dump_processors (_name, _processors);
+       DEBUG_TRACE (DEBUG::Processors, string_compose ("%1: configure processors\n", _name));
+#ifndef NDEBUG
+       DEBUG_TRACE (DEBUG::Processors, "{\n");
+       for (list<boost::shared_ptr<Processor> >::const_iterator p = _processors.begin(); p != _processors.end(); ++p) {
+               DEBUG_TRACE (DEBUG::Processors, string_compose ("\t%1 ID = %2", (*p)->name(), (*p)->id()));
+       }
+       DEBUG_TRACE (DEBUG::Processors, "}\n");
+#endif
 
        for (ProcessorList::iterator p = _processors.begin(); p != _processors.end(); ++p, ++index) {
 
                if ((*p)->can_support_io_configuration(in, out)) {
-                       cerr << "\t" << (*p)->name() << " in = " << in << " out = " << out << endl;
+                       DEBUG_TRACE (DEBUG::Processors, string_compose ("\t%1in = %2 out = %3\n",(*p)->name(), in, out));
                        configuration.push_back(make_pair(in, out));
                        in = out;
                } else {
@@ -2712,10 +2719,7 @@ Route::update_total_latency ()
                }
        }
 
-#undef DEBUG_LATENCY
-#ifdef DEBUG_LATENCY
-       cerr << _name << ": internal redirect latency = " << own_latency << endl;
-#endif
+       DEBUG_TRACE (DEBUG::Latency, string_compose ("%1: internal redirect latency = %2\n", _name, own_latency));
 
        _output->set_port_latency (own_latency);
 
@@ -2736,10 +2740,7 @@ Route::update_total_latency ()
                signal_latency_changed (); /* EMIT SIGNAL */
        }
 
-#ifdef DEBUG_LATENCY
-       cerr << _name << ": input latency = " << _input->signal_latency() << " total = "
-            << own_latency << endl;
-#endif
+       DEBUG_TRACE (DEBUG::Latency, string_compose ("%1: input latency = %2 total = %3\n", _name, _input->signal_latency(), own_latency));
 
        return _output->effective_latency ();
 }