13
0

consistent display of period-size.

This commit is contained in:
Robin Gareus 2015-01-17 22:38:48 +01:00
parent 03523f6703
commit 49047e4dc9
2 changed files with 15 additions and 4 deletions

View 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()->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()->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)); AudioEngine::instance()->Halted.connect_same_thread (halt_connection, boost::bind (&ARDOUR_UI::engine_halted, this, _1, false));
_tooltips.enable(); _tooltips.enable();

View File

@ -1036,15 +1036,25 @@ EngineControl::show_buffer_duration ()
uint32_t samples = atoi (bs_text); /* will ignore trailing text */ uint32_t samples = atoi (bs_text); /* will ignore trailing text */
uint32_t rate = get_rate(); 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 /* Developers: note the hard-coding of a double buffered model
in the (2 * samples) computation of latency. we always start in the (2 * samples) computation of latency. we always start
the audiobackend in this configuration. 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]; 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); buffer_size_duration_label.set_text (buf);
} }