Optimize plugin-processing for non-automated params
[ardour.git] / libs / ardour / ardour / value_as_string.h
index 2a973f374e1f0d9ca83cd8e898a59bc224a5c940..ed257d5cb56767ea1f6fdb84a07e7ab09eaa881b 100644 (file)
@@ -48,7 +48,7 @@ value_as_string(const ARDOUR::ParameterDescriptor& desc,
        }
 
        if (desc.toggled) {
-               return v >= 0 ? _("on") : _("off");
+               return v > 0 ? _("on") : _("off");
        }
 
        // Value is not a scale point, print it normally
@@ -56,6 +56,8 @@ value_as_string(const ARDOUR::ParameterDescriptor& desc,
                snprintf(buf, sizeof(buf), "%s", ParameterDescriptor::midi_note_name (rint(v)).c_str());
        } else if (desc.type == GainAutomation || desc.type == TrimAutomation || desc.type == EnvelopeAutomation) {
                snprintf(buf, sizeof(buf), "%.1f dB", accurate_coefficient_to_dB (v));
+       } else if (desc.type == PanWidthAutomation) {
+               snprintf (buf, sizeof (buf), "%d%%", (int) floor (100.0 * v));
        } else if (!desc.print_fmt.empty()) {
                snprintf(buf, sizeof(buf), desc.print_fmt.c_str(), v);
        } else if (desc.integer_step) {