Audacity  3.2.0
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
EffectChangeSpeed Class Referencefinal

An Effect that affects both pitch & speed. More...

#include <ChangeSpeed.h>

Inheritance diagram for EffectChangeSpeed:
[legend]
Collaboration diagram for EffectChangeSpeed:
[legend]

Public Member Functions

 EffectChangeSpeed ()
 
virtual ~EffectChangeSpeed ()
 
ComponentInterfaceSymbol GetSymbol () override
 
TranslatableString GetDescription () override
 
ManualPageID ManualPage () override
 Name of a page in the Audacity alpha manual, default is empty. More...
 
EffectType GetType () override
 Type determines how it behaves. More...
 
bool GetAutomationParameters (CommandParameters &parms) override
 Save current settings into parms. More...
 
bool SetAutomationParameters (CommandParameters &parms) override
 Change settings to those stored in parms. More...
 
bool LoadFactoryDefaults () override
 Change settings back to "factory default". More...
 
bool DefineParams (ShuttleParams &S) override
 
bool CheckWhetherSkipEffect () override
 
double CalcPreviewInputLength (double previewLength) override
 
bool Startup () override
 
bool Init () override
 
bool Process () override
 
void PopulateOrExchange (ShuttleGui &S) override
 
bool TransferDataFromWindow () override
 
bool TransferDataToWindow () override
 
- Public Member Functions inherited from Effect
 Effect ()
 
virtual ~Effect ()
 
PluginPath GetPath () override
 
ComponentInterfaceSymbol GetSymbol () override
 
VendorSymbol GetVendor () override
 
wxString GetVersion () override
 
TranslatableString GetDescription () override
 
EffectType GetType () override
 Type determines how it behaves. More...
 
EffectFamilySymbol GetFamily () override
 Report identifier and user-visible name of the effect protocol. More...
 
bool IsInteractive () override
 Whether the effect needs a dialog for entry of settings. More...
 
bool IsDefault () override
 Whether the effect sorts "above the line" in the menus. More...
 
bool IsLegacy () override
 
bool SupportsRealtime () override
 Whether the effect supports realtime previewing (while audio is playing). More...
 
bool SupportsAutomation () override
 Whether the effect can be used without the UI, in a macro. More...
 
bool GetAutomationParameters (CommandParameters &parms) override
 Save current settings into parms. More...
 
bool SetAutomationParameters (CommandParameters &parms) override
 Change settings to those stored in parms. More...
 
bool LoadUserPreset (const RegistryPath &name) override
 Change settings to a user-named preset. More...
 
bool SaveUserPreset (const RegistryPath &name) override
 Save current settings as a user-named preset. More...
 
RegistryPaths GetFactoryPresets () override
 Report names of factory presets. More...
 
bool LoadFactoryPreset (int id) override
 Change settings to the preset whose name is GetFactoryPresets()[id] More...
 
bool LoadFactoryDefaults () override
 Change settings back to "factory default". More...
 
bool SetHost (EffectHostInterface *host) override
 
unsigned GetAudioInCount () override
 
unsigned GetAudioOutCount () override
 
int GetMidiInCount () override
 
int GetMidiOutCount () override
 
sampleCount GetLatency () override
 Called for destructive, non-realtime effect computation. More...
 
size_t GetTailSize () override
 
void SetSampleRate (double rate) override
 
size_t SetBlockSize (size_t maxBlockSize) override
 
size_t GetBlockSize () const override
 
bool ProcessInitialize (sampleCount totalLen, ChannelNames chanMap=NULL) override
 Called for destructive, non-realtime effect computation. More...
 
bool ProcessFinalize () override
 Called for destructive, non-realtime effect computation. More...
 
size_t ProcessBlock (float **inBlock, float **outBlock, size_t blockLen) override
 Called for destructive, non-realtime effect computation. More...
 
bool RealtimeInitialize () override
 
bool RealtimeAddProcessor (unsigned numChannels, float sampleRate) override
 
bool RealtimeFinalize () override
 
bool RealtimeSuspend () override
 
bool RealtimeResume () noexcept override
 
bool RealtimeProcessStart () override
 
size_t RealtimeProcess (int group, float **inbuf, float **outbuf, size_t numSamples) override
 
bool RealtimeProcessEnd () noexcept override
 
int ShowClientInterface (wxWindow &parent, wxDialog &dialog, bool forceModal=false) override
 
bool PopulateUI (ShuttleGui &S) final
 Adds controls to a panel that is given as the parent window of S More...
 
bool IsGraphicalUI () override
 
bool ValidateUI () override
 
bool HideUI () override
 
bool CloseUI () override
 
bool CanExportPresets () override
 
void ExportPresets () override
 
void ImportPresets () override
 
bool HasOptions () override
 
void ShowOptions () override
 
EffectDefinitionInterfaceGetDefinition () override
 
double GetDuration () override
 
NumericFormatSymbol GetDurationFormat () override
 
virtual NumericFormatSymbol GetSelectionFormat ()
 
void SetDuration (double duration) override
 
RegistryPath GetUserPresetsGroup (const RegistryPath &name) override
 
RegistryPath GetCurrentSettingsGroup () override
 
RegistryPath GetFactoryDefaultsGroup () override
 
virtual wxString GetSavedStateGroup ()
 
int ShowHostInterface (wxWindow &parent, const EffectDialogFactory &factory, bool forceModal=false) override
 
unsigned TestUIFlags (unsigned mask)
 
void SetPresetParameters (const wxArrayString *Names, const wxArrayString *Values)
 
virtual bool Startup (EffectUIClientInterface *client)
 
virtual bool GetAutomationParametersAsString (wxString &parms)
 
virtual bool SetAutomationParametersFromString (const wxString &parms)
 
virtual bool IsBatchProcessing ()
 
virtual void SetBatchProcessing (bool start)
 
bool DoEffect (double projectRate, TrackList *list, WaveTrackFactory *factory, NotifyingSelectedRegion &selectedRegion, unsigned flags, wxWindow *pParent=nullptr, const EffectDialogFactory &dialogFactory={})
 
bool Delegate (Effect &delegate, wxWindow &parent, const EffectDialogFactory &factory)
 
int MessageBox (const TranslatableString &message, long style=DefaultMessageBoxStyle, const TranslatableString &titleStr={})
 
- Public Member Functions inherited from EffectUIClientInterface
virtual ~EffectUIClientInterface ()
 
- Public Member Functions inherited from EffectProcessor
virtual ~EffectProcessor ()
 
- Public Member Functions inherited from EffectDefinitionInterface
virtual ~EffectDefinitionInterface ()
 
virtual EffectType GetClassification ()
 Determines which menu it appears in; default same as GetType(). More...
 
virtual bool EnablesDebug ()
 Whether the effect dialog should have a Debug button; default, always false. More...
 
virtual FilePath HelpPage ()
 Fully qualified local help file name, default is empty. More...
 
virtual bool IsHiddenFromMenus ()
 Default is false. More...
 
- Public Member Functions inherited from ComponentInterface
virtual ~ComponentInterface ()
 
TranslatableString GetName ()
 
virtual bool DefineParams (ShuttleParams &WXUNUSED(S))
 
- Public Member Functions inherited from EffectUIHostInterface
virtual ~EffectUIHostInterface ()
 
- Public Member Functions inherited from EffectHostInterface
virtual ~EffectHostInterface ()
 

Static Public Attributes

static const ComponentInterfaceSymbol Symbol { XO("Change Speed") }
 
- Static Public Attributes inherited from Effect
static const wxString kUserPresetIdent = wxT("User Preset:")
 
static const wxString kFactoryPresetIdent = wxT("Factory Preset:")
 
static const wxString kCurrentSettingsIdent = wxT("<Current Settings>")
 
static const wxString kFactoryDefaultsIdent = wxT("<Factory Defaults>")
 

Private Member Functions

bool ProcessOne (WaveTrack *t, sampleCount start, sampleCount end)
 
bool ProcessLabelTrack (LabelTrack *t)
 
void OnText_PercentChange (wxCommandEvent &evt)
 
void OnText_Multiplier (wxCommandEvent &evt)
 
void OnSlider_PercentChange (wxCommandEvent &evt)
 
void OnChoice_Vinyl (wxCommandEvent &evt)
 
void OnTimeCtrl_ToLength (wxCommandEvent &evt)
 
void OnTimeCtrlUpdate (wxCommandEvent &evt)
 
void Update_Text_PercentChange ()
 
void Update_Text_Multiplier ()
 
void Update_Slider_PercentChange ()
 
void Update_Vinyl ()
 
void Update_TimeCtrl_ToLength ()
 
void UpdateUI ()
 

Private Attributes

int mCurTrackNum
 
double mMaxNewLength
 
double mCurT0
 
double mCurT1
 
double m_PercentChange
 
int mFromVinyl
 
double mFactor
 
double mFromLength
 
int mTimeCtrlFormat
 
double mMultiplier
 
bool mbLoopDetect
 
wxTextCtrl * mpTextCtrl_PercentChange
 
wxTextCtrl * mpTextCtrl_Multiplier
 
wxSlider * mpSlider_PercentChange
 
wxChoice * mpChoice_FromVinyl
 
wxChoice * mpChoice_ToVinyl
 
NumericTextCtrlmpFromLengthCtrl
 
NumericTextCtrlmpToLengthCtrl
 
double mRate
 
int mToVinyl
 
double mToLength
 
NumericFormatSymbol mFormat
 

Additional Inherited Members

- Public Types inherited from Effect
enum  : long { DefaultMessageBoxStyle = wxOK | wxCENTRE }
 
- Static Public Member Functions inherited from Effect
static void IncEffectCounter ()
 
- Static Public Member Functions inherited from EffectDefinitionInterface
static Identifier GetSquashedName (const Identifier &ident)
 A utility that strips spaces and CamelCases a name. More...
 
- Protected Member Functions inherited from Effect
bool EnableApply (bool enable=true)
 
bool EnablePreview (bool enable=true)
 
virtual bool ProcessPass ()
 
virtual bool InitPass1 ()
 
virtual bool InitPass2 ()
 
virtual void End ()
 
virtual void Preview (bool dryOnly)
 
bool TotalProgress (double frac, const TranslatableString &={})
 
bool TrackProgress (int whichTrack, double frac, const TranslatableString &={})
 
bool TrackGroupProgress (int whichGroup, double frac, const TranslatableString &={})
 
int GetNumWaveTracks ()
 
int GetNumWaveGroups ()
 
void GetBounds (const WaveTrack &track, const WaveTrack *pRight, sampleCount *start, sampleCount *len)
 
void SetLinearEffectFlag (bool linearEffectFlag)
 
void SetPreviewFullSelectionFlag (bool previewDurationFlag)
 
bool IsPreviewing ()
 
void IncludeNotSelectedPreviewTracks (bool includeNotSelected)
 
void CopyInputTracks (bool allSyncLockSelected=false)
 
std::shared_ptr< AddedAnalysisTrackAddAnalysisTrack (const wxString &name=wxString())
 
ModifiedAnalysisTrack ModifyAnalysisTrack (const LabelTrack *pOrigTrack, const wxString &name=wxString())
 
void ReplaceProcessedTracks (const bool bGoodResult)
 
TrackAddToOutputTracks (const std::shared_ptr< Track > &t)
 
const TrackListinputTracks () const
 
const AudacityProjectFindProject () const
 
- Protected Attributes inherited from Effect
BasicUI::ProgressDialogmProgress = nullptr
 
double mProjectRate
 
double mSampleRate
 
WaveTrackFactorymFactory
 
std::shared_ptr< TrackListmOutputTracks
 
double mT0
 
double mT1
 
wxArrayString mPresetNames
 
wxArrayString mPresetValues
 
int mPass
 
wxWeakRef< wxDialog > mHostUIDialog
 This smart pointer tracks the lifetime of the dialog. More...
 
wxWeakRef< wxDialog > mUIDialog
 This weak pointer may be the same as the above, or null. More...
 
wxWindow * mUIParent
 
unsigned mUIFlags { 0 }
 
sampleCount mSampleCnt
 
- Static Protected Attributes inherited from Effect
static int nEffectsDone =0
 

Detailed Description

An Effect that affects both pitch & speed.

Definition at line 24 of file ChangeSpeed.h.

Constructor & Destructor Documentation

◆ EffectChangeSpeed()

EffectChangeSpeed::EffectChangeSpeed ( )

Definition at line 96 of file ChangeSpeed.cpp.

97 {
98  // effect parameters
99  m_PercentChange = DEF_Percentage;
100 
103  mFromLength = 0.0;
104  mToLength = 0.0;
106  mbLoopDetect = false;
107 
108  SetLinearEffectFlag(true);
109 }

References NumericConverter::DefaultSelectionFormat(), and kVinyl_33AndAThird.

Here is the call graph for this function:

◆ ~EffectChangeSpeed()

EffectChangeSpeed::~EffectChangeSpeed ( )
virtual

Definition at line 111 of file ChangeSpeed.cpp.

112 {
113 }

Member Function Documentation

◆ CalcPreviewInputLength()

double EffectChangeSpeed::CalcPreviewInputLength ( double  previewLength)
overridevirtual

Reimplemented from Effect.

Definition at line 177 of file ChangeSpeed.cpp.

178 {
179  return previewLength * (100.0 + m_PercentChange) / 100.0;
180 }

References m_PercentChange.

◆ CheckWhetherSkipEffect()

bool EffectChangeSpeed::CheckWhetherSkipEffect ( )
overridevirtual

Reimplemented from Effect.

Definition at line 172 of file ChangeSpeed.cpp.

173 {
174  return (m_PercentChange == 0.0);
175 }

References m_PercentChange.

◆ DefineParams()

bool EffectChangeSpeed::DefineParams ( ShuttleParams S)
override

Definition at line 141 of file ChangeSpeed.cpp.

141  {
142  S.SHUTTLE_PARAM( m_PercentChange, Percentage );
143  return true;
144 }

References m_PercentChange, and S.

◆ GetAutomationParameters()

bool EffectChangeSpeed::GetAutomationParameters ( CommandParameters parms)
overridevirtual

Save current settings into parms.

Implements EffectDefinitionInterface.

Definition at line 146 of file ChangeSpeed.cpp.

147 {
148  parms.Write(KEY_Percentage, m_PercentChange);
149 
150  return true;
151 }

References m_PercentChange.

◆ GetDescription()

TranslatableString EffectChangeSpeed::GetDescription ( )
overridevirtual

Implements ComponentInterface.

Definition at line 122 of file ChangeSpeed.cpp.

123 {
124  return XO("Changes the speed of a track, also changing its pitch");
125 }

References XO.

◆ GetSymbol()

ComponentInterfaceSymbol EffectChangeSpeed::GetSymbol ( )
overridevirtual

Implements ComponentInterface.

Definition at line 117 of file ChangeSpeed.cpp.

118 {
119  return Symbol;
120 }

References Symbol.

◆ GetType()

EffectType EffectChangeSpeed::GetType ( )
overridevirtual

Type determines how it behaves.

Implements EffectDefinitionInterface.

Definition at line 135 of file ChangeSpeed.cpp.

136 {
137  return EffectTypeProcess;
138 }

References EffectTypeProcess.

◆ Init()

bool EffectChangeSpeed::Init ( )
overridevirtual

Reimplemented from Effect.

Definition at line 225 of file ChangeSpeed.cpp.

226 {
227  // The selection might have changed since the last time EffectChangeSpeed
228  // was invoked, so recalculate the Length parameters.
229  mFromLength = mT1 - mT0;
230  return true;
231 }

References mFromLength, Effect::mT0, and Effect::mT1.

◆ LoadFactoryDefaults()

bool EffectChangeSpeed::LoadFactoryDefaults ( )
overridevirtual

Change settings back to "factory default".

Implements EffectDefinitionInterface.

Definition at line 162 of file ChangeSpeed.cpp.

References NumericConverter::DefaultSelectionFormat(), kVinyl_33AndAThird, Effect::LoadFactoryDefaults(), mFormat, and mFromVinyl.

Here is the call graph for this function:

◆ ManualPage()

ManualPageID EffectChangeSpeed::ManualPage ( )
overridevirtual

Name of a page in the Audacity alpha manual, default is empty.

Reimplemented from EffectDefinitionInterface.

Definition at line 127 of file ChangeSpeed.cpp.

128 {
129  return L"Change_Speed";
130 }

◆ OnChoice_Vinyl()

void EffectChangeSpeed::OnChoice_Vinyl ( wxCommandEvent &  evt)
private

Definition at line 665 of file ChangeSpeed.cpp.

666 {
667  // Treat mpChoice_FromVinyl and mpChoice_ToVinyl as one control since we need
668  // both to calculate Percent Change.
669  mFromVinyl = mpChoice_FromVinyl->GetSelection();
670  mToVinyl = mpChoice_ToVinyl->GetSelection();
671  // Use this as the 'preferred' choice.
672  if (mFromVinyl != kVinyl_NA) {
674  GetCurrentSettingsGroup(), wxT("VinylChoice"), mFromVinyl);
675  }
676 
677  // If mFromVinyl & mToVinyl are set, then there's a NEW percent change.
678  if ((mFromVinyl != kVinyl_NA) && (mToVinyl != kVinyl_NA))
679  {
680  double fromRPM;
681  double toRPM;
682  switch (mFromVinyl) {
683  default:
684  case kVinyl_33AndAThird: fromRPM = 33.0 + (1.0 / 3.0); break;
685  case kVinyl_45: fromRPM = 45.0; break;
686  case kVinyl_78: fromRPM = 78; break;
687  }
688  switch (mToVinyl) {
689  default:
690  case kVinyl_33AndAThird: toRPM = 33.0 + (1.0 / 3.0); break;
691  case kVinyl_45: toRPM = 45.0; break;
692  case kVinyl_78: toRPM = 78; break;
693  }
694  m_PercentChange = ((toRPM * 100.0) / fromRPM) - 100.0;
695  UpdateUI();
696 
697  mbLoopDetect = true;
702  }
703  mbLoopDetect = false;
704 }

References Effect::GetCurrentSettingsGroup(), Effect::GetDefinition(), kVinyl_33AndAThird, kVinyl_45, kVinyl_78, kVinyl_NA, m_PercentChange, mbLoopDetect, mFromVinyl, mpChoice_FromVinyl, mpChoice_ToVinyl, mToVinyl, PluginSettings::Private, PluginSettings::SetConfig(), Update_Slider_PercentChange(), Update_Text_Multiplier(), Update_Text_PercentChange(), Update_TimeCtrl_ToLength(), and UpdateUI().

Here is the call graph for this function:

◆ OnSlider_PercentChange()

void EffectChangeSpeed::OnSlider_PercentChange ( wxCommandEvent &  evt)
private

Definition at line 646 of file ChangeSpeed.cpp.

647 {
648  if (mbLoopDetect)
649  return;
650 
651  m_PercentChange = (double)(mpSlider_PercentChange->GetValue());
652  // Warp positive values to actually go up faster & further than negatives.
653  if (m_PercentChange > 0.0)
655  UpdateUI();
656 
657  mbLoopDetect = true;
660  Update_Vinyl();
662  mbLoopDetect = false;
663 }

References kSliderWarp, m_PercentChange, mbLoopDetect, mpSlider_PercentChange, Update_Text_Multiplier(), Update_Text_PercentChange(), Update_TimeCtrl_ToLength(), Update_Vinyl(), and UpdateUI().

Here is the call graph for this function:

◆ OnText_Multiplier()

void EffectChangeSpeed::OnText_Multiplier ( wxCommandEvent &  evt)
private

Definition at line 629 of file ChangeSpeed.cpp.

630 {
631  if (mbLoopDetect)
632  return;
633 
634  mpTextCtrl_Multiplier->GetValidator()->TransferFromWindow();
635  m_PercentChange = 100 * (mMultiplier - 1);
636  UpdateUI();
637 
638  mbLoopDetect = true;
641  Update_Vinyl();
643  mbLoopDetect = false;
644 }

References m_PercentChange, mbLoopDetect, mMultiplier, mpTextCtrl_Multiplier, Update_Slider_PercentChange(), Update_Text_PercentChange(), Update_TimeCtrl_ToLength(), Update_Vinyl(), and UpdateUI().

Here is the call graph for this function:

◆ OnText_PercentChange()

void EffectChangeSpeed::OnText_PercentChange ( wxCommandEvent &  evt)
private

Definition at line 613 of file ChangeSpeed.cpp.

614 {
615  if (mbLoopDetect)
616  return;
617 
618  mpTextCtrl_PercentChange->GetValidator()->TransferFromWindow();
619  UpdateUI();
620 
621  mbLoopDetect = true;
624  Update_Vinyl();
626  mbLoopDetect = false;
627 }

References mbLoopDetect, mpTextCtrl_PercentChange, Update_Slider_PercentChange(), Update_Text_Multiplier(), Update_TimeCtrl_ToLength(), Update_Vinyl(), and UpdateUI().

Here is the call graph for this function:

◆ OnTimeCtrl_ToLength()

void EffectChangeSpeed::OnTimeCtrl_ToLength ( wxCommandEvent &  evt)
private

Definition at line 706 of file ChangeSpeed.cpp.

707 {
708  if (mbLoopDetect)
709  return;
710 
712  // Division by (double) 0.0 is not an error and we want to show "infinite" in
713  // text controls, so take care that we handle infinite values when they occur.
714  m_PercentChange = ((mFromLength * 100.0) / mToLength) - 100.0;
715  UpdateUI();
716 
717  mbLoopDetect = true;
718 
722  Update_Vinyl();
723 
724  mbLoopDetect = false;
725 }

References NumericConverter::GetValue(), m_PercentChange, mbLoopDetect, mFromLength, mpToLengthCtrl, mToLength, Update_Slider_PercentChange(), Update_Text_Multiplier(), Update_Text_PercentChange(), Update_Vinyl(), and UpdateUI().

Here is the call graph for this function:

◆ OnTimeCtrlUpdate()

void EffectChangeSpeed::OnTimeCtrlUpdate ( wxCommandEvent &  evt)
private

Definition at line 727 of file ChangeSpeed.cpp.

728 {
730  NumericConverter::TIME, evt.GetString() );
731 
733  // Update From/To Length controls (precision has changed).
736 }

References NumericConverter::LookupFormat(), mFormat, mFromLength, mpFromLengthCtrl, mpToLengthCtrl, mToLength, NumericTextCtrl::SetFormatName(), NumericTextCtrl::SetValue(), and NumericConverter::TIME.

Here is the call graph for this function:

◆ PopulateOrExchange()

void EffectChangeSpeed::PopulateOrExchange ( ShuttleGui S)
overridevirtual

Reimplemented from Effect.

Definition at line 296 of file ChangeSpeed.cpp.

297 {
298  {
299  wxString formatId;
302  wxT("TimeFormat"), formatId, mFormat.Internal());
304  NumericConverter::TIME, formatId );
305  }
308  wxT("VinylChoice"), mFromVinyl, mFromVinyl);
309 
310  S.SetBorder(5);
311 
312  S.StartVerticalLay(0);
313  {
314  S.AddSpace(0, 5);
315  S.AddTitle(XO("Change Speed, affecting both Tempo and Pitch"));
316  S.AddSpace(0, 10);
317 
318  // Speed multiplier and percent change controls.
319  S.StartMultiColumn(4, wxCENTER);
320  {
322  .Validator<FloatingPointValidator<double>>(
323  3, &mMultiplier,
324  NumValidatorStyle::THREE_TRAILING_ZEROES,
325  MIN_Percentage / 100.0, ((MAX_Percentage / 100.0) + 1)
326  )
327  .AddTextBox(XXO("&Speed Multiplier:"), wxT(""), 12);
328 
330  .Validator<FloatingPointValidator<double>>(
331  3, &m_PercentChange,
332  NumValidatorStyle::THREE_TRAILING_ZEROES,
333  MIN_Percentage, MAX_Percentage
334  )
335  .AddTextBox(XXO("Percent C&hange:"), wxT(""), 12);
336  }
337  S.EndMultiColumn();
338 
339  // Percent change slider.
340  S.StartHorizontalLay(wxEXPAND);
341  {
343  .Name(XO("Percent Change"))
344  .Style(wxSL_HORIZONTAL)
345  .AddSlider( {}, 0, (int)kSliderMax, (int)MIN_Percentage);
346  }
347  S.EndHorizontalLay();
348 
349  // Vinyl rpm controls.
350  S.StartMultiColumn(5, wxCENTER);
351  {
352  /* i18n-hint: "rpm" is an English abbreviation meaning "revolutions per minute".
353  "vinyl" refers to old-fashioned phonograph records */
354  S.AddUnits(XO("Standard Vinyl rpm:"));
355 
357  /* i18n-hint: changing speed of audio "from" one value "to" another
358  "rpm" means "revolutions per minute" as on a vinyl record turntable
359  */
360  .Name(XO("From rpm"))
361  .MinSize( { 100, -1 } )
362  /* i18n-hint: changing speed of audio "from" one value "to" another */
363  .AddChoice(XXC("&from", "change speed"), kVinylStrings);
364 
366  /* i18n-hint: changing speed of audio "from" one value "to" another
367  "rpm" means "revolutions per minute" as on a vinyl record turntable
368  */
369  .Name(XO("To rpm"))
370  .MinSize( { 100, -1 } )
371  /* i18n-hint: changing speed of audio "from" one value "to" another */
372  .AddChoice(XXC("&to", "change speed"), kVinylStrings);
373  }
374  S.EndMultiColumn();
375 
376  // From/To time controls.
377  S.StartStatic(XO("Selection Length"), 0);
378  {
379  S.StartMultiColumn(2, wxALIGN_LEFT);
380  {
381  S.AddPrompt(XXO("C&urrent Length:"));
382 
384  NumericTextCtrl(S.GetParent(), wxID_ANY,
386  mFormat,
387  mFromLength,
388  mProjectRate,
390  .ReadOnly(true)
391  .MenuEnabled(false));
392 
393  S.ToolTip(XO("Current length of selection."))
394  /* i18n-hint: changing speed of audio "from" one value "to" another */
395  .Name(XC("from", "change speed"))
396  .Position(wxALIGN_LEFT)
397  .AddWindow(mpFromLengthCtrl);
398 
399  S.AddPrompt(XXO("&New Length:"));
400 
402  NumericTextCtrl(S.GetParent(), ID_ToLength,
404  mFormat,
405  mToLength,
406  mProjectRate);
407 
408  /* i18n-hint: changing speed of audio "from" one value "to" another */
409  S.Name(XC("to", "change speed"))
410  .Position(wxALIGN_LEFT)
411  .AddWindow(mpToLengthCtrl);
412  }
413  S.EndMultiColumn();
414  }
415  S.EndStatic();
416  }
417  S.EndVerticalLay();
418 }

References PluginSettings::GetConfig(), Effect::GetCurrentSettingsGroup(), Effect::GetDefinition(), ID_FromVinyl, ID_Multiplier, ID_PercentChange, ID_ToLength, ID_ToVinyl, ComponentInterfaceSymbol::Internal(), kSliderMax, kVinylStrings, NumericConverter::LookupFormat(), m_PercentChange, NumericTextCtrl::Options::MenuEnabled(), mFormat, mFromLength, mFromVinyl, mMultiplier, mpChoice_FromVinyl, mpChoice_ToVinyl, mpFromLengthCtrl, Effect::mProjectRate, mpSlider_PercentChange, mpTextCtrl_Multiplier, mpTextCtrl_PercentChange, mpToLengthCtrl, mToLength, PluginSettings::Private, NumericTextCtrl::Options::ReadOnly(), S, safenew, NumericConverter::TIME, XC, XO, XXC, and XXO.

Here is the call graph for this function:

◆ Process()

bool EffectChangeSpeed::Process ( )
overridevirtual

If Process() is not overridden, it uses ProcessInitialize(), ProcessBlock(), and ProcessFinalize() methods of EffectProcessor, and also GetLatency() to determine how many leading output samples to discard and how many extra samples to produce.

Reimplemented from Effect.

Definition at line 233 of file ChangeSpeed.cpp.

234 {
235  // Similar to EffectSoundTouch::Process()
236 
237  // Iterate over each track.
238  // All needed because this effect needs to introduce
239  // silence in the sync-lock group tracks to keep sync
240  CopyInputTracks(true); // Set up mOutputTracks.
241  bool bGoodResult = true;
242 
243  mCurTrackNum = 0;
244  mMaxNewLength = 0.0;
245 
246  mFactor = 100.0 / (100.0 + m_PercentChange);
247 
248  mOutputTracks->Any().VisitWhile( bGoodResult,
249  [&](LabelTrack *lt) {
251  {
252  if (!ProcessLabelTrack(lt))
253  bGoodResult = false;
254  }
255  },
256  [&](WaveTrack *pOutWaveTrack, const Track::Fallthrough &fallthrough) {
257  if (!pOutWaveTrack->GetSelected())
258  return fallthrough();
259 
260  //Get start and end times from track
261  mCurT0 = pOutWaveTrack->GetStartTime();
262  mCurT1 = pOutWaveTrack->GetEndTime();
263 
264  //Set the current bounds to whichever left marker is
265  //greater and whichever right marker is less:
266  mCurT0 = wxMax(mT0, mCurT0);
267  mCurT1 = wxMin(mT1, mCurT1);
268 
269  // Process only if the right marker is to the right of the left marker
270  if (mCurT1 > mCurT0) {
271  //Transform the marker timepoints to samples
272  auto start = pOutWaveTrack->TimeToLongSamples(mCurT0);
273  auto end = pOutWaveTrack->TimeToLongSamples(mCurT1);
274 
275  //ProcessOne() (implemented below) processes a single track
276  if (!ProcessOne(pOutWaveTrack, start, end))
277  bGoodResult = false;
278  }
279  mCurTrackNum++;
280  },
281  [&](Track *t) {
283  t->SyncLockAdjust(mT1, mT0 + (mT1 - mT0) * mFactor);
284  }
285  );
286 
287  if (bGoodResult)
288  ReplaceProcessedTracks(bGoodResult);
289 
290  // Update selection.
291  mT1 = mT0 + (((mT1 - mT0) * 100.0) / (100.0 + m_PercentChange));
292 
293  return bGoodResult;
294 }

References Effect::CopyInputTracks(), WaveTrack::GetEndTime(), Track::GetSelected(), WaveTrack::GetStartTime(), SyncLock::IsSelectedOrSyncLockSelected(), SyncLock::IsSyncLockSelected(), m_PercentChange, mCurT0, mCurT1, mCurTrackNum, mFactor, mMaxNewLength, Effect::mOutputTracks, Effect::mT0, Effect::mT1, ProcessLabelTrack(), ProcessOne(), Effect::ReplaceProcessedTracks(), and SampleTrack::TimeToLongSamples().

Here is the call graph for this function:

◆ ProcessLabelTrack()

bool EffectChangeSpeed::ProcessLabelTrack ( LabelTrack t)
private

Definition at line 478 of file ChangeSpeed.cpp.

479 {
480  RegionTimeWarper warper { mT0, mT1,
481  std::make_unique<LinearTimeWarper>(mT0, mT0,
482  mT1, mT0 + (mT1-mT0)*mFactor) };
483  lt->WarpLabels(warper);
484  return true;
485 }

References mFactor, Effect::mT0, Effect::mT1, and LabelTrack::WarpLabels().

Referenced by Process().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProcessOne()

bool EffectChangeSpeed::ProcessOne ( WaveTrack t,
sampleCount  start,
sampleCount  end 
)
private

Definition at line 489 of file ChangeSpeed.cpp.

491 {
492  if (track == NULL)
493  return false;
494 
495  // initialization, per examples of Mixer::Mixer and
496  // EffectSoundTouch::ProcessOne
497 
498 
499  auto outputTrack = track->EmptyCopy();
500 
501  //Get the length of the selection (as double). len is
502  //used simple to calculate a progress meter, so it is easier
503  //to make it a double now than it is to do it later
504  auto len = (end - start).as_double();
505 
506  // Initiate processing buffers, most likely shorter than
507  // the length of the selection being processed.
508  auto inBufferSize = track->GetMaxBlockSize();
509 
510  Floats inBuffer{ inBufferSize };
511 
512  // mFactor is at most 100-fold so this shouldn't overflow size_t
513  auto outBufferSize = size_t( mFactor * inBufferSize + 10 );
514  Floats outBuffer{ outBufferSize };
515 
516  // Set up the resampling stuff for this track.
517  Resample resample(true, mFactor, mFactor); // constant rate resampling
518 
519  //Go through the track one buffer at a time. samplePos counts which
520  //sample the current buffer starts at.
521  bool bResult = true;
522  auto samplePos = start;
523  while (samplePos < end) {
524  //Get a blockSize of samples (smaller than the size of the buffer)
525  auto blockSize = limitSampleBufferSize(
526  track->GetBestBlockSize(samplePos),
527  end - samplePos
528  );
529 
530  //Get the samples from the track and put them in the buffer
531  track->GetFloats(inBuffer.get(), samplePos, blockSize);
532 
533  const auto results = resample.Process(mFactor,
534  inBuffer.get(),
535  blockSize,
536  ((samplePos + blockSize) >= end),
537  outBuffer.get(),
538  outBufferSize);
539  const auto outgen = results.second;
540 
541  if (outgen > 0)
542  outputTrack->Append((samplePtr)outBuffer.get(), floatSample,
543  outgen);
544 
545  // Increment samplePos
546  samplePos += results.first;
547 
548  // Update the Progress meter
549  if (TrackProgress(mCurTrackNum, (samplePos - start).as_double() / len)) {
550  bResult = false;
551  break;
552  }
553  }
554 
555  // Flush the output WaveTrack (since it's buffered, too)
556  outputTrack->Flush();
557 
558  // Take the output track and insert it in place of the original
559  // sample data
560  double newLength = outputTrack->GetEndTime();
561  if (bResult)
562  {
563  // Silenced samples will be inserted in gaps between clips, so capture where these
564  // gaps are for later deletion
565  std::vector<std::pair<double, double>> gaps;
566  double last = mCurT0;
567  auto clips = track->SortedClipArray();
568  auto front = clips.front();
569  auto back = clips.back();
570  for (auto &clip : clips) {
571  auto st = clip->GetPlayStartTime();
572  auto et = clip->GetPlayEndTime();
573 
574  if (st >= mCurT0 || et < mCurT1) {
575  if (mCurT0 < st && clip == front) {
576  gaps.push_back(std::make_pair(mCurT0, st));
577  }
578  else if (last < st && mCurT0 <= last ) {
579  gaps.push_back(std::make_pair(last, st));
580  }
581 
582  if (et < mCurT1 && clip == back) {
583  gaps.push_back(std::make_pair(et, mCurT1));
584  }
585  }
586  last = et;
587  }
588 
589  LinearTimeWarper warper { mCurT0, mCurT0, mCurT1, mCurT0 + newLength };
590 
591  // Take the output track and insert it in place of the original sample data
592  track->ClearAndPaste(mCurT0, mCurT1, outputTrack.get(), true, true, &warper);
593 
594  // Finally, recreate the gaps
595  for (auto gap : gaps) {
596  auto st = track->LongSamplesToTime(track->TimeToLongSamples(gap.first));
597  auto et = track->LongSamplesToTime(track->TimeToLongSamples(gap.second));
598  if (st >= mCurT0 && et <= mCurT1 && st != et)
599  {
600  track->SplitDelete(warper.Warp(st), warper.Warp(et));
601  }
602  }
603  }
604 
605  if (newLength > mMaxNewLength)
606  mMaxNewLength = newLength;
607 
608  return bResult;
609 }

References WaveTrack::ClearAndPaste(), WaveTrack::EmptyCopy(), floatSample, gap, WaveTrack::GetBestBlockSize(), SampleTrack::GetFloats(), WaveTrack::GetMaxBlockSize(), limitSampleBufferSize(), SampleTrack::LongSamplesToTime(), mCurT0, mCurT1, mCurTrackNum, mFactor, mMaxNewLength, Resample::Process(), WaveTrack::SortedClipArray(), WaveTrack::SplitDelete(), SampleTrack::TimeToLongSamples(), and Effect::TrackProgress().

Referenced by Process().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetAutomationParameters()

bool EffectChangeSpeed::SetAutomationParameters ( CommandParameters parms)
overridevirtual

Change settings to those stored in parms.

Implements EffectDefinitionInterface.

Definition at line 153 of file ChangeSpeed.cpp.

154 {
155  ReadAndVerifyDouble(Percentage);
156 
157  m_PercentChange = Percentage;
158 
159  return true;
160 }

References m_PercentChange, and ReadAndVerifyDouble.

◆ Startup()

bool EffectChangeSpeed::Startup ( )
overridevirtual

Reimplemented from Effect.

Definition at line 182 of file ChangeSpeed.cpp.

183 {
184  wxString base = wxT("/Effects/ChangeSpeed/");
185 
186  // Migrate settings from 2.1.0 or before
187 
188  // Already migrated, so bail
189  if (gPrefs->Exists(base + wxT("Migrated")))
190  {
191  return true;
192  }
193 
194  // Load the old "current" settings
195  if (gPrefs->Exists(base))
196  {
197  // Retrieve last used control values
198  gPrefs->Read(base + wxT("PercentChange"), &m_PercentChange, 0);
199 
200  wxString format;
201  gPrefs->Read(base + wxT("TimeFormat"), &format, wxString{});
203 
204  gPrefs->Read(base + wxT("VinylChoice"), &mFromVinyl, 0);
205  if (mFromVinyl == kVinyl_NA)
206  {
208  }
209 
211  GetCurrentSettingsGroup(), wxT("TimeFormat"), mFormat.Internal());
213  GetCurrentSettingsGroup(), wxT("VinylChoice"), mFromVinyl);
214 
216 
217  // Do not migrate again
218  gPrefs->Write(base + wxT("Migrated"), true);
219  gPrefs->Flush();
220  }
221 
222  return true;
223 }

References FileConfig::Flush(), format, Effect::GetCurrentSettingsGroup(), Effect::GetDefinition(), gPrefs, ComponentInterfaceSymbol::Internal(), kVinyl_33AndAThird, kVinyl_NA, NumericConverter::LookupFormat(), m_PercentChange, mFormat, mFromVinyl, PluginSettings::Private, Effect::SaveUserPreset(), PluginSettings::SetConfig(), and NumericConverter::TIME.

Here is the call graph for this function:

◆ TransferDataFromWindow()

bool EffectChangeSpeed::TransferDataFromWindow ( )
overridevirtual

Reimplemented from Effect.

Definition at line 456 of file ChangeSpeed.cpp.

457 {
458  // mUIParent->TransferDataFromWindow() loses some precision, so save and restore it.
459  double exactPercent = m_PercentChange;
460  if (!mUIParent->Validate() || !mUIParent->TransferDataFromWindow())
461  {
462  return false;
463  }
464  m_PercentChange = exactPercent;
465 
467  GetCurrentSettingsGroup(), wxT("TimeFormat"), mFormat.Internal());
469  GetCurrentSettingsGroup(), wxT("VinylChoice"), mFromVinyl);
470 
471  return true;
472 }

References Effect::GetCurrentSettingsGroup(), Effect::GetDefinition(), ComponentInterfaceSymbol::Internal(), m_PercentChange, mFormat, mFromVinyl, Effect::mUIParent, PluginSettings::Private, and PluginSettings::SetConfig().

Here is the call graph for this function:

◆ TransferDataToWindow()

bool EffectChangeSpeed::TransferDataToWindow ( )
overridevirtual

Reimplemented from Effect.

Definition at line 420 of file ChangeSpeed.cpp.

421 {
422  mbLoopDetect = true;
423 
424  if (!mUIParent->TransferDataToWindow())
425  {
426  return false;
427  }
428 
429  if (mFromVinyl == kVinyl_NA)
430  {
432  }
433 
438 
439  // Set from/to Vinyl controls - mFromVinyl must be set first.
440  mpChoice_FromVinyl->SetSelection(mFromVinyl);
441  // Then update to get correct mToVinyl.
442  Update_Vinyl();
443  // Then update ToVinyl control.
444  mpChoice_ToVinyl->SetSelection(mToVinyl);
445 
446  // Set From Length control.
447  // Set the format first so we can get sample accuracy.
450 
451  mbLoopDetect = false;
452 
453  return true;
454 }

References kVinyl_33AndAThird, kVinyl_NA, mbLoopDetect, mFormat, mFromLength, mFromVinyl, mpChoice_FromVinyl, mpChoice_ToVinyl, mpFromLengthCtrl, mToVinyl, Effect::mUIParent, NumericTextCtrl::SetFormatName(), NumericTextCtrl::SetValue(), Update_Slider_PercentChange(), Update_Text_Multiplier(), Update_Text_PercentChange(), Update_TimeCtrl_ToLength(), and Update_Vinyl().

Here is the call graph for this function:

◆ Update_Slider_PercentChange()

void EffectChangeSpeed::Update_Slider_PercentChange ( )
private

Definition at line 753 of file ChangeSpeed.cpp.

755 {
756  auto unwarped = std::min<double>(m_PercentChange, MAX_Percentage);
757  if (unwarped > 0.0)
758  // Un-warp values above zero to actually go up to kSliderMax.
759  unwarped = pow(m_PercentChange, (1.0 / kSliderWarp));
760 
761  // Caution: m_PercentChange could be infinite.
762  int unwarpedi = (int)(unwarped + 0.5);
763  unwarpedi = std::min<int>(unwarpedi, (int)kSliderMax);
764 
765  mpSlider_PercentChange->SetValue(unwarpedi);
766 }

References kSliderMax, kSliderWarp, m_PercentChange, and mpSlider_PercentChange.

Referenced by OnChoice_Vinyl(), OnText_Multiplier(), OnText_PercentChange(), OnTimeCtrl_ToLength(), and TransferDataToWindow().

Here is the caller graph for this function:

◆ Update_Text_Multiplier()

void EffectChangeSpeed::Update_Text_Multiplier ( )
private

Definition at line 746 of file ChangeSpeed.cpp.

748 {
749  mMultiplier = 1 + (m_PercentChange) / 100.0;
750  mpTextCtrl_Multiplier->GetValidator()->TransferToWindow();
751 }

References m_PercentChange, mMultiplier, and mpTextCtrl_Multiplier.

Referenced by OnChoice_Vinyl(), OnSlider_PercentChange(), OnText_PercentChange(), OnTimeCtrl_ToLength(), and TransferDataToWindow().

Here is the caller graph for this function:

◆ Update_Text_PercentChange()

void EffectChangeSpeed::Update_Text_PercentChange ( )
private

Definition at line 740 of file ChangeSpeed.cpp.

742 {
743  mpTextCtrl_PercentChange->GetValidator()->TransferToWindow();
744 }

References mpTextCtrl_PercentChange.

Referenced by OnChoice_Vinyl(), OnSlider_PercentChange(), OnText_Multiplier(), OnTimeCtrl_ToLength(), and TransferDataToWindow().

Here is the caller graph for this function:

◆ Update_TimeCtrl_ToLength()

void EffectChangeSpeed::Update_TimeCtrl_ToLength ( )
private

Definition at line 822 of file ChangeSpeed.cpp.

824 {
825  mToLength = (mFromLength * 100.0) / (100.0 + m_PercentChange);
826 
827  // Set the format first so we can get sample accuracy.
829  // Negative times do not make sense.
830  // 359999 = 99h:59m:59s which is a little less disturbing than overflow characters
831  // though it may still look a bit strange with some formats.
832  mToLength = TrapDouble(mToLength, 0.0, 359999.0);
834 }

References m_PercentChange, mFormat, mFromLength, mpToLengthCtrl, mToLength, NumericTextCtrl::SetFormatName(), NumericTextCtrl::SetValue(), and TrapDouble().

Referenced by OnChoice_Vinyl(), OnSlider_PercentChange(), OnText_Multiplier(), OnText_PercentChange(), and TransferDataToWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Update_Vinyl()

void EffectChangeSpeed::Update_Vinyl ( )
private

Definition at line 768 of file ChangeSpeed.cpp.

770 {
771  // Match Vinyl rpm when within 0.01% of a standard ratio.
772  // Ratios calculated as: ((toRPM / fromRPM) - 1) * 100 * 100
773 
774  // Caution: m_PercentChange could be infinite
775  int ratio = (int)((m_PercentChange * 100) + 0.5);
776 
777  switch (ratio)
778  {
779  case 0: // toRPM is the same as fromRPM
780  if (mFromVinyl != kVinyl_NA) {
781  mpChoice_ToVinyl->SetSelection(mpChoice_FromVinyl->GetSelection());
782  } else {
783  // Use the last saved option.
785  GetCurrentSettingsGroup(), wxT("VinylChoice"), mFromVinyl, 0);
786  mpChoice_FromVinyl->SetSelection(mFromVinyl);
787  mpChoice_ToVinyl->SetSelection(mFromVinyl);
788  }
789  break;
790  case 3500:
791  mpChoice_FromVinyl->SetSelection(kVinyl_33AndAThird);
792  mpChoice_ToVinyl->SetSelection(kVinyl_45);
793  break;
794  case 13400:
795  mpChoice_FromVinyl->SetSelection(kVinyl_33AndAThird);
796  mpChoice_ToVinyl->SetSelection(kVinyl_78);
797  break;
798  case -2593:
799  mpChoice_FromVinyl->SetSelection(kVinyl_45);
800  mpChoice_ToVinyl->SetSelection(kVinyl_33AndAThird);
801  break;
802  case 7333:
803  mpChoice_FromVinyl->SetSelection(kVinyl_45);
804  mpChoice_ToVinyl->SetSelection(kVinyl_78);
805  break;
806  case -5727:
807  mpChoice_FromVinyl->SetSelection(kVinyl_78);
808  mpChoice_ToVinyl->SetSelection(kVinyl_33AndAThird);
809  break;
810  case -4231:
811  mpChoice_FromVinyl->SetSelection(kVinyl_78);
812  mpChoice_ToVinyl->SetSelection(kVinyl_45);
813  break;
814  default:
815  mpChoice_ToVinyl->SetSelection(kVinyl_NA);
816  }
817  // and update variables.
818  mFromVinyl = mpChoice_FromVinyl->GetSelection();
819  mToVinyl = mpChoice_ToVinyl->GetSelection();
820 }

References PluginSettings::GetConfig(), Effect::GetCurrentSettingsGroup(), Effect::GetDefinition(), kVinyl_33AndAThird, kVinyl_45, kVinyl_78, kVinyl_NA, m_PercentChange, mFromVinyl, mpChoice_FromVinyl, mpChoice_ToVinyl, mToVinyl, and PluginSettings::Private.

Referenced by OnSlider_PercentChange(), OnText_Multiplier(), OnText_PercentChange(), OnTimeCtrl_ToLength(), and TransferDataToWindow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateUI()

void EffectChangeSpeed::UpdateUI ( )
private

Definition at line 836 of file ChangeSpeed.cpp.

838 {
839  EnableApply(m_PercentChange >= MIN_Percentage && m_PercentChange <= MAX_Percentage);
840 }

References Effect::EnableApply(), and m_PercentChange.

Referenced by OnChoice_Vinyl(), OnSlider_PercentChange(), OnText_Multiplier(), OnText_PercentChange(), and OnTimeCtrl_ToLength().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_PercentChange

double EffectChangeSpeed::m_PercentChange
private

◆ mbLoopDetect

bool EffectChangeSpeed::mbLoopDetect
private

◆ mCurT0

double EffectChangeSpeed::mCurT0
private

Definition at line 86 of file ChangeSpeed.h.

Referenced by Process(), and ProcessOne().

◆ mCurT1

double EffectChangeSpeed::mCurT1
private

Definition at line 87 of file ChangeSpeed.h.

Referenced by Process(), and ProcessOne().

◆ mCurTrackNum

int EffectChangeSpeed::mCurTrackNum
private

Definition at line 84 of file ChangeSpeed.h.

Referenced by Process(), and ProcessOne().

◆ mFactor

double EffectChangeSpeed::mFactor
private

Definition at line 94 of file ChangeSpeed.h.

Referenced by Process(), ProcessLabelTrack(), and ProcessOne().

◆ mFormat

NumericFormatSymbol EffectChangeSpeed::mFormat
private

◆ mFromLength

double EffectChangeSpeed::mFromLength
private

◆ mFromVinyl

int EffectChangeSpeed::mFromVinyl
private

◆ mMaxNewLength

double EffectChangeSpeed::mMaxNewLength
private

Definition at line 85 of file ChangeSpeed.h.

Referenced by Process(), and ProcessOne().

◆ mMultiplier

double EffectChangeSpeed::mMultiplier
private

Definition at line 97 of file ChangeSpeed.h.

Referenced by OnText_Multiplier(), PopulateOrExchange(), and Update_Text_Multiplier().

◆ mpChoice_FromVinyl

wxChoice* EffectChangeSpeed::mpChoice_FromVinyl
private

◆ mpChoice_ToVinyl

wxChoice* EffectChangeSpeed::mpChoice_ToVinyl
private

◆ mpFromLengthCtrl

NumericTextCtrl* EffectChangeSpeed::mpFromLengthCtrl
private

Definition at line 107 of file ChangeSpeed.h.

Referenced by OnTimeCtrlUpdate(), PopulateOrExchange(), and TransferDataToWindow().

◆ mpSlider_PercentChange

wxSlider* EffectChangeSpeed::mpSlider_PercentChange
private

◆ mpTextCtrl_Multiplier

wxTextCtrl* EffectChangeSpeed::mpTextCtrl_Multiplier
private

Definition at line 103 of file ChangeSpeed.h.

Referenced by OnText_Multiplier(), PopulateOrExchange(), and Update_Text_Multiplier().

◆ mpTextCtrl_PercentChange

wxTextCtrl* EffectChangeSpeed::mpTextCtrl_PercentChange
private

◆ mpToLengthCtrl

NumericTextCtrl* EffectChangeSpeed::mpToLengthCtrl
private

◆ mRate

double EffectChangeSpeed::mRate
private

Definition at line 109 of file ChangeSpeed.h.

◆ mTimeCtrlFormat

int EffectChangeSpeed::mTimeCtrlFormat
private

Definition at line 96 of file ChangeSpeed.h.

◆ mToLength

double EffectChangeSpeed::mToLength
private

◆ mToVinyl

int EffectChangeSpeed::mToVinyl
private

Definition at line 112 of file ChangeSpeed.h.

Referenced by OnChoice_Vinyl(), TransferDataToWindow(), and Update_Vinyl().

◆ Symbol

const ComponentInterfaceSymbol EffectChangeSpeed::Symbol { XO("Change Speed") }
static

Definition at line 27 of file ChangeSpeed.h.

Referenced by GetSymbol().


The documentation for this class was generated from the following files:
EffectChangeSpeed::mpChoice_FromVinyl
wxChoice * mpChoice_FromVinyl
Definition: ChangeSpeed.h:105
EffectChangeSpeed::ProcessOne
bool ProcessOne(WaveTrack *t, sampleCount start, sampleCount end)
Definition: ChangeSpeed.cpp:489
EffectChangeSpeed::Update_Text_Multiplier
void Update_Text_Multiplier()
Definition: ChangeSpeed.cpp:746
kSliderMax
static const double kSliderMax
Definition: ChangeSpeed.cpp:74
NumericTextCtrl::SetFormatName
bool SetFormatName(const NumericFormatSymbol &formatName)
Definition: NumericTextCtrl.cpp:1445
WaveTrack
A Track that contains audio waveform data.
Definition: WaveTrack.h:75
EffectTypeProcess
@ EffectTypeProcess
Definition: EffectInterface.h:56
EffectChangeSpeed::ProcessLabelTrack
bool ProcessLabelTrack(LabelTrack *t)
Definition: ChangeSpeed.cpp:478
Effect::SetLinearEffectFlag
void SetLinearEffectFlag(bool linearEffectFlag)
Definition: Effect.cpp:1764
Effect::EnableApply
bool EnableApply(bool enable=true)
Definition: Effect.cpp:1694
S
#define S(N)
Definition: ToChars.cpp:64
EffectChangeSpeed::Symbol
static const ComponentInterfaceSymbol Symbol
Definition: ChangeSpeed.h:27
ID_Multiplier
@ ID_Multiplier
Definition: ChangeSpeed.cpp:42
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:71
kVinyl_NA
@ kVinyl_NA
Definition: ChangeSpeed.cpp:55
EffectChangeSpeed::mToVinyl
int mToVinyl
Definition: ChangeSpeed.h:112
WaveTrack::GetEndTime
double GetEndTime() const override
Get the time at which the last clip in the track ends, plus recorded stuff.
Definition: WaveTrack.cpp:2014
EffectChangeSpeed::mbLoopDetect
bool mbLoopDetect
Definition: ChangeSpeed.h:99
Effect::CopyInputTracks
void CopyInputTracks(bool allSyncLockSelected=false)
Definition: Effect.cpp:1834
kVinyl_33AndAThird
@ kVinyl_33AndAThird
Definition: ChangeSpeed.cpp:52
EffectChangeSpeed::mpToLengthCtrl
NumericTextCtrl * mpToLengthCtrl
Definition: ChangeSpeed.h:108
Effect::mT1
double mT1
Definition: Effect.h:424
XO
#define XO(s)
Definition: Internat.h:31
XC
#define XC(s, c)
Definition: Internat.h:37
LabelTrack
A LabelTrack is a Track that holds labels (LabelStruct).
Definition: LabelTrack.h:89
gap
static const int gap
Definition: MeterPanel.cpp:256
Effect::SaveUserPreset
bool SaveUserPreset(const RegistryPath &name) override
Save current settings as a user-named preset.
Definition: Effect.cpp:547
NumericTextCtrl
Definition: NumericTextCtrl.h:172
PluginSettings::SetConfig
bool SetConfig(EffectDefinitionInterface &ident, ConfigurationType type, const RegistryPath &group, const RegistryPath &key, const Value &value)
Definition: ConfigInterface.h:97
EffectChangeSpeed::mpTextCtrl_PercentChange
wxTextCtrl * mpTextCtrl_PercentChange
Definition: ChangeSpeed.h:102
NumericTextCtrl::SetValue
void SetValue(double newValue)
Definition: NumericTextCtrl.cpp:1474
ID_FromVinyl
@ ID_FromVinyl
Definition: ChangeSpeed.cpp:43
kSliderWarp
static const double kSliderWarp
Definition: ChangeSpeed.cpp:75
EffectChangeSpeed::Update_Vinyl
void Update_Vinyl()
Definition: ChangeSpeed.cpp:768
NumericTextCtrl::Options
Definition: NumericTextCtrl.h:178
EffectChangeSpeed::Update_Slider_PercentChange
void Update_Slider_PercentChange()
Definition: ChangeSpeed.cpp:753
floatSample
@ floatSample
Definition: SampleFormat.h:34
EffectChangeSpeed::mCurTrackNum
int mCurTrackNum
Definition: ChangeSpeed.h:84
ID_ToLength
@ ID_ToLength
Definition: ChangeSpeed.cpp:45
EffectChangeSpeed::mToLength
double mToLength
Definition: ChangeSpeed.h:113
Effect::mProjectRate
double mProjectRate
Definition: Effect.h:416
NumericConverter::DefaultSelectionFormat
static NumericFormatSymbol DefaultSelectionFormat()
Definition: NumericTextCtrl.cpp:690
NumericConverter::LookupFormat
static NumericFormatSymbol LookupFormat(Type type, const wxString &id)
Definition: NumericTextCtrl.cpp:704
EffectChangeSpeed::mCurT0
double mCurT0
Definition: ChangeSpeed.h:86
XXO
#define XXO(s)
Definition: Internat.h:44
EffectChangeSpeed::m_PercentChange
double m_PercentChange
Definition: ChangeSpeed.h:90
Effect::mT0
double mT0
Definition: Effect.h:423
EffectChangeSpeed::mCurT1
double mCurT1
Definition: ChangeSpeed.h:87
EffectChangeSpeed::mMaxNewLength
double mMaxNewLength
Definition: ChangeSpeed.h:85
SyncLock::IsSyncLockSelected
static bool IsSyncLockSelected(const Track *pTrack)
Definition: SyncLock.cpp:43
EffectChangeSpeed::mpChoice_ToVinyl
wxChoice * mpChoice_ToVinyl
Definition: ChangeSpeed.h:106
EffectChangeSpeed::mFormat
NumericFormatSymbol mFormat
Definition: ChangeSpeed.h:114
ID_PercentChange
@ ID_PercentChange
Definition: ChangeSpeed.cpp:41
RegionTimeWarper
No change before the specified region; during the region, warp according to the given warper; after t...
Definition: TimeWarper.h:192
Effect::LoadFactoryDefaults
bool LoadFactoryDefaults() override
Change settings back to "factory default".
Definition: Effect.cpp:582
Effect::ReplaceProcessedTracks
void ReplaceProcessedTracks(const bool bGoodResult)
Definition: Effect.cpp:1956
NumericConverter::TIME
@ TIME
Definition: NumericTextCtrl.h:52
PluginSettings::GetConfig
bool GetConfig(EffectDefinitionInterface &ident, ConfigurationType type, const RegistryPath &group, const RegistryPath &key, Value &var, const Value &defval)
Definition: ConfigInterface.h:70
Track::Fallthrough
Continuation<> Fallthrough
Type of arguments passed as optional second parameter to TypeSwitch<void>() cases.
Definition: Track.h:499
format
int format
Definition: ExportPCM.cpp:56
NumericTextCtrl::Options::MenuEnabled
Options & MenuEnabled(bool enable)
Definition: NumericTextCtrl.h:192
SyncLock::IsSelectedOrSyncLockSelected
static bool IsSelectedOrSyncLockSelected(const Track *pTrack)
Definition: SyncLock.cpp:73
WaveTrack::GetStartTime
double GetStartTime() const override
Get the time at which the first clip in the track starts.
Definition: WaveTrack.cpp:1994
Resample
Interface to libsoxr.
Definition: Resample.h:27
Effect::mOutputTracks
std::shared_ptr< TrackList > mOutputTracks
Definition: Effect.h:422
ReadAndVerifyDouble
#define ReadAndVerifyDouble(name)
Definition: Effect.h:592
kVinyl_78
@ kVinyl_78
Definition: ChangeSpeed.cpp:54
Effect::GetCurrentSettingsGroup
RegistryPath GetCurrentSettingsGroup() override
Definition: Effect.cpp:820
Track::GetSelected
bool GetSelected() const
Definition: Track.h:428
samplePtr
char * samplePtr
Definition: SampleFormat.h:49
EffectChangeSpeed::Update_Text_PercentChange
void Update_Text_PercentChange()
Definition: ChangeSpeed.cpp:740
EffectChangeSpeed::mMultiplier
double mMultiplier
Definition: ChangeSpeed.h:97
EffectChangeSpeed::mFromLength
double mFromLength
Definition: ChangeSpeed.h:95
FileConfig::Flush
virtual bool Flush(bool bCurrentOnly=false) wxOVERRIDE
Definition: FileConfig.cpp:143
ID_ToVinyl
@ ID_ToVinyl
Definition: ChangeSpeed.cpp:44
Track
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:224
EffectChangeSpeed::mpFromLengthCtrl
NumericTextCtrl * mpFromLengthCtrl
Definition: ChangeSpeed.h:107
Effect::mUIParent
wxWindow * mUIParent
Definition: Effect.h:438
kVinyl_45
@ kVinyl_45
Definition: ChangeSpeed.cpp:53
LinearTimeWarper
Linear scaling, initialised by giving two points on the line.
Definition: TimeWarper.h:87
NumericTextCtrl::Options::ReadOnly
Options & ReadOnly(bool enable)
Definition: NumericTextCtrl.h:191
ComponentInterfaceSymbol::Internal
const wxString & Internal() const
Definition: ComponentInterfaceSymbol.h:55
XXC
#define XXC(s, c)
Definition: Internat.h:47
EffectChangeSpeed::mFactor
double mFactor
Definition: ChangeSpeed.h:94
SampleTrack::TimeToLongSamples
sampleCount TimeToLongSamples(double t0) const
Convert correctly between an (absolute) time in seconds and a number of samples.
Definition: SampleTrack.cpp:35
Effect::GetDefinition
EffectDefinitionInterface & GetDefinition() override
Definition: Effect.cpp:759
TrapDouble
double TrapDouble(double x, double min, double max)
Definition: Effect.h:523
safenew
#define safenew
Definition: MemoryX.h:10
EffectChangeSpeed::mFromVinyl
int mFromVinyl
Definition: ChangeSpeed.h:93
limitSampleBufferSize
size_t limitSampleBufferSize(size_t bufferSize, sampleCount limit)
Definition: SampleCount.cpp:23
NumericConverter::GetValue
double GetValue()
Definition: NumericTextCtrl.cpp:1174
kVinylStrings
static const TranslatableStrings kVinylStrings
Definition: ChangeSpeed.cpp:58
Effect::TrackProgress
bool TrackProgress(int whichTrack, double frac, const TranslatableString &={})
Definition: Effect.cpp:1788
ArrayOf< float >
EffectChangeSpeed::mpTextCtrl_Multiplier
wxTextCtrl * mpTextCtrl_Multiplier
Definition: ChangeSpeed.h:103
EffectChangeSpeed::UpdateUI
void UpdateUI()
Definition: ChangeSpeed.cpp:836
PluginSettings::Private
@ Private
Definition: PluginInterface.h:56
EffectChangeSpeed::Update_TimeCtrl_ToLength
void Update_TimeCtrl_ToLength()
Definition: ChangeSpeed.cpp:822
EffectChangeSpeed::mpSlider_PercentChange
wxSlider * mpSlider_PercentChange
Definition: ChangeSpeed.h:104