From a4578d02b049f635afa7c475711b1237cace4127 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 20 Jan 2012 15:08:44 +0000 Subject: [PATCH] heuristic to workaround over-eager translation of NN000Hz as NN kHz git-svn-id: svn://localhost/ardour2/branches/3.0@11279 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/engine_dialog.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/engine_dialog.cc b/gtk2_ardour/engine_dialog.cc index 46098c5ba6..54b964512e 100644 --- a/gtk2_ardour/engine_dialog.cc +++ b/gtk2_ardour/engine_dialog.cc @@ -955,7 +955,14 @@ EngineControl::driver_changed () uint32_t EngineControl::get_rate () { - return atoi (sample_rate_combo.get_active_text ()); + double r = atof (sample_rate_combo.get_active_text ()); + /* the string may have been translated with an abbreviation for + * thousands, so use a crude heuristic to fix this. + */ + if (r < 1000.0) { + r *= 1000.0; + } + return lrint (r); } void -- 2.30.2