Implement basic AU parameter-printing
authorRobin Gareus <robin@gareus.org>
Thu, 25 May 2017 11:36:33 +0000 (13:36 +0200)
committerRobin Gareus <robin@gareus.org>
Thu, 25 May 2017 11:49:18 +0000 (13:49 +0200)
(don't leave buf uninitialized)

libs/ardour/audio_unit.cc

index 5d0b600e59372e299687110b1dfeecbc321e456d..5d6204a22716f30022410a3d698a6f3a2b5ed243 100644 (file)
@@ -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