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(); }
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; }
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(); }
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(); }
void SplashDialog::Populate( ShuttleGui & S ) { this->SetBackgroundColour(theTheme.Colour( clrAboutBoxBackground )); bool bShow; gPrefs->Read(wxT("/GUI/ShowSplashScreen"), &bShow, true ); S.StartVerticalLay(1); //v For now, change to AudacityLogoWithName via old-fashioned ways, not Theme. m_pLogo = new wxBitmap((const char **) AudacityLogoWithName_xpm); //v // JKC: Resize to 50% of size. Later we may use a smaller xpm as // our source, but this allows us to tweak the size - if we want to. // It also makes it easier to revert to full size if we decide to. const float fScale=0.5f;// smaller size. wxImage RescaledImage( m_pLogo->ConvertToImage() ); // wxIMAGE_QUALITY_HIGH not supported by wxWidgets 2.6.1, or we would use it here. RescaledImage.Rescale( int(LOGOWITHNAME_WIDTH * fScale), int(LOGOWITHNAME_HEIGHT *fScale) ); wxBitmap RescaledBitmap( RescaledImage ); m_pIcon = new wxStaticBitmap(S.GetParent(), -1, //*m_pLogo, //v theTheme.Bitmap(bmpAudacityLogoWithName), RescaledBitmap, wxDefaultPosition, wxSize(int(LOGOWITHNAME_WIDTH*fScale), int(LOGOWITHNAME_HEIGHT*fScale))); S.Prop(0).AddWindow( m_pIcon ); mpHtml = new LinkingHtmlWindow(S.GetParent(), -1, wxDefaultPosition, wxSize(506, 280), wxHW_SCROLLBAR_AUTO | wxSUNKEN_BORDER ); mpHtml->SetPage(HelpText( wxT("welcome") )); S.Prop(1).AddWindow( mpHtml, wxEXPAND ); S.Prop(0).StartMultiColumn(2, wxEXPAND); S.SetStretchyCol( 1 );// Column 1 is stretchy... { S.SetBorder( 5 ); S.Id( DontShowID).AddCheckBox( _("Don't show this again at start up"), bShow ? wxT("false") : wxT("true") ); wxButton *ok = new wxButton(S.GetParent(), wxID_OK); ok->SetDefault(); S.SetBorder( 5 ); S.Prop(0).AddWindow( ok, wxALIGN_RIGHT| wxALL ); } S.EndVerticalLay(); }
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 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 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()); }
void EffectAutoDuck::PopulateOrExchange(ShuttleGui & S) { S.SetBorder(5); S.StartVerticalLay(true); { S.AddSpace(0, 5); mPanel = safenew EffectAutoDuckPanel(S.GetParent(), this); S.AddWindow(mPanel); S.AddSpace(0, 5); S.StartMultiColumn(6, wxCENTER); { FloatingPointValidator<double> vldDuckAmountDb(1, &mDuckAmountDb, NUM_VAL_NO_TRAILING_ZEROES); vldDuckAmountDb.SetRange(MIN_DuckAmountDb, MAX_DuckAmountDb); mDuckAmountDbBox = S.AddTextBox(_("Duck amount:"), wxT(""), 10); mDuckAmountDbBox->SetValidator(vldDuckAmountDb); S.AddUnits(_("dB")); FloatingPointValidator<double> vldMaximumPause(2, &mMaximumPause, NUM_VAL_NO_TRAILING_ZEROES); vldMaximumPause.SetRange(MIN_MaximumPause, MAX_MaximumPause); mMaximumPauseBox = S.AddTextBox(_("Maximum pause:"), wxT(""), 10); mMaximumPauseBox->SetValidator(vldMaximumPause); S.AddUnits(_("seconds")); FloatingPointValidator<double> vldOuterFadeDownLen(2, &mOuterFadeDownLen, NUM_VAL_NO_TRAILING_ZEROES); vldOuterFadeDownLen.SetRange(MIN_OuterFadeDownLen, MAX_OuterFadeDownLen); mOuterFadeDownLenBox = S.AddTextBox(_("Outer fade down length:"), wxT(""), 10); mOuterFadeDownLenBox->SetValidator(vldOuterFadeDownLen); S.AddUnits(_("seconds")); FloatingPointValidator<double> vldOuterFadeUpLen(2, &mOuterFadeUpLen, NUM_VAL_NO_TRAILING_ZEROES); vldOuterFadeUpLen.SetRange(MIN_OuterFadeUpLen, MAX_OuterFadeUpLen); mOuterFadeUpLenBox = S.AddTextBox(_("Outer fade up length:"), wxT(""), 10); mOuterFadeUpLenBox->SetValidator(vldOuterFadeUpLen); S.AddUnits(_("seconds")); FloatingPointValidator<double> vldInnerFadeDownLen(2, &mInnerFadeDownLen, NUM_VAL_NO_TRAILING_ZEROES); vldInnerFadeDownLen.SetRange(MIN_InnerFadeDownLen, MAX_InnerFadeDownLen); mInnerFadeDownLenBox = S.AddTextBox(_("Inner fade down length:"), wxT(""), 10); mInnerFadeDownLenBox->SetValidator(vldInnerFadeDownLen); S.AddUnits(_("seconds")); FloatingPointValidator<double> vldInnerFadeUpLen(2, &mInnerFadeUpLen, NUM_VAL_NO_TRAILING_ZEROES); vldInnerFadeUpLen.SetRange(MIN_InnerFadeUpLen, MAX_InnerFadeUpLen); mInnerFadeUpLenBox = S.AddTextBox(_("Inner fade up length:"), wxT(""), 10); mInnerFadeUpLenBox->SetValidator(vldInnerFadeUpLen); S.AddUnits(_("seconds")); } S.EndMultiColumn(); S.StartMultiColumn(3, wxCENTER); { FloatingPointValidator<double> vldThresholdDb(2, &mThresholdDb, NUM_VAL_NO_TRAILING_ZEROES); vldThresholdDb.SetRange(MIN_ThresholdDb, MAX_ThresholdDb); mThresholdDbBox = S.AddTextBox(_("Threshold:"), wxT(""), 10); mThresholdDbBox->SetValidator(vldThresholdDb); S.AddUnits(_("dB")); } S.EndMultiColumn(); } S.EndVerticalLay(); return; }
void SplashDialog::Populate( ShuttleGui & S ) { //#if ((AUDACITY_BRANDING == BRAND_JAMLING__EASY) || (AUDACITY_BRANDING == BRAND_JAMLING__FULL)) // this->SetBackgroundColour(wxColour(rrr, ggg, bbb)); // same as waveform color //#else // this->SetBackgroundColour(theTheme.Colour( clrAboutBoxBackground )); //#endif this->SetBackgroundColour(theTheme.Colour( clrAboutBoxBackground )); bool bShow; gPrefs->Read(wxT("/GUI/ShowSplashScreen"), &bShow, true ); S.StartVerticalLay(1); wxImage buttonImageUp; wxImage buttonImageOver; wxSize buttonSize; wxBitmap* pButtonBitmap; wxBitmap* pButtonBitmapOver; //vvv Change this compile flag when other brands are supported. #if ((AUDACITY_BRANDING == BRAND_JAMLING__EASY) || (AUDACITY_BRANDING == BRAND_JAMLING__FULL)) //vvv Compiles only BRAND_JAMLING__EASY or BRAND_JAMLING__FULL // because we don't load any other company_logo*_xpm consts yet. pButtonBitmap = new wxBitmap(company_logo_xpm); buttonImageUp = pButtonBitmap->ConvertToImage(); pButtonBitmapOver = new wxBitmap(company_logo_over_xpm); buttonImageOver = pButtonBitmapOver->ConvertToImage(); buttonSize = wxSize(pButtonBitmap->GetWidth(), pButtonBitmap->GetHeight()); mButton_Logo = new AButton(this, ID_BUTTON_LOGO, wxDefaultPosition, buttonSize, &buttonImageUp, &buttonImageOver, &buttonImageUp, &buttonImageUp, //v other images? true); #else //vvv For now, change to AudacityLogoWithName via old-fashioned ways, not Theme. pButtonBitmap = //vvv theTheme.Bitmap(bmpAudacityLogoWithName) new wxBitmap((const char **) AudacityLogoWithName_xpm); buttonImageUp = pButtonBitmap->ConvertToImage(); // JKC: Resize to 50% of size. Later we may use a smaller xpm as // our source, but this allows us to tweak the size - if we want to. // It also makes it easier to revert to full size if we decide to. const float fScale=0.5f;// smaller size. buttonSize = wxSize(LOGOWITHNAME_WIDTH * fScale, LOGOWITHNAME_HEIGHT * fScale); // wxIMAGE_QUALITY_HIGH not supported by wxWidgets 2.6.x, or we would use it here. buttonImageUp.Rescale(buttonSize.GetWidth(), buttonSize.GetHeight()); buttonImageOver = buttonImageUp.Copy(); buttonImageOver.RotateHue(-0.01); mButton_Logo = new AButton(this, ID_BUTTON_LOGO, wxDefaultPosition, buttonSize, &buttonImageUp, &buttonImageOver, &buttonImageUp, &buttonImageUp, //v other images? true); #endif S.Prop(0).AddWindow(mButton_Logo); mpHtml = new LinkingHtmlWindow(S.GetParent(), -1, wxDefaultPosition, wxSize(kWidth, 280), wxHW_SCROLLBAR_AUTO | wxSUNKEN_BORDER ); mpHtml->SetPage(HelpText( wxT("welcome") )); S.Prop(1).AddWindow( mpHtml, wxEXPAND ); S.Prop(0).StartMultiColumn(2, wxEXPAND); S.SetStretchyCol( 1 );// Column 1 is stretchy... { S.SetBorder( 5 ); S.Id( DontShowID).AddCheckBox( _("Don't show this again at start up"), bShow ? wxT("false") : wxT("true") ); wxButton *ok = new wxButton(S.GetParent(), wxID_OK); ok->SetDefault(); ok->SetFocus(); S.SetBorder( 5 ); S.Prop(0).AddWindow( ok, wxALIGN_RIGHT| wxALL ); } S.EndVerticalLay(); }
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 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 EffectScienFilter::PopulateOrExchange(ShuttleGui & S) { wxWindow *parent = S.GetParent(); S.AddSpace(5); S.SetSizerProportion(1); S.StartMultiColumn(3, wxEXPAND); { S.SetStretchyCol(1); S.SetStretchyRow(0); // ------------------------------------------------------------------- // ROW 1: Freq response panel and sliders for vertical scale // ------------------------------------------------------------------- S.StartVerticalLay(); { mdBRuler = new RulerPanel(parent, wxID_ANY); mdBRuler->ruler.SetBounds(0, 0, 100, 100); // Ruler can't handle small sizes mdBRuler->ruler.SetOrientation(wxVERTICAL); mdBRuler->ruler.SetRange(30.0, -120.0); mdBRuler->ruler.SetFormat(Ruler::LinearDBFormat); mdBRuler->ruler.SetUnits(_("dB")); mdBRuler->ruler.SetLabelEdges(true); int w; mdBRuler->ruler.GetMaxSize(&w, NULL); mdBRuler->SetSize(wxSize(w, 150)); // height needed for wxGTK S.SetBorder(1); S.AddSpace(1, 1); S.Prop(1); S.AddWindow(mdBRuler, wxALIGN_RIGHT | wxTOP); S.AddSpace(1, 1); } S.EndVerticalLay(); mPanel = new EffectScienFilterPanel(this, parent); mPanel->SetFreqRange(mLoFreq, mNyquist); S.SetBorder(5); S.Prop(1); S.AddWindow(mPanel, wxEXPAND | wxRIGHT); S.SetSizeHints(-1, -1); S.StartVerticalLay(); { S.AddVariableText(_("+ dB"), false, wxCENTER); S.SetStyle(wxSL_VERTICAL | wxSL_INVERSE); mdBMaxSlider = S.Id(ID_dBMax).AddSlider(wxT(""), 10, 20, 0); #if wxUSE_ACCESSIBILITY mdBMaxSlider->SetName(_("Max dB")); mdBMaxSlider->SetAccessible(new SliderAx(mdBMaxSlider, wxString(wxT("%d ")) + _("dB"))); #endif S.SetStyle(wxSL_VERTICAL | wxSL_INVERSE); mdBMinSlider = S.Id(ID_dBMin).AddSlider(wxT(""), -10, -10, -120); S.AddVariableText(_("- dB"), false, wxCENTER); #if wxUSE_ACCESSIBILITY mdBMinSlider->SetName(_("Min dB")); mdBMinSlider->SetAccessible(new SliderAx(mdBMinSlider, wxString(wxT("%d ")) + _("dB"))); #endif } S.EndVerticalLay(); // ------------------------------------------------------------------- // ROW 2: Frequency ruler // ------------------------------------------------------------------- S.AddSpace(1, 1); mfreqRuler = new RulerPanel(parent, wxID_ANY); mfreqRuler->ruler.SetBounds(0, 0, 100, 100); // Ruler can't handle small sizes mfreqRuler->ruler.SetOrientation(wxHORIZONTAL); mfreqRuler->ruler.SetLog(true); mfreqRuler->ruler.SetRange(mLoFreq, mNyquist); mfreqRuler->ruler.SetFormat(Ruler::IntFormat); mfreqRuler->ruler.SetUnits(wxT("")); mfreqRuler->ruler.SetFlip(true); mfreqRuler->ruler.SetLabelEdges(true); int h; mfreqRuler->ruler.GetMaxSize(NULL, &h); mfreqRuler->SetMinSize(wxSize(-1, h)); S.Prop(1); S.AddWindow(mfreqRuler, wxEXPAND | wxALIGN_LEFT | wxRIGHT); S.AddSpace(1, 1); // ------------------------------------------------------------------- // ROW 3 and 4: Type, Order, Ripple, Subtype, Cutoff // ------------------------------------------------------------------- S.AddSpace(1, 1); S.SetSizerProportion(0); S.StartMultiColumn(8, wxALIGN_CENTER); { wxASSERT(kNumTypes == WXSIZEOF(kTypeStrings)); wxArrayString typeChoices; for (int i = 0; i < kNumTypes; i++) { typeChoices.Add(wxGetTranslation(kTypeStrings[i])); } mFilterTypeCtl = S.Id(ID_Type).AddChoice(_("&Filter Type:"), wxT(""), &typeChoices); mFilterTypeCtl->SetValidator(wxGenericValidator(&mFilterType)); S.SetSizeHints(-1, -1); wxArrayString orders; for (int i = 1; i <= 10; i++) { orders.Add(wxString::Format(wxT("%d"), i)); } /*i18n-hint: 'Order' means the complexity of the filter, and is a number between 1 and 10.*/ mFilterOrderCtl = S.Id(ID_Order).AddChoice(_("O&rder:"), wxT(""), &orders); mFilterOrderCtl->SetValidator(wxGenericValidator(&mOrderIndex)); S.SetSizeHints(-1, -1); S.AddSpace(1, 1); FloatingPointValidator<float> vldRipple(1, &mRipple); vldRipple.SetRange(MIN_Passband, MAX_Passband); mRippleCtlP = S.AddVariableText(_("&Passband Ripple:"), false, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); mRippleCtl = S.Id(ID_Ripple).AddTextBox(wxT(""), wxT(""), 10); mRippleCtl->SetName(_("Passband Ripple (dB)")); mRippleCtl->SetValidator(vldRipple); mRippleCtlU = S.AddVariableText(_("dB"), false, wxALL | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); wxASSERT(kNumSubTypes == WXSIZEOF(kSubTypeStrings)); wxArrayString subTypeChoices; for (int i = 0; i < kNumSubTypes; i++) { subTypeChoices.Add(wxGetTranslation(kSubTypeStrings[i])); } mFilterSubTypeCtl = S.Id(ID_SubType).AddChoice(_("&Subtype:"), wxT(""), &subTypeChoices); mFilterSubTypeCtl->SetValidator(wxGenericValidator(&mFilterSubtype)); S.SetSizeHints(-1, -1); FloatingPointValidator<float> vldCutoff(1, &mCutoff); vldCutoff.SetRange(MIN_Cutoff, mNyquist - 1); mCutoffCtl = S.Id(ID_Cutoff).AddTextBox(_("C&utoff:"), wxT(""), 10); mCutoffCtl->SetName(_("Cutoff (Hz)")); mCutoffCtl->SetValidator(vldCutoff); S.AddUnits(_("Hz")); FloatingPointValidator<float> vldStopbandRipple(1, &mStopbandRipple); vldStopbandRipple.SetRange(MIN_Stopband, MAX_Stopband); mStopbandRippleCtlP = S.AddVariableText(_("Minimum S&topband Attenuation:"), false, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); mStopbandRippleCtl = S.Id(ID_StopbandRipple).AddTextBox(wxT(""), wxT(""), 10); mStopbandRippleCtl->SetName(_("Minimum S&topband Attenuation (dB)")); mStopbandRippleCtl->SetValidator(vldStopbandRipple); mStopbandRippleCtlU = S.AddVariableText(_("dB"), false, wxALL | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); } S.EndMultiColumn(); S.AddSpace(1, 1); } S.EndMultiColumn(); mFilterTypeCtl->SetFocus(); 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; }