Beispiel #1
0
void EffectLeveller::PopulateOrExchange(ShuttleGui & S)
{
   wxASSERT(kNumPasses == WXSIZEOF(kPassStrings));

   wxArrayString passChoices;
   for (int i = 0; i < kNumPasses; i++)
   {
      passChoices.Add(wxGetTranslation(kPassStrings[i]));
   }

   wxArrayString dBChoices(Enums::NumDbChoices,Enums::GetDbChoices());

   S.SetBorder(5);

   S.StartVerticalLay();
   {
      S.AddSpace(5);
      S.StartMultiColumn(2, wxALIGN_CENTER);
      {
         S.AddChoice(_("Degree of Leveling:"),
                     wxT(""),
                     &passChoices)->SetValidator(wxGenericValidator(&mPassIndex));
         S.AddChoice(_("Noise Threshold:"),
                     wxT(""),
                     &dBChoices)->SetValidator(wxGenericValidator(&mDbIndex));
      }
      S.EndMultiColumn();
   }
   S.EndVerticalLay();

   return;
}
Beispiel #2
0
void TimeDialog::PopulateOrExchange(ShuttleGui &S)
{
   S.SetBorder(5);
   S.StartVerticalLay(true);
   {
      S.StartStatic(mPrompt, true);
      {
         mTimeCtrl = new
            TimeTextCtrl(this,
                         wxID_ANY,
                         wxT(""),
                         mTime,
                         mRate,
                         wxDefaultPosition,
                         wxDefaultSize,
                         true);
         mTimeCtrl->SetName(mPrompt);
         mTimeCtrl->SetFormatString(mTimeCtrl->GetBuiltinFormat(mFormat));
         S.AddWindow(mTimeCtrl);
         mTimeCtrl->EnableMenu();
      }
      S.EndStatic();
   }
   S.EndVerticalLay();
   S.AddStandardButtons();

   TransferDataToWindow();

   Layout();
   Fit();
   SetMinSize(GetSize());
   Center();
}
Beispiel #3
0
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 MacroCommandDialog::PopulateOrExchange(ShuttleGui &S)
{
   S.StartVerticalLay(true);
   {
      S.StartMultiColumn(4, wxEXPAND);
      {
         S.SetStretchyCol(1);
         mCommand = S.AddTextBox(_("&Command"), wxT(""), 20);
         mCommand->SetEditable(false);
         mEditParams = S.Id(EditParamsButtonID).AddButton(_("&Edit Parameters"));
         mEditParams->Enable(false); // disable button as box is empty
         mUsePreset = S.Id(UsePresetButtonID).AddButton(_("&Use Preset"));
         mUsePreset->Enable(false); // disable button as box is empty
      }
      S.EndMultiColumn();

      S.StartMultiColumn(2, wxEXPAND);
      {
         S.SetStretchyCol(1);
         mParameters = S.AddTextBox(_("&Parameters"), wxT(""), 0);
         mParameters->SetEditable(false);
         wxString prompt{_("&Details")};
         S.Prop(0).AddPrompt(prompt);
         mDetails = S.AddTextWindow( wxT(""));
         mDetails->SetEditable(false);
         mDetails->SetName(wxStripMenuCodes(prompt));
      }
      S.EndMultiColumn();

      S.Prop(10).StartStatic(_("Choose command"), true);
      {
         S.SetStyle(wxSUNKEN_BORDER | wxLC_LIST | wxLC_SINGLE_SEL);
         mChoices = S.Id(CommandsListID).AddListControl();
      }
      S.EndStatic();
   }
   S.EndVerticalLay();

   S.AddStandardButtons( eOkButton | eCancelButton | eHelpButton);

   PopulateCommandList();
   if (mChoices->GetItemCount() > 0) {
      // set first item to be selected (and the focus when the
      // list first becomes the focus)
      mChoices->SetItemState(0, wxLIST_STATE_FOCUSED | wxLIST_STATE_SELECTED,
         wxLIST_STATE_FOCUSED | wxLIST_STATE_SELECTED);
   }

   SetMinSize(wxSize(780, 560));
   Fit();
   Center();
}
/// Defines the dialog and does data exchange with it.
void BatchProcessDialog::PopulateOrExchange(ShuttleGui &S)
{
   S.StartVerticalLay(true);
   {
      /*i18n-hint: A chain is a sequence of commands that can be applied
       * to one or more audio files.*/
      S.StartStatic(_("&Select Chain"), true);
      {
         S.SetStyle(wxSUNKEN_BORDER | wxLC_REPORT | wxLC_HRULES | wxLC_VRULES |
                     wxLC_SINGLE_SEL);
         mChains = S.Id(ChainsListID).AddListControlReportMode();
         mChains->InsertColumn(0, _("Chain"), wxLIST_FORMAT_LEFT);
      }
      S.EndStatic();

      S.StartHorizontalLay(wxALIGN_RIGHT, false);
      {
         S.SetBorder(10);
         S.Id(ApplyToProjectID).AddButton(_("Apply to Current &Project"));
         S.Id(ApplyToFilesID).AddButton(_("Apply to &Files..."));
         S.Id(wxID_CANCEL).AddButton(_("&Cancel"));
      }
      S.EndHorizontalLay();
   }
   S.EndVerticalLay();

   wxArrayString names = mBatchCommands.GetNames();
   for (int i = 0; i < (int)names.GetCount(); i++) {
      mChains->InsertItem(i, names[i]);
   }

   // Get and validate the currently active chain
   wxString name = gPrefs->Read(wxT("/Batch/ActiveChain"), wxT(""));

   int item = mChains->FindItem(-1, name);
   if (item == -1) {
      item = 0;
      name = mChains->GetItemText(0);
   }

   // Select the name in the list...this will fire an event.
   mChains->SetItemState(item, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);

   Layout();
   Fit();
   SetSizeHints(GetSize());
   Center();

   // Set the column size for the chains list.
   wxSize sz = mChains->GetClientSize();
   mChains->SetColumnWidth(0, sz.x);
}
void SoundActivatedRecord::PopulateOrExchange(ShuttleGui & S)
{
   S.SetBorder(5);
   int dBRange;

   S.StartVerticalLay();
   {
      S.StartMultiColumn(2, wxEXPAND);
         S.SetStretchyCol(1);
         dBRange = gPrefs->Read(ENV_DB_KEY, ENV_DB_RANGE);
         S.TieSlider(_("Activation level (dB):"), wxT("/AudioIO/SilenceLevel"), -50, 0, -dBRange);
      S.EndMultiColumn();
   }
   S.EndVerticalLay();
   S.AddStandardButtons();
}
Beispiel #7
0
void ExportMP2Options::PopulateOrExchange(ShuttleGui & S)
{
   S.StartVerticalLay();
   {
      S.StartHorizontalLay(wxCENTER);
      {
         S.StartMultiColumn(2, wxCENTER);
         {
            S.TieChoice(_("Bit Rate:"), wxT("/FileFormats/MP2Bitrate"),
               160, mBitRateNames, mBitRateLabels);
         }
         S.EndMultiColumn();
      }
      S.EndHorizontalLay();
   }
   S.EndVerticalLay();
}
Beispiel #8
0
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();
}
Beispiel #9
0
   void PopulateOrExchange(ShuttleGui & S)
   {
      wxString text;

      S.SetBorder(10);
      S.StartVerticalLay(true);
      {
         text.Printf(_("Audacity needs the file '%s' to import and export audio via FFmpeg."), mName.c_str());
         S.AddTitle(text);

         S.SetBorder(3);
         S.StartHorizontalLay(wxALIGN_LEFT, true);
         {
            text.Printf(_("Location of '%s':"), mName.c_str());
            S.AddTitle(text);
         }
         S.EndHorizontalLay();

         S.StartMultiColumn(2, wxEXPAND);
         S.SetStretchyCol(0);
         {
            if (mLibPath.GetFullPath().IsEmpty()) {
               text.Printf(_("To find '%s', click here -->"), mName.c_str());
               mPathText = S.AddTextBox(wxT(""), text, 0);
            }
            else {
               mPathText = S.AddTextBox(wxT(""), mLibPath.GetFullPath(), 0);
            }
            S.Id(ID_FFMPEG_BROWSE).AddButton(_("Browse..."), wxALIGN_RIGHT);
            S.AddVariableText(_("To get a free copy of FFmpeg, click here -->"), true);
            S.Id(ID_FFMPEG_DLOAD).AddButton(_("Download"), wxALIGN_RIGHT);
         }
         S.EndMultiColumn();

         S.AddStandardButtons();
      }
      S.EndVerticalLay();

      Layout();
      Fit();
      SetMinSize(GetSize());
      Center();

      return;
   }
Beispiel #10
0
void ExportOGGOptions::PopulateOrExchange(ShuttleGui & S)
{
   S.StartVerticalLay();
   {
      S.StartHorizontalLay(wxEXPAND);
      {
         S.SetSizerProportion(1);
         S.StartMultiColumn(2, wxCENTER);
         {
            S.SetStretchyCol(1);
            S.Prop(1).TieSlider(_("Quality:"), mOggQualityUnscaled, 10);
         }
         S.EndMultiColumn();
      }
      S.EndHorizontalLay();
   }
   S.EndVerticalLay();
}
Beispiel #11
0
void NormalizeDialog::PopulateOrExchange(ShuttleGui & S)
{
   wxTextValidator vld(wxFILTER_NUMERIC);

   S.StartHorizontalLay(wxCENTER, false);
   {
      S.AddTitle(_("by Dominic Mazzoni"));
   }
   S.EndHorizontalLay();

   S.StartHorizontalLay(wxCENTER, false);
   {
      // Add a little space
   }
   S.EndHorizontalLay();

   S.StartTwoColumn();
   {
      S.StartVerticalLay(false);
      {
         mDCCheckBox = S.Id(ID_DC_REMOVE).AddCheckBox(_("Remove any DC offset (center on 0.0 vertically)"),
                                     mDC ? wxT("true") : wxT("false"));
   
         mGainCheckBox = S.Id(ID_NORMALIZE_AMPLITUDE).AddCheckBox(_("Normalize maximum amplitude to:"),
                                       mGain ? wxT("true") : wxT("false"));
   
         S.StartHorizontalLay(wxALIGN_CENTER, false);
         {
            mLevelTextCtrl = S.Id(ID_LEVEL_TEXT).AddTextBox(wxT(""), wxT(""), 10);
            mLevelTextCtrl->SetValidator(vld);
            mLevelTextCtrl->SetName(_("Maximum amplitude dB"));
            mLeveldB = S.AddVariableText(_("dB"), false,
                                         wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT);
            mWarning = S.AddVariableText( wxT(""), false,
                                         wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT);
         }
         S.EndHorizontalLay();
         mStereoIndCheckBox = S.AddCheckBox(_("Normalize stereo channels independently"),
                                     mStereoInd ? wxT("true") : wxT("false"));
      }
      S.EndVerticalLay();
   }
   S.EndTwoColumn();
}
Beispiel #12
0
void BatchCommandDialog::PopulateOrExchange(ShuttleGui &S)
{
   S.StartVerticalLay(true);
   {
      S.StartMultiColumn(3, wxEXPAND);
      {
         S.SetStretchyCol(1);
         mCommand = S.AddTextBox(_("&Command"), wxT(""), 20);
         mCommand->SetEditable(false);
         mEditParams = S.Id(EditParamsButtonID).AddButton(_("&Edit Parameters"));
         mEditParams->Enable( false ); // disable button as box is empty
      }
      S.EndMultiColumn();

      S.StartMultiColumn(2, wxEXPAND);
      {
         S.SetStretchyCol(1);
         mParameters = S.AddTextBox(_("&Parameters"), wxT(""), 0);
         mParameters->SetEditable(false);
      }
      S.EndMultiColumn();

      S.StartStatic(_("C&hoose command"), true);
      {
         S.SetStyle(wxSUNKEN_BORDER | wxLC_LIST | wxLC_SINGLE_SEL);
         mChoices = S.Id(CommandsListID).AddListControl();
      }
      S.EndStatic();
   }
   S.EndVerticalLay();

   S.AddStandardButtons();

   for(int i=0;i<99;i++)
   {
      mChoices->InsertItem( i, wxString::Format(wxT("Item%02i"),i));
   }
   PopulateCommandList();

   SetSize(350, 400);
   SetSizeHints(GetSize());
   Center();
}
Beispiel #13
0
void ExportFLACOptions::PopulateOrExchange(ShuttleGui & S)
{
   wxArrayString flacLevelNames, flacLevelLabels;
   flacLevelLabels.Add(wxT("0")); flacLevelNames.Add(_("0 (fastest)"));
   flacLevelLabels.Add(wxT("1")); flacLevelNames.Add(_("1"));
   flacLevelLabels.Add(wxT("2")); flacLevelNames.Add(_("2"));
   flacLevelLabels.Add(wxT("3")); flacLevelNames.Add(_("3"));
   flacLevelLabels.Add(wxT("4")); flacLevelNames.Add(_("4"));
   flacLevelLabels.Add(wxT("5")); flacLevelNames.Add(_("5"));
   flacLevelLabels.Add(wxT("6")); flacLevelNames.Add(_("6"));
   flacLevelLabels.Add(wxT("7")); flacLevelNames.Add(_("7"));
   flacLevelLabels.Add(wxT("8")); flacLevelNames.Add(_("8 (best)"));

   wxArrayString flacBitDepthNames, flacBitDepthLabels;
   flacBitDepthLabels.Add(wxT("16")); flacBitDepthNames.Add(_("16 bit"));
   flacBitDepthLabels.Add(wxT("24")); flacBitDepthNames.Add(_("24 bit"));

   S.StartVerticalLay();
   {
      S.StartHorizontalLay(wxCENTER);
      {
         S.StartMultiColumn(2, wxCENTER);
         {
            S.TieChoice(_("Level:"), wxT("/FileFormats/FLACLevel"),
                        wxT("5"), flacLevelNames, flacLevelLabels);
            S.TieChoice(_("Bit depth:"), wxT("/FileFormats/FLACBitDepth"),
                        wxT("16"), flacBitDepthNames, flacBitDepthLabels);
         }
         S.EndMultiColumn();
      }
      S.EndHorizontalLay();
   }
   S.EndVerticalLay();

   return;
}
Beispiel #14
0
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;
}
Beispiel #15
0
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);
}
Beispiel #16
0
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);
}
Beispiel #17
0
void TimerRecordDialog::PopulateOrExchange(ShuttleGui& S)
{
   bool bAutoSave = gPrefs->ReadBool("/TimerRecord/AutoSave", false);
   bool bAutoExport = gPrefs->ReadBool("/TimerRecord/AutoExport", false);
   int iPostTimerRecordAction = gPrefs->ReadLong("/TimerRecord/PostAction", 0);

   S.SetBorder(5);
   S.StartMultiColumn(2, wxCENTER);
   {
      S.StartVerticalLay(true);
      {
         /* i18n-hint: This string is used to configure the controls for times when the recording is
         * started and stopped. As such it is important that only the alphabetic parts of the string
         * are translated, with the numbers left exactly as they are.
         * The 'h' indicates the first number displayed is hours, the 'm' indicates the second number
         * displayed is minutes, and the 's' indicates that the third number displayed is seconds.
         */
         wxString strFormat = _("099 h 060 m 060 s");
         using Options = NumericTextCtrl::Options;
         S.StartStatic(_("Start Date and Time"), true);
         {
            m_pDatePickerCtrl_Start =
               safenew wxDatePickerCtrl(this, // wxWindow *parent,
               ID_DATEPICKER_START, // wxWindowID id,
               m_DateTime_Start); // const wxDateTime& dt = wxDefaultDateTime,
            // const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDP_DEFAULT | wxDP_SHOWCENTURY, const wxValidator& validator = wxDefaultValidator, const wxString& name = "datectrl")
            m_pDatePickerCtrl_Start->SetName(_("Start Date"));
            m_pDatePickerCtrl_Start->SetRange(wxDateTime::Today(), wxInvalidDateTime); // No backdating.
#if wxUSE_ACCESSIBILITY
            m_pDatePickerCtrl_Start->SetAccessible( safenew DatePickerCtrlAx(m_pDatePickerCtrl_Start));
#endif
            S.AddWindow(m_pDatePickerCtrl_Start);

            m_pTimeTextCtrl_Start = safenew NumericTextCtrl(
               this, ID_TIMETEXT_START, NumericConverter::TIME,
               wxEmptyString, 0, 44100,
               Options{}
                  .MenuEnabled(false)
                  .Format(strFormat)
                  .Value(true, wxDateTime_to_AudacityTime(m_DateTime_Start)));
            m_pTimeTextCtrl_Start->SetName(_("Start Time"));
            S.AddWindow(m_pTimeTextCtrl_Start);
         }
         S.EndStatic();

         S.StartStatic(_("End Date and Time"), true);
         {
            m_pDatePickerCtrl_End =
               safenew wxDatePickerCtrl(this, // wxWindow *parent,
               ID_DATEPICKER_END, // wxWindowID id,
               m_DateTime_End); // const wxDateTime& dt = wxDefaultDateTime,
            // const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
            //                            long style = wxDP_DEFAULT | wxDP_SHOWCENTURY, 
            //                            const wxValidator& validator = wxDefaultValidator,
            //                            const wxString& name = "datectrl")
            m_pDatePickerCtrl_End->SetRange(m_DateTime_Start, wxInvalidDateTime); // No backdating.
            m_pDatePickerCtrl_End->SetName(_("End Date"));
#if wxUSE_ACCESSIBILITY
            m_pDatePickerCtrl_End->SetAccessible( safenew DatePickerCtrlAx(m_pDatePickerCtrl_End));
#endif
            S.AddWindow(m_pDatePickerCtrl_End);

            m_pTimeTextCtrl_End = safenew NumericTextCtrl(
               this, ID_TIMETEXT_END, NumericConverter::TIME,
               wxEmptyString, 0, 44100,
               Options{}
                  .MenuEnabled(false)
                  .Format(strFormat)
                  .Value(true, wxDateTime_to_AudacityTime(m_DateTime_End)));
            m_pTimeTextCtrl_End->SetName(_("End Time"));
            S.AddWindow(m_pTimeTextCtrl_End);
         }
         S.EndStatic();

         S.StartStatic(_("Duration"), true);
         {
            /* i18n-hint: This string is used to configure the controls which shows the recording
            * duration. As such it is important that only the alphabetic parts of the string
            * are translated, with the numbers left exactly as they are.
            * The string 'days' indicates that the first number in the control will be the number of days,
            * then the 'h' indicates the second number displayed is hours, the 'm' indicates the third
            * number displayed is minutes, and the 's' indicates that the fourth number displayed is
            * seconds.
            */
            wxString strFormat1 = _("099 days 024 h 060 m 060 s");
            m_pTimeTextCtrl_Duration = safenew NumericTextCtrl(
               this, ID_TIMETEXT_DURATION, NumericConverter::TIME,
               wxEmptyString, 0, 44100,
               Options{}
                  .MenuEnabled(false)
                  .Format(strFormat1)
                  .Value(true, m_TimeSpan_Duration.GetSeconds().ToDouble()));
            m_pTimeTextCtrl_Duration->SetName(_("Duration"));
            S.AddWindow(m_pTimeTextCtrl_Duration);
         }
         S.EndStatic();
      }
      S.EndVerticalLay();

      S.StartVerticalLay(true);
      {
         S.StartStatic(_("Automatic Save"), true);
         {
            // If checked, the project will be saved when the recording is completed
            m_pTimerAutoSaveCheckBoxCtrl = S.Id(ID_AUTOSAVE_CHECKBOX).AddCheckBox(_("Enable &Automatic Save?"),
                                                                                    (bAutoSave ? "true" : "false"));
            S.StartMultiColumn(3, wxEXPAND);
            {
               wxString sInitialValue = wxT("");
               AudacityProject* pProject = GetActiveProject();
               wxString sSaveValue = pProject->GetFileName();
               if (sSaveValue != wxEmptyString) {
                  m_fnAutoSaveFile.Assign(sSaveValue);
                  sInitialValue = _("Current Project");
               }
               S.AddPrompt(_("Save Project As:"));
               m_pTimerSavePathTextCtrl = NewPathControl(this, ID_AUTOSAVEPATH_TEXT, _("Save Project As:"), sInitialValue);
               m_pTimerSavePathTextCtrl->SetEditable(false);
               S.AddWindow(m_pTimerSavePathTextCtrl);
               m_pTimerSavePathButtonCtrl = S.Id(ID_AUTOSAVEPATH_BUTTON).AddButton(_("Select..."));
               }
            S.EndMultiColumn();
         }
         S.EndStatic();

         S.StartStatic(_("Automatic Export"), true);
         {
            m_pTimerAutoExportCheckBoxCtrl = S.Id(ID_AUTOEXPORT_CHECKBOX).AddCheckBox(_("Enable Automatic &Export?"), (bAutoExport ? "true" : "false"));
            S.StartMultiColumn(3, wxEXPAND);
            {
               S.AddPrompt(_("Export Project As:"));
               m_pTimerExportPathTextCtrl = NewPathControl(this, ID_AUTOEXPORTPATH_TEXT, _("Export Project As:"), wxT(""));
               m_pTimerExportPathTextCtrl->SetEditable(false);
               S.AddWindow(m_pTimerExportPathTextCtrl);
               m_pTimerExportPathButtonCtrl = S.Id(ID_AUTOEXPORTPATH_BUTTON).AddButton(_("Select..."));
            }
            S.EndMultiColumn();
         }
         S.EndStatic();

         S.StartStatic(_("Options"), true);
         {

            wxArrayString arrayOptions;
            arrayOptions.Add(_("Do nothing"));
            arrayOptions.Add(_("Exit Audacity"));
            arrayOptions.Add(_("Restart system"));
            arrayOptions.Add(_("Shutdown system"));

            m_sTimerAfterCompleteOptionsArray.Add(arrayOptions.Item(0));
            m_sTimerAfterCompleteOptionsArray.Add(arrayOptions.Item(1));
#ifdef __WINDOWS__
            m_sTimerAfterCompleteOptionsArray.Add(arrayOptions.Item(2));
            m_sTimerAfterCompleteOptionsArray.Add(arrayOptions.Item(3));
#endif
            m_sTimerAfterCompleteOption = arrayOptions.Item(iPostTimerRecordAction);

            m_pTimerAfterCompleteChoiceCtrl = S.AddChoice(_("After Recording completes:"),
                                                          m_sTimerAfterCompleteOption,
                                                          &m_sTimerAfterCompleteOptionsArray);
         }
         S.EndStatic();

      }
      S.EndVerticalLay();
   }
   S.EndMultiColumn();

   // MY: Added the help button here
   S.AddStandardButtons(eOkButton | eCancelButton | eHelpButton);

   Layout();
   Fit();
   SetMinSize(GetSize());
   Center();

   EnableDisableAutoControls(bAutoSave, CONTROL_GROUP_SAVE);
   EnableDisableAutoControls(bAutoExport, CONTROL_GROUP_EXPORT);
}
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;
}
Beispiel #19
0
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;
}
Beispiel #20
0
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();
}
Beispiel #21
0
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 ExportFFmpegOptions::PopulateOrExchange(ShuttleGui & S)
{
   S.StartVerticalLay(1);
   S.StartMultiColumn(7, wxEXPAND);
   {
      S.SetStretchyCol(1);
      mPresetCombo = S.Id(FEPresetID).AddCombo(_("Preset:"), gPrefs->Read(wxT("/FileFormats/FFmpegPreset"),wxEmptyString), mPresetNames);
      mLoadPreset = S.Id(FELoadPresetID).AddButton(_("Load Preset"));
      mSavePreset = S.Id(FESavePresetID).AddButton(_("Save Preset"));
      mDeletePreset = S.Id(FEDeletePresetID).AddButton(_("Delete Preset"));
      mImportPresets = S.Id(FEImportPresetsID).AddButton(_("Import Presets"));
      mExportPresets = S.Id(FEExportPresetsID).AddButton(_("Export Presets"));
   }
   S.EndMultiColumn();
   S.StartTwoColumn();
   {
      S.Id(FEFormatLabelID).AddVariableText(_("Format:"));
      mFormatName = S.Id(FEFormatNameID).AddVariableText(wxT(""));
      S.Id(FECodecLabelID).AddVariableText(_("Codec:"));
      mCodecName = S.Id(FECodecNameID).AddVariableText(wxT(""));
   }
   S.EndTwoColumn();
   S.AddVariableText(_("Not all formats and codecs are compatible. Some parameters (such as bitrate and samplerate) combinations are not compatible with some codecs too."),false);
   S.StartMultiColumn(3,wxEXPAND);
   {
      S.AddVariableText(_("Format selector:"),true);
      S.AddVariableText(_("Codec selector:"),true);
      S.AddVariableText(wxEmptyString);
      S.Id(FEAllFormatsID).AddButton(_("Show All Formats"));
      S.Id(FEAllCodecsID).AddButton(_("Show All Codecs"));
      S.AddVariableText(wxEmptyString);
      mFormatList = S.Id(FEFormatID).AddListBox(&mFormatNames);
      mCodecList = S.Id(FECodecID).AddListBox(&mCodecNames);
      mFormatList->DeselectAll();
      mCodecList->DeselectAll();

      S.StartStatic(wxT("Options"),0);
      {
         S.StartMultiColumn(4,wxALIGN_LEFT);
         {
            mLanguageText = S.Id(FELanguageID).TieTextBox(_("Language:"), wxT("/FileFormats/FFmpegLanguage"), wxEmptyString, 0);
            mLanguageText->SetToolTip(_("ISO 639 3-letter language code\nOptional\nempty - automatic"));

            mTag = S.Id(FETagID).TieTextBox(_("Tag:"), wxT("/FileFormats/FFmpegTag"), wxEmptyString, 0);
            mTag->SetToolTip(_("Codec tag (FOURCC)\nOptional\nempty - automatic"));

            mBitrateSpin = S.Id(FEBitrateID).TieSpinCtrl(_("Bit Rate:"), wxT("/FileFormats/FFmpegBitRate"), 0,1000000,0);
            mBitrateSpin->SetToolTip(_("Bit Rate (bits/second) - influences the resulting file size and quality\nSome codecs may only accept specific values (128k, 192k, 256k etc)\n0 - automatic\nRecommended - 192000"));

            mQualitySpin = S.Id(FEQualityID).TieSpinCtrl(_("Quality:"), wxT("/FileFormats/FFmpegQuality"), 0,500,-1);
            mQualitySpin->SetToolTip(_("Overral quality, used differently by different codecs\nRequired for vorbis\n0 - automatic\n-1 - off (use bitrate instead)"));

            mSampleRateSpin = S.Id(FESampleRateID).TieSpinCtrl(_("Sample Rate:"), wxT("/FileFormats/FFmpegSampleRate"), 0,200000,0);
            mSampleRateSpin->SetToolTip(_("Sample rate (Hz)\n0 - don't change sample rate"));

            mCutoffSpin = S.Id(FECutoffID).TieSpinCtrl(_("Cutoff Bandwidth:"), wxT("/FileFormats/FFmpegCutOff"), 0,10000000,0);
            mCutoffSpin->SetToolTip(_("Audio cutoff bandwidth (Hz)\nOptional\n0 - automatic\n"));

            S.AddVariableText(wxT("Use Bit Reservoir"));
            S.Id(FEBitReservoirID).TieCheckBox(wxEmptyString, wxT("/FileFormats/FFmpegBitReservoir"), true);

            mProfileChoice = S.Id(FEProfileID).TieChoice(_("Profile:"), wxT("/FileFormats/FFmpegAACProfile"), 
               mProfileLabels[0], mProfileNames, mProfileLabels);
            mProfileChoice->SetToolTip(_("AAC Profile\nLow Complexity -default\nMost players won't play anything other than LC"));


         }
         S.EndMultiColumn();
         S.StartStatic(wxT("FLAC options"),0);
         {
            S.StartMultiColumn(4);
            {
               mCompressionLevelSpin = S.Id(FECompLevelID).TieSpinCtrl(_("Compression Level:"), wxT("/FileFormats/FFmpegCompLevel"), 0,10,-1);
               mCompressionLevelSpin->SetToolTip(_("Compression level\nRequired for FLAC\n-1 - automatic\nmin - 0 (fast encoding, large output file)\nmax - 10 (slow encoding, small output file)"));

               mFrameSizeSpin =  S.Id(FEFrameSizeID).TieSpinCtrl(_("Frame Size:"), wxT("/FileFormats/FFmpegFrameSize"), 0,65535,0);
               mFrameSizeSpin->SetToolTip(_("Frame size\nOptional\n0 - default\nmin - 16\nmax - 65535"));

               mLPCCoeffsPrecisionSpin = S.Id(FELPCCoeffsID).TieSpinCtrl(_("LPC coefficients precision"), wxT("/FileFormats/FFmpegLPCCoefPrec"), 0,15,0);
               mLPCCoeffsPrecisionSpin->SetToolTip(_("LPC coefficients precision\nOptional\n0 - default\nmin - 1\nmax - 15"));

               mMinPredictionOrderSpin = S.Id(FEMinPredID).TieSpinCtrl(_("Minimal prediction order"), wxT("/FileFormats/FFmpegMinPredOrder"), -1,32,-1);
               mMinPredictionOrderSpin->SetToolTip(_("Minimal prediction order\nOptional\n-1 - default\nmin - 0\nmax - 32 (with LPC) or 4 (without LPC)"));

               mMaxPredictionOrderSpin = S.Id(FEMaxPredID).TieSpinCtrl(_("Maximal prediction order"), wxT("/FileFormats/FFmpegMaxPredOrder"), -1,32,-1);
               mMaxPredictionOrderSpin->SetToolTip(_("Maximal prediction order\nOptional\n-1 - default\nmin - 0\nmax - 32 (with LPC) or 4 (without LPC)"));

               mPredictionOrderMethodChoice = S.Id(FEPredOrderID).TieChoice(_("Prediction Order Method:"), wxT("/FileFormats/FFmpegPredOrderMethod"), 
                  mPredictionOrderMethodLabels[4], mPredictionOrderMethodNames, mPredictionOrderMethodLabels);
               mProfileChoice->SetToolTip(_("Prediction Order Method\nEstimate - fastest, lower compression\nLog search - slowest, best compression\nFull search - default"));

               mMinPartitionOrderSpin = S.Id(FEMinPartOrderID).TieSpinCtrl(_("Minimal partition order"), wxT("/FileFormats/FFmpegMinPartOrder"), -1,8,-1);
               mMinPartitionOrderSpin->SetToolTip(_("Minimal partition order\nOptional\n-1 - default\nmin - 0\nmax - 8"));

               mMaxPartitionOrderSpin = S.Id(FEMaxPartOrderID).TieSpinCtrl(_("Maximal partition order"), wxT("/FileFormats/FFmpegMaxPredOrder"), -1,8,-1);
               mMaxPartitionOrderSpin->SetToolTip(_("Maximal partition order\nOptional\n-1 - default\nmin - 0\nmax - 8"));

               S.AddVariableText(wxT("Use LPC"));
               S.Id(FEUseLPCID).TieCheckBox(wxEmptyString, wxT("/FileFormats/FFmpegUseLPC"), true);
               
            }
            S.EndMultiColumn();
         }
         S.EndStatic();
         S.StartStatic(wxT("MPEG container options"),0);
         {
            S.StartMultiColumn(4);
            {
               mMuxRate = S.Id(FEMuxRateID).TieSpinCtrl(_("Mux Rate:"), wxT("/FileFormats/FFmpegMuxRate"), 0,10000000,0);
               mMuxRate->SetToolTip(_("Maximum bit rate of the multiplexed stream\nOptional\n0 - default"));

               mPacketSize = S.Id(FEPacketSizeID).TieSpinCtrl(_("Packet Size:"), wxT("/FileFormats/FFmpegPacketSize"), 0,10000000,0);
               mPacketSize->SetToolTip(_("Packet size\nOptional\n0 - default"));
            }
            S.EndMultiColumn();
         }
         S.EndStatic();
      }
      S.EndStatic();
   }
   S.EndTwoColumn();
   S.EndVerticalLay();

   S.AddStandardButtons();

   Layout();
   Fit();
   SetMinSize(GetSize());
   Center();

   return;
}
Beispiel #23
0
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();
}
Beispiel #24
0
/// 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();
}
Beispiel #25
0
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;
}
Beispiel #26
0
void EffectDistortion::PopulateOrExchange(ShuttleGui & S)
{
   S.AddSpace(0, 5);
   S.StartVerticalLay();
   {
      S.StartMultiColumn(4, wxCENTER);
      {
         mTypeChoiceCtrl = S.Id(ID_Type).AddChoice(_("Distortion type:"), wxT(""), &mTableTypes);
         mTypeChoiceCtrl->SetValidator(wxGenericValidator(&mParams.mTableChoiceIndx));
         S.SetSizeHints(-1, -1);

         mDCBlockCheckBox = S.Id(ID_DCBlock).AddCheckBox(_("DC blocking filter"),
                                       DEF_DCBlock ? wxT("true") : wxT("false"));
      }
      S.EndMultiColumn();
      S.AddSpace(0, 10);


      S.StartStatic(_("Threshold controls"));
      {
         S.StartMultiColumn(4, wxEXPAND);
         S.SetStretchyCol(2);
         {
            // Allow space for first Column
            S.AddSpace(250,0); S.AddSpace(0,0); S.AddSpace(0,0); S.AddSpace(0,0); 

            // Upper threshold control
            mThresholdTxt = S.AddVariableText(defaultLabel[0], false, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT);
            FloatingPointValidator<double> vldThreshold(2, &mParams.mThreshold_dB);
            vldThreshold.SetRange(MIN_Threshold_dB, MAX_Threshold_dB);
            mThresholdT = S.Id(ID_Threshold).AddTextBox(wxT(""), wxT(""), 10);
            mThresholdT->SetName(defaultLabel[0]);
            mThresholdT->SetValidator(vldThreshold);

            S.SetStyle(wxSL_HORIZONTAL);
            double maxLin = DB_TO_LINEAR(MAX_Threshold_dB) * SCL_Threshold_dB;
            double minLin = DB_TO_LINEAR(MIN_Threshold_dB) * SCL_Threshold_dB;
            mThresholdS = S.Id(ID_Threshold).AddSlider(wxT(""), 0, maxLin, minLin);
            mThresholdS->SetName(defaultLabel[0]);
            S.AddSpace(20, 0);

            // Noise floor control
            mNoiseFloorTxt = S.AddVariableText(defaultLabel[1], false, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT);
            FloatingPointValidator<double> vldfloor(2, &mParams.mNoiseFloor);
            vldfloor.SetRange(MIN_NoiseFloor, MAX_NoiseFloor);
            mNoiseFloorT = S.Id(ID_NoiseFloor).AddTextBox(wxT(""), wxT(""), 10);
            mNoiseFloorT->SetName(defaultLabel[1]);
            mNoiseFloorT->SetValidator(vldfloor);

            S.SetStyle(wxSL_HORIZONTAL);
            mNoiseFloorS = S.Id(ID_NoiseFloor).AddSlider(wxT(""), 0, MAX_NoiseFloor, MIN_NoiseFloor);
            mNoiseFloorS->SetName(defaultLabel[1]);
            S.AddSpace(20, 0);
         }
         S.EndMultiColumn();
      }
      S.EndStatic();

      S.StartStatic(_("Parameter controls"));
      {
         S.StartMultiColumn(4, wxEXPAND);
         S.SetStretchyCol(2);
         {
            // Allow space for first Column
            S.AddSpace(250,0); S.AddSpace(0,0); S.AddSpace(0,0); S.AddSpace(0,0); 

            // Parameter1 control
            mParam1Txt = S.AddVariableText(defaultLabel[2], false, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT);
            FloatingPointValidator<double> vldparam1(2, &mParams.mParam1);
            vldparam1.SetRange(MIN_Param1, MAX_Param1);
            mParam1T = S.Id(ID_Param1).AddTextBox(wxT(""), wxT(""), 10);
            mParam1T->SetName(defaultLabel[2]);
            mParam1T->SetValidator(vldparam1);

            S.SetStyle(wxSL_HORIZONTAL);
            mParam1S = S.Id(ID_Param1).AddSlider(wxT(""), 0, MAX_Param1, MIN_Param1);
            mParam1S->SetName(defaultLabel[2]);
            S.AddSpace(20, 0);

            // Parameter2 control
            mParam2Txt = S.AddVariableText(defaultLabel[3], false, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT);
            FloatingPointValidator<double> vldParam2(2, &mParams.mParam2);
            vldParam2.SetRange(MIN_Param2, MAX_Param2);
            mParam2T = S.Id(ID_Param2).AddTextBox(wxT(""), wxT(""), 10);
            mParam2T->SetName(defaultLabel[3]);
            mParam2T->SetValidator(vldParam2);

            S.SetStyle(wxSL_HORIZONTAL);
            mParam2S = S.Id(ID_Param2).AddSlider(wxT(""), 0, MAX_Param2, MIN_Param2);
            mParam2S->SetName(defaultLabel[3]);
            S.AddSpace(20, 0);

            // Repeats control
            mRepeatsTxt = S.AddVariableText(defaultLabel[4], false, wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT);
            IntegerValidator<int>vldRepeats(&mParams.mRepeats);
            vldRepeats.SetRange(MIN_Repeats, MAX_Repeats);
            mRepeatsT = S.Id(ID_Repeats).AddTextBox(wxT(""), wxT(""), 10);
            mRepeatsT->SetName(defaultLabel[4]);
            mRepeatsT->SetValidator(vldRepeats);

            S.SetStyle(wxSL_HORIZONTAL);
            mRepeatsS = S.Id(ID_Repeats).AddSlider(wxT(""), DEF_Repeats, MAX_Repeats, MIN_Repeats);
            mRepeatsS->SetName(defaultLabel[4]);
            S.AddSpace(20, 0);
         }
         S.EndMultiColumn();
      }
      S.EndStatic();
   }
   S.EndVerticalLay();

   return;
}
void TimerRecordDialog::PopulateOrExchange(ShuttleGui& S)
{
   S.SetBorder(5);
   S.StartVerticalLay(true);
   {
      wxString strFormat = wxT("099 h 060 m 060 s");
      S.StartStatic(_("Start Date and Time"), true);
      {
         m_pDatePickerCtrl_Start = 
            new wxDatePickerCtrl(this, // wxWindow *parent, 
                                 ID_DATEPICKER_START, // wxWindowID id, 
                                 m_DateTime_Start); // const wxDateTime& dt = wxDefaultDateTime, 
                                 // const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDP_DEFAULT | wxDP_SHOWCENTURY, const wxValidator& validator = wxDefaultValidator, const wxString& name = "datectrl")
         m_pDatePickerCtrl_Start->SetName(_("Start Date"));
         m_pDatePickerCtrl_Start->SetRange(wxDateTime::Today(), wxInvalidDateTime); // No backdating.
         S.AddWindow(m_pDatePickerCtrl_Start);

         m_pTimeTextCtrl_Start = new TimeTextCtrl(this, ID_TIMETEXT_START, strFormat);
         m_pTimeTextCtrl_Start->SetName(_("Start Time"));
         m_pTimeTextCtrl_Start->SetTimeValue(wxDateTime_to_AudacityTime(m_DateTime_Start));
         S.AddWindow(m_pTimeTextCtrl_Start);
         m_pTimeTextCtrl_Start->EnableMenu(false);
      }
      S.EndStatic();

      S.StartStatic(_("End Date and Time"), true);
      {
         m_pDatePickerCtrl_End = 
            new wxDatePickerCtrl(this, // wxWindow *parent, 
                                 ID_DATEPICKER_END, // wxWindowID id, 
                                 m_DateTime_End); // const wxDateTime& dt = wxDefaultDateTime, 
                                 // const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDP_DEFAULT | wxDP_SHOWCENTURY, const wxValidator& validator = wxDefaultValidator, const wxString& name = "datectrl")
         m_pDatePickerCtrl_End->SetRange(m_DateTime_Start, wxInvalidDateTime); // No backdating.
         m_pDatePickerCtrl_End->SetName(_("End Date"));
         S.AddWindow(m_pDatePickerCtrl_End);

         m_pTimeTextCtrl_End = new TimeTextCtrl(this, ID_TIMETEXT_END, strFormat);
         m_pTimeTextCtrl_End->SetName(_("End Time"));
         m_pTimeTextCtrl_End->SetTimeValue(wxDateTime_to_AudacityTime(m_DateTime_End));
         S.AddWindow(m_pTimeTextCtrl_End);
         m_pTimeTextCtrl_End->EnableMenu(false);
      }
      S.EndStatic();

      S.StartStatic(_("Duration"), true);
      {
         wxString strFormat1 = wxT("099 days 024 h 060 m 060 s");
         m_pTimeTextCtrl_Duration = new TimeTextCtrl(this, ID_TIMETEXT_DURATION, strFormat1);
         m_pTimeTextCtrl_Duration->SetName(_("Duration"));
         m_pTimeTextCtrl_Duration->SetTimeValue(
            Internat::CompatibleToDouble(m_TimeSpan_Duration.GetSeconds().ToString())); //v milliseconds?
         S.AddWindow(m_pTimeTextCtrl_Duration);
         m_pTimeTextCtrl_Duration->EnableMenu(false);
      }
      S.EndStatic();
   }
   S.EndVerticalLay();
   
   S.AddStandardButtons();

   Layout();
   Fit();
   SetMinSize(GetSize());
   Center();
}
void TimerRecordDialog::PopulateOrExchange(ShuttleGui& S)
{
   S.SetBorder(5);
   S.StartVerticalLay(true);
   {
      /* i18n-hint: This string is used to configure the controls for times when the recording is
       * started and stopped. As such it is important that only the alphabetic parts of the string
       * are translated, with the numbers left exactly as they are.
       * The 'h' indicates the first number displayed is hours, the 'm' indicates the second number
       * displayed is minutes, and the 's' indicates that the third number displayed is seconds.
       */
      wxString strFormat = _("099 h 060 m 060 s");
      S.StartStatic(_("Start Date and Time"), true);
      {
         m_pDatePickerCtrl_Start = 
            new wxDatePickerCtrl(this, // wxWindow *parent, 
                                 ID_DATEPICKER_START, // wxWindowID id, 
                                 m_DateTime_Start); // const wxDateTime& dt = wxDefaultDateTime, 
                                 // const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDP_DEFAULT | wxDP_SHOWCENTURY, const wxValidator& validator = wxDefaultValidator, const wxString& name = "datectrl")
         m_pDatePickerCtrl_Start->SetName(_("Start Date"));
         m_pDatePickerCtrl_Start->SetRange(wxDateTime::Today(), wxInvalidDateTime); // No backdating.
         S.AddWindow(m_pDatePickerCtrl_Start);

         m_pTimeTextCtrl_Start = new TimeTextCtrl(this, ID_TIMETEXT_START);
         m_pTimeTextCtrl_Start->SetName(_("Start Time"));
         m_pTimeTextCtrl_Start->SetFormatString(strFormat);
         m_pTimeTextCtrl_Start->SetTimeValue(wxDateTime_to_AudacityTime(m_DateTime_Start));
         S.AddWindow(m_pTimeTextCtrl_Start);
         m_pTimeTextCtrl_Start->EnableMenu(false);
      }
      S.EndStatic();

      S.StartStatic(_("End Date and Time"), true);
      {
         m_pDatePickerCtrl_End = 
            new wxDatePickerCtrl(this, // wxWindow *parent, 
                                 ID_DATEPICKER_END, // wxWindowID id, 
                                 m_DateTime_End); // const wxDateTime& dt = wxDefaultDateTime, 
                                 // const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDP_DEFAULT | wxDP_SHOWCENTURY, const wxValidator& validator = wxDefaultValidator, const wxString& name = "datectrl")
         m_pDatePickerCtrl_End->SetRange(m_DateTime_Start, wxInvalidDateTime); // No backdating.
         m_pDatePickerCtrl_End->SetName(_("End Date"));
         S.AddWindow(m_pDatePickerCtrl_End);

         m_pTimeTextCtrl_End = new TimeTextCtrl(this, ID_TIMETEXT_END);
         m_pTimeTextCtrl_End->SetName(_("End Time"));
         m_pTimeTextCtrl_End->SetFormatString(strFormat);
         m_pTimeTextCtrl_End->SetTimeValue(wxDateTime_to_AudacityTime(m_DateTime_End));
         S.AddWindow(m_pTimeTextCtrl_End);
         m_pTimeTextCtrl_End->EnableMenu(false);
      }
      S.EndStatic();

      S.StartStatic(_("Duration"), true);
      {
         /* i18n-hint: This string is used to configure the controls which shows the recording
          * duration. As such it is important that only the alphabetic parts of the string
          * are translated, with the numbers left exactly as they are.
          * The string 'days' indicates that the first number in the control will be the number of days,
          * then the 'h' indicates the second number displayed is hours, the 'm' indicates the third
          * number displayed is minutes, and the 's' indicates that the fourth number displayed is
          * seconds.
          */
         wxString strFormat1 = _("099 days 024 h 060 m 060 s");
         m_pTimeTextCtrl_Duration = new TimeTextCtrl(this, ID_TIMETEXT_DURATION);
         m_pTimeTextCtrl_Duration->SetName(_("Duration"));
         m_pTimeTextCtrl_Duration->SetFormatString(strFormat1);
         m_pTimeTextCtrl_Duration->SetTimeValue(m_TimeSpan_Duration.GetSeconds().ToDouble());
         S.AddWindow(m_pTimeTextCtrl_Duration);
         m_pTimeTextCtrl_Duration->EnableMenu(false);
      }
      S.EndStatic();
   }
   S.EndVerticalLay();
   
   S.AddStandardButtons();

   Layout();
   Fit();
   SetMinSize(GetSize());
   Center();
}
Beispiel #29
0
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;
}
Beispiel #30
0
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;
}