heuristic to workaround over-eager translation of NN000Hz as NN kHz
[ardour.git] / gtk2_ardour / engine_dialog.cc
index 46098c5ba623f008944e54fdd0afd24290f8d08c..54b964512e0e877f4e6b9063c79fe175438df503 100644 (file)
@@ -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