update drobilla's fascistic dir-locals.el to force emacs users into whitespace submis...
[ardour.git] / gtk2_ardour / latency_gui.cc
index 93b8be3ae73920fefc9082b0a958035e20adbd5b..8d2dd3f1c6037e6a8f18c357b6f1283c2fbd43f3 100644 (file)
@@ -1,4 +1,22 @@
-#define __STDC_FORMAT_MACROS 1
+/*
+    Copyright (C) 2009 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.
+
+*/
+
 #include <inttypes.h>
 
 #include <iomanip>
@@ -26,13 +44,13 @@ static const gchar *_unit_strings[] = {
 std::vector<std::string> LatencyGUI::unit_strings;
 
 std::string
-LatencyBarController::get_label (int&)
+LatencyBarController::get_label (double&)
 {
        double const nframes = _latency_gui->adjustment.get_value();
        std::stringstream s;
 
        if (nframes < (_latency_gui->sample_rate / 1000.0)) {
-               s << ((nframes64_t) rint (nframes)) << " samples";
+               s << ((framepos_t) rint (nframes)) << " samples";
        } else {
                s << std::fixed << std::setprecision (2) << (nframes / (_latency_gui->sample_rate / 1000.0)) << " msecs";
        }
@@ -40,7 +58,7 @@ LatencyBarController::get_label (int&)
        return s.str ();
 }
 
-LatencyGUI::LatencyGUI (Latent& l, nframes64_t sr, nframes64_t psz)
+LatencyGUI::LatencyGUI (Latent& l, framepos_t sr, framepos_t psz)
        : _latent (l),
          initial_value (_latent.signal_latency()),
          sample_rate (sr),
@@ -95,7 +113,7 @@ LatencyGUI::LatencyGUI (Latent& l, nframes64_t sr, nframes64_t psz)
 void
 LatencyGUI::finish ()
 {
-       nframes64_t new_value = (nframes64_t) adjustment.get_value();
+       framepos_t new_value = (framepos_t) adjustment.get_value();
        if (new_value != initial_value) {
                _latent.set_user_latency (new_value);
        }
@@ -140,7 +158,7 @@ LatencyGUI::change_latency_from_button (int dir)
        }
 }
 
-LatencyDialog::LatencyDialog (const std::string& title, Latent& l, nframes64_t sr, nframes64_t psz)
+LatencyDialog::LatencyDialog (const std::string& title, Latent& l, framepos_t sr, framepos_t psz)
        : ArdourDialog (title, false, true),
          lwidget (l, sr, psz)
 {