Basic DEBUG_TRACE for layering code.
authorCarl Hetherington <carl@carlh.net>
Tue, 27 Dec 2011 16:29:40 +0000 (16:29 +0000)
committerCarl Hetherington <carl@carlh.net>
Tue, 27 Dec 2011 16:29:40 +0000 (16:29 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@11091 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/ardour/debug.h
libs/ardour/debug.cc
libs/ardour/playlist.cc

index 58bc4f7af474573826006df1b99c81ae8beb4cd7..9397198838301a3c9edf20c4abf2da2bb8ff577a 100644 (file)
@@ -56,6 +56,7 @@ namespace PBD {
                extern uint64_t ControlProtocols;
                extern uint64_t CycleTimers;
                extern uint64_t MidiTrackers;
+               extern uint64_t Layering;
        }
 }
 
index c18834219e674c5c2d3c4edef96abb1d6526c7e2..90793054ad83aa0a8c064ad97b9e943fe90a8b0b 100644 (file)
@@ -53,4 +53,5 @@ uint64_t PBD::DEBUG::AudioUnits = PBD::new_debug_bit ("audiounits");
 uint64_t PBD::DEBUG::ControlProtocols = PBD::new_debug_bit ("controlprotocols");
 uint64_t PBD::DEBUG::CycleTimers = PBD::new_debug_bit ("cycletimers");
 uint64_t PBD::DEBUG::MidiTrackers = PBD::new_debug_bit ("miditrackers");
+uint64_t PBD::DEBUG::Layering = PBD::new_debug_bit ("layering");
 
index f2084fda0c3edabe613735ea6c35f4b4ecc36ef0..4d7e63599ff32001d4e91746e2361a91f171bdf2 100644 (file)
@@ -2361,9 +2361,16 @@ Playlist::compute_temporary_layers (RegionList const & relayer_regions)
 
        for (RegionList::const_iterator i = relayer_regions.begin(); i != relayer_regions.end(); ++i) {
 
+               DEBUG_TRACE (DEBUG::Layering, string_compose ("Compute temporary layer for %1\n", (*i)->name()));
+       
                /* current_overlaps: regions that overlap *i now */
                RegionList current_overlaps = cache.get ((*i)->bounds ());
                current_overlaps.remove (*i);
+
+               DEBUG_TRACE (DEBUG::Layering, "Current overlaps:\n");
+               for (RegionList::iterator j = current_overlaps.begin(); j != current_overlaps.end(); ++j) {
+                       DEBUG_TRACE (DEBUG::Layering, string_compose ("\t%1\n", (*j)->name()));
+               }
                
                /* overlaps_to_preserve: regions that overlap *i now, but which aren't being
                   worked on during this relayer: these will have their relationship with
@@ -2486,6 +2493,8 @@ Playlist::commit_temporary_layers (TemporaryLayers const & temporary_layers)
        RegionList all_regions = regions.rlist ();
        all_regions.sort (SortByTemporaryLayer (temporary_layers));
 
+       DEBUG_TRACE (DEBUG::Layering, "Commit layering:\n");
+
        for (RegionList::iterator i = all_regions.begin(); i != all_regions.end(); ++i) {
 
                /* Go through the regions that we have already layered and hence work
@@ -2509,6 +2518,8 @@ Playlist::commit_temporary_layers (TemporaryLayers const & temporary_layers)
                        /* no overlap, so put on the bottom layer */
                        (*i)->set_layer (0);
                }
+               
+               DEBUG_TRACE (DEBUG::Layering, string_compose ("\t%1 %2\n", (*i)->name(), (*i)->layer()));
        }
 
        notify_layering_changed ();