From ccfaeb245a32aba716512c2e0f653acdf8e6c474 Mon Sep 17 00:00:00 2001 From: cu Date: Wed, 25 Mar 2020 12:23:04 +0900 Subject: [PATCH] Fix parameter initialization --- examples/CVPort/ExamplePluginCVPort.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/examples/CVPort/ExamplePluginCVPort.cpp b/examples/CVPort/ExamplePluginCVPort.cpp index fa44f764..856a3671 100644 --- a/examples/CVPort/ExamplePluginCVPort.cpp +++ b/examples/CVPort/ExamplePluginCVPort.cpp @@ -29,7 +29,12 @@ class ExamplePluginCVPort : public Plugin { public: ExamplePluginCVPort() - : Plugin(1, 0, 0) {} // 1 parameters, 0 programs, 0 states + : Plugin(1, 0, 0), // 1 parameters, 0 programs, 0 states + maxHoldTime(1.0f), + sampleRate(44100.0f), + counter(0), + holdTime(0.0f), + holdValue(0.0f) {} protected: /* -------------------------------------------------------------------------------------------------------- @@ -213,12 +218,12 @@ The plugin does sample & hold processing."; // ------------------------------------------------------------------------------------------------------- private: - const float maxHoldTime = 1.0f; + const float maxHoldTime; - float sampleRate = 44100.0f; - uint32_t counter = 0; // Hold time in samples. Used to count hold time. - float holdTime = 0.0f; // Hold time in seconds. - float holdValue = 0.0f; + float sampleRate; + uint32_t counter; // Hold time in samples. Used to count hold time. + float holdTime; // Hold time in seconds. + float holdValue; /** Set our plugin class as non-copyable and add a leak detector just in case.