void EffectTruncSilence::PopulateOrExchange(ShuttleGui & S) { wxASSERT(nActions == WXSIZEOF(kActionStrings)); S.AddSpace(0, 5); S.StartStatic(_("Detect Silence")); { S.StartMultiColumn(3, wxALIGN_CENTER_HORIZONTAL); { // Threshold FloatingPointValidator<double> vldThreshold(3, &mThresholdDB, NumValidatorStyle::NO_TRAILING_ZEROES); vldThreshold.SetRange(MIN_Threshold, MAX_Threshold); mThresholdText = S.AddTextBox(_("Threshold:"), wxT(""), 0); mThresholdText->SetValidator(vldThreshold); S.AddUnits(_("dB")); // Ignored silence FloatingPointValidator<double> vldDur(3, &mInitialAllowedSilence, NumValidatorStyle::NO_TRAILING_ZEROES); vldDur.SetRange(MIN_Minimum, MAX_Minimum); mInitialAllowedSilenceT = S.AddTextBox(_("Duration:"), wxT(""), 12); mInitialAllowedSilenceT->SetValidator(vldDur); S.AddUnits(_("seconds")); } S.EndMultiColumn(); } S.EndStatic(); S.StartStatic(_("Action")); { S.StartHorizontalLay(); { // Action choices auto actionChoices = LocalizedStrings(kActionStrings, nActions); mActionChoice = S.AddChoice( {}, wxT(""), &actionChoices); mActionChoice->SetValidator(wxGenericValidator(&mActionIndex)); S.SetSizeHints(-1, -1); } S.EndHorizontalLay(); S.StartMultiColumn(3, wxALIGN_CENTER_HORIZONTAL); { // Truncation / Compression factor FloatingPointValidator<double> vldTrunc(3, &mTruncLongestAllowedSilence, NumValidatorStyle::NO_TRAILING_ZEROES); vldTrunc.SetRange(MIN_Truncate, MAX_Truncate); mTruncLongestAllowedSilenceT = S.AddTextBox(_("Truncate to:"), wxT(""), 12); mTruncLongestAllowedSilenceT->SetValidator(vldTrunc); S.AddUnits(_("seconds")); FloatingPointValidator<double> vldComp(3, &mSilenceCompressPercent, NumValidatorStyle::NO_TRAILING_ZEROES); vldComp.SetRange(MIN_Compress, MAX_Compress); mSilenceCompressPercentT = S.AddTextBox(_("Compress to:"), wxT(""), 12); mSilenceCompressPercentT->SetValidator(vldComp); S.AddUnits(_("%")); } S.EndMultiColumn(); S.StartMultiColumn(2, wxALIGN_CENTER_HORIZONTAL); { mIndependent = S.AddCheckBox(_("Truncate tracks independently"), mbIndependent ? wxT("true") : wxT("false")); } S.EndMultiColumn(); } S.EndStatic(); UpdateUI(); }
void EffectDistortion::PopulateOrExchange(ShuttleGui & S) { S.AddSpace(0, 5); S.StartVerticalLay(); { S.StartMultiColumn(4, wxCENTER); { mTypeChoiceCtrl = S.Id(ID_Type).AddChoice(_("Distortion type:"), wxT(""), &mTableTypes); mTypeChoiceCtrl->SetValidator(wxGenericValidator(&mParams.mTableChoiceIndx)); S.SetSizeHints(-1, -1); mDCBlockCheckBox = S.Id(ID_DCBlock).AddCheckBox(_("DC blocking filter"), DEF_DCBlock ? wxT("true") : wxT("false")); } S.EndMultiColumn(); S.AddSpace(0, 10); S.StartStatic(_("Threshold controls")); { S.StartMultiColumn(4, wxEXPAND); S.SetStretchyCol(2); { // Allow space for first Column S.AddSpace(250,0); S.AddSpace(0,0); S.AddSpace(0,0); S.AddSpace(0,0); // Upper threshold control mThresholdTxt = S.AddVariableText(defaultLabel[0], false, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT); FloatingPointValidator<double> vldThreshold(2, &mParams.mThreshold_dB); vldThreshold.SetRange(MIN_Threshold_dB, MAX_Threshold_dB); mThresholdT = S.Id(ID_Threshold).AddTextBox(wxT(""), wxT(""), 10); mThresholdT->SetName(defaultLabel[0]); mThresholdT->SetValidator(vldThreshold); S.SetStyle(wxSL_HORIZONTAL); double maxLin = DB_TO_LINEAR(MAX_Threshold_dB) * SCL_Threshold_dB; double minLin = DB_TO_LINEAR(MIN_Threshold_dB) * SCL_Threshold_dB; mThresholdS = S.Id(ID_Threshold).AddSlider(wxT(""), 0, maxLin, minLin); mThresholdS->SetName(defaultLabel[0]); S.AddSpace(20, 0); // Noise floor control mNoiseFloorTxt = S.AddVariableText(defaultLabel[1], false, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT); FloatingPointValidator<double> vldfloor(2, &mParams.mNoiseFloor); vldfloor.SetRange(MIN_NoiseFloor, MAX_NoiseFloor); mNoiseFloorT = S.Id(ID_NoiseFloor).AddTextBox(wxT(""), wxT(""), 10); mNoiseFloorT->SetName(defaultLabel[1]); mNoiseFloorT->SetValidator(vldfloor); S.SetStyle(wxSL_HORIZONTAL); mNoiseFloorS = S.Id(ID_NoiseFloor).AddSlider(wxT(""), 0, MAX_NoiseFloor, MIN_NoiseFloor); mNoiseFloorS->SetName(defaultLabel[1]); S.AddSpace(20, 0); } S.EndMultiColumn(); } S.EndStatic(); S.StartStatic(_("Parameter controls")); { S.StartMultiColumn(4, wxEXPAND); S.SetStretchyCol(2); { // Allow space for first Column S.AddSpace(250,0); S.AddSpace(0,0); S.AddSpace(0,0); S.AddSpace(0,0); // Parameter1 control mParam1Txt = S.AddVariableText(defaultLabel[2], false, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT); FloatingPointValidator<double> vldparam1(2, &mParams.mParam1); vldparam1.SetRange(MIN_Param1, MAX_Param1); mParam1T = S.Id(ID_Param1).AddTextBox(wxT(""), wxT(""), 10); mParam1T->SetName(defaultLabel[2]); mParam1T->SetValidator(vldparam1); S.SetStyle(wxSL_HORIZONTAL); mParam1S = S.Id(ID_Param1).AddSlider(wxT(""), 0, MAX_Param1, MIN_Param1); mParam1S->SetName(defaultLabel[2]); S.AddSpace(20, 0); // Parameter2 control mParam2Txt = S.AddVariableText(defaultLabel[3], false, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT); FloatingPointValidator<double> vldParam2(2, &mParams.mParam2); vldParam2.SetRange(MIN_Param2, MAX_Param2); mParam2T = S.Id(ID_Param2).AddTextBox(wxT(""), wxT(""), 10); mParam2T->SetName(defaultLabel[3]); mParam2T->SetValidator(vldParam2); S.SetStyle(wxSL_HORIZONTAL); mParam2S = S.Id(ID_Param2).AddSlider(wxT(""), 0, MAX_Param2, MIN_Param2); mParam2S->SetName(defaultLabel[3]); S.AddSpace(20, 0); // Repeats control mRepeatsTxt = S.AddVariableText(defaultLabel[4], false, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT); IntegerValidator<int>vldRepeats(&mParams.mRepeats); vldRepeats.SetRange(MIN_Repeats, MAX_Repeats); mRepeatsT = S.Id(ID_Repeats).AddTextBox(wxT(""), wxT(""), 10); mRepeatsT->SetName(defaultLabel[4]); mRepeatsT->SetValidator(vldRepeats); S.SetStyle(wxSL_HORIZONTAL); mRepeatsS = S.Id(ID_Repeats).AddSlider(wxT(""), DEF_Repeats, MAX_Repeats, MIN_Repeats); mRepeatsS->SetName(defaultLabel[4]); S.AddSpace(20, 0); } S.EndMultiColumn(); } S.EndStatic(); } S.EndVerticalLay(); return; }