Use labs() for long instead of abs()
[ardour.git] / gtk2_ardour / editor_tempodisplay.cc
index 0cb646be503630cb4b1ccea9ef7bd2a6c657d768..d8103fbf2b409a9cf878bea7da409c8b168139a7 100644 (file)
@@ -1,21 +1,28 @@
 /*
-    Copyright (C) 2002 Paul Davis
-
-    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., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
+ * Copyright (C) 2005-2017 Paul Davis <paul@linuxaudiosystems.com>
+ * Copyright (C) 2005 Taybin Rutkin <taybin@taybin.com>
+ * Copyright (C) 2006-2015 David Robillard <d@drobilla.net>
+ * Copyright (C) 2006-2015 Tim Mayberry <mojofunk@gmail.com>
+ * Copyright (C) 2007 Doug McLain <doug@nostar.net>
+ * Copyright (C) 2008-2011 Carl Hetherington <carl@carlh.net>
+ * Copyright (C) 2014-2015 Robin Gareus <robin@gareus.org>
+ * Copyright (C) 2015-2017 Nick Mainsbridge <mainsbridge@gmail.com>
+ * Copyright (C) 2017-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 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.
+ */
 
 #ifdef WAF_BUILD
 #include "gtk2ardour-config.h"
@@ -326,10 +333,10 @@ Editor::compute_current_bbt_points (std::vector<TempoMap::BBTPoint>& grid, sampl
        const double lower_beat = floor (max (0.0, _session->tempo_map().beat_at_sample (leftmost))) - 1.0;
        switch (bbt_ruler_scale) {
 
-       case bbt_show_beats:
-       case bbt_show_ticks:
-       case bbt_show_ticks_detail:
-       case bbt_show_ticks_super_detail:
+       case bbt_show_quarters:
+       case bbt_show_eighths:
+       case bbt_show_sixteenths:
+       case bbt_show_thirtyseconds:
                _session->tempo_map().get_grid (grid, max (_session->tempo_map().sample_at_beat (lower_beat), (samplepos_t) 0), rightmost);
                break;
 
@@ -383,7 +390,7 @@ Editor::maybe_draw_grid_lines ()
        } else if (_grid_type== GridTypeTimecode) {
                 metric_get_timecode (grid_marks, _leftmost_sample, rightmost_sample, 12);
        } else if (_grid_type == GridTypeCDFrame) {
-               metric_get_samples (grid_marks, _leftmost_sample, rightmost_sample, 12);
+               metric_get_minsec (grid_marks, _leftmost_sample, rightmost_sample, 12);
        } else if (_grid_type == GridTypeMinSec) {
                metric_get_minsec (grid_marks, _leftmost_sample, rightmost_sample, 12);
        }