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

An Effect that repeats audio several times over. More...

#include <Repeat.h>

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

Public Member Functions

 EffectRepeat ()
 
virtual ~EffectRepeat ()
 
ComponentInterfaceSymbol GetSymbol () const override
 
TranslatableString GetDescription () const override
 
ManualPageID ManualPage () const override
 Name of a page in the Audacity alpha manual, default is empty. More...
 
EffectType GetType () const override
 Type determines how it behaves. More...
 
bool Process (EffectInstance &instance, EffectSettings &settings) override
 Actually do the effect here. More...
 
std::unique_ptr< EffectUIValidatorPopulateOrExchange (ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access) override
 Add controls to effect panel; always succeeds. More...
 
bool TransferDataToWindow (const EffectSettings &settings) override
 Update controls for the settings. More...
 
bool TransferDataFromWindow (EffectSettings &settings) override
 Update the given settings from controls. More...
 
- Public Member Functions inherited from StatefulEffect
std::shared_ptr< EffectInstanceMakeInstance () const override
 Make an object maintaining short-term state of an Effect. More...
 
- Public Member Functions inherited from StatefulEffectBase
virtual bool Init ()
 Call once to set up state for whole list of tracks to be processed. More...
 
virtual bool Process (EffectInstance &instance, EffectSettings &settings)=0
 Actually do the effect here. More...
 
virtual bool RealtimeInitialize (EffectSettings &settings, double sampleRate)
 
virtual bool RealtimeAddProcessor (EffectSettings &settings, unsigned numChannels, float sampleRate)
 
virtual bool RealtimeSuspend ()
 
virtual bool RealtimeResume ()
 
virtual bool RealtimeProcessStart (EffectSettings &settings)
 settings are possibly changed, since last call, by an asynchronous dialog More...
 
virtual size_t RealtimeProcess (size_t group, EffectSettings &settings, const float *const *inBuf, float *const *outBuf, size_t numSamples)
 
virtual bool RealtimeProcessEnd (EffectSettings &settings) noexcept
 settings can be updated to let a dialog change appearance at idle More...
 
virtual bool RealtimeFinalize (EffectSettings &settings) noexcept
 
virtual size_t SetBlockSize (size_t maxBlockSize)
 
virtual size_t GetBlockSize () const
 
- Public Member Functions inherited from Effect
 Effect ()
 
virtual ~Effect ()
 
PluginPath GetPath () const override
 
bool VisitSettings (SettingsVisitor &visitor, EffectSettings &settings) override
 
bool VisitSettings (ConstSettingsVisitor &visitor, const EffectSettings &settings) const override
 
ComponentInterfaceSymbol GetSymbol () const override
 
VendorSymbol GetVendor () const override
 
wxString GetVersion () const override
 
TranslatableString GetDescription () const override
 
EffectType GetType () const override
 Type determines how it behaves. More...
 
EffectFamilySymbol GetFamily () const override
 Report identifier and user-visible name of the effect protocol. More...
 
bool IsInteractive () const override
 Whether the effect needs a dialog for entry of settings. More...
 
bool IsDefault () const override
 Whether the effect sorts "above the line" in the menus. More...
 
RealtimeSince RealtimeSupport () const override
 Since which version of Audacity has the effect supported realtime? More...
 
bool SupportsAutomation () const override
 Whether the effect has any automatable controls. More...
 
bool SaveSettings (const EffectSettings &settings, CommandParameters &parms) const override
 Store settings as keys and values. More...
 
bool LoadSettings (const CommandParameters &parms, EffectSettings &settings) const override
 Restore settings from keys and values. More...
 
bool LoadUserPreset (const RegistryPath &name, EffectSettings &settings) const override
 Change settings to a user-named preset. More...
 
bool SaveUserPreset (const RegistryPath &name, const EffectSettings &settings) const override
 Save settings in the configuration file as a user-named preset. More...
 
RegistryPaths GetFactoryPresets () const override
 Report names of factory presets. More...
 
bool LoadFactoryPreset (int id, EffectSettings &settings) const override
 Change settings to the preset whose name is GetFactoryPresets()[id] More...
 
bool LoadFactoryDefaults (EffectSettings &settings) const override
 Change settings back to "factory default". More...
 
unsigned GetAudioInCount () const override
 How many input buffers to allocate at once. More...
 
unsigned GetAudioOutCount () const override
 How many output buffers to allocate at once. More...
 
virtual const EffectParameterMethodsParameters () const
 
int ShowClientInterface (wxWindow &parent, wxDialog &dialog, bool forceModal=false) override
 
std::unique_ptr< EffectUIValidatorPopulateUI (ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access) override
 Adds controls to a panel that is given as the parent window of S More...
 
bool IsGraphicalUI () override
 
bool ValidateUI (EffectSettings &) override
 
bool CloseUI () override
 
bool CanExportPresets () override
 
void ExportPresets (const EffectSettings &settings) const override
 
void ImportPresets (EffectSettings &settings) override
 
bool HasOptions () override
 
void ShowOptions () override
 
const EffectSettingsManagerGetDefinition () const override
 
virtual NumericFormatSymbol GetSelectionFormat ()
 
int ShowHostInterface (wxWindow &parent, const EffectDialogFactory &factory, std::shared_ptr< EffectInstance > &pInstance, EffectSettingsAccess &access, bool forceModal=false) override
 Usually applies factory to self and given access. More...
 
bool SaveSettingsAsString (const EffectSettings &settings, wxString &parms) const override
 
bool LoadSettingsFromString (const wxString &parms, EffectSettings &settings) const override
 
bool IsBatchProcessing () const override
 
void SetBatchProcessing () override
 
void UnsetBatchProcessing () override
 
bool TransferDataToWindow (const EffectSettings &settings) override
 Update controls for the settings. More...
 
bool TransferDataFromWindow (EffectSettings &settings) override
 Update the given settings from controls. More...
 
unsigned TestUIFlags (unsigned mask)
 
bool Delegate (Effect &delegate, EffectSettings &settings)
 Re-invoke DoEffect on another Effect object that implements the work. More...
 
int MessageBox (const TranslatableString &message, long style=DefaultMessageBoxStyle, const TranslatableString &titleStr={}) const
 
bool EnableApply (bool enable=true)
 
wxWindow * GetUIParent ()
 
- Public Member Functions inherited from EffectBase
 EffectBase ()
 
 ~EffectBase () override
 
- Public Member Functions inherited from EffectUIClientInterface
virtual ~EffectUIClientInterface ()
 
virtual int ShowClientInterface (wxWindow &parent, wxDialog &dialog, bool forceModal=false)=0
 
virtual bool IsGraphicalUI ()=0
 
virtual std::unique_ptr< EffectUIValidatorPopulateUI (ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access)=0
 Adds controls to a panel that is given as the parent window of S More...
 
virtual bool CanExportPresets ()=0
 
virtual void ExportPresets (const EffectSettings &settings) const =0
 
virtual void ImportPresets (EffectSettings &settings)=0
 
virtual bool HasOptions ()=0
 
virtual void ShowOptions ()=0
 
- Public Member Functions inherited from EffectPlugin
EffectPluginoperator= (EffectPlugin &)=delete
 
virtual ~EffectPlugin ()
 
virtual const EffectSettingsManagerGetDefinition () const =0
 
virtual int ShowHostInterface (wxWindow &parent, const EffectDialogFactory &factory, std::shared_ptr< EffectInstance > &pInstance, EffectSettingsAccess &access, bool forceModal=false)=0
 Usually applies factory to self and given access. More...
 
virtual void Preview (EffectSettingsAccess &access, bool dryOnly)=0
 
virtual bool SaveSettingsAsString (const EffectSettings &settings, wxString &parms) const =0
 
virtual bool LoadSettingsFromString (const wxString &parms, EffectSettings &settings) const =0
 
virtual bool IsBatchProcessing () const =0
 
virtual void SetBatchProcessing ()=0
 
virtual void UnsetBatchProcessing ()=0
 
virtual bool DoEffect (EffectSettings &settings, double projectRate, TrackList *list, WaveTrackFactory *factory, NotifyingSelectedRegion &selectedRegion, unsigned flags, wxWindow *pParent=nullptr, const EffectDialogFactory &dialogFactory={}, const EffectSettingsAccessPtr &pAccess=nullptr)=0
 Unfortunately complicated dual-use function. More...
 
virtual bool TransferDataToWindow (const EffectSettings &settings)=0
 Update controls for the settings. More...
 
virtual bool TransferDataFromWindow (EffectSettings &settings)=0
 Update the given settings from controls. More...
 
- Public Member Functions inherited from EffectInstanceFactory
virtual ~EffectInstanceFactory ()
 
virtual std::shared_ptr< EffectInstanceMakeInstance () const =0
 Make an object maintaining short-term state of an Effect. More...
 
virtual unsigned GetAudioInCount () const =0
 How many input buffers to allocate at once. More...
 
virtual unsigned GetAudioOutCount () const =0
 How many output buffers to allocate at once. More...
 
virtual int GetMidiInCount () const
 Function that has not yet found a use. More...
 
virtual int GetMidiOutCount () const
 Function that has not yet found a use. More...
 
- Public Member Functions inherited from EffectSettingsManager
virtual ~EffectSettingsManager ()
 
virtual bool VisitSettings (SettingsVisitor &visitor, EffectSettings &settings)
 
virtual bool VisitSettings (ConstSettingsVisitor &visitor, const EffectSettings &settings) const
 
virtual EffectSettings MakeSettings () const
 
virtual bool CopySettingsContents (const EffectSettings &src, EffectSettings &dst) const
 Update one settings object from another. More...
 
- Public Member Functions inherited from EffectDefinitionInterface
virtual ~EffectDefinitionInterface ()
 
virtual EffectType GetType () const =0
 Type determines how it behaves. More...
 
virtual EffectType GetClassification () const
 Determines which menu it appears in; default same as GetType(). More...
 
virtual EffectFamilySymbol GetFamily () const =0
 Report identifier and user-visible name of the effect protocol. More...
 
virtual bool IsInteractive () const =0
 Whether the effect needs a dialog for entry of settings. More...
 
virtual bool IsDefault () const =0
 Whether the effect sorts "above the line" in the menus. More...
 
virtual RealtimeSince RealtimeSupport () const =0
 Since which version of Audacity has the effect supported realtime? More...
 
bool SupportsRealtime () const
 
virtual bool SupportsAutomation () const =0
 Whether the effect has any automatable controls. More...
 
virtual bool EnablesDebug () const
 Whether the effect dialog should have a Debug button; default, always false. More...
 
virtual ManualPageID ManualPage () const
 Name of a page in the Audacity alpha manual, default is empty. More...
 
virtual FilePath HelpPage () const
 Fully qualified local help file name, default is empty. More...
 
virtual bool IsHiddenFromMenus () const
 Default is false. More...
 
- Public Member Functions inherited from ComponentInterface
virtual ~ComponentInterface ()
 
virtual PluginPath GetPath () const =0
 
virtual ComponentInterfaceSymbol GetSymbol () const =0
 
virtual VendorSymbol GetVendor () const =0
 
virtual wxString GetVersion () const =0
 
virtual TranslatableString GetDescription () const =0
 
TranslatableString GetName () const
 

Static Public Member Functions

static EffectRepeatFetchParameters (EffectRepeat &e, EffectSettings &)
 
- Static Public Member Functions inherited from Effect
static EffectFetchParameters (Effect &e, EffectSettings &)
 
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...
 

Static Public Attributes

static const ComponentInterfaceSymbol Symbol { XO("Repeat") }
 
- Static Public Attributes inherited from EffectPlugin
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

void OnRepeatTextChange (wxCommandEvent &evt)
 
void DisplayNewTime ()
 
const EffectParameterMethodsParameters () const override
 

Private Attributes

int repeatCount
 
wxTextCtrl * mRepeatCount
 
wxStaticText * mCurrentTime
 
wxStaticText * mTotalTime
 

Static Private Attributes

static constexpr EffectParameter Count
 

Additional Inherited Members

- Public Types inherited from Effect
enum  : long { DefaultMessageBoxStyle = wxOK | wxCENTRE }
 
- Public Types inherited from EffectPlugin
using EffectSettingsAccessPtr = std::shared_ptr< EffectSettingsAccess >
 
- Public Types inherited from EffectDefinitionInterface
enum class  RealtimeSince : unsigned { Never , Since_3_2 , Always }
 In which versions of Audacity was an effect realtime capable? More...
 
- Protected Member Functions inherited from Effect
bool EnablePreview (bool enable=true)
 
bool CheckWhetherSkipEffect (const EffectSettings &settings) const override
 Default implementation returns false. More...
 
double CalcPreviewInputLength (const EffectSettings &settings, double previewLength) const override
 Default implementation returns previewLength More...
 
virtual std::unique_ptr< EffectUIValidatorPopulateOrExchange (ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access)
 Add controls to effect panel; always succeeds. More...
 
bool TotalProgress (double frac, const TranslatableString &={}) const
 
bool TrackProgress (int whichTrack, double frac, const TranslatableString &={}) const
 
bool TrackGroupProgress (int whichGroup, double frac, const TranslatableString &={}) const
 
int GetNumWaveTracks () const
 
int GetNumWaveGroups () const
 
void GetBounds (const WaveTrack &track, const WaveTrack *pRight, sampleCount *start, sampleCount *len)
 
void CopyInputTracks (bool allSyncLockSelected=false)
 
std::shared_ptr< AddedAnalysisTrackAddAnalysisTrack (const wxString &name=wxString())
 
ModifiedAnalysisTrack ModifyAnalysisTrack (const LabelTrack *pOrigTrack, const wxString &name=wxString())
 
TrackAddToOutputTracks (const std::shared_ptr< Track > &t)
 
- Protected Member Functions inherited from EffectBase
void Preview (EffectSettingsAccess &access, bool dryOnly) override
 
bool DoEffect (EffectSettings &settings, double projectRate, TrackList *list, WaveTrackFactory *factory, NotifyingSelectedRegion &selectedRegion, unsigned flags, wxWindow *pParent, const EffectDialogFactory &dialogFactory, const EffectSettingsAccessPtr &pAccess) override
 Unfortunately complicated dual-use function. More...
 
virtual bool CheckWhetherSkipEffect (const EffectSettings &settings) const =0
 After Init(), tell whether Process() should be skipped. More...
 
virtual double CalcPreviewInputLength (const EffectSettings &settings, double previewLength) const =0
 
void SetLinearEffectFlag (bool linearEffectFlag)
 
void SetPreviewFullSelectionFlag (bool previewDurationFlag)
 
bool IsPreviewing () const
 
void IncludeNotSelectedPreviewTracks (bool includeNotSelected)
 
void ReplaceProcessedTracks (const bool bGoodResult)
 
const TrackListinputTracks () const
 
const AudacityProjectFindProject () const
 
virtual bool ValidateUI (EffectSettings &settings)=0
 
virtual bool CloseUI ()=0
 
- Protected Attributes inherited from Effect
wxWeakRef< wxDialog > mHostUIDialog
 This smart pointer tracks the lifetime of the dialog. More...
 
wxWindow * mUIParent {}
 
- Protected Attributes inherited from EffectBase
BasicUI::ProgressDialogmProgress {}
 
double mProjectRate {}
 
WaveTrackFactorymFactory {}
 
std::shared_ptr< TrackListmOutputTracks
 
double mT0 {}
 
double mT1 {}
 
wxArrayString mPresetNames
 
unsigned mUIFlags { 0 }
 
- Protected Attributes inherited from EffectUIClientInterface
friend EffectUIValidator
 
friend DefaultEffectUIValidator
 
- Static Protected Attributes inherited from EffectBase
static int nEffectsDone = 0
 

Detailed Description

An Effect that repeats audio several times over.

Definition at line 22 of file Repeat.h.

Constructor & Destructor Documentation

◆ EffectRepeat()

EffectRepeat::EffectRepeat ( )

Definition at line 58 of file Repeat.cpp.

59{
60 Parameters().Reset(*this);
62}
void SetLinearEffectFlag(bool linearEffectFlag)
Definition: EffectBase.cpp:218
virtual void Reset(Effect &effect) const =0
const EffectParameterMethods & Parameters() const override
Definition: Repeat.cpp:41

Referenced by Parameters().

Here is the caller graph for this function:

◆ ~EffectRepeat()

EffectRepeat::~EffectRepeat ( )
virtual

Definition at line 64 of file Repeat.cpp.

65{
66}

Member Function Documentation

◆ DisplayNewTime()

void EffectRepeat::DisplayNewTime ( )
private

Definition at line 200 of file Repeat.cpp.

201{
202 long l;
203 wxString str;
204 mRepeatCount->GetValue().ToLong(&l);
205
208 mT1 - mT0,
210
211 str = wxString::Format( _("Current selection length: %s"), nc.GetString() );
212
213 mCurrentTime->SetLabel(str);
214 mCurrentTime->SetName(str); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
215
216 if (l > 0) {
217 EnableApply(true);
218 repeatCount = l;
219
220 nc.SetValue((mT1 - mT0) * (repeatCount + 1));
221 str = wxString::Format( _("New selection length: %s"), nc.GetString() );
222 }
223 else {
224 str = _("Warning: No repeats.");
225 EnableApply(false);
226 }
227 mTotalTime->SetLabel(str);
228 mTotalTime->SetName(str); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs)
229}
#define str(a)
#define _(s)
Definition: Internat.h:75
double mT1
Definition: EffectBase.h:107
double mProjectRate
Definition: EffectBase.h:99
double mT0
Definition: EffectBase.h:106
bool EnableApply(bool enable=true)
Definition: Effect.cpp:613
virtual NumericFormatSymbol GetSelectionFormat()
Definition: Effect.cpp:458
wxStaticText * mTotalTime
Definition: Repeat.h:61
int repeatCount
Definition: Repeat.h:57
wxTextCtrl * mRepeatCount
Definition: Repeat.h:59
wxStaticText * mCurrentTime
Definition: Repeat.h:60
NumericConverter provides the advanced formatting control used in the selection bar of Audacity.

References _, Effect::EnableApply(), Effect::GetSelectionFormat(), NumericConverter::GetString(), mCurrentTime, EffectBase::mProjectRate, mRepeatCount, EffectBase::mT0, EffectBase::mT1, mTotalTime, repeatCount, NumericConverter::SetValue(), str, and NumericConverter::TIME.

Referenced by OnRepeatTextChange(), and TransferDataToWindow().

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

◆ FetchParameters()

static EffectRepeat * EffectRepeat::FetchParameters ( EffectRepeat e,
EffectSettings  
)
inlinestatic

Definition at line 26 of file Repeat.h.

26{ return &e; }

◆ GetDescription()

TranslatableString EffectRepeat::GetDescription ( ) const
overridevirtual

Reimplemented from Effect.

Definition at line 75 of file Repeat.cpp.

76{
77 return XO("Repeats the selection the specified number of times");
78}
#define XO(s)
Definition: Internat.h:31

References XO.

◆ GetSymbol()

ComponentInterfaceSymbol EffectRepeat::GetSymbol ( ) const
overridevirtual

Reimplemented from Effect.

Definition at line 70 of file Repeat.cpp.

71{
72 return Symbol;
73}
static const ComponentInterfaceSymbol Symbol
Definition: Repeat.h:27

References Symbol.

◆ GetType()

EffectType EffectRepeat::GetType ( ) const
overridevirtual

Type determines how it behaves.

Reimplemented from Effect.

Definition at line 87 of file Repeat.cpp.

88{
89 return EffectTypeProcess;
90}
@ EffectTypeProcess

References EffectTypeProcess.

◆ ManualPage()

ManualPageID EffectRepeat::ManualPage ( ) const
overridevirtual

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

Reimplemented from EffectDefinitionInterface.

Definition at line 80 of file Repeat.cpp.

81{
82 return L"Repeat";
83}

◆ OnRepeatTextChange()

void EffectRepeat::OnRepeatTextChange ( wxCommandEvent &  evt)
private

Definition at line 231 of file Repeat.cpp.

232{
234}
void DisplayNewTime()
Definition: Repeat.cpp:200

References DisplayNewTime().

Here is the call graph for this function:

◆ Parameters()

const EffectParameterMethods & EffectRepeat::Parameters ( ) const
overrideprivatevirtual

Reimplemented from Effect.

Definition at line 41 of file Repeat.cpp.

42{
44 Count
45 > parameters;
46 return parameters;
47}
Generates EffectParameterMethods overrides from variadic template arguments.
EffectRepeat()
Definition: Repeat.cpp:58
static constexpr EffectParameter Count
Definition: Repeat.h:66

References Count, and EffectRepeat().

Here is the call graph for this function:

◆ PopulateOrExchange()

std::unique_ptr< EffectUIValidator > EffectRepeat::PopulateOrExchange ( ShuttleGui S,
EffectInstance instance,
EffectSettingsAccess access 
)
overridevirtual

Add controls to effect panel; always succeeds.

Returns
if not null, then return it from Effect::PopulateUI instead of a DefaultEffectUIValidator; default implementation returns null

Reimplemented from Effect.

Definition at line 158 of file Repeat.cpp.

160{
161 S.StartHorizontalLay(wxCENTER, false);
162 {
163 mRepeatCount = S.Validator<IntegerValidator<int>>(
164 &repeatCount, NumValidatorStyle::DEFAULT,
165 Count.min, 2147483647 / mProjectRate )
166 .AddTextBox(XXO("&Number of repeats to add:"), L"", 12);
167 }
168 S.EndHorizontalLay();
169
170 S.StartMultiColumn(1, wxCENTER);
171 {
172 mCurrentTime = S.AddVariableText(
173 XO("Current selection length: dd:hh:mm:ss"));
174 mTotalTime = S.AddVariableText(XO("New selection length: dd:hh:mm:ss"));
175 }
176 S.EndMultiColumn();
177 return nullptr;
178}
#define XXO(s)
Definition: Internat.h:44
#define S(N)
Definition: ToChars.cpp:64
const Type min
Minimum value.
Definition: Shuttle.h:30

References Count, mCurrentTime, EffectParameter< Structure, Member, Type, Value >::min, EffectBase::mProjectRate, mRepeatCount, mTotalTime, repeatCount, S, XO, and XXO.

◆ Process()

bool EffectRepeat::Process ( EffectInstance instance,
EffectSettings settings 
)
overridevirtual

Actually do the effect here.

Returns
success

Implements StatefulEffectBase.

Definition at line 94 of file Repeat.cpp.

95{
96 // Set up mOutputTracks.
97 // This effect needs all for sync-lock grouping.
98 CopyInputTracks(true);
99
100 int nTrack = 0;
101 bool bGoodResult = true;
102 double maxDestLen = 0.0; // used to change selection to generated bit
103
104 mOutputTracks->Any().VisitWhile( bGoodResult,
105 [&](LabelTrack *track)
106 {
108 {
109 if (!track->Repeat(mT0, mT1, repeatCount))
110 bGoodResult = false;
111 }
112 },
113 [&](WaveTrack *track, const Track::Fallthrough &fallthrough)
114 {
115 if (!track->GetSelected())
116 return fallthrough(); // Fall through to next lambda
117 auto start = track->TimeToLongSamples(mT0);
118 auto end = track->TimeToLongSamples(mT1);
119 auto len = end - start;
120 double tLen = track->LongSamplesToTime(len);
121 double tc = mT0 + tLen;
122
123 if (len <= 0)
124 return;
125
126 auto dest = track->Copy(mT0, mT1);
127 for(int j=0; j<repeatCount; j++)
128 {
129 if (TrackProgress(nTrack, j / repeatCount)) // TrackProgress returns true on Cancel.
130 {
131 bGoodResult = false;
132 return;
133 }
134 track->Paste(tc, dest.get());
135 tc += tLen;
136 }
137 if (tc > maxDestLen)
138 maxDestLen = tc;
139 nTrack++;
140 },
141 [&](Track *t)
142 {
144 t->SyncLockAdjust(mT1, mT1 + (mT1 - mT0) * repeatCount);
145 }
146 );
147
148 if (bGoodResult)
149 {
150 // Select the NEW bits + original bit
151 mT1 = maxDestLen;
152 }
153
154 ReplaceProcessedTracks(bGoodResult);
155 return bGoodResult;
156}
std::shared_ptr< TrackList > mOutputTracks
Definition: EffectBase.h:105
void ReplaceProcessedTracks(const bool bGoodResult)
Definition: EffectBase.cpp:236
void CopyInputTracks(bool allSyncLockSelected=false)
Definition: Effect.cpp:741
bool TrackProgress(int whichTrack, double frac, const TranslatableString &={}) const
Definition: Effect.cpp:693
A LabelTrack is a Track that holds labels (LabelStruct).
Definition: LabelTrack.h:89
bool Repeat(double t0, double t1, int n)
Definition: LabelTrack.cpp:812
double LongSamplesToTime(sampleCount pos) const
Convert correctly between a number of samples and an (absolute) time in seconds.
Definition: SampleTrack.cpp:47
sampleCount TimeToLongSamples(double t0) const
Convert correctly between an (absolute) time in seconds and a number of samples.
Definition: SampleTrack.cpp:42
static bool IsSelectedOrSyncLockSelected(const Track *pTrack)
Definition: SyncLock.cpp:73
static bool IsSyncLockSelected(const Track *pTrack)
Definition: SyncLock.cpp:43
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:225
bool GetSelected() const
Definition: Track.h:469
Continuation<> Fallthrough
Type of arguments passed as optional second parameter to TypeSwitch<void>() cases.
Definition: Track.h:541
A Track that contains audio waveform data.
Definition: WaveTrack.h:57
void Paste(double t0, const Track *src) override
Definition: WaveTrack.cpp:1563
Track::Holder Copy(double t0, double t1, bool forClipboard=true) const override
Definition: WaveTrack.cpp:716
auto end(const Ptr< Type, BaseDeleter > &p)
Enables range-for.
Definition: PackedArray.h:159

References LabelTrack::Copy(), Effect::CopyInputTracks(), PackedArray::end(), Track::GetSelected(), SyncLock::IsSelectedOrSyncLockSelected(), SyncLock::IsSyncLockSelected(), EffectBase::mOutputTracks, EffectBase::mT0, EffectBase::mT1, LabelTrack::Paste(), LabelTrack::Repeat(), repeatCount, EffectBase::ReplaceProcessedTracks(), and Effect::TrackProgress().

Here is the call graph for this function:

◆ TransferDataFromWindow()

bool EffectRepeat::TransferDataFromWindow ( EffectSettings settings)
overridevirtual

Update the given settings from controls.

Reimplemented from Effect.

Definition at line 189 of file Repeat.cpp.

190{
191 long l;
192
193 mRepeatCount->GetValue().ToLong(&l);
194
195 repeatCount = (int) l;
196
197 return true;
198}

References mRepeatCount, and repeatCount.

◆ TransferDataToWindow()

bool EffectRepeat::TransferDataToWindow ( const EffectSettings settings)
overridevirtual

Update controls for the settings.

Reimplemented from Effect.

Definition at line 180 of file Repeat.cpp.

181{
182 mRepeatCount->ChangeValue(wxString::Format(wxT("%d"), repeatCount));
183
185
186 return true;
187}

References DisplayNewTime(), mRepeatCount, and repeatCount.

Here is the call graph for this function:

Member Data Documentation

◆ Count

constexpr EffectParameter EffectRepeat::Count
staticconstexprprivate
Initial value:
L"Count",1, 1, INT_MAX, 1 }

Definition at line 66 of file Repeat.h.

Referenced by Parameters(), and PopulateOrExchange().

◆ mCurrentTime

wxStaticText* EffectRepeat::mCurrentTime
private

Definition at line 60 of file Repeat.h.

Referenced by DisplayNewTime(), and PopulateOrExchange().

◆ mRepeatCount

wxTextCtrl* EffectRepeat::mRepeatCount
private

◆ mTotalTime

wxStaticText* EffectRepeat::mTotalTime
private

Definition at line 61 of file Repeat.h.

Referenced by DisplayNewTime(), and PopulateOrExchange().

◆ repeatCount

int EffectRepeat::repeatCount
private

◆ Symbol

const ComponentInterfaceSymbol EffectRepeat::Symbol { XO("Repeat") }
static

Definition at line 27 of file Repeat.h.

Referenced by GetSymbol().


The documentation for this class was generated from the following files: