consistent display of period-size.
authorRobin Gareus <robin@gareus.org>
Sat, 17 Jan 2015 21:38:48 +0000 (22:38 +0100)
committerRobin Gareus <robin@gareus.org>
Sat, 17 Jan 2015 21:42:20 +0000 (22:42 +0100)
gtk2_ardour/ardour_ui.cc
gtk2_ardour/engine_dialog.cc

index 48fc0ad9f10c44e55b5b78be29f0e799f101e10f..2c5a8f3ce0206db2db1f9e68d51e462ab2465938 100644 (file)
@@ -489,6 +489,7 @@ ARDOUR_UI::post_engine ()
 
        AudioEngine::instance()->Stopped.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::engine_stopped, this), gui_context());
        AudioEngine::instance()->SampleRateChanged.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::update_sample_rate, this, _1), gui_context());
+       AudioEngine::instance()->BufferSizeChanged.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::update_sample_rate, this, _1), gui_context());
        AudioEngine::instance()->Halted.connect_same_thread (halt_connection, boost::bind (&ARDOUR_UI::engine_halted, this, _1, false));
 
        _tooltips.enable();
index 2dfcf0088c517b8cf8321b97fc6b52b8adce75fd..394a52b19302b342f1924cbe28e5891b282e50c4 100644 (file)
@@ -1036,15 +1036,25 @@ EngineControl::show_buffer_duration ()
        uint32_t samples = atoi (bs_text); /* will ignore trailing text */
        uint32_t rate = get_rate();
 
-       /* Translators: "msecs" is ALWAYS plural here, so we do not
-          need singular form as well.
-        */
        /* Developers: note the hard-coding of a double buffered model
           in the (2 * samples) computation of latency. we always start
           the audiobackend in this configuration.
         */
+       /* note to jack1 developers: ardour also always starts the engine
+        * in async mode (no jack2 --sync option) which adds an extra cycle
+        * of latency with jack2 (and *3 would be correct)
+        * The value can also be wrong if jackd is started externally..
+        *
+        * At the time of writing the ALSA backend always uses double-buffering *2,
+        * The Dummy backend *1, and who knows what ASIO really does :)
+        *
+        * So just display the period size, that's also what
+        * ARDOUR_UI::update_sample_rate() does for the status bar.
+        * (the statusbar calls AudioEngine::instance()->usecs_per_cycle()
+        * but still, that's the buffer period, not [round-trip] latency)
+        */
        char buf[32];
-       snprintf (buf, sizeof (buf), _("(%.1f msecs)"), (2 * samples) / (rate/1000.0));
+       snprintf (buf, sizeof (buf), _("(%.1f ms)"), (samples / (rate/1000.0f)));
        buffer_size_duration_label.set_text (buf);
 }