Merge branch 'master' into ms-window-compiler-warnings

pull/475/head
Mooneer Salem 2023-07-12 23:10:23 -07:00 committed by GitHub
commit 5f195e9282
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 129 additions and 19 deletions

View File

@ -915,14 +915,14 @@ LDPC | Low Density Parity Check Codes - a family of powerful FEC codes
4. Documentation
* Add RF bandwidth information to user manual. (PR #444)
5. Cleanup:
* Refactor configuration handling in the codebase. (PR #457)
* Refactor configuration handling in the codebase. (PR #457, #474)
* Clean up compiler warnings on Windows builds. (PR #475)
6. Miscellaneous:
* Set default FreeDV Reporter hostname to qso.freedv.org. (PR #448)
*Note for Windows users: you may receive a one-time error message on startup
after upgrading indicating that certain Registry keys have incorrect types.
This is expected as the formats of some configuration parameters have changed.*
after upgrading from v1.8.12-20230705 indicating that certain Registry keys
have incorrect types. This is expected as part of the bugfix merged in PR #448.*
## V1.8.11 June 2023

View File

@ -23,12 +23,14 @@
DEFINE_FILTER_CONFIG_NAMES(MicIn);
DEFINE_FILTER_CONFIG_NAMES(SpkOut);
DEFINE_FILTER_CONFIG_NAMES_OLD(MicIn);
DEFINE_FILTER_CONFIG_NAMES_OLD(SpkOut);
FilterConfiguration::FilterConfiguration()
: codec2LPCPostFilterEnable("/Filter/codec2LPCPostFilterEnable", true)
, codec2LPCPostFilterBassBoost("/Filter/codec2LPCPostFilterBassBoost", true)
, codec2LPCPostFilterGamma("/Filter/codec2LPCPostFilterGamma", CODEC2_LPC_PF_GAMMA*100)
, codec2LPCPostFilterBeta("/Filter/codec2LPCPostFilterBeta", CODEC2_LPC_PF_BETA*100)
, codec2LPCPostFilterGamma("/Filter/codec2LPCPostFilter/Gamma", CODEC2_LPC_PF_GAMMA*100)
, codec2LPCPostFilterBeta("/Filter/codec2LPCPostFilter/Beta", CODEC2_LPC_PF_BETA*100)
, speexppEnable("/Filter/speexpp_enable", true)
, enable700CEqualizer("/Filter/700C_EQ", true)
{
@ -48,6 +50,21 @@ FilterConfiguration::FilterConfiguration()
void FilterConfiguration::load(wxConfigBase* config)
{
// Migration: these values were using incorrect data types, so we have to
// move to new names in order to prevent Windows errors (for example:)
//
// 14:03:28: Registry value "HKCU\Software\freedv\Filter\codec2LPCPostFilterGamma" is not text (but of type DWORD)
// 14:03:28: Registry value "HKCU\Software\freedv\Filter\codec2LPCPostFilterBeta" is not text (but of type DWORD)
auto oldPostFilterGamma = (float)config->Read(
wxT("/Filter/codec2LPCPostFilterGamma"),
CODEC2_LPC_PF_GAMMA*100);
codec2LPCPostFilterGamma.setDefaultVal(oldPostFilterGamma);
auto oldPostFilterBeta = (float)config->Read(
wxT("/Filter/codec2LPCPostFilterBeta"),
CODEC2_LPC_PF_BETA*100);
codec2LPCPostFilterBeta.setDefaultVal(oldPostFilterBeta);
micInChannel.load(config);
spkOutChannel.load(config);

View File

@ -44,6 +44,16 @@ public:
static const char* GetMidQConfigName() { assert(0); }
static const char* GetVolInDBConfigName() { assert(0); }
static const char* GetEQEnableConfigName() { assert(0); }
static const char* GetOldBassFreqHzConfigName() { assert(0); }
static const char* GetOldBassGaindBConfigName() { assert(0); }
static const char* GetOldTrebleFreqHzConfigName() { assert(0); }
static const char* GetOldTrebleGaindBConfigName() { assert(0); }
static const char* GetOldMidFreqHzConfigName() { assert(0); }
static const char* GetOldMidGaindBConfigName() { assert(0); }
static const char* GetOldMidQConfigName() { assert(0); }
static const char* GetOldVolInDBConfigName() { assert(0); }
static const char* GetOldEQEnableConfigName() { assert(0); }
};
template<FilterConfiguration::Channel ChannelId>
@ -99,9 +109,27 @@ public:
DECLARE_FILTER_CONFIG_NAME(type, MidQ); \
DECLARE_FILTER_CONFIG_NAME(type, VolInDB); \
DECLARE_FILTER_CONFIG_NAME(type, EQEnable);
#define DECLARE_FILTER_CONFIG_NAME_OLD(type, name) \
template<> \
const char* FilterConfiguration::FilterChannelConfigName<FilterConfiguration::type>::GetOld ## name ## ConfigName()
#define DECLARE_FILTER_CONFIG_NAMES_OLD(type) \
DECLARE_FILTER_CONFIG_NAME_OLD(type, BassFreqHz); \
DECLARE_FILTER_CONFIG_NAME_OLD(type, BassGaindB); \
DECLARE_FILTER_CONFIG_NAME_OLD(type, TrebleFreqHz); \
DECLARE_FILTER_CONFIG_NAME_OLD(type, TrebleGaindB); \
DECLARE_FILTER_CONFIG_NAME_OLD(type, MidFreqHz); \
DECLARE_FILTER_CONFIG_NAME_OLD(type, MidGaindB); \
DECLARE_FILTER_CONFIG_NAME_OLD(type, MidQ); \
DECLARE_FILTER_CONFIG_NAME_OLD(type, VolInDB); \
DECLARE_FILTER_CONFIG_NAME_OLD(type, EQEnable);
#define DEFINE_FILTER_CONFIG_NAME(type, name) \
DECLARE_FILTER_CONFIG_NAME(type, name) { return "/Filter/" #type #name; }
DECLARE_FILTER_CONFIG_NAME(type, name) { return "/Filter/" #type "/" #name; }
#define DEFINE_FILTER_CONFIG_NAME_OLD(type, name) \
DECLARE_FILTER_CONFIG_NAME_OLD(type, name) { return "/Filter/" #type #name; }
#define DEFINE_FILTER_CONFIG_NAMES(type) \
DEFINE_FILTER_CONFIG_NAME(type, BassFreqHz) \
@ -113,17 +141,30 @@ public:
DEFINE_FILTER_CONFIG_NAME(type, MidQ) \
DEFINE_FILTER_CONFIG_NAME(type, VolInDB) \
DEFINE_FILTER_CONFIG_NAME(type, EQEnable)
#define DEFINE_FILTER_CONFIG_NAMES_OLD(type) \
DEFINE_FILTER_CONFIG_NAME_OLD(type, BassFreqHz) \
DEFINE_FILTER_CONFIG_NAME_OLD(type, BassGaindB) \
DEFINE_FILTER_CONFIG_NAME_OLD(type, TrebleFreqHz) \
DEFINE_FILTER_CONFIG_NAME_OLD(type, TrebleGaindB) \
DEFINE_FILTER_CONFIG_NAME_OLD(type, MidFreqHz) \
DEFINE_FILTER_CONFIG_NAME_OLD(type, MidGaindB) \
DEFINE_FILTER_CONFIG_NAME_OLD(type, MidQ) \
DEFINE_FILTER_CONFIG_NAME_OLD(type, VolInDB) \
DEFINE_FILTER_CONFIG_NAME_OLD(type, EQEnable)
DECLARE_FILTER_CONFIG_NAMES(MicIn);
DECLARE_FILTER_CONFIG_NAMES(SpkOut);
DECLARE_FILTER_CONFIG_NAMES_OLD(MicIn);
DECLARE_FILTER_CONFIG_NAMES_OLD(SpkOut);
template<FilterConfiguration::Channel ChannelId>
FilterConfiguration::FilterChannel<ChannelId>::FilterChannel()
: bassFreqHz(FilterConfiguration::FilterChannelConfigName<ChannelId>::GetBassFreqHzConfigName(), 1)
: bassFreqHz(FilterConfiguration::FilterChannelConfigName<ChannelId>::GetBassFreqHzConfigName(), 100)
, bassGaindB(FilterConfiguration::FilterChannelConfigName<ChannelId>::GetBassGaindBConfigName(), ((long)0)/10.0)
, trebleFreqHz(FilterConfiguration::FilterChannelConfigName<ChannelId>::GetTrebleFreqHzConfigName(), 1)
, trebleFreqHz(FilterConfiguration::FilterChannelConfigName<ChannelId>::GetTrebleFreqHzConfigName(), 3000)
, trebleGaindB(FilterConfiguration::FilterChannelConfigName<ChannelId>::GetTrebleGaindBConfigName(), ((long)0)/10.0)
, midFreqHz(FilterConfiguration::FilterChannelConfigName<ChannelId>::GetMidFreqHzConfigName(), 1)
, midFreqHz(FilterConfiguration::FilterChannelConfigName<ChannelId>::GetMidFreqHzConfigName(), 1500)
, midGainDB(FilterConfiguration::FilterChannelConfigName<ChannelId>::GetMidGaindBConfigName(), ((long)0)/10.0)
, midQ(FilterConfiguration::FilterChannelConfigName<ChannelId>::GetMidQConfigName(), ((long)100)/100.0)
, volInDB(FilterConfiguration::FilterChannelConfigName<ChannelId>::GetVolInDBConfigName(), ((long)0)/10.0)
@ -135,6 +176,58 @@ FilterConfiguration::FilterChannel<ChannelId>::FilterChannel()
template<FilterConfiguration::Channel ChannelId>
void FilterConfiguration::FilterChannel<ChannelId>::load(wxConfigBase* config)
{
// Migration: these values were using incorrect data types, so we have to
// move to new names in order to prevent Windows errors (for example:)
//
// 14:03:28: Registry value "HKCU\Software\freedv\Filter\MicInBassFreqHz" is not text (but of type DWORD)
// 14:03:28: Registry value "HKCU\Software\freedv\Filter\MicInBassGaindB" is not text (but of type DWORD)
// 14:03:28: Registry value "HKCU\Software\freedv\Filter\MicInTrebleFreqHz" is not text (but of type DWORD)
// 14:03:28: Registry value "HKCU\Software\freedv\Filter\MicInTrebleGaindB" is not text (but of type DWORD)
// 14:03:28: Registry value "HKCU\Software\freedv\Filter\MicInMidFreqHz" is not text (but of type DWORD)
// 14:03:28: Registry value "HKCU\Software\freedv\Filter\MicInMidGaindB" is not text (but of type DWORD)
// 14:03:28: Registry value "HKCU\Software\freedv\Filter\MicInMidQ" is not text (but of type DWORD)
// 14:03:28: Registry value "HKCU\Software\freedv\Filter\MicInVolInDB" is not text (but of type DWORD)
float oldBassFreqHz = (float)config->Read(
FilterConfiguration::FilterChannelConfigName<ChannelId>::GetOldBassFreqHzConfigName(),
100);
bassFreqHz.setDefaultVal(oldBassFreqHz);
float oldBassGaindB = (float)config->Read(
FilterConfiguration::FilterChannelConfigName<ChannelId>::GetOldBassGaindBConfigName(),
(long)0)/10.0;
bassGaindB.setDefaultVal(oldBassGaindB);
float oldTrebleFreqHz = (float)config->Read(
FilterConfiguration::FilterChannelConfigName<ChannelId>::GetOldTrebleFreqHzConfigName(),
3000);
trebleFreqHz.setDefaultVal(oldTrebleFreqHz);
float oldTrebleGaindB = (float)config->Read(
FilterConfiguration::FilterChannelConfigName<ChannelId>::GetOldTrebleGaindBConfigName(),
(long)0)/10.0;
trebleGaindB.setDefaultVal(oldTrebleGaindB);
float oldMidFreqHz = (float)config->Read(
FilterConfiguration::FilterChannelConfigName<ChannelId>::GetOldMidFreqHzConfigName(),
1500);
midFreqHz.setDefaultVal(oldMidFreqHz);
float oldMidGaindB = (float)config->Read(
FilterConfiguration::FilterChannelConfigName<ChannelId>::GetOldMidGaindBConfigName(),
(long)0)/10.0;
midGainDB.setDefaultVal(oldMidGaindB);
float oldMidQ = (float)config->Read(
FilterConfiguration::FilterChannelConfigName<ChannelId>::GetOldMidQConfigName(),
(long)100)/100.0;
midQ.setDefaultVal(oldMidQ);
float oldVolInDB = (float)config->Read(
FilterConfiguration::FilterChannelConfigName<ChannelId>::GetOldVolInDBConfigName(),
(long)0)/10.0;
volInDB.setDefaultVal(oldVolInDB);
load_(config, bassFreqHz);
load_(config, bassGaindB);
load_(config, trebleFreqHz);

View File

@ -489,30 +489,30 @@ void FilterDlg::ExchangeData(int inout)
// Mic In Equaliser
wxGetApp().appConfiguration.filterConfiguration.micInChannel.bassFreqHz = (int)m_MicInBass.freqHz;
wxGetApp().appConfiguration.filterConfiguration.micInChannel.bassGaindB = (int)(10.0*m_MicInBass.gaindB);
wxGetApp().appConfiguration.filterConfiguration.micInChannel.bassGaindB = m_MicInBass.gaindB;
wxGetApp().appConfiguration.filterConfiguration.micInChannel.trebleFreqHz = (int)m_MicInTreble.freqHz;
wxGetApp().appConfiguration.filterConfiguration.micInChannel.trebleGaindB = (int)(10.0*m_MicInTreble.gaindB);
wxGetApp().appConfiguration.filterConfiguration.micInChannel.trebleGaindB = m_MicInTreble.gaindB;
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().appConfiguration.filterConfiguration.micInChannel.midGainDB = m_MicInMid.gaindB;
wxGetApp().appConfiguration.filterConfiguration.micInChannel.midQ = m_MicInMid.Q;
wxGetApp().appConfiguration.filterConfiguration.micInChannel.volInDB = (int)(10.0*m_MicInVol.gaindB);
wxGetApp().appConfiguration.filterConfiguration.micInChannel.volInDB = m_MicInVol.gaindB;
// Spk Out Equaliser
wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.bassFreqHz = (int)m_SpkOutBass.freqHz;
wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.bassGaindB = (int)(10.0*m_SpkOutBass.gaindB);
wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.bassGaindB = m_SpkOutBass.gaindB;
wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.trebleFreqHz = (int)m_SpkOutTreble.freqHz;
wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.trebleGaindB = (int)(10.0*m_SpkOutTreble.gaindB);
wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.trebleGaindB = m_SpkOutTreble.gaindB;
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().appConfiguration.filterConfiguration.spkOutChannel.midGainDB = m_SpkOutMid.gaindB;
wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.midQ = m_SpkOutMid.Q;
wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.volInDB = (int)(10.0*m_SpkOutVol.gaindB);
wxGetApp().appConfiguration.filterConfiguration.spkOutChannel.volInDB = m_SpkOutVol.gaindB;
wxGetApp().appConfiguration.save(pConfig);
}