From 210a08f418e8638a0ace2b3deb76d989b05b26f9 Mon Sep 17 00:00:00 2001 From: Georg Krause Date: Wed, 11 Jul 2018 21:51:42 +0200 Subject: [PATCH] removed const from smoothing_value I wanted to make this const to prevent changes, but since the smoothing_value needs to be calculated based on the samplerate which is a member of jack this does not work, I dont know how to do this. Any hints welcome. --- src/jack.cxx | 5 ++--- src/jack.hxx | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/jack.cxx b/src/jack.cxx index 93b4e3f..ff742b8 100644 --- a/src/jack.cxx +++ b/src/jack.cxx @@ -78,15 +78,14 @@ Jack::Jack( std::string name ) : client( jack_client_open ( name.c_str(), JackNullOption, 0, 0 ) ), state( new State() ), controllerUpdater( new ControllerUpdater() ), - clientActive(false), - smoothing_value(SMOOTHING_CONST * (44100.f / samplerate)) + clientActive(false) { jack = this; lastnframes=0; samplerate = jack_get_sample_rate( client ); // calculate smoothing value for current sample rate - //smoothing_value = SMOOTHING_CONST * (44100.f / samplerate); + smoothing_value = SMOOTHING_CONST * (44100.f / samplerate); // construct Observer classes here, not in the initializer list as the Jack* // will be 0x0 until then. diff --git a/src/jack.hxx b/src/jack.hxx index 9386ba4..1284426 100644 --- a/src/jack.hxx +++ b/src/jack.hxx @@ -137,7 +137,7 @@ public: JackSendReturn *getJackSendReturn(int t); - const float smoothing_value; + float smoothing_value; private: int lastnframes; jack_client_t* client;