dedicated TAV separator line
authorRobin Gareus <robin@gareus.org>
Thu, 4 Sep 2014 15:01:28 +0000 (17:01 +0200)
committerRobin Gareus <robin@gareus.org>
Thu, 4 Sep 2014 15:01:28 +0000 (17:01 +0200)
gtk2_ardour/automation_time_axis.cc
gtk2_ardour/streamview.cc
gtk2_ardour/time_axis_view.cc
gtk2_ardour/time_axis_view.h

index cec3f3a4909275cd6aa76346a671d3d149938a0e..5f8845bb19bb9cf38fb4323de203c966cff84f0a 100644 (file)
@@ -120,7 +120,7 @@ AutomationTimeAxisView::AutomationTimeAxisView (
        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());
-       _base_rect->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
+       _base_rect->set_outline_what (ArdourCanvas::Rectangle::What (0));
        _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));
index 9eecc80dd7fd80de28ced468cb2bb81c02453a48..b13317939031516dc250feb5d3213624147b4dcd 100644 (file)
@@ -72,7 +72,7 @@ StreamView::StreamView (RouteTimeAxisView& tv, ArdourCanvas::Container* canvas_g
        canvas_rect = new ArdourCanvas::Rectangle (_canvas_group);
        CANVAS_DEBUG_NAME (canvas_rect, string_compose ("SV canvas rectangle %1", _trackview.name()));
        canvas_rect->set (ArdourCanvas::Rect (0, 0, ArdourCanvas::COORD_MAX, tv.current_height ()));
-       canvas_rect->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
+       canvas_rect->set_outline_what (ArdourCanvas::Rectangle::What (0));
        canvas_rect->set_outline_color (RGBA_TO_UINT (0, 0, 0, 255));
        canvas_rect->set_fill (true);
        canvas_rect->Event.connect (sigc::bind (sigc::mem_fun (_trackview.editor(), &PublicEditor::canvas_stream_view_event), canvas_rect, &_trackview));
index ee6208b6812e2ae10b0ad339040ccb4995b873e8..b2a815be5f0ae135de08c37f4565c3074122d082 100644 (file)
@@ -106,10 +106,16 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie
                compute_heights ();
        }
 
-       _canvas_display = new ArdourCanvas::Container (ed.get_trackview_group (), ArdourCanvas::Duple (0.0, 0.0));
+       _canvas_display = new ArdourCanvas::Container (ed.get_trackview_group (), ArdourCanvas::Duple (1.0, 0.0));
        CANVAS_DEBUG_NAME (_canvas_display, "main for TAV");
        _canvas_display->hide(); // reveal as needed
 
+       _canvas_separator = new ArdourCanvas::Line(ed.get_trackview_group ());
+       CANVAS_DEBUG_NAME (_canvas_separator, "separator for TAV");
+       _canvas_separator->set_outline_color(RGBA_TO_UINT (0, 0, 0, 255));
+       _canvas_separator->set_outline_width(1.0);
+       _canvas_separator->hide();
+
        selection_group = new ArdourCanvas::Container (_canvas_display);
        CANVAS_DEBUG_NAME (selection_group, "selection for TAV");
        selection_group->set_data (X_("timeselection"), (void *) 1);
@@ -222,6 +228,9 @@ TimeAxisView::~TimeAxisView()
        delete _canvas_display;
        _canvas_display = 0;
 
+       delete _canvas_separator;
+       _canvas_separator = 0;
+
        delete display_menu;
        display_menu = 0;
 
@@ -236,6 +245,7 @@ TimeAxisView::hide ()
        }
 
        _canvas_display->hide ();
+       _canvas_separator->hide ();
 
        if (control_parent) {
                control_parent->remove (time_axis_hbox);
@@ -280,16 +290,17 @@ TimeAxisView::show_at (double y, int& nth, VBox *parent)
        _order = nth;
 
        if (_y_position != y) {
-               // XXX +1 is a quick hack to align the track-header with the canvas
-               // with the separator line at the top.
-               _canvas_display->set_y_position (y + 1);
+               _canvas_separator->set (ArdourCanvas::Duple(0, y), ArdourCanvas::Duple(ArdourCanvas::COORD_MAX, y));
+               _canvas_display->set_y_position (y + 1); // XXX
                _y_position = y;
-
        }
 
        _canvas_display->raise_to_top ();
        _canvas_display->show ();
 
+       _canvas_separator->raise_to_top ();
+       _canvas_separator->show ();
+
        _hidden = false;
 
        _effective_height = current_height ();
@@ -881,14 +892,14 @@ TimeAxisView::show_selection (TimeSelection& ts)
 
                x1 = _editor.sample_to_pixel (start);
                x2 = _editor.sample_to_pixel (start + cnt - 1);
-               y2 = current_height() - 1;
+               y2 = current_height();
 
                rect->rect->set (ArdourCanvas::Rect (x1, 0, x2, y2));
 
                // trim boxes are at the top for selections
 
                if (x2 > x1) {
-                       rect->start_trim->set (ArdourCanvas::Rect (x1, 1, x1 + trim_handle_size, y2));
+                       rect->start_trim->set (ArdourCanvas::Rect (x1, 0, x1 + trim_handle_size, y2));
                        rect->end_trim->set (ArdourCanvas::Rect (x2 - trim_handle_size, 1, x2, y2));
 
                        rect->start_trim->show();
index d14686b4ee19975dc06eeb8d71c9229b4f899ca9..05ef2b93c93774391418b542465d923ad20e00fa 100644 (file)
@@ -41,6 +41,8 @@
 #include "ardour/region.h"
 #include "evoral/Parameter.hpp"
 
+#include "canvas/line.h"
+
 #include "prompter.h"
 #include "axis_view.h"
 #include "enums.h"
@@ -227,6 +229,7 @@ class TimeAxisView : public virtual AxisView
        bool                  _hidden;
        bool                   in_destructor;
        Gtk::Menu*            _size_menu;
+       ArdourCanvas::Line*       _canvas_separator;
        ArdourCanvas::Container*  _canvas_display;
        double                _y_position;
        PublicEditor&         _editor;