bool EffectTruncSilence::SetAutomationParameters(EffectAutomationParameters & parms) { wxArrayString actions(kNumActions, kActionStrings); actions.Insert(wxT("0"), 0); // Compatible with 2.1.0 and before actions.Insert(wxT("1"), 1); // Compatible with 2.1.0 and before ReadAndVerifyDouble(Minimum); ReadAndVerifyDouble(Truncate); ReadAndVerifyDouble(Compress); ReadAndVerifyEnum(DbIndex, mDbChoices); ReadAndVerifyEnum(ActIndex, actions); ReadAndVerifyBool(Independent); mInitialAllowedSilence = Minimum; mTruncLongestAllowedSilence = Truncate; mSilenceCompressPercent = Compress; mTruncDbChoiceIndex = DbIndex; mActionIndex = ActIndex; mbIndependent = Independent; // Readjust for 2.1.0 or before if (mActionIndex >= kNumActions) { mActionIndex -= kNumActions; } return true; }
bool EffectToneGen::SetAutomationParameters(EffectAutomationParameters & parms) { ReadAndVerifyEnum(Waveform, mWaveforms); ReadAndVerifyEnum(Interp, mInterpolations); if (mChirp) { ReadAndVerifyDouble(StartFreq); ReadAndVerifyDouble(EndFreq); ReadAndVerifyDouble(StartAmp); ReadAndVerifyDouble(EndAmp); mFrequency[0] = StartFreq; mFrequency[1] = EndFreq; mAmplitude[0] = StartAmp; mAmplitude[1] = EndAmp; } else { ReadAndVerifyDouble(Frequency); ReadAndVerifyDouble(Amplitude); mFrequency[0] = Frequency; mFrequency[1] = Frequency; mAmplitude[0] = Amplitude; mAmplitude[1] = Amplitude; } mWaveform = Waveform; mInterpolation = Interp; double freqMax = (GetActiveProject() ? GetActiveProject()->GetRate() : 44100.0) / 2.0; mFrequency[1] = TrapDouble(mFrequency[1], MIN_EndFreq, freqMax); return true; }
bool EffectLeveller::SetAutomationParameters(EffectAutomationParameters & parms) { // Allow for 2.1.0 and before wxArrayString passChoices(kNumPasses, kPassStrings); passChoices.Insert(wxT("1"), 0); passChoices.Insert(wxT("2"), 1); passChoices.Insert(wxT("3"), 2); passChoices.Insert(wxT("4"), 3); passChoices.Insert(wxT("5"), 4); ReadAndVerifyEnum(Level, wxArrayString(Enums::NumDbChoices,Enums::GetDbChoices())); ReadAndVerifyEnum(Passes, passChoices); mDbIndex = Level; mPassIndex = Passes; // Readjust for 2.1.0 or before if (mPassIndex >= kNumPasses) { mPassIndex -= kNumPasses; } mNumPasses = mPassIndex + 1; mDbSilenceThreshold = Enums::Db2Signal[mDbIndex]; CalcLevellerFactors(); return true; }
bool EffectTruncSilence::SetAutomationParameters(CommandParameters & parms) { ReadAndVerifyDouble(Minimum); ReadAndVerifyDouble(Truncate); ReadAndVerifyDouble(Compress); // This control migrated from a choice to a text box in version 2.3.0 double myThreshold {}; bool newParams = [&] { ReadAndVerifyDouble(Threshold); // macro may return false myThreshold = Threshold; return true; } (); if ( !newParams ) { // Use legacy param: ReadAndVerifyEnum(DbIndex, Enums::DbChoices, Enums::NumDbChoices); myThreshold = enumToDB( DbIndex ); } ReadAndVerifyEnumWithObsoletes(ActIndex, kActionStrings, nActions, kObsoleteActions, nObsoleteActions); ReadAndVerifyBool(Independent); mInitialAllowedSilence = Minimum; mTruncLongestAllowedSilence = Truncate; mSilenceCompressPercent = Compress; mThresholdDB = myThreshold; mActionIndex = ActIndex; mbIndependent = Independent; return true; }
bool EffectNoise::SetAutomationParameters(CommandParameters & parms) { ReadAndVerifyEnum(Type, kTypeStrings, nTypes); ReadAndVerifyDouble(Amp); mType = Type; mAmp = Amp; return true; }
bool EffectNoise::SetAutomationParameters(EffectAutomationParameters & parms) { ReadAndVerifyEnum(Type, wxArrayString(kNumTypes, kTypeStrings)); ReadAndVerifyDouble(Amp); mType = Type; mAmp = Amp; return true; }
bool EffectScienFilter::SetAutomationParameters(EffectAutomationParameters & parms) { ReadAndVerifyEnum(Type, wxArrayString(kNumTypes, kTypeStrings)); ReadAndVerifyEnum(Subtype, wxArrayString(kNumSubTypes, kSubTypeStrings)); ReadAndVerifyInt(Order); ReadAndVerifyFloat(Cutoff); ReadAndVerifyFloat(Passband); ReadAndVerifyFloat(Stopband); mFilterType = Type; mFilterSubtype = Subtype; mOrder = Order; mCutoff = Cutoff; mRipple = Passband; mStopbandRipple = Stopband; mOrderIndex = mOrder - 1; CalcFilter(); return true; }
bool EffectDistortion::SetAutomationParameters(EffectAutomationParameters & parms) { ReadAndVerifyEnum(TableTypeIndx, wxArrayString(kNumTableTypes, kTableTypeStrings)); ReadAndVerifyBool(DCBlock); ReadAndVerifyDouble(Threshold_dB); ReadAndVerifyDouble(NoiseFloor); ReadAndVerifyDouble(Param1); ReadAndVerifyDouble(Param2); ReadAndVerifyInt(Repeats); mParams.mTableChoiceIndx = TableTypeIndx; mParams.mDCBlock = DCBlock; mParams.mThreshold_dB = Threshold_dB; mParams.mNoiseFloor = NoiseFloor; mParams.mParam1 = Param1; mParams.mParam2 = Param2; mParams.mRepeats = Repeats; return true; }