meterbridge: don't include disk/input buttons on busses; fixes #5935
[ardour.git] / gtk2_ardour / tempo_lines.cc
index a6177d2b1d9692d7b1e16261e0ecdb5b88e2b7e2..828a4cc82ba8a390af7b320bfcf37d4c8663319b 100644 (file)
 
 */
 
+#include "pbd/compose.h"
+
 #include "canvas/line.h"
 #include "canvas/canvas.h"
 #include "canvas/debug.h"
+
 #include "tempo_lines.h"
 #include "ardour_ui.h"
+#include "public_editor.h"
 
 using namespace std;
 
-TempoLines::TempoLines (ArdourCanvas::Canvas& canvas, ArdourCanvas::Group* group, double screen_height)
+TempoLines::TempoLines (ArdourCanvas::Canvas& canvas, ArdourCanvas::Group* group, double h)
        : _canvas (canvas)
        , _group (group)
-       , _height (screen_height)
+       , _height (h)
 {
 }
 
@@ -47,23 +51,18 @@ TempoLines::tempo_map_changed()
 void
 TempoLines::show ()
 {
-       for (Lines::iterator i = _lines.begin(); i != _lines.end(); ++i) {
-               (*i)->show();
-       }
+       _group->show ();
 }
 
 void
 TempoLines::hide ()
 {
-       for (Lines::iterator i = _lines.begin(); i != _lines.end(); ++i) {
-               (*i)->hide();
-       }
+       _group->hide ();
 }
 
 void
 TempoLines::draw (const ARDOUR::TempoMap::BBTPointList::const_iterator& begin, 
-                 const ARDOUR::TempoMap::BBTPointList::const_iterator& end, 
-                 double samples_per_pixel)
+                 const ARDOUR::TempoMap::BBTPointList::const_iterator& end)
 {
        ARDOUR::TempoMap::BBTPointList::const_iterator i;
        ArdourCanvas::Rect const visible = _canvas.visible_area ();
@@ -101,7 +100,7 @@ TempoLines::draw (const ARDOUR::TempoMap::BBTPointList::const_iterator& begin,
                        color = ARDOUR_UI::config()->get_canvasvar_MeasureLineBeat();
                }
 
-               ArdourCanvas::Coord xpos = rint(((framepos_t)(*i).frame) / (double)samples_per_pixel);
+               ArdourCanvas::Coord xpos = PublicEditor::instance().sample_to_pixel_unrounded ((*i).frame);
 
                ArdourCanvas::Line* line;
 
@@ -111,6 +110,8 @@ TempoLines::draw (const ARDOUR::TempoMap::BBTPointList::const_iterator& begin,
                        line->reparent (_group);
                } else {
                        line = new ArdourCanvas::Line (_group);
+                       CANVAS_DEBUG_NAME (line, string_compose ("tempo measure line @ %1", (*i).frame));
+                       line->set_ignore_events (true);
                }
 
                line->set_x0 (xpos);