Audacity  3.0.3
Public Member Functions | Static Public Attributes | Private Member Functions | List of all members
EffectReverse Class Referencefinal

An Effect that reverses the selected audio. More...

#include <Reverse.h>

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

Public Member Functions

 EffectReverse ()
 
virtual ~EffectReverse ()
 
ComponentInterfaceSymbol GetSymbol () override
 
TranslatableString GetDescription () override
 
EffectType GetType () override
 
bool IsInteractive () override
 
bool Process () override
 
- Public Member Functions inherited from Effect
 Effect ()
 
virtual ~Effect ()
 
PluginPath GetPath () override
 
VendorSymbol GetVendor () override
 
wxString GetVersion () override
 
EffectFamilySymbol GetFamily () 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 Startup ()
 
virtual bool GetAutomationParameters (wxString &parms)
 
virtual bool SetAutomationParameters (const wxString &parms)
 
virtual RegistryPaths GetUserPresets ()
 
virtual bool HasCurrentSettings ()
 
virtual bool HasFactoryDefaults ()
 
virtual ManualPageID ManualPage ()
 
virtual FilePath 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("Reverse") }
 
- 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 ProcessOneClip (int count, WaveTrack *track, sampleCount start, sampleCount len, sampleCount originalStart, sampleCount originalEnd)
 
bool ProcessOneWave (int count, WaveTrack *track, sampleCount start, sampleCount len)
 

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 Init ()
 
virtual bool CheckWhetherSkipEffect ()
 
virtual bool ProcessPass ()
 
virtual bool InitPass1 ()
 
virtual bool InitPass2 ()
 
virtual int GetPass ()
 
virtual void End ()
 
virtual double CalcPreviewInputLength (double previewLength)
 
virtual void Preview (bool dryOnly)
 
virtual void PopulateOrExchange (ShuttleGui &S)
 
virtual bool TransferDataToWindow ()
 
virtual bool TransferDataFromWindow ()
 
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 reverses the selected audio.

Definition at line 18 of file Reverse.h.

Constructor & Destructor Documentation

◆ EffectReverse()

EffectReverse::EffectReverse ( )

Definition at line 38 of file Reverse.cpp.

39 {
40 }

◆ ~EffectReverse()

EffectReverse::~EffectReverse ( )
virtual

Definition at line 42 of file Reverse.cpp.

43 {
44 }

Member Function Documentation

◆ GetDescription()

TranslatableString EffectReverse::GetDescription ( )
overridevirtual

Reimplemented from Effect.

Definition at line 53 of file Reverse.cpp.

54 {
55  return XO("Reverses the selected audio");
56 }

References XO.

◆ GetSymbol()

ComponentInterfaceSymbol EffectReverse::GetSymbol ( )
overridevirtual

Reimplemented from Effect.

Definition at line 48 of file Reverse.cpp.

49 {
50  return Symbol;
51 }

References Symbol.

◆ GetType()

EffectType EffectReverse::GetType ( )
overridevirtual

Reimplemented from Effect.

Definition at line 60 of file Reverse.cpp.

61 {
62  return EffectTypeProcess;
63 }

References EffectTypeProcess.

◆ IsInteractive()

bool EffectReverse::IsInteractive ( )
overridevirtual

Reimplemented from Effect.

Definition at line 65 of file Reverse.cpp.

66 {
67  return false;
68 }

◆ Process()

bool EffectReverse::Process ( )
overridevirtual

Reimplemented from Effect.

Definition at line 72 of file Reverse.cpp.

73 {
74  //all needed because Reverse should move the labels too
75  this->CopyInputTracks(true); // Set up mOutputTracks.
76  bool bGoodResult = true;
77  int count = 0;
78 
79  auto trackRange =
81  trackRange.VisitWhile( bGoodResult,
82  [&](WaveTrack * track) {
83  if (mT1 > mT0) {
84  auto start = track->TimeToLongSamples(mT0);
85  auto end = track->TimeToLongSamples(mT1);
86  auto len = end - start;
87 
88  if (!ProcessOneWave(count, track, start, len))
89  bGoodResult = false;
90  }
91  count++;
92  },
93  [&](LabelTrack * track) {
94  track->ChangeLabelsOnReverse(mT0, mT1);
95  count++;
96  }
97  );
98 
99  this->ReplaceProcessedTracks(bGoodResult);
100  return bGoodResult;
101 }

References Effect::CopyInputTracks(), Track::IsSelectedOrSyncLockSelected(), Effect::mOutputTracks, Effect::mT0, Effect::mT1, ProcessOneWave(), Effect::ReplaceProcessedTracks(), and WaveTrack::TimeToLongSamples().

Here is the call graph for this function:

◆ ProcessOneClip()

bool EffectReverse::ProcessOneClip ( int  count,
WaveTrack track,
sampleCount  start,
sampleCount  len,
sampleCount  originalStart,
sampleCount  originalEnd 
)
private

Definition at line 215 of file Reverse.cpp.

218 {
219  bool rc = true;
220  // keep track of two blocks whose data we will swap
221  auto first = start;
222 
223  auto blockSize = track->GetMaxBlockSize();
224  float tmp;
225  Floats buffer1{ blockSize };
226  Floats buffer2{ blockSize };
227 
228  auto originalLen = originalEnd - originalStart;
229 
230  while (len > 1) {
231  auto block =
232  limitSampleBufferSize( track->GetBestBlockSize(first), len / 2 );
233  auto second = first + (len - block);
234 
235  track->GetFloats(buffer1.get(), first, block);
236  track->GetFloats(buffer2.get(), second, block);
237  for (decltype(block) i = 0; i < block; i++) {
238  tmp = buffer1[i];
239  buffer1[i] = buffer2[block-i-1];
240  buffer2[block-i-1] = tmp;
241  }
242  track->Set((samplePtr)buffer1.get(), floatSample, first, block);
243  track->Set((samplePtr)buffer2.get(), floatSample, second, block);
244 
245  len -= 2 * block;
246  first += block;
247 
248  if( TrackProgress(count, 2 * ( first - originalStart ).as_double() /
249  originalLen.as_double() ) ) {
250  rc = false;
251  break;
252  }
253  }
254 
255  return rc;
256 }

References floatSample, WaveTrack::GetBestBlockSize(), WaveTrack::GetFloats(), WaveTrack::GetMaxBlockSize(), limitSampleBufferSize(), WaveTrack::Set(), and Effect::TrackProgress().

Referenced by ProcessOneWave().

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

◆ ProcessOneWave()

bool EffectReverse::ProcessOneWave ( int  count,
WaveTrack track,
sampleCount  start,
sampleCount  len 
)
private

Definition at line 103 of file Reverse.cpp.

104 {
105  bool rValue = true; // return value
106 
107  auto end = start + len; // start, end, len refer to the selected reverse region
108 
109  // STEP 1:
110  // If a reverse selection begins and/or ends at the inside of a clip
111  // perform a split at the start and/or end of the reverse selection
112  const auto &clips = track->GetClips();
113  // Beware, the array grows as we loop over it. Use integer subscripts, not iterators.
114  for (size_t ii = 0; ii < clips.size(); ++ii) {
115  const auto &clip = clips[ii].get();
116  auto clipStart = clip->GetStartSample();
117  auto clipEnd = clip->GetEndSample();
118  if (clipStart < start && clipEnd > start && clipEnd <= end) { // the reverse selection begins at the inside of a clip
119  double splitTime = track->LongSamplesToTime(start);
120  track->SplitAt(splitTime);
121  }
122  else if (clipStart >= start && clipStart < end && clipEnd > end) { // the reverse selection ends at the inside of a clip
123  double splitTime = track->LongSamplesToTime(end);
124  track->SplitAt(splitTime);
125  }
126  else if (clipStart < start && clipEnd > end) { // the selection begins AND ends at the inside of a clip
127  double splitTime = track->LongSamplesToTime(start);
128  track->SplitAt(splitTime);
129  splitTime = track->LongSamplesToTime(end);
130  track->SplitAt(splitTime);
131  }
132  }
133 
134  //STEP 2:
135  // Individually reverse each clip inside the selected region
136  // and apply the appropriate offset after detaching them from the track
137 
138  bool checkedFirstClip = false;
139 
140  // used in calculating the offset of clips to rearrange
141  // holds the NEW end position of the current clip
142  auto currentEnd = end;
143 
144  WaveClipHolders revClips; // holds the reversed clips
145  WaveClipHolders otherClips; // holds the clips that appear after the reverse selection region
146  auto clipArray = track->SortedClipArray();
147  size_t i;
148  for (i=0; i < clipArray.size(); i++) {
149 
150  WaveClip *clip = clipArray[i];
151  auto clipStart = clip->GetStartSample();
152  auto clipEnd = clip->GetEndSample();
153 
154  if (clipStart >= start && clipEnd <= end) { // if the clip is inside the selected region
155 
156  // this is used to check if the selected region begins with a whitespace.
157  // if yes then clipStart (of the first clip) and start are not the same.
158  // adjust currentEnd accordingly and set endMerge to false
159  if(checkedFirstClip == false && clipStart > start) {
160  checkedFirstClip = true;
161  if(i > 0) {
162  if (clipArray[i-1]->GetEndSample() <= start) {
163  currentEnd -= (clipStart - start);
164  }
165  }
166  else {
167  currentEnd -= (clipStart - start);
168  }
169  }
170 
171  auto revStart = (clipStart >= start)? clipStart: start;
172  auto revEnd = (clipEnd >= end)? end: clipEnd;
173  auto revLen = revEnd - revStart;
174  if (revEnd >= revStart) {
175  if(!ProcessOneClip(count, track, revStart, revLen, start, end)) // reverse the clip
176  {
177  rValue = false;
178  break;
179  }
180 
181  auto clipOffsetStart = currentEnd - (clipEnd - clipStart); // calculate the offset required
182  double offsetStartTime = track->LongSamplesToTime(clipOffsetStart);
183  if(i+1 < clipArray.size()) // update currentEnd if there is a clip to process next
184  {
185  auto nextClipStart = clipArray[i+1]->GetStartSample();
186  currentEnd = currentEnd - (clipEnd - clipStart) - (nextClipStart - clipEnd);
187  }
188 
189  revClips.push_back(track->RemoveAndReturnClip(clip)); // detach the clip from track
190  revClips.back()->SetOffset(track->LongSamplesToTime(track->TimeToLongSamples(offsetStartTime))); // align time to a sample and set offset
191  }
192  }
193  else if (clipStart >= end) { // clip is after the selection region
194  otherClips.push_back(track->RemoveAndReturnClip(clip)); // simply remove and append to otherClips
195  }
196  }
197 
198  // STEP 3: Append the clips from
199  // revClips and otherClips back to the track
200  // the last clip of revClips is appended to the track first
201  // PRL: I don't think that matters, the sequence of storage of clips in the track
202  // is not elsewhere assumed to be by time
203  {
204  for (auto it = revClips.rbegin(), revEnd = revClips.rend(); rValue && it != revEnd; ++it)
205  rValue = track->AddClip(*it);
206  }
207 
208  for (auto &clip : otherClips)
209  if (!(rValue = track->AddClip(clip)))
210  break;
211 
212  return rValue;
213 }

References WaveTrack::AddClip(), WaveTrack::GetClips(), WaveClip::GetEndSample(), WaveClip::GetStartSample(), WaveTrack::LongSamplesToTime(), ProcessOneClip(), WaveTrack::RemoveAndReturnClip(), WaveTrack::SortedClipArray(), WaveTrack::SplitAt(), and WaveTrack::TimeToLongSamples().

Referenced by Process().

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

Member Data Documentation

◆ Symbol

const ComponentInterfaceSymbol EffectReverse::Symbol { XO("Reverse") }
static

Definition at line 21 of file Reverse.h.

Referenced by GetSymbol().


The documentation for this class was generated from the following files:
WaveTrack
A Track that contains audio waveform data.
Definition: WaveTrack.h:69
EffectTypeProcess
@ EffectTypeProcess
Definition: EffectInterface.h:59
EffectReverse::ProcessOneWave
bool ProcessOneWave(int count, WaveTrack *track, sampleCount start, sampleCount len)
Definition: Reverse.cpp:103
Effect::CopyInputTracks
void CopyInputTracks(bool allSyncLockSelected=false)
Definition: Effect.cpp:2071
Effect::mT1
double mT1
Definition: Effect.h:467
EffectReverse::Symbol
static const ComponentInterfaceSymbol Symbol
Definition: Reverse.h:21
XO
#define XO(s)
Definition: Internat.h:31
LabelTrack
A LabelTrack is a Track that holds labels (LabelStruct).
Definition: LabelTrack.h:88
WaveClipHolders
std::vector< WaveClipHolder > WaveClipHolders
Definition: WaveClip.h:122
WaveTrack::RemoveAndReturnClip
std::shared_ptr< WaveClip > RemoveAndReturnClip(WaveClip *clip)
Definition: WaveTrack.cpp:1052
WaveClip::GetStartSample
sampleCount GetStartSample() const
Definition: WaveClip.cpp:266
WaveTrack::SortedClipArray
WaveClipPointers SortedClipArray()
Definition: WaveTrack.cpp:2606
WaveTrack::Set
void Set(constSamplePtr buffer, sampleFormat format, sampleCount start, size_t len)
Definition: WaveTrack.cpp:2076
floatSample
@ floatSample
Definition: SampleFormat.h:34
WaveClip
This allows multiple clips to be a part of one WaveTrack.
Definition: WaveClip.h:173
Effect::mT0
double mT0
Definition: Effect.h:466
WaveTrack::LongSamplesToTime
double LongSamplesToTime(sampleCount pos) const
Convert correctly between a number of samples and an (absolute) time in seconds.
Definition: WaveTrack.cpp:1870
WaveTrack::GetClips
WaveClipHolders & GetClips()
Definition: WaveTrack.h:370
Effect::ReplaceProcessedTracks
void ReplaceProcessedTracks(const bool bGoodResult)
Definition: Effect.cpp:2193
Effect::mOutputTracks
std::shared_ptr< TrackList > mOutputTracks
Definition: Effect.h:465
EffectReverse::ProcessOneClip
bool ProcessOneClip(int count, WaveTrack *track, sampleCount start, sampleCount len, sampleCount originalStart, sampleCount originalEnd)
Definition: Reverse.cpp:215
samplePtr
char * samplePtr
Definition: SampleFormat.h:49
WaveTrack::GetMaxBlockSize
size_t GetMaxBlockSize() const
Definition: WaveTrack.cpp:1669
WaveTrack::TimeToLongSamples
sampleCount TimeToLongSamples(double t0) const
Convert correctly between an (absolute) time in seconds and a number of samples.
Definition: WaveTrack.cpp:1865
WaveTrack::AddClip
bool AddClip(const std::shared_ptr< WaveClip > &clip)
Append a clip to the track; which must have the same block factory as this track; return success.
Definition: WaveTrack.cpp:1065
WaveClip::GetEndSample
sampleCount GetEndSample() const
Definition: WaveClip.cpp:271
Track::IsSelectedOrSyncLockSelected
bool IsSelectedOrSyncLockSelected() const
Definition: Track.cpp:376
WaveTrack::GetBestBlockSize
size_t GetBestBlockSize(sampleCount t) const
Definition: WaveTrack.cpp:1651
WaveTrack::SplitAt
void SplitAt(double t)
Definition: WaveTrack.cpp:2406
limitSampleBufferSize
size_t limitSampleBufferSize(size_t bufferSize, sampleCount limit)
Definition: SampleCount.cpp:23
WaveTrack::GetFloats
bool GetFloats(float *buffer, sampleCount start, size_t len, fillFormat fill=fillZero, bool mayThrow=true, sampleCount *pNumWithinClips=nullptr) const
Retrieve samples from a track in floating-point format, regardless of the storage format.
Definition: WaveTrack.h:265
Effect::TrackProgress
bool TrackProgress(int whichTrack, double frac, const TranslatableString &={})
Definition: Effect.cpp:2025
ArrayOf< float >