Example #1
0
void ModulePrefs::PopulateOrExchange(ShuttleGui & S)
{
  wxArrayString StatusChoices;
   StatusChoices.Add( _("Disabled" ) );
   StatusChoices.Add( _("Enabled" ) );
   StatusChoices.Add( _("Ask" ) );
   StatusChoices.Add( _("Failed" ) );
   StatusChoices.Add( _("New" ) );
   S.SetBorder(2);

   S.StartStatic(_(""));
   {
      S.AddFixedText(_("These are experimental Modules. Enable them only if you've read the manual\nand know what you are doing.") );
      S.AddFixedText(wxString(wxT("  ")) + _("'Ask' means Audacity will ask if you want to load the plug-each time it starts.") );
      S.AddFixedText(wxString(wxT("  ")) + _("'Failed' means Audacity thinks the plug-in is broken and won't run it.") );
      S.AddFixedText(wxString(wxT("  ")) + _("'New' is like 'Ask', but asks just once.") );
      S.StartMultiColumn( 2 );
      int i;
      for(i=0;i<(int)mModules.GetCount();i++)
         S.TieChoice( mModules[i], mStatuses[i], &StatusChoices );
      S.EndMultiColumn();
lse);
   }
   S.EndStatic();
}
Example #2
0
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();
}
Example #3
0
void DtmfDialog::PopulateOrExchange( ShuttleGui & S )
{
   wxTextValidator vldDtmf(wxFILTER_INCLUDE_CHAR_LIST);
   vldDtmf.SetIncludes(wxArrayString(42, dtmfSymbols));

   S.AddTitle(_("by Salvo Ventura"));

   S.StartMultiColumn(2, wxEXPAND);
   {
      mDtmfStringT = S.Id(ID_DTMF_STRING_TEXT).AddTextBox(_("DTMF sequence:"), wxT(""), 10);
      mDtmfStringT->SetValidator(vldDtmf);

      // The added colon to improve visual consistency was placed outside 
      // the translatable strings to avoid breaking translations close to 2.0. 
      // TODO: Make colon part of the translatable string after 2.0.
      S.TieNumericTextBox(_("Amplitude (0-1)") + wxString(wxT(":")),  dAmplitude, 10);

      S.AddPrompt(_("Duration:"));
      if (mDtmfDurationT == NULL)
      {
         mDtmfDurationT = new
            TimeTextCtrl(this,
                         ID_DTMF_DURATION_TEXT,
                         wxT(""),
                         dDuration,
                         mEffect->mProjectRate,
                         wxDefaultPosition,
                         wxDefaultSize,
                         true);
         /* use this instead of "seconds" because if a selection is passed to the
         * effect, I want it (dDuration) to be used as the duration, and with
         * "seconds" this does not always work properly. For example, it rounds
         * down to zero... */
         mDtmfDurationT->SetName(_("Duration"));
         mDtmfDurationT->SetFormatString(mDtmfDurationT->GetBuiltinFormat(dIsSelection==true?(_("hh:mm:ss + samples")):(_("hh:mm:ss + milliseconds"))));
         mDtmfDurationT->EnableMenu();
      }
      S.AddWindow(mDtmfDurationT);

      S.AddFixedText(_("Tone/silence ratio:"), false);
      S.SetStyle(wxSL_HORIZONTAL | wxEXPAND);
      mDtmfDutyS = S.Id(ID_DTMF_DUTYCYCLE_SLIDER).AddSlider(wxT(""), (int)dDutyCycle, DUTY_MAX, DUTY_MIN);

      S.SetSizeHints(-1,-1);
   }
   S.EndMultiColumn();

   S.StartMultiColumn(2, wxCENTER);
   {
      S.AddFixedText(_("Duty cycle:"), false);
      mDtmfDutyT = S.Id(ID_DTMF_DUTYCYCLE_TEXT).AddVariableText(wxString::Format(wxT("%.1f %%"), (float) dDutyCycle/DUTY_SCALE), false);
      S.AddFixedText(_("Tone duration:"), false);
      mDtmfSilenceT = S.Id(ID_DTMF_TONELEN_TEXT).AddVariableText(wxString::Format(wxString(wxT("%d ")) + _("ms"),  (int) dTone * 1000), false);
      S.AddFixedText(_("Silence duration:"), false);
      mDtmfToneT = S.Id(ID_DTMF_SILENCE_TEXT).AddVariableText(wxString::Format(wxString(wxT("%d ")) + _("ms"), (int) dSilence * 1000), false);
   }
   S.EndMultiColumn();
}
Example #4
0
void DtmfDialog::PopulateOrExchange( ShuttleGui & S )
{
   wxTextValidator vldDtmf(wxFILTER_INCLUDE_CHAR_LIST);
   vldDtmf.SetIncludes(wxArrayString(20, dtmfSymbols));

   S.AddTitle(_("by Salvo Ventura (2006)"));

   S.StartMultiColumn(2, wxEXPAND);
   {
      mDtmfStringT = S.Id(ID_DTMF_STRING_TEXT).AddTextBox(_("DTMF sequence:"), wxT(""), 10);
      mDtmfStringT->SetValidator(vldDtmf);

      S.AddPrompt(_("DTMF duration:"));
      mDtmfDurationT = new
         TimeTextCtrl(this,
                      ID_DTMF_DURATION_TEXT,
                      /*
                      use this instead of "seconds" because if a selection is passed to the effect,
                      I want it (dDuration) to be used as the duration, and with "seconds" this does
                      not always work properly. For example, it rounds down to zero...
                      */
                      TimeTextCtrl::GetBuiltinFormat(dIsSelection==true?(wxT("hh:mm:ss + samples")):(wxT("seconds"))),
                      dDuration,
                      44100,
                      wxDefaultPosition,
                      wxDefaultSize,
                      true);
      S.AddWindow(mDtmfDurationT);
      mDtmfDurationT->EnableMenu();

      S.AddFixedText(_("Tone/silence ratio:"), false);
      S.SetStyle(wxSL_HORIZONTAL | wxEXPAND);
      mDtmfDutyS = S.Id(ID_DTMF_DUTYCYCLE_SLIDER).AddSlider(wxT(""), (int)dDutyCycle, DUTY_MAX);
      mDtmfDutyS->SetRange(DUTY_MIN, DUTY_MAX);

      S.SetSizeHints(-1,-1);
   }
   S.EndMultiColumn();

   S.StartMultiColumn(2, wxCENTER);
   {
      S.AddFixedText(_("Duty cycle:"), false);
      mDtmfDutyT = S.Id(ID_DTMF_DUTYCYCLE_TEXT).AddVariableText(wxString::Format(wxT("%.1f %%"), (float) dDutyCycle/DUTY_SCALE), false);
      S.AddFixedText(_("Tone duration:"), false);
      mDtmfSilenceT = S.Id(ID_DTMF_TONELEN_TEXT).AddVariableText(wxString::Format(wxString(wxT("%d ")) + _("ms"),  (int) dTone * 1000), false);
      S.AddFixedText(_("Silence duration:"), false);
      mDtmfToneT = S.Id(ID_DTMF_SILENCE_TEXT).AddVariableText(wxString::Format(wxString(wxT("%d ")) + _("ms"), (int) dSilence * 1000), false);
   }
   S.EndMultiColumn();
}
Example #5
0
/// Populates more complex dialog that has a chirp.
void ToneGenDialog::PopulateOrExchangeExtended( ShuttleGui & S )
{
   S.StartMultiColumn(2, wxCENTER);
   {
      S.TieChoice( _("Waveform:"), waveform,  waveforms);
      S.SetSizeHints(-1,-1);
   }
   S.EndMultiColumn();
   S.StartMultiColumn(3, wxCENTER);
   {
      S.AddFixedText(wxT(""));
      S.AddTitle( _("Start"));
      S.AddTitle( _("End") );
      S.TieTextBox( _("Frequency / Hz"),frequency[0], 10);
      S.TieTextBox( wxT(""),frequency[1], 10);
      S.TieTextBox( _("Amplitude (0-1)"),amplitude[0], 10);
      S.TieTextBox( wxT(""),amplitude[1], 10);
   }
   S.EndMultiColumn();
   S.StartMultiColumn(2, wxCENTER);
   {
      S.TieTextBox( _("Length (seconds)"),length, 10 );
   }
   S.EndMultiColumn();
}
Example #6
0
void NoiseDialog::PopulateOrExchange( ShuttleGui & S )
{
   S.StartMultiColumn(2, wxCENTER);
   {
      S.AddFixedText(_("Duration"), false);
      if (mNoiseDurationT == NULL)
      {
         mNoiseDurationT = new
         TimeTextCtrl(this,
                      wxID_ANY,
                      wxT(""),
                      nDuration,
                      44100,
                      wxDefaultPosition,
                      wxDefaultSize,
                      true);
         /* use this instead of "seconds" because if a selection is passed to
          * the effect, I want it (nDuration) to be used as the duration, and
          * with "seconds" this does not always work properly. For example,
          * it rounds down to zero... */
         mNoiseDurationT->SetFormatString(mNoiseDurationT->GetBuiltinFormat(nIsSelection==true?(wxT("hh:mm:ss + samples")):(wxT("seconds"))));
         mNoiseDurationT->EnableMenu();
      }
      S.AddWindow(mNoiseDurationT);
      S.TieTextBox(_("Amplitude (0-1)"),  nAmplitude, 10);
      S.TieChoice(_("Noise type"), nType, nTypeList);
      S.SetSizeHints(-1, -1);
   }
   S.EndMultiColumn();
}
Example #7
0
void MidiIOPrefs::PopulateOrExchange( ShuttleGui & S ) {
   wxArrayString empty;

   S.SetBorder(2);

   S.StartStatic(_("Interface"));
   {
      S.StartMultiColumn(2);
      {
         S.Id(HostID);
         mHost = S.TieChoice(_("Host") + wxString(wxT(":")),
                             wxT("/MidiIO/Host"), 
                             wxT(""),
                             mHostNames,
                             mHostLabels);
         S.SetSizeHints(mHostNames);

         S.AddPrompt(_("Using:"));
         S.AddFixedText(wxString(Pa_GetVersionText(), wxConvLocal));
      }
      S.EndMultiColumn();
   }                              
   S.EndStatic();

   S.StartStatic(_("Playback"));
   {
      S.StartMultiColumn(2);
      {
         S.Id(PlayID);
         mPlay = S.AddChoice(_("Device") + wxString(wxT(":")),
                             wxEmptyString,
                             &empty);
      }
      S.EndMultiColumn();
   }
   S.EndStatic();

   S.StartStatic(_("Recording"));
   {
      S.StartMultiColumn(2);
      {
         S.Id(RecordID);
         mRecord = S.AddChoice(_("Device") + wxString(wxT(":")),
                               wxEmptyString,
                               &empty);

         S.Id(ChannelsID);
         /*
         mChannels = S.AddChoice(_("Channels") + wxString(wxT(":")),
                                 wxEmptyString,
                                 &empty);
         */
      }
      S.EndMultiColumn();
   }
   S.EndStatic();
}
Example #8
0
/// Normally in classes derived from PrefsPanel this function 
/// is used both to populate the panel and to exchange data with it.
/// With KeyConfigPrefs all the exchanges are handled specially,
/// so this is only used in populating the panel.
void KeyConfigPrefs::PopulateOrExchange(ShuttleGui & S)
{
   S.SetBorder(2);

   S.StartStatic(_("Key Bindings"), 1);
   {
      S.StartHorizontalLay(wxALIGN_CENTRE, false);
      {
         S.Id(CategoryID);
         mCat = S.AddChoice(_("C&ategory:"),
                            mCats[0],
                            &mCats);
      }
      S.EndHorizontalLay();
                                    
      mList = S.Id(CommandsListID).AddListControlReportMode();
      mList->SetName(_("Key Bindings"));

      S.StartThreeColumn();
      {
         if (!mKey) {
            mKey = new wxTextCtrl(this,
                                  CurrentComboID,
                                  wxT(""),
                                  wxDefaultPosition,
#if defined(__WXMAC__)                                  
                                  wxSize(300, -1));
#else
                                  wxSize(210, -1));
#endif
            mKey->Connect(wxEVT_KEY_DOWN,
                          wxKeyEventHandler(KeyConfigPrefs::OnCaptureKeyDown));
            mKey->Connect(wxEVT_CHAR,
                          wxKeyEventHandler(KeyConfigPrefs::OnCaptureChar));
         }
         S.AddWindow(mKey);

         /* i18n-hint: (verb)*/
         S.Id(SetButtonID).AddButton(_("Set"));
         S.Id(ClearButtonID).AddButton(_("Cl&ear"));
      }
      S.EndThreeColumn();

#if defined(__WXMAC__)
      S.AddFixedText(_("Note: Pressing Cmd+Q will quit. All other keys are valid."));
#endif

      S.StartThreeColumn();
      {
         S.Id(ImportButtonID).AddButton(_("&Import..."));
         S.Id(ExportButtonID).AddButton(_("&Export..."));
         S.Id(AssignDefaultsButtonID).AddButton(_("&Defaults"));
      }
      S.EndThreeColumn();
   }
Example #9
0
void ModulePrefs::PopulateOrExchange(ShuttleGui & S)
{
   wxArrayString StatusChoices;
   StatusChoices.Add( _("Disabled" ) );
   StatusChoices.Add( _("Enabled" ) );
   StatusChoices.Add( _("Ask" ) );
   StatusChoices.Add( _("Failed" ) );
   StatusChoices.Add( _("New" ) );
   S.SetBorder(2);

   S.StartStatic(wxT(""));
   {
      S.AddFixedText(_("These are experimental modules. Enable them only if you've read the Audacity Manual\nand know what you are doing.") );
      S.AddFixedText(wxString(wxT("  ")) + _("'Ask' means Audacity will ask if you want to load the module each time it starts.") );
      S.AddFixedText(wxString(wxT("  ")) + _("'Failed' means Audacity thinks the module is broken and won't run it.") );
      S.AddFixedText(wxString(wxT("  ")) + _("'New' means no choice has been made yet.") );
      S.AddFixedText(_("Changes to these settings only take effect when Audacity starts up."));
      S.StartScroller();
      {
        S.StartMultiColumn( 2 );
        int i;
        for(i=0;i<(int)mModules.GetCount();i++)
           S.TieChoice( mModules[i], mStatuses[i], &StatusChoices );
        S.EndMultiColumn();
      }
      if( mModules.GetCount() < 1 )
      {
        S.AddFixedText( _("No modules were found") );
      }
      S.EndScroller();
   }
   S.EndStatic();
}
Example #10
0
void DirectoriesPrefs::PopulateOrExchange(ShuttleGui & S)
{
   S.SetBorder(2);

   S.StartStatic(_("Temporary files directory"));
   {
      S.StartMultiColumn(3, wxEXPAND);
      {
         S.SetStretchyCol(1);

         S.Id(TempDirID);
         mTempDir = S.TieTextBox(_("&Location:"),
                                 wxT("/Directories/TempDir"),
                                 wxT(""),
                                 30);
         S.Id(ChooseButtonID);
         S.AddButton(_("C&hoose..."));

         S.AddFixedText(_("Free Space:"));
         mFreeSpace = S.AddVariableText(wxT(""));
      }
      S.EndMultiColumn();
   }
   S.EndStatic();

#ifdef DEPRECATED_AUDIO_CACHE
   // See http://bugzilla.audacityteam.org/show_bug.cgi?id=545.
   S.StartStatic(_("Audio cache"));
   {
      S.TieCheckBox(_("Play and/or record using &RAM (useful for slow drives)"),
                    wxT("/Directories/CacheBlockFiles"),
                    false);

      S.StartTwoColumn();
      {
         S.TieNumericTextBox(_("Mi&nimum Free Memory (MB):"),
                             wxT("/Directories/CacheLowMem"),
                             16,
                             9);
      }
      S.EndTwoColumn();

      S.AddVariableText(_("If the available system memory falls below this value, audio will no longer\nbe cached in memory and will be written to disk."))->Wrap(600);
   }
   S.EndStatic();
#endif // DEPRECATED_AUDIO_CACHE
}
Example #11
0
/// Populates more complex dialog that has a chirp.
void ToneGenDialog::PopulateOrExchangeExtended( ShuttleGui & S )
{
   S.StartMultiColumn(2, wxCENTER);
   {
      S.TieChoice(_("Waveform:"), waveform,  waveforms);
      S.SetSizeHints(-1, -1);
   }
   S.EndMultiColumn();
   S.StartMultiColumn(3, wxCENTER);
   {
      S.AddFixedText(wxT(""));
      S.AddTitle(_("Start"));
      S.AddTitle(_("End"));

      // The added colon to improve visual consistency was placed outside 
      // the translatable strings to avoid breaking translations close to 2.0. 
      // TODO: Make colon part of the translatable string after 2.0.
      S.TieNumericTextBox(_("Frequency (Hz)") + wxString(wxT(":")), frequency[0], 10)->SetName(_("Frequency Hertz Start"));
      S.TieNumericTextBox(wxT(""), frequency[1], 10)->SetName(_("Frequency Hertz End"));
      S.TieNumericTextBox(_("Amplitude (0-1)") + wxString(wxT(":")), amplitude[0], 10)->SetName(_("Amplitude Start"));
      S.TieNumericTextBox(wxT(""), amplitude[1], 10)->SetName(_("Amplitude End"));
   }
   S.EndMultiColumn();
   S.StartMultiColumn(2, wxCENTER);
   {
      S.TieChoice(_("Interpolation:"), interpolation,  interpolations);
      S.AddPrompt(_("Duration") + wxString(wxT(":")));
      if (mToneDurationT == NULL)
      {
         mToneDurationT = new
         TimeTextCtrl(this,
                      wxID_ANY,
                      wxT(""),
                      mDuration,
                      mEffect->mProjectRate,
                      wxDefaultPosition,
                      wxDefaultSize,
                      true);
         mToneDurationT->SetName(_("Duration"));
         mToneDurationT->SetFormatString(mToneDurationT->GetBuiltinFormat(isSelection==true?(_("hh:mm:ss + samples")):(_("seconds"))));
         mToneDurationT->EnableMenu();
      }
      S.AddWindow(mToneDurationT);
   }
   S.EndMultiColumn();
}
void DirectoriesPrefs::PopulateOrExchange(ShuttleGui & S)
{
   S.SetBorder(2);

   S.StartStatic(_("Temporary files directory"));
   {
      S.StartMultiColumn(3, wxEXPAND);
      {
         S.SetStretchyCol(1);

         S.Id(TempDirID);
         mTempDir = S.TieTextBox(_("Location:"),
                                 wxT("/Directories/TempDir"),
                                 wxT(""),
                                 30);
         S.Id(ChooseButtonID);
         S.AddButton(_("Choose..."));

         S.AddFixedText(_("Free Space:"));
         mFreeSpace = S.AddVariableText(wxT(""));
      }
      S.EndMultiColumn();
   }
   S.EndStatic();

   S.StartStatic(_("Audio cache"));
   {
      S.TieCheckBox(_("Play and/or record using RAM (useful for slow drives)"),
                    wxT("/Directories/CacheBlockFiles"),
                    false);

      S.StartTwoColumn();
      {
         S.TieTextBox(_("Minimum Free Memory (MB):"),
                      wxT("/Directories/CacheLowMem"),
                      16,
                      9);
      }
      S.EndTwoColumn();

      S.AddVariableText(_("If the available system memory falls below this value, audio will no longer\nbe cached in memory and will be written to disk."))->Wrap(600);
   }
   S.EndStatic();
}
void ModulePrefs::PopulateOrExchange(ShuttleGui & S)
{
   S.SetBorder(2);

   S.StartStatic(_("Enable these Modules (if present), next time Audacity is started"));
   {
      S.AddFixedText(_("These are experimental. Enable them only if you've read the manual\nand know what you are doing.") );
      S.TieCheckBox(_("mod-&script-pipe"),
                    wxT("/Module/mod-script-pipe"),
                    false);
      S.TieCheckBox(_("mod-&nyq-bench"),    
                    wxT("/Module/mod-nyq-bench"),
                    false);
      S.TieCheckBox(_("mod-&track-panel"),
                    wxT("/Module/mod-track-panel"),
                    false);
   }
   S.EndStatic();
}
Example #14
0
/// Normally in classes derived from PrefsPanel this function 
/// is used both to populate the panel and to exchange data with it.
/// With KeyConfigPrefs all the exchanges are handled specially,
/// so this is only used in populating the panel.
void KeyConfigPrefs::PopulateOrExchange( ShuttleGui & S )
{
   S.StartStatic( _("Key Bindings"), 1 );
   mList = S.Id( CommandsListID ).AddListControlReportMode();
   S.StartHorizontalLay( wxALIGN_LEFT, 0);
   {
      // LLL: Moved here from Populate.  On the Mac, the control
      //      would not accept focus when using the mouse, but it
      //      would when tabbing to the field.  Not really sure
      //      why...just glad it works now.  :-)

      // The SysKeyText ctrl is so special that we aren't
      // going to include it into Audacity's version of ShuttleGui.
      // So instead we create it here, and we can add it into 
      // the sizer scheme later...
      mCurrentComboText = new SysKeyTextCtrl(
            this, CurrentComboID, wxT(""),
            wxDefaultPosition, wxSize(115, -1), 0 );

      // AddWindow is a generic 'Add' for ShuttleGui.
      // It allows us to add 'foreign' controls.
      S.AddWindow( mCurrentComboText )->MoveAfterInTabOrder( mList );
      S.Id( SetButtonID ).AddButton( _("S&et"));
      S.Id( ClearButtonID ).AddButton( _("&Clear"));
   }
   S.EndHorizontalLay();
   #ifdef __WXMAC__
   S.AddFixedText( _("Note: Pressing Cmd+Q will quit. All other keys are valid."));
   #endif
   S.StartHorizontalLay( wxALIGN_LEFT, 0);
   {
      S.Id( AssignDefaultsButtonID ).AddButton( _("&Defaults"));
      S.Id( SaveButtonID ).AddButton( _("&Save..."));
      S.Id( LoadButtonID ).AddButton( _("&Load..."));
   }
   S.EndHorizontalLay();
   S.EndStatic();
   return;
}
Example #15
0
/// Normally in classes derived from PrefsPanel this function
/// is used both to populate the panel and to exchange data with it.
/// With KeyConfigPrefs all the exchanges are handled specially,
/// so this is only used in populating the panel.
void KeyConfigPrefs::PopulateOrExchange(ShuttleGui & S)
{
   S.SetBorder(2);

   S.StartStatic(_("Key Bindings"), 1);
   {
      S.StartMultiColumn(3, wxEXPAND);
      {
         S.SetStretchyCol(1);

         S.StartHorizontalLay(wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 0);
         {
            S.AddTitle(_("View by:"));
            S.StartRadioButtonGroup(wxT("/Prefs/KeyConfig/ViewBy"), wxT("tree"));
            {
               mViewByTree = S.Id(ViewByTreeID).TieRadioButton(_("&Tree"), wxT("tree"));
               mViewByTree->SetName(_("View by tree"));
               mViewByName = S.Id(ViewByNameID).TieRadioButton(_("&Name"), wxT("name"));
               mViewByName->SetName(_("View by name"));
               mViewByKey = S.Id(ViewByKeyID).TieRadioButton(_("&Key"), wxT("key"));
               mViewByKey->SetName(_("View by key"));
            }
            S.EndRadioButtonGroup();
         }
         S.EndHorizontalLay();

         S.StartHorizontalLay(wxALIGN_CENTER|wxALIGN_CENTER_VERTICAL, 0);
         {
            // just a spacer
         }
         S.EndHorizontalLay();

         S.StartHorizontalLay(wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 0);
         {
            mFilterLabel = S.AddVariableText(_("Searc&h:"));

            if (!mFilter) {
               mFilter = safenew wxTextCtrl(this,
                                        FilterID,
                                        wxT(""),
                                        wxDefaultPosition,
#if defined(__WXMAC__)
                                        wxSize(300, -1),
#else
                                        wxSize(210, -1),
#endif
                                        wxTE_PROCESS_ENTER);
               mFilter->SetName(wxStripMenuCodes(mFilterLabel->GetLabel()));
               mFilter->Connect(wxEVT_KEY_DOWN,
                                wxKeyEventHandler(KeyConfigPrefs::OnFilterKeyDown),
                                NULL,
                                this);
               mFilter->Connect(wxEVT_CHAR,
                                wxKeyEventHandler(KeyConfigPrefs::OnFilterChar),
                                NULL,
                                this);
            }
            S.AddWindow(mFilter, wxALIGN_NOT | wxALIGN_LEFT);
         }
         S.EndHorizontalLay();
      }
      S.EndThreeColumn();
      S.AddSpace(-1, 2);

      S.StartHorizontalLay(wxEXPAND, 1);
      {
         if (!mView) {
            mView = safenew KeyView(this, CommandsListID);
            mView->SetName(_("Bindings"));
         }
         S.Prop(true);
         S.AddWindow(mView, wxEXPAND);
      }
      S.EndHorizontalLay();

      S.StartThreeColumn();
      {
         if (!mKey) {
            mKey = safenew wxTextCtrl(this,
                                  CurrentComboID,
                                  wxT(""),
                                  wxDefaultPosition,
#if defined(__WXMAC__)
                                  wxSize(300, -1),
#else
                                  wxSize(210, -1),
#endif
                                  wxTE_PROCESS_ENTER);

            mKey->SetName(_("Short cut"));
            mKey->Connect(wxEVT_KEY_DOWN,
                          wxKeyEventHandler(KeyConfigPrefs::OnHotkeyKeyDown),
                          NULL,
                          this);
            mKey->Connect(wxEVT_CHAR,
                          wxKeyEventHandler(KeyConfigPrefs::OnHotkeyChar),
                          NULL,
                          this);
            mKey->Connect(wxEVT_KILL_FOCUS,
                          wxFocusEventHandler(KeyConfigPrefs::OnHotkeyKillFocus),
                          NULL,
                          this);
         }
         S.AddWindow(mKey);

         /* i18n-hint: (verb)*/
         mSet = S.Id(SetButtonID).AddButton(_("&Set"));
         mClear = S.Id(ClearButtonID).AddButton(_("Cl&ear"));
      }
      S.EndThreeColumn();

#if defined(__WXMAC__)
      S.AddFixedText(_("Note: Pressing Cmd+Q will quit. All other keys are valid."));
#endif

      S.StartThreeColumn();
      {
         S.Id(ImportButtonID).AddButton(_("&Import..."));
         S.Id(ExportButtonID).AddButton(_("&Export..."));
         S.Id(AssignDefaultsButtonID).AddButton(_("&Defaults"));
      }
      S.EndThreeColumn();
   }
   S.EndStatic();


   // Need to layout so that the KeyView is properly sized before populating.
   // Otherwise, the initial selection is not scrolled into view.
   Layout();
}
Example #16
0
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;
}
Example #17
0
void AudioIOPrefs::PopulateOrExchange( ShuttleGui & S )
{
   /// \todo
   /// JKC: I think setting paths in gPrefs is bad practice.
   /// Suppose we are using gPrefs from elsewhere at the same time?
   /// Change these all to full paths?
   gPrefs->SetPath(wxT("/AudioIO"));

   S.SetBorder( 2 );

   S.StartHorizontalLay(wxEXPAND, 0 );
   S.StartStatic( _("Playback"),1 );
   {
      S.StartMultiColumn(2, wxEXPAND);
      S.SetStretchyCol(1);
      S.TieChoice( _("Device") + wxString(wxT(":")), wxT("PlaybackDevice"), 
         wxT(""), mmPlayNames, mmPlayLabels );

      S.AddPrompt( _("Using:") );
      wxString ver = _("Portaudio v");
#if USE_PORTAUDIO_V19
      ver += wxT("19");
#else
      ver += wxT("18");
#endif
      S.AddFixedText( ver );
      S.EndMultiColumn();
   }                              
   S.EndStatic();
   S.StartStatic( _("Recording"), 1 );
   {
      S.StartMultiColumn(2, wxEXPAND);
      S.SetStretchyCol(1);
      S.TieChoice( _("Device") + wxString(wxT(":")), wxT("RecordingDevice"), 
         wxT(""), mmRecordNames, mmRecordLabels );
      S.TieChoice( _("Channels") + wxString(wxT(":")), wxT("RecordChannels"), 
         2, mmChannelNames, mmChannelLabels );
      S.EndMultiColumn();
   }
   S.EndStatic();
   S.EndHorizontalLay();
   S.StartStatic( _("Playthrough") );
   {
      S.TieCheckBox( _("&Play other tracks while recording new one"),
         wxT("Duplex"),true);
#ifdef __MACOSX__
      S.TieCheckBox( _("&Hardware Playthrough (Play new track while recording it)"),
         wxT("Playthrough"),false);
#endif
      S.TieCheckBox( _("&Software Playthrough (Play new track while recording it)"),
         wxT("SWPlaythrough"),false);
   }
   S.EndStatic();
   S.StartHorizontalLay( wxEXPAND, 0 );
   S.StartStatic( _("Cut Preview"),1 );
   {
      S.StartThreeColumn();
      S.TieTextBox( _("Play before cut region:"), wxT("CutPreviewBeforeLen"),1.0,9);
      S.AddUnits(  _("seconds") );
      S.TieTextBox( _("Play after cut region:"),wxT("CutPreviewAfterLen"), 1.0,9);
      S.AddUnits(  _("seconds") );
      S.EndThreeColumn();
   }
   S.EndStatic();
   S.StartStatic( _("Latency"),1 );
   {
      S.StartThreeColumn();
#if USE_PORTAUDIO_V19
      // only show the following controls if we use Portaudio v19, because
      // for Portaudio v19 we always use default buffer sizes
      S.TieTextBox( _("Audio to buffer:"),wxT("LatencyDuration"),100.0,9);
      S.AddUnits(  _("milliseconds") );
#endif
      S.TieTextBox( _("Latency correction:"),wxT("LatencyCorrection"),0.0,9);
      S.AddUnits(  _("milliseconds") );
      S.EndThreeColumn();
   }
   S.EndStatic();
   S.EndHorizontalLay();
   S.StartHorizontalLay( wxEXPAND, 0 );
   S.StartStatic( _("Seek Time"),1 );
   {
      S.StartThreeColumn();
      S.TieTextBox( _("Short period:"), wxT("SeekShortPeriod"),1.0,9);
      S.AddUnits(  _("seconds") );
      S.TieTextBox( _("Long period:"),wxT("SeekLongPeriod"), 15.0,9);
      S.AddUnits(  _("seconds") );
      S.EndThreeColumn();
   }
   S.EndStatic();
   S.StartStatic( _("Effects Preview"),1 );
   {
      S.StartThreeColumn();
      S.TieTextBox( _("Play when previewing:"), wxT("EffectsPreviewLen"), 3.0,9);
      S.AddUnits( _("seconds") );
      S.EndThreeColumn();
   }

   gPrefs->SetPath(wxT("/"));
}
Example #18
0
void QualityPrefs::PopulateOrExchange( ShuttleGui & S )
{
   S.SetBorder( 2 );
   S.StartStatic(_("Sampling"),0 );
   {
      S.StartTwoColumn();
      S.AddPrompt( _("Default Sample Rate:") );
      DefineSampleRateControl( S ); // A tricky control.
      S.TieChoice(_("Default Sample Format:"),
         wxT("/SamplingRate/DefaultProjectSampleFormat"),
         floatSample, mmSampleFormatNames, mmSampleFormatLabels );

// JKC For the old style of layout, uncomment the next line.
// #define OLD_STYLE_LAYOUT
// Once we've chosen which layout to use we'll remove the 
// other one.  (June/2006).
#ifdef OLD_STYLE_LAYOUT
      S.TieChoice(_("Real-time sample rate converter:"),
         wxT("/Quality/LibresampleSampleRateConverter"),
         (int)0, mConverterNames, mConverterLabels),
      S.TieChoice(_("High-quality sample rate converter:"),
         wxT("/Quality/LibresampleHQSampleRateConverter"),
         (int)1, mConverterNames, mConverterLabels),
      S.TieChoice(_("Real-time dither:"),
         wxT("/Quality/DitherAlgorithm"),
         Dither::none, mmDitherNames, mmDitherLabels );  
      S.TieChoice(_("High-quality dither:"),
         wxT("/Quality/HQDitherAlgorithm"),
         Dither::shaped, mmDitherNames, mmDitherLabels );  
#endif
      S.EndTwoColumn();
   }
   S.EndStatic();

// The new style of layout has 
//   - columns for converter and dither.
//   - rows for Real-time and High-quality.
#ifndef OLD_STYLE_LAYOUT
   S.StartStatic( _("Conversion") );
   {
      // We use blank labels here and there to end up with
      // a three column layout.
      S.StartMultiColumn(3);
      S.AddFixedText(wxT(""));
      S.AddTitle(_("Sample Rate Converter" ));
      S.AddTitle(_("Dither"));
      S.TieChoice(_("Real-time:"),
         wxT("/Quality/LibresampleSampleRateConverter"),
         (int)0, mConverterNames, mConverterLabels),
      S.TieChoice(wxT(""),
         wxT("/Quality/DitherAlgorithm"),
         Dither::none, mmDitherNames, mmDitherLabels );  
      S.TieChoice(_("High-quality:"),
         wxT("/Quality/LibresampleHQSampleRateConverter"),
         (int)1, mConverterNames, mConverterLabels),
      S.TieChoice(wxT(""),
         wxT("/Quality/HQDitherAlgorithm"),
         Dither::shaped, mmDitherNames, mmDitherLabels );  
      S.EndMultiColumn();
   }
   S.EndStatic();
#endif
}
Example #19
0
void EffectsPrefs::PopulateOrExchange(ShuttleGui & S)
{
   S.SetBorder(2);

   S.StartStatic(_("Enable Effects"));
   {

#if USE_AUDIO_UNITS
      S.TieCheckBox(_("Audio Unit"),
                    wxT("/AudioUnits/Enable"),
                    true);
#endif

      // JKC: LADSPA, LV2, Nyquist, VST, VAMP should not be translated.
#if USE_LADSPA
      S.TieCheckBox(wxT("&LADSPA"),
                    wxT("/Ladspa/Enable"),
                    true);
#endif

#if USE_LV2
      S.TieCheckBox(wxT("LV&2"),
                    wxT("/LV2/Enable"),
                    true);
#endif
#if USE_NYQUIST
      S.TieCheckBox(wxT("N&yquist"),
                    wxT("/Nyquist/Enable"),
                    true);
#endif

#if USE_VAMP
      S.TieCheckBox(wxT("&VAMP"),
                    wxT("/VAMP/Enable"),
                    true);
#endif

#if USE_VST
      S.TieCheckBox(wxT("V&ST"),
                    wxT("/VST/Enable"),
                    true);
#endif

      S.AddFixedText(_("Restart Audacity to apply changes."));
   }
   S.EndStatic();

#if USE_AUDIO_UNITS
   S.StartStatic(_("Audio Unit Effects"));
   {
      S.TieCheckBox(_("Display Audio Unit effects in Graphical Mode"),
                    wxT("/AudioUnits/GUI"),
                    true);
#if 0
      S.TieCheckBox(_("Rescan VST effects next time Audacity is started"),
                    wxT("/VST/Rescan"),
                    false);
#endif
   }
   S.EndStatic();
#endif

#if USE_VST
   S.StartStatic(_("VST Effects"));
   {
      S.TieCheckBox(_("&Display VST effects in Graphical Mode"),
                    wxT("/VST/GUI"),
                    true);
      S.TieCheckBox(_("&Rescan VST effects next time Audacity is started"),
                    wxT("/VST/Rescan"),
                    false);
   }
   S.EndStatic();
#endif

#ifdef EXPERIMENTAL_EQ_SSE_THREADED
   S.StartStatic(_("Instruction Set"));
   {
      S.TieCheckBox(_("&Use SSE/SSE2/.../AVX"),
                    wxT("/SSE/GUI"),
                    true);
   }
   S.EndStatic();
#endif

}
Example #20
0
void EffectsPrefs::PopulateOrExchange(ShuttleGui & S)
{
   S.SetBorder(2);

   S.StartStatic(_("Enable"));
   {
#if USE_LADSPA
      S.TieCheckBox(_("LADSPA effects"),
                    wxT("/Ladspa/Enable"),
                    true);
#endif

#if USE_NYQUIST
      S.TieCheckBox(_("Nyquist effects"),
                    wxT("/Nyquist/Enable"),
                    true);
#endif

#if USE_VAMP
      S.TieCheckBox(_("VAMP effects"),
                    wxT("/VAMP/Enable"),
                    true);
#endif
      S.AddFixedText(_("Restart Audacity to apply changes."));
   }
   S.EndStatic();

#if USE_AUDIO_UNITS
   S.StartStatic(_("Audio Unit Effects"));
   {
      S.TieCheckBox(_("Enable Audio Unit effects"),
                    wxT("/AudioUnits/Enable"),
                    true);
      S.TieCheckBox(_("Display Audio Unit effects in graphical mode"), 
                    wxT("/AudioUnits/GUI"),
                    true);
#if 0
      S.TieCheckBox(_("Rescan VST effects next time Audacity is started"), 
                    wxT("/VST/Rescan"),
                    false);
#endif
   }
   S.EndStatic();
#endif

#if USE_VST
   S.StartStatic(_("VST Effects"));
   {
      S.TieCheckBox(_("Enable VST effects"),
                    wxT("/VST/Enable"),
                    true);
      S.TieCheckBox(_("Display VST effects in graphical mode"), 
                    wxT("/VST/GUI"),
                    true);
      S.TieCheckBox(_("Rescan VST effects next time Audacity is started"), 
                    wxT("/VST/Rescan"),
                    false);
   }
   S.EndStatic();
#endif
}
Example #21
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();
}