1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-09 22:53:55 +01:00

Inserting CLEANSPEECH ifdef's around anything CleanSpeech so that CleanSpeech can be removed easily in the (not to distant) future. The idea is never to turn CLEANSPEECH on, but fix any (unexpected) differences this may make.

This commit is contained in:
martynshaw99
2012-04-26 22:57:04 +00:00
parent 08b68fd96a
commit 758a8f65e6
24 changed files with 632 additions and 206 deletions

View File

@@ -75,6 +75,7 @@ EffectClickRemoval::~EffectClickRemoval()
bool EffectClickRemoval::Init()
{
#ifdef CLEANSPEECH
mThresholdLevel = gPrefs->Read(wxT("/CsPresets/ClickThresholdLevel"), 200);
if ((mThresholdLevel < MIN_THRESHOLD) || (mThresholdLevel > MAX_THRESHOLD)) { // corrupted Prefs?
mThresholdLevel = 0; //Off-skip
@@ -85,6 +86,18 @@ bool EffectClickRemoval::Init()
mClickWidth = 0; //Off-skip
gPrefs->Write(wxT("/CsPresets/ClickWidth"), mClickWidth);
}
#else // CLEANSPEECH
mThresholdLevel = gPrefs->Read(wxT("/Effects/ClickRemoval/ClickThresholdLevel"), 200);
if ((mThresholdLevel < MIN_THRESHOLD) || (mThresholdLevel > MAX_THRESHOLD)) { // corrupted Prefs?
mThresholdLevel = 0; //Off-skip
gPrefs->Write(wxT("/Effects/ClickRemoval/ClickThresholdLevel"), mThresholdLevel);
}
mClickWidth = gPrefs->Read(wxT("/Effects/ClickRemoval/ClickWidth"), 20);
if ((mClickWidth < MIN_CLICK_WIDTH) || (mClickWidth > MAX_CLICK_WIDTH)) { // corrupted Prefs?
mClickWidth = 0; //Off-skip
gPrefs->Write(wxT("/Effects/ClickRemoval/ClickWidth"), mClickWidth);
}
#endif // CLEANSPEECH
return true;
}
@@ -110,8 +123,13 @@ bool EffectClickRemoval::PromptUser()
mThresholdLevel = dlog.mThresh;
mClickWidth = dlog.mWidth;
#ifdef CLEANSPEECH
gPrefs->Write(wxT("/CsPresets/ClickThresholdLevel"), mThresholdLevel);
gPrefs->Write(wxT("/CsPresets/ClickWidth"), mClickWidth);
#else // CLEANSPEECH
gPrefs->Write(wxT("/Effects/ClickRemoval/ClickThresholdLevel"), mThresholdLevel);
gPrefs->Write(wxT("/Effects/ClickRemoval/ClickWidth"), mClickWidth);
#endif // CLEANSPEECH
return true;
}