fix pathscanner / stl_vector related memory leaks
[ardour.git] / gtk2_ardour / automation_time_axis.cc
index 7b5771d74c9143dc3c8e7e9ad5a2ec23063bc1e0..c6238e67111c9de0d9795e0d4d71362ab64b896d 100644 (file)
@@ -31,6 +31,8 @@
 #include "ardour/route.h"
 #include "ardour/session.h"
 
+#include "canvas/debug.h"
+
 #include "ardour_ui.h"
 #include "automation_time_axis.h"
 #include "automation_streamview.h"
@@ -82,12 +84,17 @@ AutomationTimeAxisView::AutomationTimeAxisView (
        , _control (c)
        , _automatable (a)
        , _parameter (p)
-       , _base_rect (0)
-       , _view (show_regions ? new AutomationStreamView (*this) : 0)
+       , _base_rect (new ArdourCanvas::Rectangle (_canvas_display))
        , _name (nom)
+       , _view (show_regions ? new AutomationStreamView (*this) : 0)
        , auto_button (X_("")) /* force addition of a label */
        , _show_regions (show_regions)
 {
+
+       CANVAS_DEBUG_NAME (_canvas_display, string_compose ("main for auto %2/%1", _name, r->name()));
+       CANVAS_DEBUG_NAME (selection_group, string_compose ("selections for auto %2/%1", _name, r->name()));
+       CANVAS_DEBUG_NAME (_ghost_group, string_compose ("ghosts for auto %2/%1", _name, r->name()));
+
        if (!have_name_font) {
                name_font = get_font_for_style (X_("AutomationTrackName"));
                have_name_font = true;
@@ -108,20 +115,13 @@ AutomationTimeAxisView::AutomationTimeAxisView (
        ignore_state_request = false;
        first_call_to_set_height = true;
 
-       _base_rect = new ArdourCanvas::Rectangle (_canvas_display);
+       CANVAS_DEBUG_NAME (_base_rect, string_compose ("base rect for %1", _name));
        _base_rect->set_x1 (ArdourCanvas::COORD_MAX);
        _base_rect->set_outline_color (ARDOUR_UI::config()->get_canvasvar_AutomationTrackOutline());
-
-       /* outline ends and bottom */
-       _base_rect->set_outline_what (0x1 | 0x2 | 0x8);
+       _base_rect->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
        _base_rect->set_fill_color (ARDOUR_UI::config()->get_canvasvar_AutomationTrackFill());
-
        _base_rect->set_data ("trackview", this);
-
-       _base_rect->Event.connect (sigc::bind (
-                       sigc::mem_fun (_editor, &PublicEditor::canvas_automation_track_event),
-                       _base_rect, this));
-
+       _base_rect->Event.connect (sigc::bind (sigc::mem_fun (_editor, &PublicEditor::canvas_automation_track_event), _base_rect, this));
        if (!a) {
                _base_rect->lower_to_bottom();
        }
@@ -543,7 +543,7 @@ AutomationTimeAxisView::build_display_menu ()
 }
 
 void
-AutomationTimeAxisView::add_automation_event (GdkEvent* event, framepos_t when, double y)
+AutomationTimeAxisView::add_automation_event (GdkEvent* event, framepos_t when, double y, bool with_guard_points)
 {
        if (!_line) {
                return;
@@ -576,7 +576,7 @@ AutomationTimeAxisView::add_automation_event (GdkEvent* event, framepos_t when,
        _session->begin_reversible_command (_("add automation event"));
        XMLNode& before = list->get_state();
 
-       list->add (when, y);
+       list->add (when, y, with_guard_points);
 
        XMLNode& after = list->get_state();
        _session->commit_reversible_command (new MementoCommand<ARDOUR::AutomationList> (*list, &before, &after));