void EffectTruncSilence::PopulateOrExchange(ShuttleGui & S) { wxASSERT(kNumActions == WXSIZEOF(kActionStrings)); wxArrayString actionChoices; for (int i = 0; i < kNumActions; i++) { actionChoices.Add(wxGetTranslation(kActionStrings[i])); } S.AddSpace(0, 5); S.StartStatic(_("Detect Silence")); { S.StartMultiColumn(3, wxALIGN_CENTER_HORIZONTAL); { // Threshold mTruncDbChoice = S.AddChoice(_("Level:"), wxT(""), &mDbChoices); mTruncDbChoice->SetValidator(wxGenericValidator(&mTruncDbChoiceIndex)); S.SetSizeHints(-1, -1); S.AddSpace(0); // 'choices' already includes units. // Ignored silence FloatingPointValidator<double> vldDur(3, &mInitialAllowedSilence, NUM_VAL_NO_TRAILING_ZEROES); vldDur.SetRange(MIN_Minimum, MAX_Minimum); mInitialAllowedSilenceT = S.AddTextBox(_("Duration:"), wxT(""), 12); mInitialAllowedSilenceT->SetValidator(vldDur); S.AddUnits(wxT("seconds")); } S.EndMultiColumn(); } S.EndStatic(); S.StartStatic(_("Action")); { S.StartHorizontalLay(); { // Action choices mActionChoice = S.AddChoice(wxT(""), 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, NUM_VAL_NO_TRAILING_ZEROES); vldTrunc.SetRange(MIN_Truncate, MAX_Truncate); mTruncLongestAllowedSilenceT = S.AddTextBox(_("Truncate to:"), wxT(""), 12); mTruncLongestAllowedSilenceT->SetValidator(vldTrunc); S.AddUnits(wxT("seconds")); FloatingPointValidator<double> vldComp(3, &mSilenceCompressPercent, NUM_VAL_NO_TRAILING_ZEROES); vldComp.SetRange(MIN_Compress, MAX_Compress); mSilenceCompressPercentT = S.AddTextBox(_("Compress to:"), wxT(""), 12); mSilenceCompressPercentT->SetValidator(vldComp); S.AddUnits(wxT("percent")); } 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 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(); }