add icons for cut mouse mode button and cut cursor (both need improving)
[ardour.git] / gtk2_ardour / automation_line.cc
index b0cc6eeea378610ab9fda5af2bff01cb607c4654..1cfd7eeb48d4a7c657d27d0142d7b35bb9a53bf6 100644 (file)
@@ -51,7 +51,6 @@
 #include "rgb_macros.h"
 #include "ardour_ui.h"
 #include "public_editor.h"
-#include "utils.h"
 #include "selection.h"
 #include "time_axis_view.h"
 #include "point_selection.h"
@@ -70,7 +69,7 @@ using namespace Editing;
 /** @param converter A TimeConverter whose origin_b is the start time of the AutomationList in session frames.
  *  This will not be deleted by AutomationLine.
  */
-AutomationLine::AutomationLine (const string& name, TimeAxisView& tv, ArdourCanvas::Group& parent,
+AutomationLine::AutomationLine (const string& name, TimeAxisView& tv, ArdourCanvas::Item& parent,
                                 boost::shared_ptr<AutomationList> al,
                                 Evoral::TimeConverter<double, framepos_t>* converter)
        : trackview (tv)
@@ -99,7 +98,7 @@ AutomationLine::AutomationLine (const string& name, TimeAxisView& tv, ArdourCanv
        terminal_points_can_slide = true;
        _height = 0;
 
-       group = new ArdourCanvas::Group (&parent);
+       group = new ArdourCanvas::Container (&parent);
        CANVAS_DEBUG_NAME (group, "region gain envelope group");
 
        line = new ArdourCanvas::PolyLine (group);
@@ -537,7 +536,8 @@ AutomationLine::ContiguousControlPoints::compute_x_bounds (PublicEditor& e)
 
                        const framepos_t pos = e.pixel_to_sample(before_x);
                        const Meter& meter = map.meter_at (pos);
-                       const framecnt_t len = ceil(meter.frames_per_bar (map.tempo_at (pos), e.session()->frame_rate()) / 1920.0 / meter.divisions_per_bar());
+                       const framecnt_t len = ceil (meter.frames_per_bar (map.tempo_at (pos), e.session()->frame_rate())
+                                       / (Timecode::BBT_Time::ticks_per_beat * meter.divisions_per_bar()) );
                        const double one_tick_in_pixels = e.sample_to_pixel_unrounded (len);
 
                        before_x += one_tick_in_pixels;
@@ -552,7 +552,8 @@ AutomationLine::ContiguousControlPoints::compute_x_bounds (PublicEditor& e)
 
                        const framepos_t pos = e.pixel_to_sample(after_x);
                        const Meter& meter = map.meter_at (pos);
-                       const framecnt_t len = ceil(meter.frames_per_bar (map.tempo_at (pos), e.session()->frame_rate()) / 1920.0 / meter.divisions_per_bar());
+                       const framecnt_t len = ceil (meter.frames_per_bar (map.tempo_at (pos), e.session()->frame_rate())
+                                       / (Timecode::BBT_Time::ticks_per_beat * meter.divisions_per_bar()));
                        const double one_tick_in_pixels = e.sample_to_pixel_unrounded (len);
 
                        after_x -= one_tick_in_pixels;