本文整理汇总了C++中ShuttleGui::StartHorizontalLay方法的典型用法代码示例。如果您正苦于以下问题:C++ ShuttleGui::StartHorizontalLay方法的具体用法?C++ ShuttleGui::StartHorizontalLay怎么用?C++ ShuttleGui::StartHorizontalLay使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ShuttleGui
的用法示例。
在下文中一共展示了ShuttleGui::StartHorizontalLay方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PopulateOrExchange
/// Create the dialog contents, or exchange data with it.
void ThemePrefs::PopulateOrExchange( ShuttleGui & S)
{
S.StartHorizontalLay(wxEXPAND,1);
S.StartVerticalLay(0);
S.StartStatic( _("Theme Cache - Images && Color"));
{
S.Id( idSaveThemeCache ).AddButton( _("Save Theme Cache"));
S.Id( idLoadThemeCache ).AddButton( _("Load Theme Cache"));
// This next button is only provided in Debug mode.
// It is for developers who are compiling Audacity themselves
// and who who wish to generate a new ThemeAsCeeCode.h and compile it in.
#ifdef __WXDEBUG__
// S.Id( idSaveThemeAsCode ).AddButton( wxT("Save Code" ));
S.Id( idSaveThemeAsCode ).AddButton( wxT("Output Sourcery" ));
#endif
S.Id( idReadThemeInternal ).AddButton( _("Defaults" ));
S.TieCheckBox( _("Load Theme Cache At Startup"),
wxT("/Theme/LoadAtStart"), false);
}
S.EndStatic();
// JKC: 'Ergonomic' details:
// Theme components are used much less frequently than
// the ImageCache. Yet it's easy to click them 'by mistake'.
//
// To reduce that risk, we use a separate box to separate them off.
// And choose text on the buttons that is shorter, making the
// buttons smaller and less tempting to click.
S.StartStatic( _("Individual Theme Files"),1);
{
S.Id( idSaveThemeComponents ).AddButton( _("Save Files"));
S.Id( idLoadThemeComponents ).AddButton( _("Load Files"));
}
S.EndStatic();
S.EndVerticalLay();
S.StartStatic( _("Info"), 1 );
{
S.AddFixedText(
_("Themability is an experimental feature.\n\n"
wxT("To try it out, click \"Save Theme Cache\" then\n" )
wxT("find and modify the images and colors in \n" )
wxT("ImageCacheVxx.png using an image editor such \n" )
wxT("as the Gimp.\n\n")
wxT("Click \"Load Theme Cache\" to load the changed images\n")
wxT("and colors back into Audacity.\n\n")
wxT("[Only the control toolbar and the colors on the \n")
wxT("wavetrack are currently affected, even though the\n")
wxT("image file shows other icons too.]\n"))
);
#ifdef __WXDEBUG__
S.AddFixedText(
_("You have compiled Audacity with an extra button, \n"
wxT("'Output Sourcery'. This will save a C version of \n")
wxT("the image cache that can be compiled in as a default.\n"))
);
#endif
S.AddFixedText(
_("If 'Load Theme Cache At Startup' is checked, then \n"
wxT("the Theme Cache will be loaded when the program \n")
wxT("starts up.\n\n")
wxT("Saving and loading individual theme files uses a \n")
wxT("separate file for each image, but is otherwise the \n")
wxT("same idea.\n\n"))
);
}
S.EndStatic();
}
示例2: PopulateOrExchange
void EffectCompressor::PopulateOrExchange(ShuttleGui & S)
{
S.SetBorder(5);
S.StartHorizontalLay(wxEXPAND, true);
{
S.SetBorder(10);
mPanel = safenew EffectCompressorPanel(S.GetParent(),
mThresholdDB,
mNoiseFloorDB,
mRatio);
mPanel->SetMinSize(wxSize(400, 200));
S.Prop(true).AddWindow(mPanel, wxEXPAND | wxALL);
S.SetBorder(5);
}
S.EndHorizontalLay();
S.StartStatic(wxT(""));
{
S.StartMultiColumn(3, wxEXPAND);
{
S.SetStretchyCol(1);
mThresholdLabel = S.AddVariableText(_("Threshold:"), true,
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
S.SetStyle(wxSL_HORIZONTAL);
mThresholdSlider = S.Id(ID_Threshold).AddSlider(wxT(""),
DEF_Threshold * SCL_Threshold,
MAX_Threshold * SCL_Threshold,
MIN_Threshold * SCL_Threshold);
mThresholdSlider->SetName(_("Threshold"));
mThresholdText = S.AddVariableText(wxT("XXX dB"), true,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
mNoiseFloorLabel = S.AddVariableText(_("Noise Floor:"), true,
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
S.SetStyle(wxSL_HORIZONTAL);
mNoiseFloorSlider = S.Id(ID_NoiseFloor).AddSlider(wxT(""),
DEF_NoiseFloor / SCL_NoiseFloor,
MAX_NoiseFloor / SCL_NoiseFloor,
MIN_NoiseFloor / SCL_NoiseFloor);
mNoiseFloorSlider->SetName(_("Noise Floor"));
mNoiseFloorText = S.AddVariableText(wxT("XXX dB"), true,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
mRatioLabel = S.AddVariableText(_("Ratio:"), true,
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
S.SetStyle(wxSL_HORIZONTAL);
mRatioSlider = S.Id(ID_Ratio).AddSlider(wxT(""),
DEF_Ratio * SCL_Ratio,
MAX_Ratio * SCL_Ratio,
MIN_Ratio * SCL_Ratio);
mRatioSlider->SetName(_("Ratio"));
mRatioSlider->SetPageSize(5);
mRatioText = S.AddVariableText(wxT("XXXX:1"), true,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
/* i18n-hint: Particularly in percussion, sounds can be regarded as having
* an 'attack' phase where the sound builds up and a 'decay' where the
* sound dies away. So this means 'onset duration'. */
mAttackLabel = S.AddVariableText(_("Attack Time:"), true,
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
S.SetStyle(wxSL_HORIZONTAL);
mAttackSlider = S.Id(ID_Attack).AddSlider(wxT(""),
DEF_AttackTime * SCL_AttackTime,
MAX_AttackTime * SCL_AttackTime,
MIN_AttackTime * SCL_AttackTime);
mAttackSlider->SetName(_("Attack Time"));
mAttackText = S.AddVariableText(wxT("XXXX secs"), true,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
mDecayLabel = S.AddVariableText(_("Release Time:"), true,
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
S.SetStyle(wxSL_HORIZONTAL);
mDecaySlider = S.Id(ID_Decay).AddSlider(wxT(""),
DEF_ReleaseTime * SCL_ReleaseTime,
MAX_ReleaseTime * SCL_ReleaseTime,
MIN_ReleaseTime * SCL_ReleaseTime);
mDecaySlider->SetName(_("Release Time"));
mDecayText = S.AddVariableText(wxT("XXXX secs"), true,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
}
S.EndMultiColumn();
}
S.EndStatic();
S.StartHorizontalLay(wxCENTER, false);
{
/* i18n-hint: Make-up, i.e. correct for any reduction, rather than fabricate it.*/
mGainCheckBox = S.AddCheckBox(_("Make-up gain for 0 dB after compressing"),
DEF_Normalize ? wxT("true") : wxT("false"));
mPeakCheckBox = S.AddCheckBox(_("Compress based on Peaks"),
DEF_UsePeak ? wxT("true") : wxT("false"));
}
S.EndHorizontalLay();
}
示例3: PopulateOrExchange
void EffectChangePitch::PopulateOrExchange(ShuttleGui & S)
{
DeduceFrequencies(); // Set frequency-related control values based on sample.
wxArrayString pitch;
pitch.Add(wxT("C"));
pitch.Add(wxT("C#/Db"));
pitch.Add(wxT("D"));
pitch.Add(wxT("D#/Eb"));
pitch.Add(wxT("E"));
pitch.Add(wxT("F"));
pitch.Add(wxT("F#/Gb"));
pitch.Add(wxT("G"));
pitch.Add(wxT("G#/Ab"));
pitch.Add(wxT("A"));
pitch.Add(wxT("A#/Bb"));
pitch.Add(wxT("B"));
S.SetBorder(5);
S.StartVerticalLay(0);
{
S.StartVerticalLay();
{
S.AddTitle(_("Change Pitch without Changing Tempo"));
S.AddTitle(
wxString::Format(_("Estimated Start Pitch: %s%d (%.3f Hz)"),
pitch[m_nFromPitch].c_str(), m_nFromOctave, m_FromFrequency));
}
S.EndVerticalLay();
/* i18n-hint: (noun) Musical pitch.*/
S.StartStatic(_("Pitch"));
{
S.StartMultiColumn(6, wxALIGN_CENTER); // 6 controls, because each AddChoice adds a wxStaticText and a wxChoice.
{
m_pChoice_FromPitch = S.Id(ID_FromPitch).AddChoice(_("from"), wxT(""), &pitch);
m_pChoice_FromPitch->SetName(_("from"));
m_pChoice_FromPitch->SetSizeHints(80, -1);
m_pSpin_FromOctave = S.Id(ID_FromOctave).AddSpinCtrl(wxT(""), m_nFromOctave, INT_MAX, INT_MIN);
m_pSpin_FromOctave->SetName(_("from Octave"));
m_pSpin_FromOctave->SetSizeHints(50, -1);
m_pChoice_ToPitch = S.Id(ID_ToPitch).AddChoice(_("to"), wxT(""), &pitch);
m_pChoice_ToPitch->SetName(_("to"));
m_pChoice_ToPitch->SetSizeHints(80, -1);
m_pSpin_ToOctave =
S.Id(ID_ToOctave).AddSpinCtrl(wxT(""), m_nToOctave, INT_MAX, INT_MIN);
m_pSpin_ToOctave->SetName(_("to Octave"));
m_pSpin_ToOctave->SetSizeHints(50, -1);
}
S.EndMultiColumn();
S.StartHorizontalLay(wxALIGN_CENTER);
{
FloatingPointValidator<double> vldSemitones(2, &m_dSemitonesChange, NUM_VAL_TWO_TRAILING_ZEROES);
m_pTextCtrl_SemitonesChange =
S.Id(ID_SemitonesChange).AddTextBox(_("Semitones (half-steps):"), wxT(""), 12);
m_pTextCtrl_SemitonesChange->SetName(_("Semitones (half-steps)"));
m_pTextCtrl_SemitonesChange->SetValidator(vldSemitones);
}
S.EndHorizontalLay();
}
S.EndStatic();
S.StartStatic(_("Frequency"));
{
S.StartMultiColumn(5, wxALIGN_CENTER); // 5, because AddTextBox adds a wxStaticText and a wxTextCtrl.
{
FloatingPointValidator<double> vldFromFrequency(3, &m_FromFrequency, NUM_VAL_THREE_TRAILING_ZEROES);
vldFromFrequency.SetMin(0.0);
m_pTextCtrl_FromFrequency = S.Id(ID_FromFrequency).AddTextBox(_("from"), wxT(""), 12);
m_pTextCtrl_FromFrequency->SetName(_("from (Hz)"));
m_pTextCtrl_FromFrequency->SetValidator(vldFromFrequency);
FloatingPointValidator<double> vldToFrequency(3, &m_ToFrequency, NUM_VAL_THREE_TRAILING_ZEROES);
vldToFrequency.SetMin(0.0);
m_pTextCtrl_ToFrequency = S.Id(ID_ToFrequency).AddTextBox(_("to"), wxT(""), 12);
m_pTextCtrl_ToFrequency->SetName(_("to (Hz)"));
m_pTextCtrl_ToFrequency->SetValidator(vldToFrequency);
S.AddUnits(_("Hz"));
}
S.EndMultiColumn();
S.StartHorizontalLay(wxALIGN_CENTER);
{
FloatingPointValidator<double> vldPercentage(3, &m_dPercentChange, NUM_VAL_THREE_TRAILING_ZEROES);
vldPercentage.SetRange(MIN_Percentage, MAX_Percentage);
m_pTextCtrl_PercentChange = S.Id(ID_PercentChange).AddTextBox(_("Percent Change:"), wxT(""), 12);
m_pTextCtrl_PercentChange->SetValidator(vldPercentage);
}
S.EndHorizontalLay();
S.StartHorizontalLay(wxEXPAND);
{
S.SetStyle(wxSL_HORIZONTAL);
m_pSlider_PercentChange = S.Id(ID_PercentChange)
//.........这里部分代码省略.........
示例4: PopulateOrExchange
void TagsEditor::PopulateOrExchange(ShuttleGui & S)
{
S.StartVerticalLay();
{
S.StartHorizontalLay(wxALIGN_LEFT, false);
{
S.AddUnits(_("Use arrow keys (or RETURN key after editing) to navigate fields."));
}
S.EndHorizontalLay();
if (mGrid == NULL) {
mGrid = new Grid(S.GetParent(),
wxID_ANY,
wxDefaultPosition,
wxDefaultSize,
wxSUNKEN_BORDER);
mStringRenderer = new wxGridCellStringRenderer;
mComboEditor = new ComboEditor(wxArrayString(), true);
mGrid->RegisterDataType(wxT("Combo"), mStringRenderer, mComboEditor);
mGrid->SetColLabelSize(mGrid->GetDefaultRowSize());
wxArrayString cs(WXSIZEOF(names), names);
// Build the initial (empty) grid
mGrid->CreateGrid(0, 2);
mGrid->SetRowLabelSize(0);
mGrid->SetDefaultCellAlignment(wxALIGN_LEFT, wxALIGN_CENTER);
mGrid->SetColLabelValue(0, _("Tag"));
mGrid->SetColLabelValue(1, _("Value"));
// Resize the name column and set default row height.
wxComboBox tc(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, cs);
mGrid->SetColSize(0, tc.GetSize().x);
mGrid->SetColMinimalWidth(0, tc.GetSize().x);
}
S.Prop(true);
S.AddWindow(mGrid, wxEXPAND | wxALL);
S.StartMultiColumn(4, wxALIGN_CENTER);
{
S.Id(AddID).AddButton(_("&Add"));
S.Id(RemoveID).AddButton(_("&Remove"));
S.AddTitle(wxT(" "));
S.Id(ClearID).AddButton(_("Cl&ear"));
}
S.EndMultiColumn();
S.StartHorizontalLay(wxALIGN_CENTRE, false);
{
S.StartStatic(_("Genres"));
{
S.StartMultiColumn(4, wxALIGN_CENTER);
{
S.Id(EditID).AddButton(_("E&dit..."));
S.Id(ResetID).AddButton(_("Rese&t..."));
}
S.EndMultiColumn();
}
S.EndStatic();
S.StartStatic(_("Template"));
{
S.StartMultiColumn(4, wxALIGN_CENTER);
{
S.Id(LoadID).AddButton(_("&Load..."));
S.Id(SaveID).AddButton(_("&Save..."));
S.AddTitle(wxT(" "));
S.Id(SaveDefaultsID).AddButton(_("Set De&fault"));
}
S.EndMultiColumn();
}
S.EndStatic();
}
S.EndHorizontalLay();
}
S.EndVerticalLay();
S.AddStandardButtons(eOkButton | eCancelButton);
}
示例5: PopulateOrExchange
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();
}
示例6: PopulateOrExchange
void EffectAmplify::PopulateOrExchange(ShuttleGui & S)
{
if (IsBatchProcessing())
{
mPeak = 1.0;
}
else
{
if (mPeak > 0.0)
{
mRatio = 1.0 / mPeak;
mRatioClip = mRatio;
}
else
{
mRatio = 1.0;
}
}
S.AddSpace(0, 5);
S.StartVerticalLay(0);
{
int precission = 3; // allow (a generous) 3 decimal places for Amplification (dB)
// Amplitude
S.StartMultiColumn(2, wxCENTER);
{
FloatingPointValidator<double> vldAmp(precission, &mAmp, NumValidatorStyle::ONE_TRAILING_ZERO);
vldAmp.SetRange(MIN_Amp, MAX_Amp);
mAmpT = S.Id(ID_Amp).AddTextBox(_("Amplification (dB):"), wxT(""), 12);
mAmpT->SetValidator(vldAmp);
}
S.EndMultiColumn();
// Amplitude
S.StartHorizontalLay(wxEXPAND);
{
S.SetStyle(wxSL_HORIZONTAL);
mAmpS = S.Id(ID_Amp).AddSlider( {}, 0, MAX_Amp * SCL_Amp, MIN_Amp * SCL_Amp);
mAmpS->SetName(_("Amplification dB"));
}
S.EndHorizontalLay();
// Peak
S.StartMultiColumn(2, wxCENTER);
{
// One extra decimal place so that rounding is visible to user (see: bug 958)
FloatingPointValidator<double> vldNewPeak(precission + 1, &mNewPeak, NumValidatorStyle::ONE_TRAILING_ZERO);
double minAmp = MIN_Amp + LINEAR_TO_DB(mPeak);
double maxAmp = MAX_Amp + LINEAR_TO_DB(mPeak);
// min and max need same precision as what we're validating (bug 963)
minAmp = Internat::CompatibleToDouble(Internat::ToString(minAmp, precission +1));
maxAmp = Internat::CompatibleToDouble(Internat::ToString(maxAmp, precission +1));
vldNewPeak.SetRange(minAmp, maxAmp);
mNewPeakT = S.Id(ID_Peak).AddTextBox(_("New Peak Amplitude (dB):"), wxT(""), 12);
mNewPeakT->SetValidator(vldNewPeak);
}
S.EndMultiColumn();
// Clipping
S.StartHorizontalLay(wxCENTER);
{
mClip = S.Id(ID_Clip).AddCheckBox(_("Allow clipping"), wxT("false"));
if (IsBatchProcessing())
{
mClip->Enable(false);
mCanClip = true;
}
}
S.EndHorizontalLay();
}
S.EndVerticalLay();
return;
}
示例7: PopulateOrExchange
void ChangePitchDialog::PopulateOrExchange(ShuttleGui & S)
{
wxTextValidator nullvld(wxFILTER_INCLUDE_CHAR_LIST);
wxTextValidator numvld(wxFILTER_NUMERIC);
wxArrayString pitch;
pitch.Add(wxT("C"));
pitch.Add(wxT("C#/Db"));
pitch.Add(wxT("D"));
pitch.Add(wxT("D#/Eb"));
pitch.Add(wxT("E"));
pitch.Add(wxT("F"));
pitch.Add(wxT("F#/Gb"));
pitch.Add(wxT("G"));
pitch.Add(wxT("G#/Ab"));
pitch.Add(wxT("A"));
pitch.Add(wxT("A#/Bb"));
pitch.Add(wxT("B"));
S.SetBorder(10);
S.StartHorizontalLay(wxCENTER, false);
{
S.AddTitle(_("Change Pitch without Changing Tempo") +
wxString(wxT("\n\n")) +
_("by Vaughan Johnson && Dominic Mazzoni") +
wxString(wxT("\n")) +
_("using SoundTouch, by Olli Parviainen"));
}
S.EndHorizontalLay();
S.SetBorder(5);
//
S.StartMultiColumn(6, wxCENTER);
{
//
S.AddUnits(_("Pitch:"));
S.StartHorizontalLay(wxALIGN_CENTER_VERTICAL);
{
m_pChoice_FromPitch = S.Id(ID_CHOICE_FROMPITCH)
.AddChoice(_("From:"), wxT(""), &pitch);
m_pChoice_FromPitch->SetName(_("From Pitch"));
m_pChoice_FromPitch->SetSizeHints(100, -1);
}
S.EndHorizontalLay();
S.StartStatic(wxT(""));
{
S.StartVerticalLay();
{
S.SetBorder(3);
m_pRadioButton_PitchUp = S.Id(ID_RADIOBUTTON_PITCHUPDOWN)
.AddRadioButton(_("Up"));
m_pRadioButton_PitchDown = S.Id(ID_RADIOBUTTON_PITCHUPDOWN)
.AddRadioButtonToGroup(_("Down"));
S.SetBorder(5);
}
S.EndVerticalLay();
}
S.EndStatic();
S.StartHorizontalLay(wxALIGN_CENTER_VERTICAL);
{
m_pChoice_ToPitch = S.Id(ID_CHOICE_TOPITCH)
.AddChoice(_("To:"), wxT(""), &pitch);
m_pChoice_ToPitch->SetName(_("To Pitch"));
m_pChoice_ToPitch->SetSizeHints(100, -1);
}
S.EndHorizontalLay();
}
S.EndMultiColumn();
//
S.StartMultiColumn(2, wxCENTER);
{
//
S.AddPrompt(_("Semitones (half-steps):"));
S.StartHorizontalLay(wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, false);
{
m_pTextCtrl_SemitonesChange = S.Id(ID_TEXT_SEMITONESCHANGE)
.AddTextBox(wxT(""), wxT(""), 12);
m_pTextCtrl_SemitonesChange->SetName(_("Semitones in half-steps"));
m_pTextCtrl_SemitonesChange->SetValidator(numvld);
}
S.EndHorizontalLay();
//
S.AddPrompt(_("Frequency (Hz):"));
S.StartHorizontalLay(wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, false);
{
m_pTextCtrl_FromFrequency = S.Id(ID_TEXT_FROMFREQUENCY)
.AddTextBox(_("from"), wxT(""), 12);
m_pTextCtrl_FromFrequency->SetName(_("From frequency in hertz"));
m_pTextCtrl_FromFrequency->SetValidator(nullvld);
m_pTextCtrl_ToFrequency = S.Id(ID_TEXT_TOFREQUENCY)
.AddTextBox(_("to"), wxT(""), 12);
m_pTextCtrl_ToFrequency->SetName(_("To frequency in seconds"));
m_pTextCtrl_ToFrequency->SetValidator(numvld);
//.........这里部分代码省略.........
示例8: PopulateOrExchange
void AudioIOPrefs::PopulateOrExchange( ShuttleGui & S )
{
/// \todo
/// JKC: I think setting paths in gPrefs is bad practice.
/// Suppose we are using gPrefs from elsewhere at the same time?
/// Change these all to full paths?
gPrefs->SetPath(wxT("/AudioIO"));
S.SetBorder( 2 );
S.StartHorizontalLay(wxEXPAND, 0 );
S.StartStatic( _("Playback"),1 );
{
S.StartMultiColumn(2, wxEXPAND);
S.SetStretchyCol(1);
S.TieChoice( _("Device") + wxString(wxT(":")), wxT("PlaybackDevice"),
wxT(""), mmPlayNames, mmPlayLabels );
S.AddPrompt( _("Using:") );
wxString ver = _("Portaudio v");
#if USE_PORTAUDIO_V19
ver += wxT("19");
#else
ver += wxT("18");
#endif
S.AddFixedText( ver );
S.EndMultiColumn();
}
S.EndStatic();
S.StartStatic( _("Recording"), 1 );
{
S.StartMultiColumn(2, wxEXPAND);
S.SetStretchyCol(1);
S.TieChoice( _("Device") + wxString(wxT(":")), wxT("RecordingDevice"),
wxT(""), mmRecordNames, mmRecordLabels );
S.TieChoice( _("Channels") + wxString(wxT(":")), wxT("RecordChannels"),
2, mmChannelNames, mmChannelLabels );
S.EndMultiColumn();
}
S.EndStatic();
S.EndHorizontalLay();
S.StartStatic( _("Playthrough") );
{
S.TieCheckBox( _("&Play other tracks while recording new one"),
wxT("Duplex"),true);
#ifdef __MACOSX__
S.TieCheckBox( _("&Hardware Playthrough (Play new track while recording it)"),
wxT("Playthrough"),false);
#endif
S.TieCheckBox( _("&Software Playthrough (Play new track while recording it)"),
wxT("SWPlaythrough"),false);
}
S.EndStatic();
S.StartHorizontalLay( wxEXPAND, 0 );
S.StartStatic( _("Cut Preview"),1 );
{
S.StartThreeColumn();
S.TieTextBox( _("Play before cut region:"), wxT("CutPreviewBeforeLen"),1.0,9);
S.AddUnits( _("seconds") );
S.TieTextBox( _("Play after cut region:"),wxT("CutPreviewAfterLen"), 1.0,9);
S.AddUnits( _("seconds") );
S.EndThreeColumn();
}
S.EndStatic();
S.StartStatic( _("Latency"),1 );
{
S.StartThreeColumn();
#if USE_PORTAUDIO_V19
// only show the following controls if we use Portaudio v19, because
// for Portaudio v19 we always use default buffer sizes
S.TieTextBox( _("Audio to buffer:"),wxT("LatencyDuration"),100.0,9);
S.AddUnits( _("milliseconds") );
#endif
S.TieTextBox( _("Latency correction:"),wxT("LatencyCorrection"),0.0,9);
S.AddUnits( _("milliseconds") );
S.EndThreeColumn();
}
S.EndStatic();
S.EndHorizontalLay();
S.StartHorizontalLay( wxEXPAND, 0 );
S.StartStatic( _("Seek Time"),1 );
{
S.StartThreeColumn();
S.TieTextBox( _("Short period:"), wxT("SeekShortPeriod"),1.0,9);
S.AddUnits( _("seconds") );
S.TieTextBox( _("Long period:"),wxT("SeekLongPeriod"), 15.0,9);
S.AddUnits( _("seconds") );
S.EndThreeColumn();
}
S.EndStatic();
S.StartStatic( _("Effects Preview"),1 );
{
S.StartThreeColumn();
S.TieTextBox( _("Play when previewing:"), wxT("EffectsPreviewLen"), 3.0,9);
S.AddUnits( _("seconds") );
S.EndThreeColumn();
}
gPrefs->SetPath(wxT("/"));
}
示例9: PopulateOrExchange
void ExportMultiple::PopulateOrExchange(ShuttleGui& S)
{
S.SetBorder(5);
S.StartMultiColumn(4, true);
{
wxArrayString formats;
for (size_t i = 0; i < mPlugins.GetCount(); i++) {
formats.Add(mPlugins[i]->GetDescription());
}
S.AddPrompt(_("Export format:"));
mFormat = S.Id(FormatID)
.TieChoice(wxT(""),
wxT("/Export/MultipleFormat"),
gPrefs->Read(wxT("/Export/Format"), wxT("WAV")),
formats,
formats);
S.Id(OptionsID).AddButton(_("Options..."));
S.AddVariableText(wxT(""), false);
S.AddPrompt(_("Export location:"));
mDir = S.Id(DirID)
.TieTextBox(wxT(""),
wxT("/Export/MultiplePath"),
gPrefs->Read(wxT("/Export/Path"), ::wxGetCwd()),
64);
S.Id(ChooseID).AddButton(_("Choose..."));
S.Id(CreateID).AddButton(_("Create"));
}
S.EndMultiColumn();
S.StartHorizontalLay(wxEXPAND, true);
{
S.SetBorder(5);
S.StartStatic(_("Split files based on:"), true);
{
S.StartMultiColumn(2, false);
S.SetStretchyCol(1);
{
// Row 1
S.SetBorder(1);
mLabel = S.Id(LabelID)
.AddRadioButton(wxT(""));
S.SetBorder(3);
mLabelLabel = S.AddVariableText(_("Labels"), false);
// Row 2
S.AddVariableText(wxT(""), false);
mFirst = S.Id(FirstID)
.AddCheckBox(_("Include audio before first label"), wxT("false"));
// Row 3
S.AddVariableText(wxT(""), false);
S.StartHorizontalLay(wxEXPAND, false);
{
mFirstFileLabel = S.AddVariableText(_("First file name:"), true);
mFirstFileName = S.Id(FirstFileNameID)
.TieTextBox(wxT(""),
wxT("/Export/MultipleFirstName"),
wxT(""),
30);
}
S.EndHorizontalLay();
// Row 4
S.SetBorder(1);
mTrack = S.Id(TrackID)
.AddRadioButtonToGroup(wxT(""));
S.SetBorder(3);
mTrackLabel = S.AddVariableText(_("Tracks"), false);
}
S.EndMultiColumn();
}
S.EndStatic();
S.SetBorder(5);
S.StartStatic(_("Name files:"), false);
{
S.StartMultiColumn(2, false);
S.SetStretchyCol(1);
{
// Row 1
S.SetBorder(1);
mByName = S.Id(ByNameID)
.AddRadioButton(wxT(""));
S.SetBorder(3);
mByNameLabel = S.AddVariableText(_("Using Label/Track Name"), false);
// Row 2
S.SetBorder(1);
mByNumber = S.Id(ByNumberID)
.AddRadioButtonToGroup(wxT(""));
S.SetBorder(3);
mByNumberLabel = S.AddVariableText(_("Numbering consecutively"), false);
// Row 3
S.AddVariableText(wxT(""), false);
S.StartHorizontalLay(wxEXPAND, false);
{
//.........这里部分代码省略.........
示例10: PopulateOrExchange
void TimeScaleDialog::PopulateOrExchange(ShuttleGui & S)
{
wxTextValidator nullvld(wxFILTER_INCLUDE_CHAR_LIST);
wxTextValidator numvld(wxFILTER_NUMERIC);
S.SetBorder(5);
S.AddSpace(0, 5);
S.StartMultiColumn(2, 0);
// Rate Start
S.StartStatic(_("Initial Tempo Change (%)"));
{
S.StartMultiColumn(1, wxCENTER);
{
m_pTextCtrl_RatePercentChangeStart = S.Id(ID_TEXT_RATE_PERCENTCHANGE_START)
.AddTextBox(wxT(""), wxT(""), 12);
m_pTextCtrl_RatePercentChangeStart->SetValidator(numvld);
}
S.EndMultiColumn();
S.StartHorizontalLay(wxEXPAND,0);
{
S.SetStyle(wxSL_HORIZONTAL);
m_pSlider_RatePercentChangeStart = S.Id(ID_SLIDER_RATE_PERCENTCHANGE_START)
.AddSlider(wxT(""), (int)RATE_PERCENTCHANGE_DEFAULT, (int)RATE_PERCENTCHANGE_MAX_SLIDER, (int)RATE_PERCENTCHANGE_MIN_SLIDER);
}
S.EndHorizontalLay();
}
S.EndStatic();
S.StartStatic(_("Final Tempo Change (%)"));
{
S.StartMultiColumn(1, wxCENTER);
{
m_pTextCtrl_RatePercentChangeEnd = S.Id(ID_TEXT_RATE_PERCENTCHANGE_END)
.AddTextBox(wxT(""), wxT(""), 12);
m_pTextCtrl_RatePercentChangeEnd->SetValidator(numvld);
}
S.EndMultiColumn();
S.StartHorizontalLay(wxEXPAND,0);
{
S.SetStyle(wxSL_HORIZONTAL);
m_pSlider_RatePercentChangeEnd = S.Id(ID_SLIDER_RATE_PERCENTCHANGE_END)
.AddSlider(wxT(""), (int)RATE_PERCENTCHANGE_DEFAULT, (int)RATE_PERCENTCHANGE_MAX_SLIDER, (int)RATE_PERCENTCHANGE_MIN_SLIDER);
}
S.EndHorizontalLay();
}
S.EndStatic();
// Pitch Start
S.StartStatic(_("Initial Pitch Shift"));
{
S.StartMultiColumn(2, wxCENTER);
{
m_pTextCtrl_PitchHalfStepsStart = S.Id(ID_TEXT_PITCH_HALFSTEPS_START)
.AddTextBox(_("(semitones) [-12 to 12]:"), wxT(""), 12);
m_pTextCtrl_PitchHalfStepsStart->SetValidator(numvld);
m_pTextCtrl_PitchPercentChangeStart = S.Id(ID_TEXT_PITCH_PERCENTCHANGE_START)
.AddTextBox(_("(%) [-50 to 100]:"), wxT(""), 12);
m_pTextCtrl_PitchPercentChangeStart->SetValidator(numvld);
}
S.EndMultiColumn();
}
S.EndStatic();
// Pitch End
S.StartStatic(_("Final Pitch Shift"));
{
S.StartMultiColumn(2, wxCENTER);
{
m_pTextCtrl_PitchHalfStepsEnd = S.Id(ID_TEXT_PITCH_HALFSTEPS_END)
.AddTextBox(_("(semitones) [-12 to 12]:"), wxT(""), 12);
m_pTextCtrl_PitchHalfStepsEnd->SetValidator(numvld);
m_pTextCtrl_PitchPercentChangeEnd = S.Id(ID_TEXT_PITCH_PERCENTCHANGE_END)
.AddTextBox(_("(%) [-50 to 100]:"), wxT(""), 12);
m_pTextCtrl_PitchPercentChangeEnd->SetValidator(numvld);
}
S.EndMultiColumn();
}
S.EndStatic();
S.EndMultiColumn();
return;
}
示例11: PopulateOrExchange
void EffectToneGen::PopulateOrExchange(ShuttleGui & S)
{
wxTextCtrl *t;
S.StartMultiColumn(2, wxCENTER);
{
wxChoice *c = S.AddChoice(_("Waveform:"), wxT(""), &mWaveforms);
c->SetValidator(wxGenericValidator(&mWaveform));
if (mChirp)
{
S.AddFixedText(wxT(""));
S.StartHorizontalLay(wxEXPAND);
{
S.StartHorizontalLay(wxLEFT, 50);
{
S.AddTitle(_("Start"));
}
S.EndHorizontalLay();
S.StartHorizontalLay(wxLEFT, 50);
{
S.AddTitle(_("End"));
}
S.EndHorizontalLay();
}
S.EndHorizontalLay();
S.AddPrompt(_("Frequency (Hz):"));
S.StartHorizontalLay(wxEXPAND);
{
S.StartHorizontalLay(wxLEFT, 50);
{
FloatingPointValidator<double> vldStartFreq(6, &mFrequency[0], NUM_VAL_NO_TRAILING_ZEROES);
vldStartFreq.SetRange(MIN_StartFreq, GetActiveProject()->GetRate() / 2.0);
t = S.AddTextBox(wxT(""), wxT(""), 12);
t->SetName(_("Frequency Hertz Start"));
t->SetValidator(vldStartFreq);
}
S.EndHorizontalLay();
S.StartHorizontalLay(wxLEFT, 50);
{
FloatingPointValidator<double> vldEndFreq(6, &mFrequency[1], NUM_VAL_NO_TRAILING_ZEROES);
vldEndFreq.SetRange(MIN_EndFreq, GetActiveProject()->GetRate() / 2.0);
t = S.AddTextBox(wxT(""), wxT(""), 12);
t->SetName(_("Frequency Hertz End"));
t->SetValidator(vldEndFreq);
}
S.EndHorizontalLay();
}
S.EndHorizontalLay();
S.AddPrompt(_("Amplitude (Hz):"));
S.StartHorizontalLay(wxEXPAND);
{
S.StartHorizontalLay(wxLEFT, 50);
{
FloatingPointValidator<double> vldStartAmp(6, &mAmplitude[0], NUM_VAL_NO_TRAILING_ZEROES);
vldStartAmp.SetRange(MIN_StartAmp, MAX_StartAmp);
t = S.AddTextBox(wxT(""), wxT(""), 12);
t->SetName(_("Amplitude Start"));
t->SetValidator(vldStartAmp);
}
S.EndHorizontalLay();
S.StartHorizontalLay(wxLEFT, 50);
{
FloatingPointValidator<double> vldEndAmp(6, &mAmplitude[1], NUM_VAL_NO_TRAILING_ZEROES);
vldEndAmp.SetRange(MIN_EndAmp, MAX_EndAmp);
t = S.AddTextBox(wxT(""), wxT(""), 12);
t->SetName(_("Amplitude End"));
t->SetValidator(vldEndAmp);
}
S.EndHorizontalLay();
}
S.EndHorizontalLay();
c = S.AddChoice(_("Interpolation:"), wxT(""), &mInterpolations);
c->SetValidator(wxGenericValidator(&mInterpolation));
}
else
{
FloatingPointValidator<double> vldFrequency(6, &mFrequency[0], NUM_VAL_NO_TRAILING_ZEROES);
vldFrequency.SetRange(MIN_Frequency, GetActiveProject()->GetRate() / 2.0);
t = S.AddTextBox(_("Frequency (Hz):"), wxT(""), 12);
t->SetValidator(vldFrequency);
FloatingPointValidator<double> vldAmplitude(6, &mAmplitude[0], NUM_VAL_NO_TRAILING_ZEROES);
vldAmplitude.SetRange(MIN_Amplitude, MAX_Amplitude);
t = S.AddTextBox(_("Amplitude (0-1):"), wxT(""), 12);
t->SetValidator(vldAmplitude);
}
bool isSelection;
double duration = GetDuration(&isSelection);
S.AddPrompt(_("Duration:"));
mToneDurationT = new
NumericTextCtrl(NumericConverter::TIME,
//.........这里部分代码省略.........
示例12: PopulateOrExchange
void NoiseRemovalDialog::PopulateOrExchange(ShuttleGui & S)
{
wxString step1Label;
wxString step1Prompt;
wxString step2Label;
wxString step2Prompt;
bool bCleanSpeechMode = false;
AudacityProject * project = GetActiveProject();
if( project && project->GetCleanSpeechMode() ) {
bCleanSpeechMode = true;
}
if (bCleanSpeechMode) {
// We're not marking these as translatable because most people
// don't use CleanSpeech so it'd be a waste of time for most
// translators
step1Label = wxT("Preparation Step");
step1Prompt = wxT("Listen carefully to section with some speech "
wxT("and some silence to check before/after.\n")
wxT("Select a few seconds of just noise ('thinner' ")
wxT("part of wave pattern usually between\nspoken ")
wxT("phrases or during pauses) so Audacity knows ")
wxT("what to filter out, then click"));
step2Label = wxT("Actually Remove Noise");
step2Prompt = wxT("Select what part of the audio you want filtered "
wxT("(Ctrl-A = All), chose how much noise\nyou want ")
wxT("filtered out with sliders below, and then click ")
wxT("'OK' to remove noise.\nFind best setting with ")
wxT("Ctrl-Z to Undo, Select All, and change ")
wxT("the slider positions."));
}
else {
step1Label = _("Step 1");
step1Prompt = _("Select a few seconds of just noise so Audacity knows what to filter out,\nthen click Get Noise Profile:");
step2Label = _("Step 2");
step2Prompt = _("Select all of the audio you want filtered, choose how much noise you want\nfiltered out, and then click 'OK' to remove noise.\n");
}
S.StartHorizontalLay(wxCENTER, false);
{
S.AddTitle(_("Noise Removal by Dominic Mazzoni"));
}
S.EndHorizontalLay();
S.StartStatic(step1Label);
{
S.AddVariableText(step1Prompt);
m_pButton_GetProfile = S.Id(ID_BUTTON_GETPROFILE).
AddButton(_("Get Noise Profile"));
}
S.EndStatic();
S.StartStatic(step2Label);
{
S.AddVariableText(step2Prompt);
S.StartMultiColumn(3, wxEXPAND);
S.SetStretchyCol(2);
{
mGainT = S.Id(ID_GAIN_TEXT).AddTextBox(_("Noise reduction (dB):"),
wxT(""),
0);
S.SetStyle(wxSL_HORIZONTAL);
mGainS = S.Id(ID_GAIN_SLIDER).AddSlider(wxT(""), 0, GAIN_MAX);
mGainS->SetName(_("Noise reduction"));
mGainS->SetRange(GAIN_MIN, GAIN_MAX);
mGainS->SetSizeHints(150, -1);
mFreqT = S.Id(ID_FREQ_TEXT).AddTextBox(_("Frequency smoothing (Hz):"),
wxT(""),
0);
S.SetStyle(wxSL_HORIZONTAL);
mFreqS = S.Id(ID_FREQ_SLIDER).AddSlider(wxT(""), 0, FREQ_MAX);
mFreqS->SetName(_("Frequency smoothing"));
mFreqS->SetRange(FREQ_MIN, FREQ_MAX);
mFreqS->SetSizeHints(150, -1);
mTimeT = S.Id(ID_FREQ_TEXT).AddTextBox(_("Attack/decay time (secs):"),
wxT(""),
0);
S.SetStyle(wxSL_HORIZONTAL);
mTimeS = S.Id(ID_TIME_SLIDER).AddSlider(wxT(""), 0, TIME_MAX);
mTimeS->SetName(_("Attach/decay time"));
mTimeS->SetRange(TIME_MIN, TIME_MAX);
mTimeS->SetSizeHints(150, -1);
}
S.EndMultiColumn();
}
S.EndStatic();
}
示例13: PopulateOrExchange
void SpectrumPrefs::PopulateOrExchange( ShuttleGui & S )
{
wxArrayString windowTypeList;
for(int i=0; i<NumWindowFuncs(); i++)
windowTypeList.Add(WindowFuncName(i));
S.SetBorder( 2 );
S.StartHorizontalLay(wxEXPAND, 0 );
S.StartStatic( _("FFT Size"), 0 );
{
S.StartRadioButtonGroup( wxT("/Spectrum/FFTSize"), 256 );
S.TieRadioButton( _("8 - most wideband"), 8);
S.TieRadioButton( wxT("16"), 16);
S.TieRadioButton( wxT("32"), 32);
S.TieRadioButton( wxT("64"), 64);
S.TieRadioButton( wxT("128"), 128);
S.TieRadioButton( _("256 - default"), 256);
S.TieRadioButton( wxT("512"), 512);
S.TieRadioButton( wxT("1024"), 1024);
S.TieRadioButton( wxT("2048"), 2048);
#ifdef EXPERIMENTAL_FIND_NOTES
S.TieRadioButton( wxT("4096"), 4096);
S.TieRadioButton( wxT("8192"), 8192);
S.TieRadioButton( wxT("16384"), 16384);
S.TieRadioButton( _("32768 - most narrowband"),32768);
#else
S.TieRadioButton( _("4096 - most narrowband"),4096);
#endif //LOGARITHMIC_SPECTRUM
S.EndRadioButtonGroup();
// add choice for windowtype
S.StartMultiColumn(2, wxCENTER);
{
S.TieChoice( _("Window type:"), windowType, &windowTypeList);
S.SetSizeHints(-1,-1);
}
S.EndMultiColumn();
}
S.EndStatic();
#ifdef EXPERIMENTAL_FFT_SKIP_POINTS
S.StartHorizontalLay(wxEXPAND, 0 );
S.StartStatic( _("FFT Skip Points"), 0 );
{
S.StartRadioButtonGroup(wxT("/Spectrum/FFTSkipPoints"), 0);
S.TieRadioButton(wxT("0"), 0);
S.TieRadioButton(wxT("1"), 1);
S.TieRadioButton(wxT("3"), 3);
S.TieRadioButton(wxT("7"), 7);
S.TieRadioButton(wxT("15"), 15);
S.TieRadioButton(wxT("31"), 31);
S.TieRadioButton(wxT("63"), 63);
S.EndRadioButtonGroup();
}
S.EndStatic();
#endif //EXPERIMENTAL_FFT_SKIP_POINTS
S.StartStatic( _("Display"),1 );
{
// JC: For layout of mixtures of controls I prefer checkboxes on the right,
// with everything in two columns over what we have here.
S.TieCheckBox( _("&Grayscale"), wxT("/Spectrum/Grayscale"), false);
S.StartTwoColumn(); // 2 cols because we have a control with a separate label.
S.Id(ID_MINFREQUENCY).TieTextBox(
_("Minimum Frequency (Hz):"), // prompt
minFreqStr, // String to exchange with
12 // max number of characters (used to size the control).
);
S.Id(ID_MAXFREQUENCY).TieTextBox(
_("Maximum Frequency (Hz):"), // prompt
maxFreqStr, // String to exchange with
12 // max number of characters (used to size the control).
);
S.EndTwoColumn();
#ifdef EXPERIMENTAL_FFT_Y_GRID
S.TieCheckBox( _("&Y-Grid"), wxT("/Spectrum/FFTYGrid"), false);
#endif //EXPERIMENTAL_FFT_Y_GRID
#ifdef EXPERIMENTAL_FIND_NOTES
S.TieCheckBox( _("&Find Notes"), wxT("/Spectrum/FFTFindNotes"), false);
S.TieCheckBox( _("&Quantize Notes"), wxT("/Spectrum/FindNotesQuantize"), false);
S.StartTwoColumn(); // 2 cols because we have a control with a separate label.
S.Id(ID_FIND_NOTES_MIN_A).TieTextBox(
_("Minimum Amplitude (dB):"), // prompt
findNotesMinAStr, // String to exchange with
8 // max number of characters (used to size the control).
);
S.Id(ID_FIND_NOTES_N).TieTextBox(
_("Max. Number of Notes (1..128):"), // prompt
findNotesNStr, // String to exchange with
8 // max number of characters (used to size the control).
);
S.EndTwoColumn();
#endif //EXPERIMENTAL_FIND_NOTES
}
S.EndStatic();
S.EndHorizontalLay();
}
示例14: PopulateOrExchange
void EffectChangePitch::PopulateOrExchange(ShuttleGui & S)
{
DeduceFrequencies(); // Set frequency-related control values based on sample.
wxArrayString pitch;
for (int ii = 0; ii < 12; ++ii)
pitch.Add( PitchName( ii, PitchNameChoice::Both ) );
S.SetBorder(5);
S.StartVerticalLay(0);
{
S.StartVerticalLay();
{
S.AddTitle(_("Change Pitch without Changing Tempo"));
S.AddTitle(
wxString::Format(_("Estimated Start Pitch: %s%d (%.3f Hz)"),
pitch[m_nFromPitch], m_nFromOctave, m_FromFrequency));
}
S.EndVerticalLay();
/* i18n-hint: (noun) Musical pitch.*/
S.StartStatic(_("Pitch"));
{
S.StartMultiColumn(6, wxALIGN_CENTER); // 6 controls, because each AddChoice adds a wxStaticText and a wxChoice.
{
m_pChoice_FromPitch = S.Id(ID_FromPitch).AddChoice(_("from"), wxT(""), &pitch);
m_pChoice_FromPitch->SetName(_("from"));
m_pChoice_FromPitch->SetSizeHints(80, -1);
m_pSpin_FromOctave = S.Id(ID_FromOctave).AddSpinCtrl( {}, m_nFromOctave, INT_MAX, INT_MIN);
m_pSpin_FromOctave->SetName(_("from Octave"));
m_pSpin_FromOctave->SetSizeHints(50, -1);
m_pChoice_ToPitch = S.Id(ID_ToPitch).AddChoice(_("to"), wxT(""), &pitch);
m_pChoice_ToPitch->SetName(_("to"));
m_pChoice_ToPitch->SetSizeHints(80, -1);
m_pSpin_ToOctave =
S.Id(ID_ToOctave).AddSpinCtrl( {}, m_nToOctave, INT_MAX, INT_MIN);
m_pSpin_ToOctave->SetName(_("to Octave"));
m_pSpin_ToOctave->SetSizeHints(50, -1);
}
S.EndMultiColumn();
S.StartHorizontalLay(wxALIGN_CENTER);
{
FloatingPointValidator<double> vldSemitones(2, &m_dSemitonesChange, NumValidatorStyle::TWO_TRAILING_ZEROES);
m_pTextCtrl_SemitonesChange =
S.Id(ID_SemitonesChange).AddTextBox(_("Semitones (half-steps):"), wxT(""), 12);
m_pTextCtrl_SemitonesChange->SetName(_("Semitones (half-steps)"));
m_pTextCtrl_SemitonesChange->SetValidator(vldSemitones);
}
S.EndHorizontalLay();
}
S.EndStatic();
S.StartStatic(_("Frequency"));
{
S.StartMultiColumn(5, wxALIGN_CENTER); // 5, because AddTextBox adds a wxStaticText and a wxTextCtrl.
{
FloatingPointValidator<double> vldFromFrequency(3, &m_FromFrequency, NumValidatorStyle::THREE_TRAILING_ZEROES);
vldFromFrequency.SetMin(0.0);
m_pTextCtrl_FromFrequency = S.Id(ID_FromFrequency).AddTextBox(_("from"), wxT(""), 12);
m_pTextCtrl_FromFrequency->SetName(_("from (Hz)"));
m_pTextCtrl_FromFrequency->SetValidator(vldFromFrequency);
FloatingPointValidator<double> vldToFrequency(3, &m_ToFrequency, NumValidatorStyle::THREE_TRAILING_ZEROES);
vldToFrequency.SetMin(0.0);
m_pTextCtrl_ToFrequency = S.Id(ID_ToFrequency).AddTextBox(_("to"), wxT(""), 12);
m_pTextCtrl_ToFrequency->SetName(_("to (Hz)"));
m_pTextCtrl_ToFrequency->SetValidator(vldToFrequency);
S.AddUnits(_("Hz"));
}
S.EndMultiColumn();
S.StartHorizontalLay(wxALIGN_CENTER);
{
FloatingPointValidator<double> vldPercentage(3, &m_dPercentChange, NumValidatorStyle::THREE_TRAILING_ZEROES);
vldPercentage.SetRange(MIN_Percentage, MAX_Percentage);
m_pTextCtrl_PercentChange = S.Id(ID_PercentChange).AddTextBox(_("Percent Change:"), wxT(""), 12);
m_pTextCtrl_PercentChange->SetValidator(vldPercentage);
}
S.EndHorizontalLay();
S.StartHorizontalLay(wxEXPAND);
{
S.SetStyle(wxSL_HORIZONTAL);
m_pSlider_PercentChange = S.Id(ID_PercentChange)
.AddSlider( {}, 0, (int)kSliderMax, (int)MIN_Percentage);
m_pSlider_PercentChange->SetName(_("Percent Change"));
}
S.EndHorizontalLay();
}
S.EndStatic();
#if USE_SBSMS
S.StartMultiColumn(2);
{
//.........这里部分代码省略.........
示例15: PopulateOrExchange
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();
}