本文整理汇总了C++中ShuttleGui::AddPrompt方法的典型用法代码示例。如果您正苦于以下问题:C++ ShuttleGui::AddPrompt方法的具体用法?C++ ShuttleGui::AddPrompt怎么用?C++ ShuttleGui::AddPrompt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ShuttleGui
的用法示例。
在下文中一共展示了ShuttleGui::AddPrompt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PopulateOrExchange
void NoiseDialog::PopulateOrExchange( ShuttleGui & S )
{
S.StartMultiColumn(2, wxCENTER);
{
S.TieChoice(_("Noise type"), nType, nTypeList);
S.TieTextBox(_("Amplitude (0-1)"), nAmplitude, 10);
S.AddPrompt(_("Duration"));
if (mNoiseDurationT == NULL)
{
mNoiseDurationT = new
TimeTextCtrl(this,
wxID_ANY,
wxT(""),
nDuration,
mEffect->mProjectRate,
wxDefaultPosition,
wxDefaultSize,
true);
/* use this instead of "seconds" because if a selection is passed to
* the effect, I want it (nDuration) to be used as the duration, and
* with "seconds" this does not always work properly. For example,
* it rounds down to zero... */
mNoiseDurationT->SetName(_("Duration"));
mNoiseDurationT->SetFormatString(mNoiseDurationT->GetBuiltinFormat(nIsSelection==true?(_("hh:mm:ss + samples")):(_("seconds"))));
mNoiseDurationT->EnableMenu();
}
S.AddWindow(mNoiseDurationT, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL);
}
S.EndMultiColumn();
}
示例2: PopulateOrExchange
void EffectNoise::PopulateOrExchange(ShuttleGui & S)
{
wxASSERT(nTypes == WXSIZEOF(kTypeStrings));
S.StartMultiColumn(2, wxCENTER);
{
auto typeChoices = LocalizedStrings(kTypeStrings, nTypes);
S.AddChoice(_("Noise type:"), wxT(""), &typeChoices)->SetValidator(wxGenericValidator(&mType));
FloatingPointValidator<double> vldAmp(6, &mAmp, NumValidatorStyle::NO_TRAILING_ZEROES);
vldAmp.SetRange(MIN_Amp, MAX_Amp);
S.AddTextBox(_("Amplitude (0-1):"), wxT(""), 12)->SetValidator(vldAmp);
S.AddPrompt(_("Duration:"));
mNoiseDurationT = safenew
NumericTextCtrl(S.GetParent(), wxID_ANY,
NumericConverter::TIME,
GetDurationFormat(),
GetDuration(),
mProjectRate,
NumericTextCtrl::Options{}
.AutoPos(true));
mNoiseDurationT->SetName(_("Duration"));
S.AddWindow(mNoiseDurationT, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL);
}
S.EndMultiColumn();
}
示例3: PopulateOrExchangeStandard
/// Populates simple dialog that has a single tone.
void ToneGenDialog::PopulateOrExchangeStandard( ShuttleGui & S )
{
S.StartMultiColumn(2, wxCENTER);
{
S.TieChoice(_("Waveform") + wxString(wxT(":")), waveform, waveforms);
S.SetSizeHints(-1, -1);
// The added colon to improve visual consistency was placed outside
// the translatable strings to avoid breaking translations close to 2.0.
// TODO: Make colon part of the translatable string after 2.0.
S.TieNumericTextBox(_("Frequency (Hz)") + wxString(wxT(":")), frequency[0], 5);
S.TieNumericTextBox(_("Amplitude (0-1)") + wxString(wxT(":")), amplitude[0], 5);
S.AddPrompt(_("Duration") + wxString(wxT(":")));
if (mToneDurationT == NULL)
{
mToneDurationT = new
TimeTextCtrl(this,
wxID_ANY,
wxT(""),
mDuration,
mEffect->mProjectRate,
wxDefaultPosition,
wxDefaultSize,
true);
mToneDurationT->SetName(_("Duration"));
mToneDurationT->SetFormatString(mToneDurationT->GetBuiltinFormat(isSelection==true?(_("hh:mm:ss + samples")):(_("seconds"))));
mToneDurationT->EnableMenu();
}
S.AddWindow(mToneDurationT);
}
S.EndMultiColumn();
}
示例4: PopulateOrExchange
void EffectSilence::PopulateOrExchange(ShuttleGui & S)
{
S.StartVerticalLay();
{
S.StartHorizontalLay();
{
S.AddPrompt(_("Duration:"));
mDurationT = new
NumericTextCtrl(NumericConverter::TIME,
S.GetParent(),
wxID_ANY,
GetDurationFormat(),
GetDuration(),
mProjectRate,
wxDefaultPosition,
wxDefaultSize,
true);
mDurationT->SetName(_("Duration"));
mDurationT->EnableMenu();
S.AddWindow(mDurationT, wxALIGN_CENTER | wxALL);
}
S.EndHorizontalLay();
}
S.EndVerticalLay();
return;
}
示例5: PopulateOrExchange
void EffectNoise::PopulateOrExchange(ShuttleGui & S)
{
wxASSERT(kNumTypes == WXSIZEOF(kTypeStrings));
wxArrayString typeChoices;
for (int i = 0; i < kNumTypes; i++)
{
typeChoices.Add(wxGetTranslation(kTypeStrings[i]));
}
S.StartMultiColumn(2, wxCENTER);
{
S.AddChoice(_("Noise type:"), wxT(""), &typeChoices)->SetValidator(wxGenericValidator(&mType));
FloatingPointValidator<double> vldAmp(6, &mAmp, NUM_VAL_NO_TRAILING_ZEROES);
vldAmp.SetRange(MIN_Amp, MAX_Amp);
S.AddTextBox(_("Amplitude (0-1):"), wxT(""), 12)->SetValidator(vldAmp);
S.AddPrompt(_("Duration:"));
mNoiseDurationT = new
NumericTextCtrl(NumericConverter::TIME,
S.GetParent(),
wxID_ANY,
GetDurationFormat(),
GetDuration(),
mProjectRate,
wxDefaultPosition,
wxDefaultSize,
true);
mNoiseDurationT->SetName(_("Duration"));
mNoiseDurationT->EnableMenu();
S.AddWindow(mNoiseDurationT, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL);
}
S.EndMultiColumn();
}
示例6: PopulateOrExchange
void EffectDtmf::PopulateOrExchange(ShuttleGui & S)
{
// dialog will be passed values from effect
// Effect retrieves values from saved config
// Dialog will take care of using them to initialize controls
// If there is a selection, use that duration, otherwise use
// value from saved config: this is useful is user wants to
// replace selection with dtmf sequence
S.AddSpace(0, 5);
S.StartMultiColumn(2, wxCENTER);
{
wxTextValidator vldDtmf(wxFILTER_INCLUDE_CHAR_LIST, &dtmfSequence);
vldDtmf.SetIncludes(wxArrayString(WXSIZEOF(kSymbols), kSymbols));
mDtmfSequenceT = S.Id(ID_Sequence).AddTextBox(_("DTMF sequence:"), wxT(""), 10);
mDtmfSequenceT->SetValidator(vldDtmf);
FloatingPointValidator<double> vldAmp(3, &dtmfAmplitude, NUM_VAL_NO_TRAILING_ZEROES);
vldAmp.SetRange(MIN_Amplitude, MAX_Amplitude);
S.Id(ID_Amplitude).AddTextBox(_("Amplitude (0-1):"), wxT(""), 10)->SetValidator(vldAmp);
S.AddPrompt(_("Duration:"));
mDtmfDurationT = safenew
NumericTextCtrl(NumericConverter::TIME,
S.GetParent(),
ID_Duration,
GetDurationFormat(),
GetDuration(),
mProjectRate,
wxDefaultPosition,
wxDefaultSize,
true);
mDtmfDurationT->SetName(_("Duration"));
mDtmfDurationT->EnableMenu();
S.AddWindow(mDtmfDurationT);
S.AddFixedText(_("Tone/silence ratio:"), false);
S.SetStyle(wxSL_HORIZONTAL | wxEXPAND);
mDtmfDutyCycleS = S.Id(ID_DutyCycle).AddSlider( {},
dtmfDutyCycle * SCL_DutyCycle,
MAX_DutyCycle * SCL_DutyCycle,
MIN_DutyCycle * SCL_DutyCycle);
S.SetSizeHints(-1,-1);
}
S.EndMultiColumn();
S.StartMultiColumn(2, wxCENTER);
{
S.AddFixedText(_("Duty cycle:"), false);
mDtmfDutyT = S.AddVariableText(wxString::Format(wxT("%.1f %%"), dtmfDutyCycle), false);
S.AddFixedText(_("Tone duration:"), false);
mDtmfSilenceT = S.AddVariableText(wxString::Format(wxString(wxT("%.0f ")) + _("ms"), dtmfTone * 1000.0), false);
S.AddFixedText(_("Silence duration:"), false);
mDtmfToneT = S.AddVariableText(wxString::Format(wxString(wxT("%0.f ")) + _("ms"), dtmfSilence * 1000.0), false);
}
S.EndMultiColumn();
}
示例7: PopulateOrExchange
void DtmfDialog::PopulateOrExchange( ShuttleGui & S )
{
wxTextValidator vldDtmf(wxFILTER_INCLUDE_CHAR_LIST);
vldDtmf.SetIncludes(wxArrayString(42, dtmfSymbols));
S.AddTitle(_("by Salvo Ventura"));
S.StartMultiColumn(2, wxEXPAND);
{
mDtmfStringT = S.Id(ID_DTMF_STRING_TEXT).AddTextBox(_("DTMF sequence:"), wxT(""), 10);
mDtmfStringT->SetValidator(vldDtmf);
// The added colon to improve visual consistency was placed outside
// the translatable strings to avoid breaking translations close to 2.0.
// TODO: Make colon part of the translatable string after 2.0.
S.TieNumericTextBox(_("Amplitude (0-1)") + wxString(wxT(":")), dAmplitude, 10);
S.AddPrompt(_("Duration:"));
if (mDtmfDurationT == NULL)
{
mDtmfDurationT = new
TimeTextCtrl(this,
ID_DTMF_DURATION_TEXT,
wxT(""),
dDuration,
mEffect->mProjectRate,
wxDefaultPosition,
wxDefaultSize,
true);
/* use this instead of "seconds" because if a selection is passed to the
* effect, I want it (dDuration) to be used as the duration, and with
* "seconds" this does not always work properly. For example, it rounds
* down to zero... */
mDtmfDurationT->SetName(_("Duration"));
mDtmfDurationT->SetFormatString(mDtmfDurationT->GetBuiltinFormat(dIsSelection==true?(_("hh:mm:ss + samples")):(_("hh:mm:ss + milliseconds"))));
mDtmfDurationT->EnableMenu();
}
S.AddWindow(mDtmfDurationT);
S.AddFixedText(_("Tone/silence ratio:"), false);
S.SetStyle(wxSL_HORIZONTAL | wxEXPAND);
mDtmfDutyS = S.Id(ID_DTMF_DUTYCYCLE_SLIDER).AddSlider(wxT(""), (int)dDutyCycle, DUTY_MAX, DUTY_MIN);
S.SetSizeHints(-1,-1);
}
S.EndMultiColumn();
S.StartMultiColumn(2, wxCENTER);
{
S.AddFixedText(_("Duty cycle:"), false);
mDtmfDutyT = S.Id(ID_DTMF_DUTYCYCLE_TEXT).AddVariableText(wxString::Format(wxT("%.1f %%"), (float) dDutyCycle/DUTY_SCALE), false);
S.AddFixedText(_("Tone duration:"), false);
mDtmfSilenceT = S.Id(ID_DTMF_TONELEN_TEXT).AddVariableText(wxString::Format(wxString(wxT("%d ")) + _("ms"), (int) dTone * 1000), false);
S.AddFixedText(_("Silence duration:"), false);
mDtmfToneT = S.Id(ID_DTMF_SILENCE_TEXT).AddVariableText(wxString::Format(wxString(wxT("%d ")) + _("ms"), (int) dSilence * 1000), false);
}
S.EndMultiColumn();
}
示例8: PopulateOrExchange
void MidiIOPrefs::PopulateOrExchange( ShuttleGui & S ) {
wxArrayString empty;
S.SetBorder(2);
S.StartStatic(_("Interface"));
{
S.StartMultiColumn(2);
{
S.Id(HostID);
mHost = S.TieChoice(_("Host") + wxString(wxT(":")),
wxT("/MidiIO/Host"),
wxT(""),
mHostNames,
mHostLabels);
S.SetSizeHints(mHostNames);
S.AddPrompt(_("Using:"));
S.AddFixedText(wxString(Pa_GetVersionText(), wxConvLocal));
}
S.EndMultiColumn();
}
S.EndStatic();
S.StartStatic(_("Playback"));
{
S.StartMultiColumn(2);
{
S.Id(PlayID);
mPlay = S.AddChoice(_("Device") + wxString(wxT(":")),
wxEmptyString,
&empty);
}
S.EndMultiColumn();
}
S.EndStatic();
S.StartStatic(_("Recording"));
{
S.StartMultiColumn(2);
{
S.Id(RecordID);
mRecord = S.AddChoice(_("Device") + wxString(wxT(":")),
wxEmptyString,
&empty);
S.Id(ChannelsID);
/*
mChannels = S.AddChoice(_("Channels") + wxString(wxT(":")),
wxEmptyString,
&empty);
*/
}
S.EndMultiColumn();
}
S.EndStatic();
}
示例9: PopulateOrExchange
void DtmfDialog::PopulateOrExchange( ShuttleGui & S )
{
wxTextValidator vldDtmf(wxFILTER_INCLUDE_CHAR_LIST);
vldDtmf.SetIncludes(wxArrayString(20, dtmfSymbols));
S.AddTitle(_("by Salvo Ventura (2006)"));
S.StartMultiColumn(2, wxEXPAND);
{
mDtmfStringT = S.Id(ID_DTMF_STRING_TEXT).AddTextBox(_("DTMF sequence:"), wxT(""), 10);
mDtmfStringT->SetValidator(vldDtmf);
S.AddPrompt(_("DTMF duration:"));
mDtmfDurationT = new
TimeTextCtrl(this,
ID_DTMF_DURATION_TEXT,
/*
use this instead of "seconds" because if a selection is passed to the effect,
I want it (dDuration) to be used as the duration, and with "seconds" this does
not always work properly. For example, it rounds down to zero...
*/
TimeTextCtrl::GetBuiltinFormat(dIsSelection==true?(wxT("hh:mm:ss + samples")):(wxT("seconds"))),
dDuration,
44100,
wxDefaultPosition,
wxDefaultSize,
true);
S.AddWindow(mDtmfDurationT);
mDtmfDurationT->EnableMenu();
S.AddFixedText(_("Tone/silence ratio:"), false);
S.SetStyle(wxSL_HORIZONTAL | wxEXPAND);
mDtmfDutyS = S.Id(ID_DTMF_DUTYCYCLE_SLIDER).AddSlider(wxT(""), (int)dDutyCycle, DUTY_MAX);
mDtmfDutyS->SetRange(DUTY_MIN, DUTY_MAX);
S.SetSizeHints(-1,-1);
}
S.EndMultiColumn();
S.StartMultiColumn(2, wxCENTER);
{
S.AddFixedText(_("Duty cycle:"), false);
mDtmfDutyT = S.Id(ID_DTMF_DUTYCYCLE_TEXT).AddVariableText(wxString::Format(wxT("%.1f %%"), (float) dDutyCycle/DUTY_SCALE), false);
S.AddFixedText(_("Tone duration:"), false);
mDtmfSilenceT = S.Id(ID_DTMF_TONELEN_TEXT).AddVariableText(wxString::Format(wxString(wxT("%d ")) + _("ms"), (int) dTone * 1000), false);
S.AddFixedText(_("Silence duration:"), false);
mDtmfToneT = S.Id(ID_DTMF_SILENCE_TEXT).AddVariableText(wxString::Format(wxString(wxT("%d ")) + _("ms"), (int) dSilence * 1000), false);
}
S.EndMultiColumn();
}
示例10: PopulateOrExchange
void EffectChangeSpeed::PopulateOrExchange(ShuttleGui & S)
{
GetPrivateConfig(GetCurrentSettingsGroup(), wxT("TimeFormat"), mFormat, mFormat);
GetPrivateConfig(GetCurrentSettingsGroup(), wxT("VinylChoice"), mFromVinyl, mFromVinyl);
S.SetBorder(5);
S.StartVerticalLay(0);
{
S.AddSpace(0, 5);
S.AddTitle(_("Change Speed, affecting both Tempo and Pitch"));
S.AddSpace(0, 10);
// Speed multiplier and percent change controls.
S.StartMultiColumn(4, wxCENTER);
{
FloatingPointValidator<double> vldMultiplier(3, &mMultiplier, NUM_VAL_THREE_TRAILING_ZEROES);
vldMultiplier.SetRange(MIN_Percentage / 100.0, ((MAX_Percentage / 100.0) + 1));
mpTextCtrl_Multiplier =
S.Id(ID_Multiplier).AddTextBox(_("Speed Multiplier:"), wxT(""), 12);
mpTextCtrl_Multiplier->SetValidator(vldMultiplier);
FloatingPointValidator<double> vldPercentage(3, &m_PercentChange, NUM_VAL_THREE_TRAILING_ZEROES);
vldPercentage.SetRange(MIN_Percentage, MAX_Percentage);
mpTextCtrl_PercentChange =
S.Id(ID_PercentChange).AddTextBox(_("Percent Change:"), wxT(""), 12);
mpTextCtrl_PercentChange->SetValidator(vldPercentage);
}
S.EndMultiColumn();
// Percent change slider.
S.StartHorizontalLay(wxEXPAND);
{
S.SetStyle(wxSL_HORIZONTAL);
mpSlider_PercentChange =
S.Id(ID_PercentChange).AddSlider(wxT(""), 0, (int)kSliderMax, (int)MIN_Percentage);
mpSlider_PercentChange->SetName(_("Percent Change"));
}
S.EndHorizontalLay();
// Vinyl rpm controls.
S.StartMultiColumn(5, wxCENTER);
{
/* i18n-hint: "rpm" is an English abbreviation meaning "revolutions per minute". */
S.AddUnits(_("Standard Vinyl rpm:"));
wxASSERT(kNumVinyl == WXSIZEOF(kVinylStrings));
wxArrayString vinylChoices;
for (int i = 0; i < kNumVinyl; i++)
{
if (i == kVinyl_NA)
{
vinylChoices.Add(wxGetTranslation(kVinylStrings[i]));
}
else
{
vinylChoices.Add(kVinylStrings[i]);
}
}
mpChoice_FromVinyl =
S.Id(ID_FromVinyl).AddChoice(_("from"), wxT(""), &vinylChoices);
mpChoice_FromVinyl->SetName(_("From rpm"));
mpChoice_FromVinyl->SetSizeHints(100, -1);
mpChoice_ToVinyl =
S.Id(ID_ToVinyl).AddChoice(_("to"), wxT(""), &vinylChoices);
mpChoice_ToVinyl->SetName(_("To rpm"));
mpChoice_ToVinyl->SetSizeHints(100, -1);
}
S.EndMultiColumn();
// From/To time controls.
S.StartStatic(_("Selection Length"), 0);
{
S.StartMultiColumn(2, wxALIGN_LEFT);
{
S.AddPrompt(_("Current Length:"));
mpFromLengthCtrl = safenew
NumericTextCtrl(NumericConverter::TIME,
S.GetParent(),
wxID_ANY,
mFormat,
mFromLength,
mProjectRate);
mpFromLengthCtrl->SetName(_("from"));
mpFromLengthCtrl->SetToolTip(_("Current length of selection."));
mpFromLengthCtrl->SetReadOnly(true);
mpFromLengthCtrl->EnableMenu(false);
S.AddWindow(mpFromLengthCtrl, wxALIGN_LEFT);
S.AddPrompt(_("New Length:"));
mpToLengthCtrl = safenew
NumericTextCtrl(NumericConverter::TIME,
S.GetParent(),
ID_ToLength,
//.........这里部分代码省略.........
示例11: 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);
{
//.........这里部分代码省略.........
示例12: 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("/"));
}
示例13: PopulateOrExchange
//.........这里部分代码省略.........
* The string 'days' indicates that the first number in the control will be the number of days,
* then the 'h' indicates the second number displayed is hours, the 'm' indicates the third
* number displayed is minutes, and the 's' indicates that the fourth number displayed is
* seconds.
*/
wxString strFormat1 = _("099 days 024 h 060 m 060 s");
m_pTimeTextCtrl_Duration = safenew NumericTextCtrl(
this, ID_TIMETEXT_DURATION, NumericConverter::TIME,
wxEmptyString, 0, 44100,
Options{}
.MenuEnabled(false)
.Format(strFormat1)
.Value(true, m_TimeSpan_Duration.GetSeconds().ToDouble()));
m_pTimeTextCtrl_Duration->SetName(_("Duration"));
S.AddWindow(m_pTimeTextCtrl_Duration);
}
S.EndStatic();
}
S.EndVerticalLay();
S.StartVerticalLay(true);
{
S.StartStatic(_("Automatic Save"), true);
{
// If checked, the project will be saved when the recording is completed
m_pTimerAutoSaveCheckBoxCtrl = S.Id(ID_AUTOSAVE_CHECKBOX).AddCheckBox(_("Enable &Automatic Save?"),
(bAutoSave ? "true" : "false"));
S.StartMultiColumn(3, wxEXPAND);
{
wxString sInitialValue = wxT("");
AudacityProject* pProject = GetActiveProject();
wxString sSaveValue = pProject->GetFileName();
if (sSaveValue != wxEmptyString) {
m_fnAutoSaveFile.Assign(sSaveValue);
sInitialValue = _("Current Project");
}
S.AddPrompt(_("Save Project As:"));
m_pTimerSavePathTextCtrl = NewPathControl(this, ID_AUTOSAVEPATH_TEXT, _("Save Project As:"), sInitialValue);
m_pTimerSavePathTextCtrl->SetEditable(false);
S.AddWindow(m_pTimerSavePathTextCtrl);
m_pTimerSavePathButtonCtrl = S.Id(ID_AUTOSAVEPATH_BUTTON).AddButton(_("Select..."));
}
S.EndMultiColumn();
}
S.EndStatic();
S.StartStatic(_("Automatic Export"), true);
{
m_pTimerAutoExportCheckBoxCtrl = S.Id(ID_AUTOEXPORT_CHECKBOX).AddCheckBox(_("Enable Automatic &Export?"), (bAutoExport ? "true" : "false"));
S.StartMultiColumn(3, wxEXPAND);
{
S.AddPrompt(_("Export Project As:"));
m_pTimerExportPathTextCtrl = NewPathControl(this, ID_AUTOEXPORTPATH_TEXT, _("Export Project As:"), wxT(""));
m_pTimerExportPathTextCtrl->SetEditable(false);
S.AddWindow(m_pTimerExportPathTextCtrl);
m_pTimerExportPathButtonCtrl = S.Id(ID_AUTOEXPORTPATH_BUTTON).AddButton(_("Select..."));
}
S.EndMultiColumn();
}
S.EndStatic();
S.StartStatic(_("Options"), true);
{
wxArrayString arrayOptions;
arrayOptions.Add(_("Do nothing"));
arrayOptions.Add(_("Exit Audacity"));
arrayOptions.Add(_("Restart system"));
arrayOptions.Add(_("Shutdown system"));
m_sTimerAfterCompleteOptionsArray.Add(arrayOptions.Item(0));
m_sTimerAfterCompleteOptionsArray.Add(arrayOptions.Item(1));
#ifdef __WINDOWS__
m_sTimerAfterCompleteOptionsArray.Add(arrayOptions.Item(2));
m_sTimerAfterCompleteOptionsArray.Add(arrayOptions.Item(3));
#endif
m_sTimerAfterCompleteOption = arrayOptions.Item(iPostTimerRecordAction);
m_pTimerAfterCompleteChoiceCtrl = S.AddChoice(_("After Recording completes:"),
m_sTimerAfterCompleteOption,
&m_sTimerAfterCompleteOptionsArray);
}
S.EndStatic();
}
S.EndVerticalLay();
}
S.EndMultiColumn();
// MY: Added the help button here
S.AddStandardButtons(eOkButton | eCancelButton | eHelpButton);
Layout();
Fit();
SetMinSize(GetSize());
Center();
EnableDisableAutoControls(bAutoSave, CONTROL_GROUP_SAVE);
EnableDisableAutoControls(bAutoExport, CONTROL_GROUP_EXPORT);
}
示例14: PopulateOrExchange
void VampEffect::PopulateOrExchange(ShuttleGui & S)
{
Vamp::Plugin::ProgramList programs = mPlugin->getPrograms();
mParameters = mPlugin->getParameterDescriptors();
auto count = mParameters.size();
mToggles.reinit( count );
mSliders.reinit( count );
mFields.reinit( count );
mLabels.reinit( count );
mChoices.reinit( count );
mValues.reinit( count );
S.SetStyle(wxVSCROLL | wxTAB_TRAVERSAL);
wxScrolledWindow *scroller = S.StartScroller(2);
{
S.StartStatic(_("Plugin Settings"));
{
S.StartMultiColumn(5, wxEXPAND);
{
S.SetStretchyCol(3);
if (!programs.empty())
{
wxString currentProgram = wxString::FromUTF8(mPlugin->getCurrentProgram().c_str());
wxArrayStringEx choices;
for (size_t i = 0, cnt = programs.size(); i < cnt; i++)
{
choices.push_back(wxString::FromUTF8(programs[i].c_str()));
}
S.AddPrompt(_("Program"));
S.Id(ID_Program);
mProgram = S.AddChoice(
{},
choices,
choices.Index( currentProgram )
);
mProgram->SetName(_("Program"));
mProgram->SetSizeHints(-1, -1);
wxSizer *s = mProgram->GetContainingSizer();
s->GetItem(mProgram)->SetFlag(wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALL);
S.AddSpace(1, 1);
S.AddSpace(1, 1);
S.AddSpace(1, 1);
}
for (size_t p = 0; p < count; p++)
{
wxString tip = wxString::FromUTF8(mParameters[p].description.c_str());
wxString unit = wxString::FromUTF8(mParameters[p].unit.c_str());
float value = mPlugin->getParameter(mParameters[p].identifier);
mToggles[p] = NULL;
mChoices[p] = NULL;
mSliders[p] = NULL;
mFields[p] = NULL;
mValues[p] = 0.0;
wxString labelText = wxString::FromUTF8(mParameters[p].name.c_str());
if (!unit.empty())
{
labelText += wxT(" (") + unit + wxT(")");
}
S.AddPrompt(labelText + wxT(":"));
if (mParameters[p].isQuantized &&
mParameters[p].quantizeStep == 1.0 &&
mParameters[p].minValue == 0.0 &&
mParameters[p].maxValue == 1.0)
{
S.Id(ID_Toggles + p);
mToggles[p] = S.AddCheckBox( {},
value > 0.5);
mToggles[p]->SetName(labelText);
if (!tip.empty())
{
mToggles[p]->SetToolTip(tip);
}
wxSizer *s = mToggles[p]->GetContainingSizer();
s->GetItem(mToggles[p])->SetFlag(wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL);
S.AddSpace(1, 1);
S.AddSpace(1, 1);
S.AddSpace(1, 1);
}
else if (mParameters[p].isQuantized &&
mParameters[p].quantizeStep == 1.0 &&
!mParameters[p].valueNames.empty())
{
wxArrayStringEx choices;
int selected = -1;
//.........这里部分代码省略.........
示例15: PopulateOrExchange
void MidiIOPrefs::PopulateOrExchange( ShuttleGui & S ) {
wxArrayString empty;
S.SetBorder(2);
S.StartStatic(_("Interface"));
{
S.StartMultiColumn(2);
{
S.Id(HostID);
/* i18n-hint: (noun) */
mHost = S.TieChoice(_("Host") + wxString(wxT(":")),
wxT("/MidiIO/Host"),
wxT(""),
mHostNames,
mHostLabels);
S.SetSizeHints(mHostNames);
S.AddPrompt(_("Using: PortMidi"));
}
S.EndMultiColumn();
}
S.EndStatic();
S.StartStatic(_("Playback"));
{
S.StartMultiColumn(2);
{
S.Id(PlayID);
mPlay = S.AddChoice(_("Device") + wxString(wxT(":")),
wxEmptyString,
&empty);
int latency = gPrefs->Read(wxT("/MidiIO/OutputLatency"),
DEFAULT_SYNTH_LATENCY);
mLatency = S.TieNumericTextBox(_("MIDI Synthesizer Latency (ms):"),
wxT("/MidiIO/SynthLatency"),
latency, 3);
}
S.EndMultiColumn();
}
S.EndStatic();
#ifdef EXPERIMENTAL_MIDI_IN
S.StartStatic(_("Recording"));
{
S.StartMultiColumn(2);
{
S.Id(RecordID);
mRecord = S.AddChoice(_("Device") + wxString(wxT(":")),
wxEmptyString,
&empty);
S.Id(ChannelsID);
/*
mChannels = S.AddChoice(_("Channels") + wxString(wxT(":")),
wxEmptyString,
&empty);
*/
}
S.EndMultiColumn();
}
S.EndStatic();
#endif
}