/// 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(); }
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(); }
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) .AddSlider(wxT(""), 0, (int)kSliderMax, (int)MIN_Percentage); m_pSlider_PercentChange->SetName(_("Percent Change")); } S.EndHorizontalLay(); } S.EndStatic(); } S.EndVerticalLay(); return; }
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); }
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 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; }
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); } S.EndHorizontalLay(); // S.AddPrompt(_("Percent Change:")); S.StartHorizontalLay(wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, false); { m_pTextCtrl_PercentChange = S.Id(ID_TEXT_PERCENTCHANGE) .AddTextBox(wxT(""), wxT(""), 12); m_pTextCtrl_PercentChange->SetName(_("Percent Change")); m_pTextCtrl_PercentChange->SetValidator(numvld); } S.EndHorizontalLay(); } S.EndMultiColumn(); // S.StartHorizontalLay(wxEXPAND); { S.SetStyle(wxSL_HORIZONTAL); m_pSlider_PercentChange = S.Id(ID_SLIDER_PERCENTCHANGE) .AddSlider(wxT(""), 0, (int)PERCENTCHANGE_MAX, (int)PERCENTCHANGE_MIN); m_pSlider_PercentChange->SetName(_("Percent Change")); } S.EndHorizontalLay(); return; }
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("/")); }
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); { mPrefixLabel = S.AddVariableText(_("File name prefix:"), true); mPrefix = S.Id(PrefixID) .TieTextBox(wxT(""), wxT("/Export/MultiplePrefix"), wxT(""), 30); } S.EndHorizontalLay(); } S.EndMultiColumn(); } S.EndStatic(); } S.EndHorizontalLay(); S.SetBorder(5); S.StartHorizontalLay(wxEXPAND, false); { mOverwrite = S.Id(OverwriteID) .AddCheckBox(_("Overwrite existing files"), wxT("true")); } S.EndHorizontalLay(); S.StartHorizontalLay(wxALIGN_CENTER, false); { #if defined(__WXGTK20__) || defined(__WXMAC__) S.Id(wxID_CANCEL).AddButton(_("&Cancel")); mExport = S.Id(wxID_OK).AddButton(_("E&xport")); #else mExport = S.Id(wxID_OK).AddButton(_("E&xport")); S.Id(wxID_CANCEL).AddButton(_("&Cancel")); #endif mExport->SetDefault(); } S.EndHorizontalLay(); }
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; }
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, S.GetParent(), wxID_ANY, isSelection ? _("hh:mm:ss + samples") : _("hh:mm:ss + milliseconds"), duration, mProjectRate, wxDefaultPosition, wxDefaultSize, true); mToneDurationT->SetName(_("Duration")); mToneDurationT->EnableMenu(); S.AddWindow(mToneDurationT, wxALIGN_LEFT | wxALL); } S.EndMultiColumn(); return; }
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(); }
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(); }
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); { mUseSBSMSCheckBox = S.AddCheckBox(_("Use high quality stretching (slow)"), mUseSBSMS? wxT("true") : wxT("false")); mUseSBSMSCheckBox->SetValidator(wxGenericValidator(&mUseSBSMS)); } S.EndMultiColumn(); #endif } S.EndVerticalLay(); return; }
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(); }
/// Defines the dialog and does data exchange with it. void EditChainsDialog::PopulateOrExchange(ShuttleGui & S) { S.StartHorizontalLay(wxEXPAND, 1); { S.StartStatic(_("&Chains")); { // JKC: Experimenting with an alternative way to get multiline // translated strings to work correctly without very long lines. // My appologies Alexandre if this way didn't work either. // // With this method: // 1) it compiles fine under windows unicode and normal mode. // 2) xgettext source code has handling for the trailing '\' // // It remains to see if linux and mac can cope and if xgettext // actually does do fine with strings presented like this. // If it doesn't work out, revert to all-on-one-line. S.SetStyle(wxSUNKEN_BORDER | wxLC_REPORT | wxLC_HRULES | wxLC_SINGLE_SEL | wxLC_EDIT_LABELS); mChains = S.Id(ChainsListID).AddListControlReportMode(); mChains->InsertColumn(0, wxT("Chain"), wxLIST_FORMAT_LEFT); S.StartHorizontalLay(wxCENTER, false); { S.Id(AddButtonID).AddButton(_("&Add")); mRemove = S.Id(RemoveButtonID).AddButton(_("&Remove")); mRename = S.Id(RenameButtonID).AddButton(_("Re&name")); } S.EndHorizontalLay(); } S.EndStatic(); S.StartStatic(_("C&hain (Double-Click or press SPACE to edit)"), true); { S.SetStyle(wxSUNKEN_BORDER | wxLC_REPORT | wxLC_HRULES | wxLC_VRULES | wxLC_SINGLE_SEL); mList = S.Id(CommandsListID).AddListControlReportMode(); //An empty first column is a workaround - under Win98 the first column //can't be right aligned. mList->InsertColumn(BlankColumn, wxT(""), wxLIST_FORMAT_LEFT); /* i18n-hint: This is the number of the command in the list */ mList->InsertColumn(ItemNumberColumn, _("Num"), wxLIST_FORMAT_RIGHT); mList->InsertColumn(ActionColumn, _("Command "), wxLIST_FORMAT_RIGHT); mList->InsertColumn(ParamsColumn, _("Parameters"), wxLIST_FORMAT_LEFT); S.StartHorizontalLay(wxCENTER, false); { S.Id(InsertButtonID).AddButton(_("&Insert"), wxALIGN_LEFT); S.Id(DeleteButtonID).AddButton(_("De&lete"), wxALIGN_LEFT); S.Id(UpButtonID).AddButton(_("Move &Up"), wxALIGN_LEFT); S.Id(DownButtonID).AddButton(_("Move &Down"), wxALIGN_LEFT); mDefaults = S.Id(DefaultsButtonID).AddButton(_("De&faults")); } S.EndHorizontalLay(); } S.EndStatic(); } S.EndHorizontalLay(); S.AddStandardButtons(); return; }
void ChangeSpeedDialog::PopulateOrExchange(ShuttleGui & S) { wxTextValidator numvld(wxFILTER_NUMERIC); wxArrayString rpm; rpm.Add(wxT("33 1/3")); rpm.Add(wxT("45")); rpm.Add(wxT("78")); /* i18n-hint: n/a is an English abbreviation meaning "not applicable" (in other words, unimportant, not relevant). */ rpm.Add(_("n/a")); S.SetBorder(10); S.StartHorizontalLay(wxCENTER, false); { S.AddTitle(_("Change Speed, affecting both Tempo and Pitch") + wxString(wxT("\n\n")) + _("by Vaughan Johnson && Dominic Mazzoni") + wxString(wxT("\n")) + _("using SampleRate, by Erik de Castro Lopo")); } S.EndHorizontalLay(); S.SetBorder(5); // S.StartMultiColumn(2, wxCENTER); { m_pTextCtrl_PercentChange = S.Id(ID_TEXT_PERCENTCHANGE) .AddTextBox(_("Percent Change:"), wxT(""), 12); m_pTextCtrl_PercentChange->SetValidator(numvld); } S.EndMultiColumn(); // S.StartHorizontalLay(wxEXPAND); { S.SetStyle(wxSL_HORIZONTAL); m_pSlider_PercentChange = S.Id(ID_SLIDER_PERCENTCHANGE) .AddSlider(wxT(""), 0, (int)PERCENTCHANGE_MAX, (int)PERCENTCHANGE_MIN); m_pSlider_PercentChange->SetName(_("Percent Change")); } S.EndHorizontalLay(); // S.StartMultiColumn(5, wxCENTER); { // S.AddUnits(_("Standard Vinyl RPM:")); m_pChoice_FromVinyl = S.Id(ID_CHOICE_FROMVINYL) .AddChoice(_("from"), wxT(""), &rpm); m_pChoice_FromVinyl->SetName(_("From RPM")); m_pChoice_FromVinyl->SetSizeHints(100, -1); m_pChoice_ToVinyl = S.Id(ID_CHOICE_TOVINYL) .AddChoice(_("to"), wxT(""), &rpm); m_pChoice_ToVinyl->SetName(_("To RPM")); m_pChoice_ToVinyl->SetSizeHints(100, -1); } S.EndMultiColumn(); return; }
void NyqBench::PopulateOrExchange(ShuttleGui & S) { S.StartHorizontalLay(wxEXPAND, true); { wxPanel *scriptp; wxPanel *outputp; wxStaticBoxSizer *scripts; wxStaticBoxSizer *outputs; wxBoxSizer *bs; mSplitter = new wxSplitterWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_LIVE_UPDATE | wxSP_3DSASH | wxSP_NOBORDER); scriptp = new wxPanel(mSplitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNO_FULL_REPAINT_ON_RESIZE | wxCLIP_CHILDREN); bs = new wxBoxSizer(wxVERTICAL); scriptp->SetSizer(bs); mScriptBox = new wxStaticBox(scriptp, wxID_ANY, _("Script")); scripts = new wxStaticBoxSizer(mScriptBox, wxVERTICAL); bs->Add(scripts, true, wxEXPAND); mScript = new NyqTextCtrl(scriptp, ID_SCRIPT, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_RICH2 | wxTE_RICH | (mAutoWrap ? wxTE_BESTWRAP : wxTE_DONTWRAP) | wxTE_NOHIDESEL | wxTE_MULTILINE); scripts->Add(mScript, true, wxEXPAND); outputp = new wxPanel(mSplitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNO_FULL_REPAINT_ON_RESIZE | wxCLIP_CHILDREN); bs = new wxBoxSizer(wxVERTICAL); outputp->SetSizer(bs); mOutputBox = new wxStaticBox(outputp, wxID_ANY, _("Output")); outputs = new wxStaticBoxSizer(mOutputBox, wxVERTICAL); bs->Add(outputs, true, wxEXPAND); mOutput = new NyqTextCtrl(outputp, ID_OUTPUT, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY | #if !defined(__WXMAC__) // I could not get the bloody horizontal scroll bar to appear on // wxMac, so we can't use wxTE_DONTWRAP as you can't easily scroll // left and right. wxTE_DONTWRAP | #endif wxTE_NOHIDESEL | wxTE_MULTILINE); outputs->Add(mOutput, true, wxEXPAND); switch (mSplitMode) { case wxSPLIT_VERTICAL: mSplitter->SplitVertically(scriptp, outputp, 300); break; case wxSPLIT_HORIZONTAL: mSplitter->SplitHorizontally(scriptp, outputp, 300); break; default: mSplitter->Initialize((mShowCode ? scriptp : outputp)); break; } mSplitter->SetMinimumPaneSize(50); S.AddSpace(5, 1); S.Prop(true); S.AddWindow(mSplitter, wxEXPAND); S.AddSpace(5, 1); mSplitter->SetMinSize(wxSize(600, 400)); } S.EndHorizontalLay(); S.AddSpace(1, 5); return; }
void ChangeTempoDialog::PopulateOrExchange(ShuttleGui & S) { wxTextValidator nullvld(wxFILTER_INCLUDE_CHAR_LIST); wxTextValidator numvld(wxFILTER_NUMERIC); S.SetBorder(10); S.StartHorizontalLay(wxCENTER, false); { S.AddTitle(_("Change Tempo without Changing Pitch") + wxString(wxT("\n\n")) + _("by Vaughan Johnson && Dominic Mazzoni") + wxString(wxT("\n")) + _("using SoundTouch, by Olli Parviainen")); } S.EndHorizontalLay(); S.SetBorder(5); // S.StartMultiColumn(2, wxCENTER); { m_pTextCtrl_PercentChange = S.Id(ID_TEXT_PERCENTCHANGE) .AddTextBox(_("Percent Change:"), wxT(""), 12); m_pTextCtrl_PercentChange->SetValidator(numvld); } S.EndMultiColumn(); // S.StartHorizontalLay(wxEXPAND); { S.SetStyle(wxSL_HORIZONTAL); m_pSlider_PercentChange = S.Id(ID_SLIDER_PERCENTCHANGE) .AddSlider(wxT(""), 0, (int)PERCENTCHANGE_MAX, (int)PERCENTCHANGE_MIN); m_pSlider_PercentChange->SetName(_("Percent Change")); } S.EndHorizontalLay(); // S.StartMultiColumn(5, wxCENTER); { // S.AddUnits(_("Beats per minute:")); m_pTextCtrl_FromBPM = S.Id(ID_TEXT_FROMBPM) .AddTextBox(_("from"), wxT(""), 12); m_pTextCtrl_FromBPM->SetName(_("From beats per minute")); m_pTextCtrl_FromBPM->SetValidator(numvld); m_pTextCtrl_ToBPM = S.Id(ID_TEXT_TOBPM) .AddTextBox(_("to"), wxT(""), 12); m_pTextCtrl_ToBPM->SetName(_("To beats per minute")); m_pTextCtrl_ToBPM->SetValidator(numvld); // S.AddUnits(_("Length (seconds):")); m_pTextCtrl_FromLength = S.Id(ID_TEXT_FROMLENGTH) .AddTextBox(_("from"), wxT(""), 12); m_pTextCtrl_FromLength->SetName(_("From length in seconds")); m_pTextCtrl_FromLength->SetValidator(nullvld); m_pTextCtrl_ToLength = S.Id(ID_TEXT_TOLENGTH) .AddTextBox(_("to"), wxT(""), 12); m_pTextCtrl_ToLength->SetName(_("To length in seconds")); m_pTextCtrl_ToLength->SetValidator(numvld); } S.EndMultiColumn(); return; }
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, mFormat, mToLength, mProjectRate); mpToLengthCtrl->SetName(_("to")); mpToLengthCtrl->EnableMenu(); S.AddWindow(mpToLengthCtrl, wxALIGN_LEFT); } S.EndMultiColumn(); } S.EndStatic(); } S.EndVerticalLay(); }
void ExtImportPrefs::PopulateOrExchange(ShuttleGui & S) { S.SetBorder(2); S.TieCheckBox(_("Attempt to use filter in OpenFile dialog first"), wxT("/ExtendedImport/OverrideExtendedImportByOpenFileDialogChoice"), true); S.StartStatic(_("Rules to choose import filters"), 1); { S.SetSizerProportion(1); S.StartHorizontalLay (wxEXPAND, 1); { bool fillRuleTable = false; if (RuleTable == NULL) { RuleTable = new Grid(S.GetParent(),EIPRuleTable); RuleTable->SetColLabelSize(RuleTable->GetDefaultRowSize()); #if EXTIMPORT_MIME_SUPPORT RuleTable->CreateGrid (0, 2, wxGrid::wxGridSelectRows); #else RuleTable->CreateGrid (0, 1, wxGrid::wxGridSelectRows); #endif RuleTable->DisableDragColMove (); RuleTable->DisableDragRowSize (); RuleTable->SetDefaultCellAlignment(wxALIGN_LEFT, wxALIGN_CENTER); RuleTable->SetColLabelValue (0, _("File extensions")); #if EXTIMPORT_MIME_SUPPORT RuleTable->SetColLabelValue (1, _("Mime-types")); #endif RuleTable->SetRowLabelSize (0); RuleTable->SetSelectionMode (wxGrid::wxGridSelectRows); RuleTable->AutoSizeColumns (); RuleTable->SetDropTarget (dragtarget1); RuleTable->EnableDragCell (true); fillRuleTable = true; } S.AddWindow(RuleTable, wxEXPAND | wxALL); PluginList = S.Id(EIPPluginList).AddListControl (); if (fillRuleTable) { PluginList->SetSingleStyle (wxLC_REPORT, true); PluginList->SetSingleStyle (wxLC_SINGLE_SEL, true); PluginList->InsertColumn (0, _("Importer order")); PluginList->SetDropTarget (dragtarget2); ExtImportItems *items = wxGetApp().mImporter->GetImportItems(); for (unsigned int i = 0; i < items->Count(); i++) AddItemToTable (i, &(*items)[i]); if (items->Count() > 0) { RuleTable->SelectRow(0); RuleTable->SetGridCursor(0,0); } } } S.EndHorizontalLay(); S.StartHorizontalLay (wxSHRINK, 0); { MoveRuleUp = S.Id (EIPMoveRuleUp).AddButton (_("Move rule &up")); MoveRuleDown = S.Id (EIPMoveRuleDown).AddButton (_("Move rule &down")); MoveFilterUp = S.Id (EIPMoveFilterUp).AddButton (_("Move f&ilter up")); MoveFilterDown = S.Id (EIPMoveFilterDown).AddButton (_("Move &filter down")); } S.EndHorizontalLay(); S.StartHorizontalLay (wxSHRINK, 0); { AddRule = S.Id (EIPAddRule).AddButton (_("&Add new rule")); DelRule = S.Id (EIPDelRule).AddButton (_("De&lete selected rule")); } S.EndHorizontalLay(); } S.EndStatic(); Layout(); Fit(); SetMinSize(GetSize()); }
/// Normally in classes derived from PrefsPanel this function /// is used both to populate the panel and to exchange data with it. /// With KeyConfigPrefs all the exchanges are handled specially, /// so this is only used in populating the panel. void KeyConfigPrefs::PopulateOrExchange(ShuttleGui & S) { S.SetBorder(2); S.StartStatic(_("Key Bindings"), 1); { S.StartMultiColumn(3, wxEXPAND); { S.SetStretchyCol(1); S.StartHorizontalLay(wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 0); { S.AddTitle(_("View by:")); S.StartRadioButtonGroup(wxT("/Prefs/KeyConfig/ViewBy"), wxT("tree")); { mViewByTree = S.Id(ViewByTreeID).TieRadioButton(_("&Tree"), wxT("tree")); mViewByTree->SetName(_("View by tree")); mViewByName = S.Id(ViewByNameID).TieRadioButton(_("&Name"), wxT("name")); mViewByName->SetName(_("View by name")); mViewByKey = S.Id(ViewByKeyID).TieRadioButton(_("&Key"), wxT("key")); mViewByKey->SetName(_("View by key")); } S.EndRadioButtonGroup(); } S.EndHorizontalLay(); S.StartHorizontalLay(wxALIGN_CENTER|wxALIGN_CENTER_VERTICAL, 0); { // just a spacer } S.EndHorizontalLay(); S.StartHorizontalLay(wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 0); { mFilterLabel = S.AddVariableText(_("Searc&h:")); if (!mFilter) { mFilter = safenew wxTextCtrl(this, FilterID, wxT(""), wxDefaultPosition, #if defined(__WXMAC__) wxSize(300, -1), #else wxSize(210, -1), #endif wxTE_PROCESS_ENTER); mFilter->SetName(wxStripMenuCodes(mFilterLabel->GetLabel())); mFilter->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(KeyConfigPrefs::OnFilterKeyDown), NULL, this); mFilter->Connect(wxEVT_CHAR, wxKeyEventHandler(KeyConfigPrefs::OnFilterChar), NULL, this); } S.AddWindow(mFilter, wxALIGN_NOT | wxALIGN_LEFT); } S.EndHorizontalLay(); } S.EndThreeColumn(); S.AddSpace(-1, 2); S.StartHorizontalLay(wxEXPAND, 1); { if (!mView) { mView = safenew KeyView(this, CommandsListID); mView->SetName(_("Bindings")); } S.Prop(true); S.AddWindow(mView, wxEXPAND); } S.EndHorizontalLay(); S.StartThreeColumn(); { if (!mKey) { mKey = safenew wxTextCtrl(this, CurrentComboID, wxT(""), wxDefaultPosition, #if defined(__WXMAC__) wxSize(300, -1), #else wxSize(210, -1), #endif wxTE_PROCESS_ENTER); mKey->SetName(_("Short cut")); mKey->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(KeyConfigPrefs::OnHotkeyKeyDown), NULL, this); mKey->Connect(wxEVT_CHAR, wxKeyEventHandler(KeyConfigPrefs::OnHotkeyChar), NULL, this); mKey->Connect(wxEVT_KILL_FOCUS, wxFocusEventHandler(KeyConfigPrefs::OnHotkeyKillFocus), NULL, this); } S.AddWindow(mKey); /* i18n-hint: (verb)*/ mSet = S.Id(SetButtonID).AddButton(_("&Set")); mClear = S.Id(ClearButtonID).AddButton(_("Cl&ear")); } S.EndThreeColumn(); #if defined(__WXMAC__) S.AddFixedText(_("Note: Pressing Cmd+Q will quit. All other keys are valid.")); #endif S.StartThreeColumn(); { S.Id(ImportButtonID).AddButton(_("&Import...")); S.Id(ExportButtonID).AddButton(_("&Export...")); S.Id(AssignDefaultsButtonID).AddButton(_("&Defaults")); } S.EndThreeColumn(); } S.EndStatic(); // Need to layout so that the KeyView is properly sized before populating. // Otherwise, the initial selection is not scrolled into view. Layout(); }
void TagsEditor::PopulateOrExchange(ShuttleGui & S) { bool bShow; gPrefs->Read(wxT("/AudioFiles/ShowId3Dialog"), &bShow, true ); S.StartVerticalLay(); { S.StartHorizontalLay(wxALIGN_LEFT, 0); { S.AddUnits(_("Use arrow keys (or ENTER key after editing) to navigate fields.")); } S.EndHorizontalLay(); if (mGrid == NULL) { mGrid = safenew Grid(S.GetParent(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER); mGrid->RegisterDataType(wxT("Combo"), (mStringRenderer = safenew wxGridCellStringRenderer), (mComboEditor = safenew ComboEditor(wxArrayString(), true))); mGrid->SetColLabelSize(mGrid->GetDefaultRowSize()); auto cs = 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(1); S.AddWindow(mGrid, wxEXPAND | wxALL); S.StartMultiColumn(4, wxALIGN_CENTER); { S.Id(AddID).AddButton(_("&Add")); S.Id(RemoveID).AddButton(_("&Remove")); S.AddTitle( {} ); S.Id(ClearID).AddButton(_("Cl&ear")); } S.EndMultiColumn(); S.StartHorizontalLay(wxALIGN_CENTRE, 0); { 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( {} ); S.Id(SaveDefaultsID).AddButton(_("Set De&fault")); } S.EndMultiColumn(); } S.EndStatic(); } S.EndHorizontalLay(); S.StartHorizontalLay(wxALIGN_LEFT, 0); { S.Id( DontShowID ).AddCheckBox( _("Don't show this when exporting audio"), !bShow ); } S.EndHorizontalLay(); } S.EndVerticalLay(); S.AddStandardButtons(eOkButton | eCancelButton | eHelpButton); }
void EffectChangeTempo::PopulateOrExchange(ShuttleGui & S) { S.StartVerticalLay(0); { S.AddSpace(0, 5); S.AddTitle(_("Change Tempo without Changing Pitch")); S.SetBorder(5); // S.StartMultiColumn(2, wxCENTER); { FloatingPointValidator<double> vldPercentage(3, &m_PercentChange, 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.EndMultiColumn(); // S.StartHorizontalLay(wxEXPAND); { S.SetStyle(wxSL_HORIZONTAL); m_pSlider_PercentChange = S.Id(ID_PercentChange) .AddSlider(wxT(""), 0, (int)kSliderMax, (int)MIN_Percentage); m_pSlider_PercentChange->SetName(_("Percent Change")); } S.EndHorizontalLay(); // S.StartMultiColumn(5, wxCENTER); { // S.AddUnits(_("Beats per minute:")); FloatingPointValidator<double> vldFromBPM(3, &m_FromBPM, NUM_VAL_THREE_TRAILING_ZEROES | NUM_VAL_ZERO_AS_BLANK); m_pTextCtrl_FromBPM = S.Id(ID_FromBPM) .AddTextBox(_("from"), wxT(""), 12); m_pTextCtrl_FromBPM->SetName(_("From beats per minute")); m_pTextCtrl_FromBPM->SetValidator(vldFromBPM); FloatingPointValidator<double> vldToBPM(3, &m_ToBPM, NUM_VAL_THREE_TRAILING_ZEROES | NUM_VAL_ZERO_AS_BLANK); m_pTextCtrl_ToBPM = S.Id(ID_ToBPM) .AddTextBox(_("to"), wxT(""), 12); m_pTextCtrl_ToBPM->SetName(_("To beats per minute")); m_pTextCtrl_ToBPM->SetValidator(vldToBPM); // S.AddUnits(_("Length (seconds):")); int precission = 2; FloatingPointValidator<double> vldFromLength(precission, &m_FromLength, NUM_VAL_TWO_TRAILING_ZEROES); m_pTextCtrl_FromLength = S.Id(ID_FromLength) .AddTextBox(_("from"), wxT(""), 12); m_pTextCtrl_FromLength->SetName(_("From length in seconds")); m_pTextCtrl_FromLength->SetValidator(vldFromLength); m_pTextCtrl_FromLength->Enable(false); // Disable because the value comes from the user selection. FloatingPointValidator<double> vldToLength(2, &m_ToLength, NUM_VAL_TWO_TRAILING_ZEROES); // min and max need same precision as what we're validating (bug 963) double minLength = (m_FromLength * 100.0) / (100.0 + MAX_Percentage); double maxLength = (m_FromLength * 100.0) / (100.0 + MIN_Percentage); minLength = Internat::CompatibleToDouble(Internat::ToString(minLength, precission)); maxLength = Internat::CompatibleToDouble(Internat::ToString(maxLength, precission)); vldToLength.SetRange(minLength, maxLength); m_pTextCtrl_ToLength = S.Id(ID_ToLength) .AddTextBox(_("to"), wxT(""), 12); m_pTextCtrl_ToLength->SetName(_("To length in seconds")); m_pTextCtrl_ToLength->SetValidator(vldToLength); } S.EndMultiColumn(); } S.EndVerticalLay(); return; }