From ae4b6316f158cc04585d82061857803f7a7ea251 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 25 May 2017 13:36:33 +0200 Subject: [PATCH] Implement basic AU parameter-printing (don't leave buf uninitialized) --- libs/ardour/audio_unit.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libs/ardour/audio_unit.cc b/libs/ardour/audio_unit.cc index 5d0b600e59..5d6204a227 100644 --- a/libs/ardour/audio_unit.cc +++ b/libs/ardour/audio_unit.cc @@ -2016,9 +2016,16 @@ AUPlugin::describe_parameter (Evoral::Parameter param) } void -AUPlugin::print_parameter (uint32_t /*param*/, char* /*buf*/, uint32_t /*len*/) const +AUPlugin::print_parameter (uint32_t param, char* buf, uint32_t len) const { // NameValue stuff here + if (buf && len) { + if (param < parameter_count()) { + snprintf (buf, len, "%.3f", get_parameter (param)); + } else { + strcat (buf, "0"); + } + } } bool