Use labs() for long instead of abs()
[ardour.git] / gtk2_ardour / mini_timeline.cc
index 9d7dc61d73709534ca925125b91ca940af8f8926..7030aa8e82a8cb4bb42ea1c15705a6ce7118f86c 100644 (file)
@@ -1,19 +1,20 @@
 /*
- * Copyright (C) 2016 Robin Gareus <robin@gareus.org>
+ * Copyright (C) 2016-2017 Robin Gareus <robin@gareus.org>
+ * Copyright (C) 2016-2018 Ben Loftis <ben@harrisonconsoles.com>
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
 #include "ardour/audioengine.h"
@@ -151,6 +152,7 @@ void
 MiniTimeline::set_colors ()
 {
        // TODO  UIConfiguration::instance().color & font
+       _phead_color = UIConfiguration::instance().color ("play head");
 }
 
 void
@@ -648,7 +650,8 @@ MiniTimeline::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle_
        /* playhead on top */
        int xc = width * 0.5f;
        cairo_set_line_width (cr, 1.0);
-       cairo_set_source_rgb (cr, 1, 0, 0); // playhead color
+       double r,g,b,a;  Gtkmm2ext::color_to_rgba(_phead_color, r,g,b,a);
+       cairo_set_source_rgb (cr, r,g,b); // playhead color
        cairo_move_to (cr, xc - .5, 0);
        cairo_rel_line_to (cr, 0, height);
        cairo_stroke (cr);