Audacity  3.0.3
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
 
wxString ManualPage () override
 
EffectType GetType () override
 
bool DefineParams (ShuttleParams &S) override
 
bool GetAutomationParameters (CommandParameters &parms) override
 
bool SetAutomationParameters (CommandParameters &parms) override
 
bool LoadFactoryDefaults () 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
 
EffectFamilySymbol GetFamily () override
 
bool IsInteractive () override
 
bool IsDefault () override
 
bool IsLegacy () override
 
bool SupportsRealtime () override
 
bool SupportsAutomation () override
 
bool SetHost (EffectHostInterface *host) override
 
unsigned GetAudioInCount () override
 
unsigned GetAudioOutCount () override
 
int GetMidiInCount () override
 
int GetMidiOutCount () override
 
sampleCount GetLatency () override
 
size_t GetTailSize () override
 
void SetSampleRate (double rate) override
 
size_t SetBlockSize (size_t maxBlockSize) override
 
size_t GetBlockSize () const override
 
bool IsReady () override
 
bool ProcessInitialize (sampleCount totalLen, ChannelNames chanMap=NULL) override
 
bool ProcessFinalize () override
 
size_t ProcessBlock (float **inBlock, float **outBlock, size_t blockLen) override
 
bool RealtimeInitialize () override
 
bool RealtimeAddProcessor (unsigned numChannels, float sampleRate) override
 
bool RealtimeFinalize () override
 
bool RealtimeSuspend () override
 
bool RealtimeResume () override
 
bool RealtimeProcessStart () override
 
size_t RealtimeProcess (int group, float **inbuf, float **outbuf, size_t numSamples) override
 
bool RealtimeProcessEnd () override
 
bool ShowInterface (wxWindow &parent, const EffectDialogFactory &factory, bool forceModal=false) override
 
bool GetAutomationParameters (CommandParameters &parms) override
 
bool SetAutomationParameters (CommandParameters &parms) override
 
bool LoadUserPreset (const RegistryPath &name) override
 
bool SaveUserPreset (const RegistryPath &name) override
 
RegistryPaths GetFactoryPresets () override
 
bool LoadFactoryPreset (int id) override
 
bool LoadFactoryDefaults () override
 
void SetHostUI (EffectUIHostInterface *host) override
 
bool PopulateUI (ShuttleGui &S) final
 
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
 
double GetDefaultDuration () 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 ()
 
bool HasSharedConfigGroup (const RegistryPath &group) override
 
bool GetSharedConfigSubgroups (const RegistryPath &group, RegistryPaths &subgroups) override
 
bool GetSharedConfig (const RegistryPath &group, const RegistryPath &key, wxString &value, const wxString &defval={}) override
 
bool GetSharedConfig (const RegistryPath &group, const RegistryPath &key, int &value, int defval=0) override
 
bool GetSharedConfig (const RegistryPath &group, const RegistryPath &key, bool &value, bool defval=false) override
 
bool GetSharedConfig (const RegistryPath &group, const RegistryPath &key, float &value, float defval=0.0) override
 
bool GetSharedConfig (const RegistryPath &group, const RegistryPath &key, double &value, double defval=0.0) override
 
bool SetSharedConfig (const RegistryPath &group, const RegistryPath &key, const wxString &value) override
 
bool SetSharedConfig (const RegistryPath &group, const RegistryPath &key, const int &value) override
 
bool SetSharedConfig (const RegistryPath &group, const RegistryPath &key, const bool &value) override
 
bool SetSharedConfig (const RegistryPath &group, const RegistryPath &key, const float &value) override
 
bool SetSharedConfig (const RegistryPath &group, const RegistryPath &key, const double &value) override
 
bool RemoveSharedConfigSubgroup (const RegistryPath &group) override
 
bool RemoveSharedConfig (const RegistryPath &group, const RegistryPath &key) override
 
bool HasPrivateConfigGroup (const RegistryPath &group) override
 
bool GetPrivateConfigSubgroups (const RegistryPath &group, RegistryPaths &paths) override
 
bool GetPrivateConfig (const RegistryPath &group, const RegistryPath &key, wxString &value, const wxString &defval={}) override
 
bool GetPrivateConfig (const RegistryPath &group, const RegistryPath &key, int &value, int defval=0) override
 
bool GetPrivateConfig (const RegistryPath &group, const RegistryPath &key, bool &value, bool defval=false) override
 
bool GetPrivateConfig (const RegistryPath &group, const RegistryPath &key, float &value, float defval=0.0) override
 
bool GetPrivateConfig (const RegistryPath &group, const RegistryPath &key, double &value, double defval=0.0) override
 
bool SetPrivateConfig (const RegistryPath &group, const RegistryPath &key, const wxString &value) override
 
bool SetPrivateConfig (const RegistryPath &group, const RegistryPath &key, const int &value) override
 
bool SetPrivateConfig (const RegistryPath &group, const RegistryPath &key, const bool &value) override
 
bool SetPrivateConfig (const RegistryPath &group, const RegistryPath &key, const float &value) override
 
bool SetPrivateConfig (const RegistryPath &group, const RegistryPath &key, const double &value) override
 
bool RemovePrivateConfigSubgroup (const RegistryPath &group) override
 
bool RemovePrivateConfig (const RegistryPath &group, const RegistryPath &key) override
 
virtual PluginID GetID ()
 
virtual bool Startup (EffectClientInterface *client)
 
virtual bool GetAutomationParameters (wxString &parms)
 
virtual bool SetAutomationParameters (const wxString &parms)
 
virtual RegistryPaths GetUserPresets ()
 
virtual bool HasCurrentSettings ()
 
virtual bool HasFactoryDefaults ()
 
virtual wxString HelpPage ()
 
virtual void SetUIFlags (unsigned flags)
 
virtual unsigned TestUIFlags (unsigned mask)
 
virtual bool IsBatchProcessing ()
 
virtual void SetBatchProcessing (bool start)
 
void SetPresetParameters (const wxArrayString *Names, const wxArrayString *Values)
 
bool DoEffect (double projectRate, TrackList *list, WaveTrackFactory *factory, NotifyingSelectedRegion &selectedRegion, wxWindow *pParent=nullptr, const EffectDialogFactory &dialogFactory={})
 
bool Delegate (Effect &delegate, wxWindow &parent, const EffectDialogFactory &factory)
 
virtual bool IsHidden ()
 
int MessageBox (const TranslatableString &message, long style=DefaultMessageBoxStyle, const TranslatableString &titleStr={})
 
- Public Member Functions inherited from EffectClientInterface
virtual ~EffectClientInterface ()
 
- Public Member Functions inherited from EffectDefinitionInterface
virtual ~EffectDefinitionInterface ()
 
virtual EffectType GetClassification ()
 
- Public Member Functions inherited from ComponentInterface
virtual ~ComponentInterface ()
 
TranslatableString GetName ()
 
virtual bool DefineParams (ShuttleParams &WXUNUSED(S))
 
- Public Member Functions inherited from EffectUIClientInterface
virtual ~EffectUIClientInterface ()
 
- Public Member Functions inherited from EffectHostInterface
virtual ~EffectHostInterface ()
 
- Public Member Functions inherited from ConfigClientInterface
virtual ~ConfigClientInterface ()
 

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 }
 
using VetoDialogHook = bool(*)(wxDialog *)
 
- Public Types inherited from EffectClientInterface
using EffectDialogFactory = std::function< wxDialog *(wxWindow &parent, EffectHostInterface *, EffectUIClientInterface *) >
 
- Static Public Member Functions inherited from Effect
static VetoDialogHook SetVetoDialogHook (VetoDialogHook hook)
 
static CommandID GetSquashedName (wxString name)
 
static void IncEffectCounter ()
 
- Protected Member Functions inherited from Effect
virtual bool ProcessPass ()
 
virtual bool InitPass1 ()
 
virtual bool InitPass2 ()
 
virtual int GetPass ()
 
virtual void End ()
 
virtual void Preview (bool dryOnly)
 
virtual bool EnableApply (bool enable=true)
 
virtual bool EnablePreview (bool enable=true)
 
virtual void EnableDebug (bool enable=true)
 
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
ProgressDialogmProgress
 
double mProjectRate
 
double mSampleRate
 
wxWeakRef< NotifyingSelectedRegionmpSelectedRegion {}
 
WaveTrackFactorymFactory
 
std::shared_ptr< TrackListmOutputTracks
 
double mT0
 
double mT1
 
wxArrayString mPresetNames
 
wxArrayString mPresetValues
 
int mPass
 
wxDialog * mUIDialog
 
wxWindow * mUIParent
 
int mUIResultID
 
unsigned mUIFlags
 
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 95 of file ChangeSpeed.cpp.

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

References NumericConverter::DefaultSelectionFormat(), and kVinyl_33AndAThird.

Here is the call graph for this function:

◆ ~EffectChangeSpeed()

EffectChangeSpeed::~EffectChangeSpeed ( )
virtual

Definition at line 110 of file ChangeSpeed.cpp.

111 {
112 }

Member Function Documentation

◆ CalcPreviewInputLength()

double EffectChangeSpeed::CalcPreviewInputLength ( double  previewLength)
overridevirtual

Reimplemented from Effect.

Definition at line 176 of file ChangeSpeed.cpp.

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

References m_PercentChange.

◆ CheckWhetherSkipEffect()

bool EffectChangeSpeed::CheckWhetherSkipEffect ( )
overridevirtual

Reimplemented from Effect.

Definition at line 171 of file ChangeSpeed.cpp.

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

References m_PercentChange.

◆ DefineParams()

bool EffectChangeSpeed::DefineParams ( ShuttleParams S)
override

Definition at line 140 of file ChangeSpeed.cpp.

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

References m_PercentChange.

◆ GetAutomationParameters()

bool EffectChangeSpeed::GetAutomationParameters ( CommandParameters parms)
overridevirtual

Implements EffectClientInterface.

Definition at line 145 of file ChangeSpeed.cpp.

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

References m_PercentChange.

◆ GetDescription()

TranslatableString EffectChangeSpeed::GetDescription ( )
overridevirtual

Implements ComponentInterface.

Definition at line 121 of file ChangeSpeed.cpp.

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

References XO.

◆ GetSymbol()

ComponentInterfaceSymbol EffectChangeSpeed::GetSymbol ( )
overridevirtual

Implements ComponentInterface.

Definition at line 116 of file ChangeSpeed.cpp.

117 {
118  return Symbol;
119 }

References Symbol.

◆ GetType()

EffectType EffectChangeSpeed::GetType ( )
overridevirtual

Implements EffectDefinitionInterface.

Definition at line 134 of file ChangeSpeed.cpp.

135 {
136  return EffectTypeProcess;
137 }

References EffectTypeProcess.

◆ Init()

bool EffectChangeSpeed::Init ( )
overridevirtual

Reimplemented from Effect.

Definition at line 222 of file ChangeSpeed.cpp.

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

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

◆ LoadFactoryDefaults()

bool EffectChangeSpeed::LoadFactoryDefaults ( )
overridevirtual

Implements EffectClientInterface.

Definition at line 161 of file ChangeSpeed.cpp.

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

Here is the call graph for this function:

◆ ManualPage()

wxString EffectChangeSpeed::ManualPage ( )
overridevirtual

Reimplemented from Effect.

Definition at line 126 of file ChangeSpeed.cpp.

127 {
128  return wxT("Change_Speed");
129 }

◆ OnChoice_Vinyl()

void EffectChangeSpeed::OnChoice_Vinyl ( wxCommandEvent &  evt)
private

Definition at line 656 of file ChangeSpeed.cpp.

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

References Effect::GetCurrentSettingsGroup(), kVinyl_33AndAThird, kVinyl_45, kVinyl_78, kVinyl_NA, m_PercentChange, mbLoopDetect, mFromVinyl, mpChoice_FromVinyl, mpChoice_ToVinyl, mToVinyl, Effect::SetPrivateConfig(), 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 637 of file ChangeSpeed.cpp.

638 {
639  if (mbLoopDetect)
640  return;
641 
642  m_PercentChange = (double)(mpSlider_PercentChange->GetValue());
643  // Warp positive values to actually go up faster & further than negatives.
644  if (m_PercentChange > 0.0)
646  UpdateUI();
647 
648  mbLoopDetect = true;
651  Update_Vinyl();
653  mbLoopDetect = false;
654 }

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 620 of file ChangeSpeed.cpp.

621 {
622  if (mbLoopDetect)
623  return;
624 
625  mpTextCtrl_Multiplier->GetValidator()->TransferFromWindow();
626  m_PercentChange = 100 * (mMultiplier - 1);
627  UpdateUI();
628 
629  mbLoopDetect = true;
632  Update_Vinyl();
634  mbLoopDetect = false;
635 }

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 604 of file ChangeSpeed.cpp.

605 {
606  if (mbLoopDetect)
607  return;
608 
609  mpTextCtrl_PercentChange->GetValidator()->TransferFromWindow();
610  UpdateUI();
611 
612  mbLoopDetect = true;
615  Update_Vinyl();
617  mbLoopDetect = false;
618 }

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 696 of file ChangeSpeed.cpp.

697 {
698  if (mbLoopDetect)
699  return;
700 
702  // Division by (double) 0.0 is not an error and we want to show "infinite" in
703  // text controls, so take care that we handle infinite values when they occur.
704  m_PercentChange = ((mFromLength * 100.0) / mToLength) - 100.0;
705  UpdateUI();
706 
707  mbLoopDetect = true;
708 
712  Update_Vinyl();
713 
714  mbLoopDetect = false;
715 }

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 717 of file ChangeSpeed.cpp.

718 {
720  NumericConverter::TIME, evt.GetString() );
721 
723  // Update From/To Length controls (precision has changed).
726 }

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 293 of file ChangeSpeed.cpp.

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

References ShuttleGuiBase::AddPrompt(), ShuttleGuiBase::AddSlider(), ShuttleGui::AddSpace(), ShuttleGuiBase::AddTitle(), ShuttleGuiBase::AddUnits(), ShuttleGuiBase::AddWindow(), ShuttleGuiBase::EndHorizontalLay(), ShuttleGuiBase::EndMultiColumn(), ShuttleGuiBase::EndStatic(), ShuttleGuiBase::EndVerticalLay(), Effect::GetCurrentSettingsGroup(), ShuttleGuiBase::GetParent(), Effect::GetPrivateConfig(), ShuttleGui::Id(), 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, ShuttleGui::Name(), ShuttleGui::Position(), NumericTextCtrl::Options::ReadOnly(), safenew, ShuttleGuiBase::SetBorder(), ShuttleGuiBase::StartHorizontalLay(), ShuttleGuiBase::StartMultiColumn(), ShuttleGuiBase::StartStatic(), ShuttleGuiBase::StartVerticalLay(), NumericConverter::TIME, ShuttleGui::ToolTip(), ShuttleGui::Validator(), XC, XO, XXC, and XXO.

Here is the call graph for this function:

◆ Process()

bool EffectChangeSpeed::Process ( )
overridevirtual

Reimplemented from Effect.

Definition at line 230 of file ChangeSpeed.cpp.

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

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

Here is the call graph for this function:

◆ ProcessLabelTrack()

bool EffectChangeSpeed::ProcessLabelTrack ( LabelTrack t)
private

Definition at line 470 of file ChangeSpeed.cpp.

471 {
472  RegionTimeWarper warper { mT0, mT1,
473  std::make_unique<LinearTimeWarper>(mT0, mT0,
474  mT1, mT0 + (mT1-mT0)*mFactor) };
475  lt->WarpLabels(warper);
476  return true;
477 }

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 481 of file ChangeSpeed.cpp.

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

References WaveTrack::ClearAndPaste(), WaveTrack::EmptyCopy(), floatSample, gap, WaveTrack::Get(), WaveTrack::GetBestBlockSize(), WaveTrack::GetMaxBlockSize(), limitSampleBufferSize(), WaveTrack::LongSamplesToTime(), mCurT0, mCurT1, mCurTrackNum, mFactor, mMaxNewLength, Resample::Process(), WaveTrack::SortedClipArray(), WaveTrack::SplitDelete(), WaveTrack::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

Implements EffectClientInterface.

Definition at line 152 of file ChangeSpeed.cpp.

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

References m_PercentChange, and ReadAndVerifyDouble.

◆ Startup()

bool EffectChangeSpeed::Startup ( )
overridevirtual

Reimplemented from Effect.

Definition at line 181 of file ChangeSpeed.cpp.

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

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

Here is the call graph for this function:

◆ TransferDataFromWindow()

bool EffectChangeSpeed::TransferDataFromWindow ( )
overridevirtual

Reimplemented from Effect.

Definition at line 450 of file ChangeSpeed.cpp.

451 {
452  // mUIParent->TransferDataFromWindow() loses some precision, so save and restore it.
453  double exactPercent = m_PercentChange;
454  if (!mUIParent->Validate() || !mUIParent->TransferDataFromWindow())
455  {
456  return false;
457  }
458  m_PercentChange = exactPercent;
459 
460  SetPrivateConfig(GetCurrentSettingsGroup(), wxT("TimeFormat"), mFormat.Internal());
461  SetPrivateConfig(GetCurrentSettingsGroup(), wxT("VinylChoice"), mFromVinyl);
462 
463  return true;
464 }

References Effect::GetCurrentSettingsGroup(), ComponentInterfaceSymbol::Internal(), m_PercentChange, mFormat, mFromVinyl, Effect::mUIParent, and Effect::SetPrivateConfig().

Here is the call graph for this function:

◆ TransferDataToWindow()

bool EffectChangeSpeed::TransferDataToWindow ( )
overridevirtual

Reimplemented from Effect.

Definition at line 414 of file ChangeSpeed.cpp.

415 {
416  mbLoopDetect = true;
417 
418  if (!mUIParent->TransferDataToWindow())
419  {
420  return false;
421  }
422 
423  if (mFromVinyl == kVinyl_NA)
424  {
426  }
427 
432 
433  // Set from/to Vinyl controls - mFromVinyl must be set first.
434  mpChoice_FromVinyl->SetSelection(mFromVinyl);
435  // Then update to get correct mToVinyl.
436  Update_Vinyl();
437  // Then update ToVinyl control.
438  mpChoice_ToVinyl->SetSelection(mToVinyl);
439 
440  // Set From Length control.
441  // Set the format first so we can get sample accuracy.
444 
445  mbLoopDetect = false;
446 
447  return true;
448 }

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 743 of file ChangeSpeed.cpp.

745 {
746  auto unwarped = std::min<double>(m_PercentChange, MAX_Percentage);
747  if (unwarped > 0.0)
748  // Un-warp values above zero to actually go up to kSliderMax.
749  unwarped = pow(m_PercentChange, (1.0 / kSliderWarp));
750 
751  // Caution: m_PercentChange could be infinite.
752  int unwarpedi = (int)(unwarped + 0.5);
753  unwarpedi = std::min<int>(unwarpedi, (int)kSliderMax);
754 
755  mpSlider_PercentChange->SetValue(unwarpedi);
756 }

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 736 of file ChangeSpeed.cpp.

738 {
739  mMultiplier = 1 + (m_PercentChange) / 100.0;
740  mpTextCtrl_Multiplier->GetValidator()->TransferToWindow();
741 }

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 730 of file ChangeSpeed.cpp.

732 {
733  mpTextCtrl_PercentChange->GetValidator()->TransferToWindow();
734 }

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 811 of file ChangeSpeed.cpp.

813 {
814  mToLength = (mFromLength * 100.0) / (100.0 + m_PercentChange);
815 
816  // Set the format first so we can get sample accuracy.
818  // Negative times do not make sense.
819  // 359999 = 99h:59m:59s which is a little less disturbing than overflow characters
820  // though it may still look a bit strange with some formats.
821  mToLength = TrapDouble(mToLength, 0.0, 359999.0);
823 }

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 758 of file ChangeSpeed.cpp.

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

References Effect::GetCurrentSettingsGroup(), Effect::GetPrivateConfig(), kVinyl_33AndAThird, kVinyl_45, kVinyl_78, kVinyl_NA, m_PercentChange, mFromVinyl, mpChoice_FromVinyl, mpChoice_ToVinyl, and mToVinyl.

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 825 of file ChangeSpeed.cpp.

827 {
828  EnableApply(m_PercentChange >= MIN_Percentage && m_PercentChange <= MAX_Percentage);
829 }

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:481
EffectChangeSpeed::Update_Text_Multiplier
void Update_Text_Multiplier()
Definition: ChangeSpeed.cpp:736
kSliderMax
static const double kSliderMax
Definition: ChangeSpeed.cpp:73
NumericTextCtrl::SetFormatName
bool SetFormatName(const NumericFormatSymbol &formatName)
Definition: NumericTextCtrl.cpp:1441
ShuttleGuiBase::StartVerticalLay
void StartVerticalLay(int iProp=1)
Definition: ShuttleGui.cpp:1177
WaveTrack
A Track that contains audio waveform data.
Definition: WaveTrack.h:68
EffectTypeProcess
@ EffectTypeProcess
Definition: EffectInterface.h:59
EffectChangeSpeed::ProcessLabelTrack
bool ProcessLabelTrack(LabelTrack *t)
Definition: ChangeSpeed.cpp:470
Effect::SetLinearEffectFlag
void SetLinearEffectFlag(bool linearEffectFlag)
Definition: Effect.cpp:2000
Effect::EnableApply
virtual bool EnableApply(bool enable=true)
Definition: Effect.cpp:1925
EffectChangeSpeed::Symbol
static const ComponentInterfaceSymbol Symbol
Definition: ChangeSpeed.h:27
ShuttleGuiBase::AddTitle
void AddTitle(const TranslatableString &Prompt, int wrapWidth=0)
Centred text string.
Definition: ShuttleGui.cpp:274
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:67
kVinyl_NA
@ kVinyl_NA
Definition: ChangeSpeed.cpp:54
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:1797
EffectChangeSpeed::mbLoopDetect
bool mbLoopDetect
Definition: ChangeSpeed.h:99
ShuttleGui::ToolTip
ShuttleGui & ToolTip(const TranslatableString &tip)
Definition: ShuttleGui.h:663
Effect::CopyInputTracks
void CopyInputTracks(bool allSyncLockSelected=false)
Definition: Effect.cpp:2070
kVinyl_33AndAThird
@ kVinyl_33AndAThird
Definition: ChangeSpeed.cpp:51
EffectChangeSpeed::mpToLengthCtrl
NumericTextCtrl * mpToLengthCtrl
Definition: ChangeSpeed.h:108
Effect::mT1
double mT1
Definition: Effect.h:466
ShuttleGui::AddSpace
wxSizerItem * AddSpace(int width, int height, int prop=0)
Definition: ShuttleGui.cpp:2421
XO
#define XO(s)
Definition: Internat.h:32
XC
#define XC(s, c)
Definition: Internat.h:38
Effect::SetPrivateConfig
bool SetPrivateConfig(const RegistryPath &group, const RegistryPath &key, const wxString &value) override
Definition: Effect.cpp:986
LabelTrack
A LabelTrack is a Track that holds labels (LabelStruct).
Definition: LabelTrack.h:88
ShuttleGuiBase::EndMultiColumn
void EndMultiColumn()
Definition: ShuttleGui.cpp:1212
floatSample
@ floatSample
Definition: Types.h:714
ID_Multiplier
@ ID_Multiplier
Definition: ChangeSpeed.cpp:41
Effect::SaveUserPreset
bool SaveUserPreset(const RegistryPath &name) override
Definition: Effect.cpp:569
NumericTextCtrl
Definition: NumericTextCtrl.h:169
EffectChangeSpeed::mpTextCtrl_PercentChange
wxTextCtrl * mpTextCtrl_PercentChange
Definition: ChangeSpeed.h:102
NumericTextCtrl::SetValue
void SetValue(double newValue)
Definition: NumericTextCtrl.cpp:1470
Track::IsSyncLockSelected
bool IsSyncLockSelected() const
Definition: Track.cpp:245
kSliderWarp
static const double kSliderWarp
Definition: ChangeSpeed.cpp:74
EffectChangeSpeed::Update_Vinyl
void Update_Vinyl()
Definition: ChangeSpeed.cpp:758
ID_FromVinyl
@ ID_FromVinyl
Definition: ChangeSpeed.cpp:42
NumericTextCtrl::Options
Definition: NumericTextCtrl.h:175
ShuttleGui::Id
ShuttleGui & Id(int id)
Definition: ShuttleGui.cpp:2248
limitSampleBufferSize
size_t limitSampleBufferSize(size_t bufferSize, sampleCount limit)
Definition: Types.h:698
EffectChangeSpeed::Update_Slider_PercentChange
void Update_Slider_PercentChange()
Definition: ChangeSpeed.cpp:743
EffectChangeSpeed::mCurTrackNum
int mCurTrackNum
Definition: ChangeSpeed.h:84
EffectChangeSpeed::mToLength
double mToLength
Definition: ChangeSpeed.h:113
Effect::mProjectRate
double mProjectRate
Definition: Effect.h:457
NumericConverter::DefaultSelectionFormat
static NumericFormatSymbol DefaultSelectionFormat()
Definition: NumericTextCtrl.cpp:688
NumericConverter::LookupFormat
static NumericFormatSymbol LookupFormat(Type type, const wxString &id)
Definition: NumericTextCtrl.cpp:702
EffectChangeSpeed::mCurT0
double mCurT0
Definition: ChangeSpeed.h:86
samplePtr
char * samplePtr
Definition: Types.h:729
XXO
#define XXO(s)
Definition: Internat.h:45
EffectChangeSpeed::m_PercentChange
double m_PercentChange
Definition: ChangeSpeed.h:90
ShuttleGuiBase::EndHorizontalLay
void EndHorizontalLay()
Definition: ShuttleGui.cpp:1170
Effect::mT0
double mT0
Definition: Effect.h:465
EffectChangeSpeed::mCurT1
double mCurT1
Definition: ChangeSpeed.h:87
EffectChangeSpeed::mMaxNewLength
double mMaxNewLength
Definition: ChangeSpeed.h:85
ShuttleGuiBase::StartHorizontalLay
void StartHorizontalLay(int PositionFlags=wxALIGN_CENTRE, int iProp=1)
Definition: ShuttleGui.cpp:1160
EffectChangeSpeed::mpChoice_ToVinyl
wxChoice * mpChoice_ToVinyl
Definition: ChangeSpeed.h:106
ShuttleGuiBase::StartMultiColumn
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
Definition: ShuttleGui.cpp:1203
ShuttleGuiBase::EndVerticalLay
void EndVerticalLay()
Definition: ShuttleGui.cpp:1196
EffectChangeSpeed::mFormat
NumericFormatSymbol mFormat
Definition: ChangeSpeed.h:114
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
Definition: Effect.cpp:605
ShuttleGuiBase::AddUnits
void AddUnits(const TranslatableString &Prompt, int wrapWidth=0)
Left aligned text string.
Definition: ShuttleGui.cpp:256
Effect::ReplaceProcessedTracks
void ReplaceProcessedTracks(const bool bGoodResult)
Definition: Effect.cpp:2192
NumericConverter::TIME
@ TIME
Definition: NumericTextCtrl.h:51
Track::Fallthrough
Continuation<> Fallthrough
Type of arguments passed as optional second parameter to TypeSwitch<void>() cases.
Definition: Track.h:487
gap
static const int gap
Definition: Meter.cpp:255
format
int format
Definition: ExportPCM.cpp:54
ShuttleGuiBase::GetParent
wxWindow * GetParent()
Definition: ShuttleGui.h:503
ShuttleGui::Validator
ShuttleGui & Validator(const Factory &f)
Definition: ShuttleGui.h:685
NumericTextCtrl::Options::MenuEnabled
Options & MenuEnabled(bool enable)
Definition: NumericTextCtrl.h:189
WaveTrack::GetStartTime
double GetStartTime() const override
Get the time at which the first clip in the track starts.
Definition: WaveTrack.cpp:1777
Resample
Interface to libsoxr.
Definition: Resample.h:29
Effect::mOutputTracks
std::shared_ptr< TrackList > mOutputTracks
Definition: Effect.h:464
ReadAndVerifyDouble
#define ReadAndVerifyDouble(name)
Definition: Effect.h:632
ShuttleGuiBase::AddSlider
wxSlider * AddSlider(const TranslatableString &Prompt, int pos, int Max, int Min=0)
Definition: ShuttleGui.cpp:582
kVinyl_78
@ kVinyl_78
Definition: ChangeSpeed.cpp:53
Effect::GetCurrentSettingsGroup
RegistryPath GetCurrentSettingsGroup() override
Definition: Effect.cpp:865
Track::GetSelected
bool GetSelected() const
Definition: Track.h:414
ShuttleGuiBase::StartStatic
wxStaticBox * StartStatic(const TranslatableString &Str, int iProp=0)
Definition: ShuttleGui.cpp:886
EffectChangeSpeed::Update_Text_PercentChange
void Update_Text_PercentChange()
Definition: ChangeSpeed.cpp:730
ShuttleGui::Name
ShuttleGui & Name(const TranslatableString &name)
Definition: ShuttleGui.h:670
EffectChangeSpeed::mMultiplier
double mMultiplier
Definition: ChangeSpeed.h:97
EffectChangeSpeed::mFromLength
double mFromLength
Definition: ChangeSpeed.h:95
ShuttleGuiBase::AddWindow
wxWindow * AddWindow(wxWindow *pWindow)
Definition: ShuttleGui.cpp:292
FileConfig::Flush
virtual bool Flush(bool bCurrentOnly=false) wxOVERRIDE
Definition: FileConfig.cpp:151
WaveTrack::TimeToLongSamples
sampleCount TimeToLongSamples(double t0) const
Convert correctly between an (absolute) time in seconds and a number of samples.
Definition: WaveTrack.cpp:1767
ShuttleGui::Position
ShuttleGui & Position(int flags)
Definition: ShuttleGui.h:719
Track
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:238
EffectChangeSpeed::mpFromLengthCtrl
NumericTextCtrl * mpFromLengthCtrl
Definition: ChangeSpeed.h:107
Effect::mUIParent
wxWindow * mUIParent
Definition: Effect.h:477
kVinyl_45
@ kVinyl_45
Definition: ChangeSpeed.cpp:52
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:188
ComponentInterfaceSymbol::Internal
const wxString & Internal() const
Definition: ComponentInterface.h:88
XXC
#define XXC(s, c)
Definition: Internat.h:48
EffectChangeSpeed::mFactor
double mFactor
Definition: ChangeSpeed.h:94
TrapDouble
double TrapDouble(double x, double min, double max)
Definition: Effect.h:563
ShuttleGuiBase::AddPrompt
void AddPrompt(const TranslatableString &Prompt, int wrapWidth=0)
Right aligned text string.
Definition: ShuttleGui.cpp:231
ShuttleGuiBase::SetBorder
void SetBorder(int Border)
Definition: ShuttleGui.h:497
ShuttleGuiBase::EndStatic
void EndStatic()
Definition: ShuttleGui.cpp:915
ID_ToLength
@ ID_ToLength
Definition: ChangeSpeed.cpp:44
safenew
#define safenew
Definition: MemoryX.h:8
EffectChangeSpeed::mFromVinyl
int mFromVinyl
Definition: ChangeSpeed.h:93
Effect::GetPrivateConfig
bool GetPrivateConfig(const RegistryPath &group, const RegistryPath &key, wxString &value, const wxString &defval={}) override
Definition: Effect.cpp:961
NumericConverter::GetValue
double GetValue()
Definition: NumericTextCtrl.cpp:1170
kVinylStrings
static const TranslatableStrings kVinylStrings
Definition: ChangeSpeed.cpp:57
Effect::TrackProgress
bool TrackProgress(int whichTrack, double frac, const TranslatableString &={})
Definition: Effect.cpp:2024
ArrayOf< float >
EffectChangeSpeed::mpTextCtrl_Multiplier
wxTextCtrl * mpTextCtrl_Multiplier
Definition: ChangeSpeed.h:103
ID_ToVinyl
@ ID_ToVinyl
Definition: ChangeSpeed.cpp:43
EffectChangeSpeed::UpdateUI
void UpdateUI()
Definition: ChangeSpeed.cpp:825
ID_PercentChange
@ ID_PercentChange
Definition: ChangeSpeed.cpp:40
EffectChangeSpeed::Update_TimeCtrl_ToLength
void Update_TimeCtrl_ToLength()
Definition: ChangeSpeed.cpp:811
EffectChangeSpeed::mpSlider_PercentChange
wxSlider * mpSlider_PercentChange
Definition: ChangeSpeed.h:104