diff --git a/src/config/CMakeLists.txt b/src/config/CMakeLists.txt
index 1430513b0..0a035b7c2 100644
--- a/src/config/CMakeLists.txt
+++ b/src/config/CMakeLists.txt
@@ -1,5 +1,6 @@
add_library(fdv_config STATIC
AudioConfiguration.cpp
+ FilterConfiguration.cpp
FreeDVConfiguration.cpp
WxWidgetsConfigStore.cpp
)
diff --git a/src/config/FilterConfiguration.cpp b/src/config/FilterConfiguration.cpp
new file mode 100644
index 000000000..8057ef23c
--- /dev/null
+++ b/src/config/FilterConfiguration.cpp
@@ -0,0 +1,37 @@
+//==========================================================================
+// Name: FilterConfiguration.cpp
+// Purpose: Implements the filter configuration for FreeDV
+// Created: July 2, 2023
+// Authors: Mooneer Salem
+//
+// License:
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License version 2.1,
+// as published by the Free Software Foundation. This program is
+// distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+// License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, see .
+//
+//==========================================================================
+
+#include "FilterConfiguration.h"
+
+DEFINE_FILTER_CONFIG_NAMES(MicIn);
+DEFINE_FILTER_CONFIG_NAMES(SpkOut);
+
+void FilterConfiguration::load(wxConfigBase* config)
+{
+ micInChannel.load(config);
+ spkOutChannel.load(config);
+}
+
+void FilterConfiguration::save(wxConfigBase* config)
+{
+ micInChannel.save(config);
+ spkOutChannel.save(config);
+}
\ No newline at end of file
diff --git a/src/config/FilterConfiguration.h b/src/config/FilterConfiguration.h
new file mode 100644
index 000000000..4e9524d14
--- /dev/null
+++ b/src/config/FilterConfiguration.h
@@ -0,0 +1,154 @@
+//==========================================================================
+// Name: FilterConfiguration.h
+// Purpose: Implements the filter configuration for FreeDV
+// Created: July 2, 2023
+// Authors: Mooneer Salem
+//
+// License:
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License version 2.1,
+// as published by the Free Software Foundation. This program is
+// distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+// License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, see .
+//
+//==========================================================================
+
+#ifndef FILTER_CONFIGURATION_H
+#define FILTER_CONFIGURATION_H
+
+#include "WxWidgetsConfigStore.h"
+#include "ConfigurationDataElement.h"
+
+class FilterConfiguration : public WxWidgetsConfigStore
+{
+public:
+ enum Channel { MicIn, SpkOut };
+
+ template
+ class FilterChannelConfigName
+ {
+ public:
+ static const char* GetBassFreqHzConfigName() { assert(0); }
+ static const char* GetBassGaindBConfigName() { assert(0); }
+ static const char* GetTrebleFreqHzConfigName() { assert(0); }
+ static const char* GetTrebleGaindBConfigName() { assert(0); }
+ static const char* GetMidFreqHzConfigName() { assert(0); }
+ static const char* GetMidGaindBConfigName() { assert(0); }
+ static const char* GetMidQConfigName() { assert(0); }
+ static const char* GetVolInDBConfigName() { assert(0); }
+ static const char* GetEQEnableConfigName() { assert(0); }
+ };
+
+ template
+ class FilterChannel : public WxWidgetsConfigStore
+ {
+ public:
+ FilterChannel();
+ virtual ~FilterChannel() = default;
+
+ ConfigurationDataElement bassFreqHz;
+ ConfigurationDataElement bassGaindB;
+ ConfigurationDataElement trebleFreqHz;
+ ConfigurationDataElement trebleGaindB;
+ ConfigurationDataElement midFreqHz;
+ ConfigurationDataElement midGainDB;
+ ConfigurationDataElement midQ;
+ ConfigurationDataElement volInDB;
+ ConfigurationDataElement eqEnable;
+
+ virtual void load(wxConfigBase* config) override;
+ virtual void save(wxConfigBase* config) override;
+ };
+
+ FilterConfiguration() = default;
+ virtual ~FilterConfiguration() = default;
+
+ FilterChannel micInChannel;
+ FilterChannel spkOutChannel;
+
+ virtual void load(wxConfigBase* config) override;
+ virtual void save(wxConfigBase* config) override;
+};
+
+#define DECLARE_FILTER_CONFIG_NAME(type, name) \
+ template<> \
+ const char* FilterConfiguration::FilterChannelConfigName::Get ## name ## ConfigName()
+
+#define DECLARE_FILTER_CONFIG_NAMES(type) \
+ DECLARE_FILTER_CONFIG_NAME(type, BassFreqHz); \
+ DECLARE_FILTER_CONFIG_NAME(type, BassGaindB); \
+ DECLARE_FILTER_CONFIG_NAME(type, TrebleFreqHz); \
+ DECLARE_FILTER_CONFIG_NAME(type, TrebleGaindB); \
+ DECLARE_FILTER_CONFIG_NAME(type, MidFreqHz); \
+ DECLARE_FILTER_CONFIG_NAME(type, MidGaindB); \
+ DECLARE_FILTER_CONFIG_NAME(type, MidQ); \
+ DECLARE_FILTER_CONFIG_NAME(type, VolInDB); \
+ DECLARE_FILTER_CONFIG_NAME(type, EQEnable);
+
+#define DEFINE_FILTER_CONFIG_NAME(type, name) \
+ DECLARE_FILTER_CONFIG_NAME(type, name) { return "/Filter/" #type #name; }
+
+#define DEFINE_FILTER_CONFIG_NAMES(type) \
+ DEFINE_FILTER_CONFIG_NAME(type, BassFreqHz) \
+ DEFINE_FILTER_CONFIG_NAME(type, BassGaindB) \
+ DEFINE_FILTER_CONFIG_NAME(type, TrebleFreqHz) \
+ DEFINE_FILTER_CONFIG_NAME(type, TrebleGaindB) \
+ DEFINE_FILTER_CONFIG_NAME(type, MidFreqHz) \
+ DEFINE_FILTER_CONFIG_NAME(type, MidGaindB) \
+ DEFINE_FILTER_CONFIG_NAME(type, MidQ) \
+ DEFINE_FILTER_CONFIG_NAME(type, VolInDB) \
+ DEFINE_FILTER_CONFIG_NAME(type, EQEnable)
+
+DECLARE_FILTER_CONFIG_NAMES(MicIn);
+DECLARE_FILTER_CONFIG_NAMES(SpkOut);
+
+template
+FilterConfiguration::FilterChannel::FilterChannel()
+ : bassFreqHz(FilterConfiguration::FilterChannelConfigName::GetBassFreqHzConfigName(), 1)
+ , bassGaindB(FilterConfiguration::FilterChannelConfigName::GetBassGaindBConfigName(), ((long)0)/10.0)
+ , trebleFreqHz(FilterConfiguration::FilterChannelConfigName::GetTrebleFreqHzConfigName(), 1)
+ , trebleGaindB(FilterConfiguration::FilterChannelConfigName::GetTrebleGaindBConfigName(), ((long)0)/10.0)
+ , midFreqHz(FilterConfiguration::FilterChannelConfigName::GetMidFreqHzConfigName(), 1)
+ , midGainDB(FilterConfiguration::FilterChannelConfigName::GetMidGaindBConfigName(), ((long)0)/10.0)
+ , midQ(FilterConfiguration::FilterChannelConfigName::GetMidQConfigName(), ((long)100)/100.0)
+ , volInDB(FilterConfiguration::FilterChannelConfigName::GetVolInDBConfigName(), ((long)0)/10.0)
+ , eqEnable(FilterConfiguration::FilterChannelConfigName::GetEQEnableConfigName(), false)
+{
+ // empty
+}
+
+template
+void FilterConfiguration::FilterChannel::load(wxConfigBase* config)
+{
+ load_(config, bassFreqHz);
+ load_(config, bassGaindB);
+ load_(config, trebleFreqHz);
+ load_(config, trebleGaindB);
+ load_(config, midFreqHz);
+ load_(config, midGainDB);
+ load_(config, midQ);
+ load_(config, volInDB);
+ load_(config, eqEnable);
+}
+
+template
+void FilterConfiguration::FilterChannel::save(wxConfigBase* config)
+{
+ save_(config, bassFreqHz);
+ save_(config, bassGaindB);
+ save_(config, trebleFreqHz);
+ save_(config, trebleGaindB);
+ save_(config, midFreqHz);
+ save_(config, midGainDB);
+ save_(config, midQ);
+ save_(config, volInDB);
+ save_(config, eqEnable);
+}
+
+#endif // FILTER_CONFIGURATION_H
\ No newline at end of file
diff --git a/src/config/FreeDVConfiguration.cpp b/src/config/FreeDVConfiguration.cpp
index 880830e0b..80ede2a80 100644
--- a/src/config/FreeDVConfiguration.cpp
+++ b/src/config/FreeDVConfiguration.cpp
@@ -71,6 +71,7 @@ void FreeDVConfiguration::load(wxConfigBase* config)
load_(config, squelchLevel);
audioConfiguration.load(config);
+ filterConfiguration.load(config);
load_(config, fifoSizeMs);
load_(config, transmitLevel);
@@ -99,6 +100,7 @@ void FreeDVConfiguration::save(wxConfigBase* config)
save_(config, squelchLevel);
audioConfiguration.save(config);
+ filterConfiguration.save(config);
save_(config, fifoSizeMs);
save_(config, transmitLevel);
diff --git a/src/config/FreeDVConfiguration.h b/src/config/FreeDVConfiguration.h
index 78326a86d..5b2cff4a5 100644
--- a/src/config/FreeDVConfiguration.h
+++ b/src/config/FreeDVConfiguration.h
@@ -25,6 +25,7 @@
#include "WxWidgetsConfigStore.h"
#include "ConfigurationDataElement.h"
#include "AudioConfiguration.h"
+#include "FilterConfiguration.h"
class FreeDVConfiguration : public WxWidgetsConfigStore
{
@@ -46,6 +47,7 @@ class FreeDVConfiguration : public WxWidgetsConfigStore
ConfigurationDataElement squelchLevel;
AudioConfiguration audioConfiguration;
+ FilterConfiguration filterConfiguration;
ConfigurationDataElement fifoSizeMs;
ConfigurationDataElement transmitLevel;
diff --git a/src/dlg_filter.cpp b/src/dlg_filter.cpp
index 2dd41c715..19972a5ad 100644
--- a/src/dlg_filter.cpp
+++ b/src/dlg_filter.cpp
@@ -403,69 +403,69 @@ void FilterDlg::ExchangeData(int inout)
// Mic In Equaliser
- m_MicInBass.freqHz = wxGetApp().m_MicInBassFreqHz;
+ m_MicInBass.freqHz = wxGetApp().appConfiguration.filterConfiguration.micInChannel.bassFreqHz;
m_MicInBass.freqHz = limit(m_MicInBass.freqHz, 1.0, MAX_FREQ_BASS);
setFreq(&m_MicInBass);
- m_MicInBass.gaindB = wxGetApp().m_MicInBassGaindB;
+ m_MicInBass.gaindB = wxGetApp().appConfiguration.filterConfiguration.micInChannel.bassGaindB;
m_MicInBass.gaindB = limit(m_MicInBass.gaindB, MIN_GAIN, MAX_GAIN);
setGain(&m_MicInBass);
- m_MicInTreble.freqHz = wxGetApp().m_MicInTrebleFreqHz;
+ m_MicInTreble.freqHz = wxGetApp().appConfiguration.filterConfiguration.micInChannel.trebleFreqHz;
m_MicInTreble.freqHz = limit(m_MicInTreble.freqHz, 1.0, MAX_FREQ_TREBLE);
setFreq(&m_MicInTreble);
- m_MicInTreble.gaindB = wxGetApp().m_MicInTrebleGaindB;
+ m_MicInTreble.gaindB = wxGetApp().appConfiguration.filterConfiguration.micInChannel.trebleGaindB;
m_MicInTreble.gaindB = limit(m_MicInTreble.gaindB, MIN_GAIN, MAX_GAIN);
setGain(&m_MicInTreble);
- m_MicInMid.freqHz = wxGetApp().m_MicInMidFreqHz;
+ m_MicInMid.freqHz = wxGetApp().appConfiguration.filterConfiguration.micInChannel.midFreqHz;
m_MicInMid.freqHz = limit(m_MicInMid.freqHz, 1.0, MAX_FREQ_TREBLE);
setFreq(&m_MicInMid);
- m_MicInMid.gaindB = wxGetApp().m_MicInMidGaindB;
+ m_MicInMid.gaindB = wxGetApp().appConfiguration.filterConfiguration.micInChannel.midGainDB;
m_MicInMid.gaindB = limit(m_MicInMid.gaindB, MIN_GAIN, MAX_GAIN);
setGain(&m_MicInMid);
- m_MicInMid.Q = wxGetApp().m_MicInMidQ;
+ m_MicInMid.Q = wxGetApp().appConfiguration.filterConfiguration.micInChannel.midQ;
m_MicInMid.Q = limit(m_MicInMid.Q, pow(10.0,MIN_LOG10_Q), pow(10.0, MAX_LOG10_Q));
setQ(&m_MicInMid);
- m_MicInVol.gaindB = wxGetApp().m_MicInVolInDB;
+ m_MicInVol.gaindB = wxGetApp().appConfiguration.filterConfiguration.micInChannel.volInDB;
m_MicInVol.gaindB = limit(m_MicInVol.gaindB, MIN_GAIN, MAX_GAIN);
setGain(&m_MicInVol);
- m_MicInEnable->SetValue(wxGetApp().m_MicInEQEnable);
+ m_MicInEnable->SetValue(wxGetApp().appConfiguration.filterConfiguration.micInChannel.eqEnable);
plotMicInFilterSpectrum();
// Spk Out Equaliser
- m_SpkOutBass.freqHz = wxGetApp().m_SpkOutBassFreqHz;
+ m_SpkOutBass.freqHz = wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.bassFreqHz;
m_SpkOutBass.freqHz = limit(m_SpkOutBass.freqHz, 1.0, MAX_FREQ_BASS);
setFreq(&m_SpkOutBass);
- m_SpkOutBass.gaindB = wxGetApp().m_SpkOutBassGaindB;
+ m_SpkOutBass.gaindB = wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.bassGaindB;
m_SpkOutBass.gaindB = limit(m_SpkOutBass.gaindB, MIN_GAIN, MAX_GAIN);
setGain(&m_SpkOutBass);
- m_SpkOutTreble.freqHz = wxGetApp().m_SpkOutTrebleFreqHz;
+ m_SpkOutTreble.freqHz = wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.trebleFreqHz;
m_SpkOutTreble.freqHz = limit(m_SpkOutTreble.freqHz, 1.0, MAX_FREQ_TREBLE);
setFreq(&m_SpkOutTreble);
- m_SpkOutTreble.gaindB = wxGetApp().m_SpkOutTrebleGaindB;
+ m_SpkOutTreble.gaindB = wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.trebleGaindB;
m_SpkOutTreble.gaindB = limit(m_SpkOutTreble.gaindB, MIN_GAIN, MAX_GAIN);
setGain(&m_SpkOutTreble);
- m_SpkOutMid.freqHz = wxGetApp().m_SpkOutMidFreqHz;
+ m_SpkOutMid.freqHz = wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.midFreqHz;
m_SpkOutMid.freqHz = limit(m_SpkOutMid.freqHz, 1.0, MAX_FREQ_TREBLE);
setFreq(&m_SpkOutMid);
- m_SpkOutMid.gaindB = wxGetApp().m_SpkOutMidGaindB;
+ m_SpkOutMid.gaindB = wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.midGainDB;
m_SpkOutMid.gaindB = limit(m_SpkOutMid.gaindB, MIN_GAIN, MAX_GAIN);
setGain(&m_SpkOutMid);
- m_SpkOutMid.Q = wxGetApp().m_SpkOutMidQ;
+ m_SpkOutMid.Q = wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.midQ;
m_SpkOutMid.Q = limit(m_SpkOutMid.Q, pow(10.0,MIN_LOG10_Q), pow(10.0, MAX_LOG10_Q));
setQ(&m_SpkOutMid);
- m_SpkOutVol.gaindB = wxGetApp().m_SpkOutVolInDB;
+ m_SpkOutVol.gaindB = wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.volInDB;
m_SpkOutVol.gaindB = limit(m_SpkOutVol.gaindB, MIN_GAIN, MAX_GAIN);
setGain(&m_SpkOutVol);
- m_SpkOutEnable->SetValue(wxGetApp().m_SpkOutEQEnable);
+ m_SpkOutEnable->SetValue(wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.eqEnable);
plotSpkOutFilterSpectrum();
@@ -488,31 +488,31 @@ void FilterDlg::ExchangeData(int inout)
// Mic In Equaliser
- wxGetApp().m_MicInBassFreqHz = m_MicInBass.freqHz;
- wxGetApp().m_MicInBassGaindB = m_MicInBass.gaindB;
+ wxGetApp().appConfiguration.filterConfiguration.micInChannel.bassFreqHz = (int)m_MicInBass.freqHz;
+ wxGetApp().appConfiguration.filterConfiguration.micInChannel.bassGaindB = (int)(10.0*m_MicInBass.gaindB);
- wxGetApp().m_MicInTrebleFreqHz = m_MicInTreble.freqHz;
- wxGetApp().m_MicInTrebleGaindB = m_MicInTreble.gaindB;
+ wxGetApp().appConfiguration.filterConfiguration.micInChannel.trebleFreqHz = (int)m_MicInTreble.freqHz;
+ wxGetApp().appConfiguration.filterConfiguration.micInChannel.trebleGaindB = (int)(10.0*m_MicInTreble.gaindB);
- wxGetApp().m_MicInMidFreqHz = m_MicInMid.freqHz;
- wxGetApp().m_MicInMidGaindB = m_MicInMid.gaindB;
- wxGetApp().m_MicInMidQ = m_MicInMid.Q;
+ wxGetApp().appConfiguration.filterConfiguration.micInChannel.midFreqHz = (int)m_MicInMid.freqHz;
+ wxGetApp().appConfiguration.filterConfiguration.micInChannel.midGainDB = (int)(10.0*m_MicInMid.gaindB);
+ wxGetApp().appConfiguration.filterConfiguration.micInChannel.midQ = (int)(100.0*m_MicInMid.Q);
- wxGetApp().m_MicInVolInDB = m_MicInVol.gaindB;
+ wxGetApp().appConfiguration.filterConfiguration.micInChannel.volInDB = (int)(10.0*m_MicInVol.gaindB);
// Spk Out Equaliser
- wxGetApp().m_SpkOutBassFreqHz = m_SpkOutBass.freqHz;
- wxGetApp().m_SpkOutBassGaindB = m_SpkOutBass.gaindB;
+ wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.bassFreqHz = (int)m_SpkOutBass.freqHz;
+ wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.bassGaindB = (int)(10.0*m_SpkOutBass.gaindB);
- wxGetApp().m_SpkOutTrebleFreqHz = m_SpkOutTreble.freqHz;
- wxGetApp().m_SpkOutTrebleGaindB = m_SpkOutTreble.gaindB;
+ wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.trebleFreqHz = (int)m_SpkOutTreble.freqHz;
+ wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.trebleGaindB = (int)(10.0*m_SpkOutTreble.gaindB);
- wxGetApp().m_SpkOutMidFreqHz = m_SpkOutMid.freqHz;
- wxGetApp().m_SpkOutMidGaindB = m_SpkOutMid.gaindB;
- wxGetApp().m_SpkOutMidQ = m_SpkOutMid.Q;
+ wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.midFreqHz = (int)m_SpkOutMid.freqHz;
+ wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.midGainDB = (int)(10.0*m_SpkOutMid.gaindB);
+ wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.midQ = (int)(100.0*m_SpkOutMid.Q);
- wxGetApp().m_SpkOutVolInDB = m_SpkOutVol.gaindB;
+ wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.volInDB = (int)(10.0*m_SpkOutVol.gaindB);
pConfig->Write(wxT("/Filter/codec2LPCPostFilterEnable"), wxGetApp().m_codec2LPCPostFilterEnable);
pConfig->Write(wxT("/Filter/codec2LPCPostFilterBassBoost"), wxGetApp().m_codec2LPCPostFilterBassBoost);
@@ -523,25 +523,7 @@ void FilterDlg::ExchangeData(int inout)
pConfig->Write(wxT("/Filter/700C_EQ"), wxGetApp().m_700C_EQ);
- pConfig->Write(wxT("/Filter/MicInBassFreqHz"), (int)m_MicInBass.freqHz);
- pConfig->Write(wxT("/Filter/MicInBassGaindB"), (int)(10.0*m_MicInBass.gaindB));
- pConfig->Write(wxT("/Filter/MicInTrebleFreqHz"), (int)m_MicInTreble.freqHz);
- pConfig->Write(wxT("/Filter/MicInTrebleGaindB"), (int)(10.0*m_MicInTreble.gaindB));
- pConfig->Write(wxT("/Filter/MicInMidFreqHz"), (int)m_MicInMid.freqHz);
- pConfig->Write(wxT("/Filter/MicInMidGaindB"), (int)(10.0*m_MicInMid.gaindB));
- pConfig->Write(wxT("/Filter/MicInMidQ"), (int)(100.0*m_MicInMid.Q));
- pConfig->Write(wxT("/Filter/MicInVolInDB"), (int)(10.0*m_MicInVol.gaindB));
-
- pConfig->Write(wxT("/Filter/SpkOutBassFreqHz"), (int)m_SpkOutBass.freqHz);
- pConfig->Write(wxT("/Filter/SpkOutBassGaindB"), (int)(10.0*m_SpkOutBass.gaindB));
- pConfig->Write(wxT("/Filter/SpkOutTrebleFreqHz"), (int)m_SpkOutTreble.freqHz);
- pConfig->Write(wxT("/Filter/SpkOutTrebleGaindB"), (int)(10.0*m_SpkOutTreble.gaindB));
- pConfig->Write(wxT("/Filter/SpkOutMidQ"), (int)(100.0*m_SpkOutMid.Q));
- pConfig->Write(wxT("/Filter/SpkOutMidFreqHz"), (int)m_SpkOutMid.freqHz);
- pConfig->Write(wxT("/Filter/SpkOutMidGaindB"), (int)(10.0*m_SpkOutMid.gaindB));
- pConfig->Write(wxT("/Filter/SpkOutVolInDB"), (int)(10.0*m_SpkOutVol.gaindB));
-
- pConfig->Flush();
+ wxGetApp().appConfiguration.save(pConfig);
}
}
@@ -701,33 +683,33 @@ void FilterDlg::On700C_EQ(wxScrollEvent& event) {
void FilterDlg::updateControlState()
{
- m_MicInBass.sliderFreq->Enable(wxGetApp().m_MicInEQEnable);
- m_MicInBass.sliderGain->Enable(wxGetApp().m_MicInEQEnable);
+ m_MicInBass.sliderFreq->Enable(wxGetApp().appConfiguration.filterConfiguration.micInChannel.eqEnable);
+ m_MicInBass.sliderGain->Enable(wxGetApp().appConfiguration.filterConfiguration.micInChannel.eqEnable);
- m_MicInMid.sliderFreq->Enable(wxGetApp().m_MicInEQEnable);
- m_MicInMid.sliderGain->Enable(wxGetApp().m_MicInEQEnable);
- m_MicInMid.sliderQ->Enable(wxGetApp().m_MicInEQEnable);
+ m_MicInMid.sliderFreq->Enable(wxGetApp().appConfiguration.filterConfiguration.micInChannel.eqEnable);
+ m_MicInMid.sliderGain->Enable(wxGetApp().appConfiguration.filterConfiguration.micInChannel.eqEnable);
+ m_MicInMid.sliderQ->Enable(wxGetApp().appConfiguration.filterConfiguration.micInChannel.eqEnable);
- m_MicInTreble.sliderFreq->Enable(wxGetApp().m_MicInEQEnable);
- m_MicInTreble.sliderGain->Enable(wxGetApp().m_MicInEQEnable);
+ m_MicInTreble.sliderFreq->Enable(wxGetApp().appConfiguration.filterConfiguration.micInChannel.eqEnable);
+ m_MicInTreble.sliderGain->Enable(wxGetApp().appConfiguration.filterConfiguration.micInChannel.eqEnable);
- m_MicInVol.sliderGain->Enable(wxGetApp().m_MicInEQEnable);
+ m_MicInVol.sliderGain->Enable(wxGetApp().appConfiguration.filterConfiguration.micInChannel.eqEnable);
- m_MicInDefault->Enable(wxGetApp().m_MicInEQEnable);
+ m_MicInDefault->Enable(wxGetApp().appConfiguration.filterConfiguration.micInChannel.eqEnable);
- m_SpkOutBass.sliderFreq->Enable(wxGetApp().m_SpkOutEQEnable);
- m_SpkOutBass.sliderGain->Enable(wxGetApp().m_SpkOutEQEnable);
+ m_SpkOutBass.sliderFreq->Enable(wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.eqEnable);
+ m_SpkOutBass.sliderGain->Enable(wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.eqEnable);
- m_SpkOutMid.sliderFreq->Enable(wxGetApp().m_SpkOutEQEnable);
- m_SpkOutMid.sliderGain->Enable(wxGetApp().m_SpkOutEQEnable);
- m_SpkOutMid.sliderQ->Enable(wxGetApp().m_SpkOutEQEnable);
+ m_SpkOutMid.sliderFreq->Enable(wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.eqEnable);
+ m_SpkOutMid.sliderGain->Enable(wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.eqEnable);
+ m_SpkOutMid.sliderQ->Enable(wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.eqEnable);
- m_SpkOutTreble.sliderFreq->Enable(wxGetApp().m_SpkOutEQEnable);
- m_SpkOutTreble.sliderGain->Enable(wxGetApp().m_SpkOutEQEnable);
+ m_SpkOutTreble.sliderFreq->Enable(wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.eqEnable);
+ m_SpkOutTreble.sliderGain->Enable(wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.eqEnable);
- m_SpkOutVol.sliderGain->Enable(wxGetApp().m_SpkOutEQEnable);
+ m_SpkOutVol.sliderGain->Enable(wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.eqEnable);
- m_SpkOutDefault->Enable(wxGetApp().m_SpkOutEQEnable);
+ m_SpkOutDefault->Enable(wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.eqEnable);
m_codec2LPCPostFilterBeta->Enable(m_codec2LPCPostFilterEnable->GetValue());
m_codec2LPCPostFilterBassBoost->Enable(m_codec2LPCPostFilterEnable->GetValue());
@@ -736,13 +718,13 @@ void FilterDlg::updateControlState()
}
void FilterDlg::OnMicInEnable(wxScrollEvent& event) {
- wxGetApp().m_MicInEQEnable = m_MicInEnable->GetValue();
+ wxGetApp().appConfiguration.filterConfiguration.micInChannel.eqEnable = m_MicInEnable->GetValue();
updateControlState();
adjRunTimeMicInFilter();
}
void FilterDlg::OnSpkOutEnable(wxScrollEvent& event) {
- wxGetApp().m_SpkOutEQEnable = m_SpkOutEnable->GetValue();
+ wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.eqEnable = m_SpkOutEnable->GetValue();
updateControlState();
adjRunTimeSpkOutFilter();
}
diff --git a/src/eq.cpp b/src/eq.cpp
index c0768af1f..ea6226e73 100644
--- a/src/eq.cpp
+++ b/src/eq.cpp
@@ -62,10 +62,10 @@ void MainFrame::designEQFilters(paCallBackData *cb, int rxSampleRate, int txSam
if (m_newMicInFilter) {
assert(cb->sbqMicInBass == nullptr && cb->sbqMicInTreble == nullptr && cb->sbqMicInMid == nullptr);
//printf("designing new Min In filters\n");
- cb->sbqMicInBass = designAnEQFilter("bass", wxGetApp().m_MicInBassFreqHz, wxGetApp().m_MicInBassGaindB, txSampleRate);
- cb->sbqMicInTreble = designAnEQFilter("treble", wxGetApp().m_MicInTrebleFreqHz, wxGetApp().m_MicInTrebleGaindB, txSampleRate);
- cb->sbqMicInMid = designAnEQFilter("equalizer", wxGetApp().m_MicInMidFreqHz, wxGetApp().m_MicInMidGaindB, wxGetApp().m_MicInMidQ, txSampleRate);
- cb->sbqMicInVol = designAnEQFilter("vol", 0, wxGetApp().m_MicInVolInDB, 0, txSampleRate);
+ cb->sbqMicInBass = designAnEQFilter("bass", wxGetApp().appConfiguration.filterConfiguration.micInChannel.bassFreqHz, wxGetApp().appConfiguration.filterConfiguration.micInChannel.bassGaindB, txSampleRate);
+ cb->sbqMicInTreble = designAnEQFilter("treble", wxGetApp().appConfiguration.filterConfiguration.micInChannel.trebleFreqHz, wxGetApp().appConfiguration.filterConfiguration.micInChannel.trebleGaindB, txSampleRate);
+ cb->sbqMicInMid = designAnEQFilter("equalizer", wxGetApp().appConfiguration.filterConfiguration.micInChannel.midFreqHz, wxGetApp().appConfiguration.filterConfiguration.micInChannel.midGainDB, wxGetApp().appConfiguration.filterConfiguration.micInChannel.midQ, txSampleRate);
+ cb->sbqMicInVol = designAnEQFilter("vol", 0, wxGetApp().appConfiguration.filterConfiguration.micInChannel.volInDB, 0, txSampleRate);
// Note: vol can be a no-op!
assert(cb->sbqMicInBass != nullptr && cb->sbqMicInTreble != nullptr && cb->sbqMicInMid != nullptr);
@@ -76,11 +76,11 @@ void MainFrame::designEQFilters(paCallBackData *cb, int rxSampleRate, int txSam
if (m_newSpkOutFilter) {
assert(cb->sbqSpkOutBass == nullptr && cb->sbqSpkOutTreble == nullptr && cb->sbqSpkOutMid == nullptr);
//printf("designing new Spk Out filters\n");
- //printf("designEQFilters: wxGetApp().m_SpkOutBassFreqHz: %f\n",wxGetApp().m_SpkOutBassFreqHz);
- cb->sbqSpkOutBass = designAnEQFilter("bass", wxGetApp().m_SpkOutBassFreqHz, wxGetApp().m_SpkOutBassGaindB, rxSampleRate);
- cb->sbqSpkOutTreble = designAnEQFilter("treble", wxGetApp().m_SpkOutTrebleFreqHz, wxGetApp().m_SpkOutTrebleGaindB, rxSampleRate);
- cb->sbqSpkOutMid = designAnEQFilter("equalizer", wxGetApp().m_SpkOutMidFreqHz, wxGetApp().m_SpkOutMidGaindB, wxGetApp().m_SpkOutMidQ, rxSampleRate);
- cb->sbqSpkOutVol = designAnEQFilter("vol", 0, wxGetApp().m_SpkOutVolInDB, 0, txSampleRate);
+ //printf("designEQFilters: wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.bassFreqHz: %f\n",wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.bassFreqHz);
+ cb->sbqSpkOutBass = designAnEQFilter("bass", wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.bassFreqHz, wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.bassGaindB, rxSampleRate);
+ cb->sbqSpkOutTreble = designAnEQFilter("treble", wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.trebleFreqHz, wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.trebleGaindB, rxSampleRate);
+ cb->sbqSpkOutMid = designAnEQFilter("equalizer", wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.midFreqHz, wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.midGainDB, wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.midQ, rxSampleRate);
+ cb->sbqSpkOutVol = designAnEQFilter("vol", 0, wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.volInDB, 0, txSampleRate);
// Note: vol can be a no-op!
assert(cb->sbqSpkOutBass != nullptr && cb->sbqSpkOutTreble != nullptr && cb->sbqSpkOutMid != nullptr);
diff --git a/src/main.cpp b/src/main.cpp
index 36c85812f..46288e2fd 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -465,28 +465,7 @@ void MainFrame::loadConfiguration_()
wxGetApp().m_speexpp_enable = pConfig->Read(wxT("/Filter/speexpp_enable"), t);
wxGetApp().m_700C_EQ = pConfig->Read(wxT("/Filter/700C_EQ"), t);
- wxGetApp().m_MicInBassFreqHz = (float)pConfig->Read(wxT("/Filter/MicInBassFreqHz"), 1);
- wxGetApp().m_MicInBassGaindB = (float)pConfig->Read(wxT("/Filter/MicInBassGaindB"), (long)0)/10.0;
- wxGetApp().m_MicInTrebleFreqHz = (float)pConfig->Read(wxT("/Filter/MicInTrebleFreqHz"), 1);
- wxGetApp().m_MicInTrebleGaindB = (float)pConfig->Read(wxT("/Filter/MicInTrebleGaindB"), (long)0)/10.0;
- wxGetApp().m_MicInMidFreqHz = (float)pConfig->Read(wxT("/Filter/MicInMidFreqHz"), 1);
- wxGetApp().m_MicInMidGaindB = (float)pConfig->Read(wxT("/Filter/MicInMidGaindB"), (long)0)/10.0;
- wxGetApp().m_MicInMidQ = (float)pConfig->Read(wxT("/Filter/MicInMidQ"), (long)100)/100.0;
- wxGetApp().m_MicInVolInDB = (float)pConfig->Read(wxT("/Filter/MicInVolInDB"), (long)0)/10.0;
-
bool f = false;
- wxGetApp().m_MicInEQEnable = (float)pConfig->Read(wxT("/Filter/MicInEQEnable"), f);
-
- wxGetApp().m_SpkOutBassFreqHz = (float)pConfig->Read(wxT("/Filter/SpkOutBassFreqHz"), 1);
- wxGetApp().m_SpkOutBassGaindB = (float)pConfig->Read(wxT("/Filter/SpkOutBassGaindB"), (long)0)/10.0;
- wxGetApp().m_SpkOutTrebleFreqHz = (float)pConfig->Read(wxT("/Filter/SpkOutTrebleFreqHz"), 1);
- wxGetApp().m_SpkOutTrebleGaindB = (float)pConfig->Read(wxT("/Filter/SpkOutTrebleGaindB"), (long)0)/10.0;
- wxGetApp().m_SpkOutMidFreqHz = (float)pConfig->Read(wxT("/Filter/SpkOutMidFreqHz"), 1);
- wxGetApp().m_SpkOutMidGaindB = (float)pConfig->Read(wxT("/Filter/SpkOutMidGaindB"), (long)0)/10.0;
- wxGetApp().m_SpkOutMidQ = (float)pConfig->Read(wxT("/Filter/SpkOutMidQ"), (long)100)/100.0;
- wxGetApp().m_SpkOutVolInDB = (float)pConfig->Read(wxT("/Filter/SpkOutVolInDB"), (long)0)/10.0;
-
- wxGetApp().m_SpkOutEQEnable = (float)pConfig->Read(wxT("/Filter/SpkOutEQEnable"), f);
wxGetApp().m_callSign = pConfig->Read("/Data/CallSign", wxT(""));
wxGetApp().m_textEncoding = pConfig->Read("/Data/TextEncoding", 1);
@@ -930,9 +909,6 @@ MainFrame::~MainFrame()
pConfig->Write(wxT("/Data/CallSign"), wxGetApp().m_callSign);
pConfig->Write(wxT("/Data/TextEncoding"), wxGetApp().m_textEncoding);
- pConfig->Write(wxT("/Filter/MicInEQEnable"), wxGetApp().m_MicInEQEnable);
- pConfig->Write(wxT("/Filter/SpkOutEQEnable"), wxGetApp().m_SpkOutEQEnable);
-
pConfig->Write(wxT("/FreeDV700/txClip"), wxGetApp().m_FreeDV700txClip);
pConfig->Write(wxT("/Noise/noise_snr"), wxGetApp().m_noise_snr);
@@ -1508,8 +1484,8 @@ void MainFrame::OnTimer(wxTimerEvent &evt)
m_newMicInFilter = m_newSpkOutFilter = false;
}
- g_rxUserdata->micInEQEnable = wxGetApp().m_MicInEQEnable;
- g_rxUserdata->spkOutEQEnable = wxGetApp().m_SpkOutEQEnable;
+ g_rxUserdata->micInEQEnable = wxGetApp().appConfiguration.filterConfiguration.micInChannel.eqEnable;
+ g_rxUserdata->spkOutEQEnable = wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.eqEnable;
// set some run time options (if applicable)
freedvInterface.setRunTimeOptions(
@@ -2691,8 +2667,8 @@ void MainFrame::startRxStream()
m_newMicInFilter = m_newSpkOutFilter = true;
g_mutexProtectingCallbackData.Lock();
designEQFilters(g_rxUserdata, wxGetApp().appConfiguration.audioConfiguration.soundCard2Out.sampleRate, wxGetApp().appConfiguration.audioConfiguration.soundCard2In.sampleRate);
- g_rxUserdata->micInEQEnable = wxGetApp().m_MicInEQEnable;
- g_rxUserdata->spkOutEQEnable = wxGetApp().m_SpkOutEQEnable;
+ g_rxUserdata->micInEQEnable = wxGetApp().appConfiguration.filterConfiguration.micInChannel.eqEnable;
+ g_rxUserdata->spkOutEQEnable = wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.eqEnable;
m_newMicInFilter = m_newSpkOutFilter = false;
g_mutexProtectingCallbackData.Unlock();
diff --git a/src/main.h b/src/main.h
index 8ff185028..6f1effc5b 100644
--- a/src/main.h
+++ b/src/main.h
@@ -211,10 +211,6 @@ class MainApp : public wxApp
wxString m_strPTTInputPort;
bool m_boolCTSPos;
Serialport *m_pttInSerialPort;
-
- // Play/Rec files
-
- unsigned int m_recFileFromModulatorSecs;
// Options dialog
@@ -234,28 +230,6 @@ class MainApp : public wxApp
// Codec 2 700C Equaliser
bool m_700C_EQ;
- // Mic In Equaliser
- float m_MicInBassFreqHz;
- float m_MicInBassGaindB;
- float m_MicInTrebleFreqHz;
- float m_MicInTrebleGaindB;
- float m_MicInMidFreqHz;
- float m_MicInMidGaindB;
- float m_MicInMidQ;
- bool m_MicInEQEnable;
- float m_MicInVolInDB;
-
- // Spk Out Equaliser
- float m_SpkOutBassFreqHz;
- float m_SpkOutBassGaindB;
- float m_SpkOutTrebleFreqHz;
- float m_SpkOutTrebleGaindB;
- float m_SpkOutMidFreqHz;
- float m_SpkOutMidGaindB;
- float m_SpkOutMidQ;
- bool m_SpkOutEQEnable;
- float m_SpkOutVolInDB;
-
// optional vox trigger tone
bool m_leftChannelVoxTone;