From 0b2e58dde9f7363fdb614b993cb691a11e44b3a8 Mon Sep 17 00:00:00 2001 From: "RichardAsh1981@gmail.com" Date: Mon, 23 Dec 2013 10:31:47 +0000 Subject: [PATCH] Fix for Bug 697 Incorrect naming of Compressor 'release phase' http://bugzilla.audacityteam.org/show_bug.cgi?id=697 Patch by Steve Daulton alters the UI strings but leaves variable naming alone. Provides backwards compatibility with old chains via a string substitution - to come out in time. --- src/BatchCommands.cpp | 5 +++++ src/effects/Compressor.cpp | 8 ++++---- src/effects/Compressor.h | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/BatchCommands.cpp b/src/BatchCommands.cpp index 9f7948899..3bdfb7b5a 100644 --- a/src/BatchCommands.cpp +++ b/src/BatchCommands.cpp @@ -136,6 +136,9 @@ bool BatchCommands::ReadChain(const wxString & chain) wxString parm = tf[i].Mid(splitAt + 1).Strip(wxString::trailing); // Backward compatibility for old Chain scripts + // Please comment the version of audacity these are introduced in, so + // that old ones can easily be removed once users have had a chance to + // migrate if (cmd == wxT("SaveMP3_56k_before")) cmd = wxT("ExportMP3_56k_before"); else if (cmd == wxT("SaveMP3_56k_after")) @@ -146,6 +149,8 @@ bool BatchCommands::ReadChain(const wxString & chain) cmd = wxT("ExportMP3"); else if (cmd == wxT("ExportWav")) cmd = wxT("ExportWAV"); + else if (cmd == wxT("Compressor") && (parm.find(wxT("DecayTime")) != parm.npos)) + parm.Replace(wxT("DecayTime"), wxT("ReleaseTime"), NULL); // 2.0.6 // Add to lists mCommandChain.Add(cmd); diff --git a/src/effects/Compressor.cpp b/src/effects/Compressor.cpp index a9da96270..66b9e18ae 100644 --- a/src/effects/Compressor.cpp +++ b/src/effects/Compressor.cpp @@ -102,7 +102,7 @@ bool EffectCompressor::TransferParameters( Shuttle & shuttle ) shuttle.TransferDouble( wxT("NoiseFloor"), mNoiseFloorDB, -40.0f ); shuttle.TransferDouble( wxT("Ratio"), mRatio, 2.0f ); shuttle.TransferDouble( wxT("AttackTime"), mAttackTime, 0.2f ); - shuttle.TransferDouble( wxT("DecayTime"), mDecayTime, 1.0f ); + shuttle.TransferDouble( wxT("ReleaseTime"), mDecayTime, 1.0f ); shuttle.TransferBool( wxT("Normalize"), mNormalize, true ); shuttle.TransferBool( wxT("UsePeak"), mUsePeak, false ); return true; @@ -658,11 +658,11 @@ void CompressorDialog::PopulateOrExchange(ShuttleGui & S) mAttackText = S.AddVariableText(wxT("XXXX secs"), true, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); - mDecayLabel = S.AddVariableText(_("Decay Time:"), true, + mDecayLabel = S.AddVariableText(_("Release Time:"), true, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); S.SetStyle(wxSL_HORIZONTAL); mDecaySlider = S.Id(DecayID).AddSlider(wxT(""), 2, 30, 1); - mDecaySlider->SetName(_("Decay Time")); + mDecaySlider->SetName(_("Release Time")); mDecayText = S.AddVariableText(wxT("XXXX secs"), true, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); } @@ -741,7 +741,7 @@ bool CompressorDialog::TransferDataFromWindow() mAttackText->SetLabel(wxString::Format(_("%.1f secs"), attack)); mAttackText->SetName(mAttackText->GetLabel()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs) - mDecayLabel->SetName(wxString::Format(_("Decay Time %.1f secs"), decay)); + mDecayLabel->SetName(wxString::Format(_("Release Time %.1f secs"), decay)); mDecayText->SetLabel(wxString::Format(_("%.1f secs"), decay)); mDecayText->SetName(mDecayText->GetLabel()); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs) diff --git a/src/effects/Compressor.h b/src/effects/Compressor.h index d114cfc16..a710c05f5 100644 --- a/src/effects/Compressor.h +++ b/src/effects/Compressor.h @@ -82,7 +82,7 @@ public: bool mNormalize; //MJS bool mUsePeak; - double mDecayTime; + double mDecayTime; // The "Release" time. double mAttackFactor; double mAttackInverseFactor; double mDecayFactor; @@ -144,7 +144,7 @@ public: double noisefloor; double ratio; double attack; - double decay; + double decay; // "release" bool useGain; bool usePeak;