use mpeg4 for internal video format (not mjpeg)
[ardour.git] / gtk2_ardour / automation_line.cc
index db541933b913a6c51ccff729b8c830ebc0e4c859..069a82315508f8af9b5394d92ba1e54428b900b8 100644 (file)
@@ -376,19 +376,16 @@ AutomationLine::fraction_to_string (double fraction) const
 {
        if (_uses_gain_mapping) {
                char buf[32];
-               if (_desc.type == GainAutomation) {
+               if (_desc.type == GainAutomation || _desc.type == EnvelopeAutomation || _desc.lower == 0) {
                        if (fraction == 0.0) {
                                snprintf (buf, sizeof (buf), "-inf");
                        } else {
                                snprintf (buf, sizeof (buf), "%.1f", accurate_coefficient_to_dB (slider_position_to_gain_with_max (fraction, _desc.upper)));
                        }
                } else {
-                       float coeff = _desc.lower + fraction * (_desc.upper - _desc.lower);
-                       if (coeff == 0.0) {
-                               snprintf (buf, sizeof (buf), "-inf");
-                       } else {
-                               snprintf (buf, sizeof (buf), "%.1f", accurate_coefficient_to_dB (coeff));
-                       }
+                       const double lower_db = accurate_coefficient_to_dB (_desc.lower);
+                       const double range_db = accurate_coefficient_to_dB (_desc.upper) - lower_db;
+                       snprintf (buf, sizeof (buf), "%.1f", lower_db + fraction * range_db);
                }
                return buf;
        } else {