summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2015-09-18 11:29:57 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2015-09-18 11:29:57 +0200
commit8f1d668ddad1bd2c44932b93853282b4eec9eba4 (patch)
treec43f5ea36b6b25b142e866b631e482d1c911aabd
parentde9777f27dbbe350494ba956ac5691a7a87cb892 (diff)
downloaddabmod-8f1d668ddad1bd2c44932b93853282b4eec9eba4.tar.gz
dabmod-8f1d668ddad1bd2c44932b93853282b4eec9eba4.tar.bz2
dabmod-8f1d668ddad1bd2c44932b93853282b4eec9eba4.zip
Keep digital gain across modulator restarts
-rw-r--r--src/DabModulator.cpp2
-rw-r--r--src/DabModulator.h10
-rw-r--r--src/GainControl.cpp6
-rw-r--r--src/GainControl.h8
4 files changed, 13 insertions, 13 deletions
diff --git a/src/DabModulator.cpp b/src/DabModulator.cpp
index 539de09..dbd3528 100644
--- a/src/DabModulator.cpp
+++ b/src/DabModulator.cpp
@@ -60,7 +60,7 @@ DabModulator::DabModulator(
const tii_config_t& tiiConfig,
unsigned outputRate, unsigned clockRate,
unsigned dabMode, GainMode gainMode,
- float digGain, float normalise,
+ float& digGain, float normalise,
std::string filterTapsFilename
) :
ModCodec(ModFormat(1), ModFormat(0)),
diff --git a/src/DabModulator.h b/src/DabModulator.h
index f212ecf..2552f50 100644
--- a/src/DabModulator.h
+++ b/src/DabModulator.h
@@ -53,10 +53,10 @@ public:
double& tist_offset_s, unsigned tist_delay_stages,
RemoteControllers* rcs,
const tii_config_t& tiiConfig,
- unsigned outputRate = 2048000, unsigned clockRate = 0,
- unsigned dabMode = 0, GainMode gainMode = GAIN_VAR,
- float digGain = 1.0, float normalise = 1.0,
- std::string filterTapsFilename = "");
+ unsigned outputRate, unsigned clockRate,
+ unsigned dabMode, GainMode gainMode,
+ float& digGain, float normalise,
+ std::string filterTapsFilename);
DabModulator(const DabModulator& other) = delete;
DabModulator& operator=(const DabModulator& other) = delete;
virtual ~DabModulator();
@@ -74,7 +74,7 @@ protected:
unsigned myClockRate;
unsigned myDabMode;
GainMode myGainMode;
- float myDigGain;
+ float& myDigGain;
float myNormalise;
EtiReader myEtiReader;
Flowgraph* myFlowgraph;
diff --git a/src/GainControl.cpp b/src/GainControl.cpp
index 03d8aa6..ee912bb 100644
--- a/src/GainControl.cpp
+++ b/src/GainControl.cpp
@@ -45,9 +45,9 @@ using namespace std;
GainControl::GainControl(size_t framesize,
- GainMode mode,
- float digGain,
- float normalise) :
+ GainMode mode,
+ float& digGain,
+ float normalise) :
ModCodec(ModFormat(framesize * sizeof(complexf)),
ModFormat(framesize * sizeof(complexf))),
RemoteControllable("gain"),
diff --git a/src/GainControl.h b/src/GainControl.h
index 00379b8..3340215 100644
--- a/src/GainControl.h
+++ b/src/GainControl.h
@@ -51,9 +51,9 @@ class GainControl : public ModCodec, public RemoteControllable
{
public:
GainControl(size_t framesize,
- GainMode mode = GAIN_VAR,
- float digGain = 1.0f,
- float normalise = 1.0f);
+ GainMode mode,
+ float& digGain,
+ float normalise);
virtual ~GainControl();
GainControl(const GainControl&);
@@ -72,7 +72,7 @@ class GainControl : public ModCodec, public RemoteControllable
protected:
size_t d_frameSize;
- float d_digGain;
+ float& d_digGain;
float d_normalise;
#ifdef __SSE__
__m128 (*computeGain)(const __m128* in, size_t sizeIn);