From 2c124b658762e5498a42fb1453304ba32a9eca6b Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 21 Feb 2011 01:52:15 +0000 Subject: [PATCH] some cut-n-paste debugging stuff (more likely to follow) git-svn-id: svn://localhost/ardour2/branches/3.0@8914 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/debug.cc | 1 + gtk2_ardour/debug.h | 1 + gtk2_ardour/midi_region_view.cc | 11 +++++++++++ 3 files changed, 13 insertions(+) diff --git a/gtk2_ardour/debug.cc b/gtk2_ardour/debug.cc index 1d437ffe21..9dac857125 100644 --- a/gtk2_ardour/debug.cc +++ b/gtk2_ardour/debug.cc @@ -26,4 +26,5 @@ using namespace std; uint64_t PBD::DEBUG::Drags = PBD::new_debug_bit ("drags"); +uint64_t PBD::DEBUG::CutNPaste = PBD::new_debug_bit ("cutnpaste"); diff --git a/gtk2_ardour/debug.h b/gtk2_ardour/debug.h index 830f17ab30..488cbd202c 100644 --- a/gtk2_ardour/debug.h +++ b/gtk2_ardour/debug.h @@ -27,6 +27,7 @@ namespace PBD { namespace DEBUG { extern uint64_t Drags; + extern uint64_t CutNPaste; } } diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index 1e6ded20ae..10d869945a 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -49,6 +49,7 @@ #include "canvas-hit.h" #include "canvas-note.h" #include "canvas_patch_change.h" +#include "debug.h" #include "editor.h" #include "ghostregion.h" #include "gui_thread.h" @@ -2969,6 +2970,8 @@ MidiRegionView::paste (framepos_t pos, float times, const MidiCutBuffer& mcb) return; } + DEBUG_TRACE (DEBUG::CutNPaste, string_compose ("MIDI paste @ %1 times %2\n", pos, times)); + start_note_diff_command (_("paste")); Evoral::MusicalTime beat_delta; @@ -2981,6 +2984,12 @@ MidiRegionView::paste (framepos_t pos, float times, const MidiCutBuffer& mcb) beat_delta = (*mcb.notes().begin())->time() - paste_pos_beats; paste_pos_beats = 0; + DEBUG_TRACE (DEBUG::CutNPaste, string_compose ("Paste data spans from %1 to %2 (%3) ; paste pos beats = %4 (based on %5 - %6 ; beat delta = %7\n", + (*mcb.notes().begin())->time(), + (*mcb.notes().rbegin())->end_time(), + duration, pos, _region->position(), + paste_pos_beats, beat_delta)); + clear_selection (); for (int n = 0; n < (int) times; ++n) { @@ -3006,6 +3015,8 @@ MidiRegionView::paste (framepos_t pos, float times, const MidiCutBuffer& mcb) if (end_frame > region_end) { + DEBUG_TRACE (DEBUG::CutNPaste, string_compose ("Paste extended region from %1 to %2\n", region_end, end_frame)); + trackview.session()->begin_reversible_command (_("paste")); _region->clear_changes ();