12#ifndef __AUDACITY_WAVECLIP__
13#define __AUDACITY_WAVECLIP__
22#include <wx/longlong.h>
114 int rate,
int colourIndex);
127 double t0,
double t1);
132 const std::function<
void(
size_t)> & progressReport = {});
142 void SetRate(
int rate);
151 double GetSequenceStartTime() const noexcept;
152 void SetSequenceStartTime(
double startTime);
153 double GetSequenceEndTime() const;
161 double GetPlayStartTime() const noexcept;
162 void SetPlayStartTime(
double time);
164 double GetPlayEndTime() const;
171 void SetTrimLeft(
double trim);
173 double GetTrimLeft() const noexcept;
176 void SetTrimRight(
double trim);
178 double GetTrimRight() const noexcept;
181 void TrimLeft(
double deltaTime);
183 void TrimRight(
double deltaTime);
186 void TrimLeftTo(
double to);
188 void TrimRightTo(
double to);
191 void Offset(
double delta) noexcept;
196 bool WithinPlayRegion(
double t) const;
197 bool BeforePlayStartTime(
double t) const;
198 bool AfterPlayEndTime(
double t) const;
201 sampleCount start,
size_t len,
bool mayThrow = true) const;
205 Envelope* GetEnvelope() {
return mEnvelope.get(); }
208 const BlockArray* GetSequenceBlockArray()
const;
224 std::pair<float, float> GetMinMax(
225 double t0,
double t1,
bool mayThrow =
true)
const;
226 float GetRMS(
double t0,
double t1,
bool mayThrow =
true)
const;
231 void UpdateEnvelopeTrackLen();
234 std::shared_ptr<SampleBlock> AppendNewBlock(
238 void AppendSharedBlock(
const std::shared_ptr<SampleBlock> &pBlock);
243 size_t len,
unsigned int stride);
249 void Clear(
double t0,
double t1);
255 void ClearLeft(
double t);
259 void ClearRight(
double t);
262 void ClearAndAddCutLine(
double t0,
double t1);
265 void Paste(
double t0,
const WaveClip* other);
269 void InsertSilence(
double t,
double len,
double *pEnvelopeValue =
nullptr );
273 void AppendSilence(
double len,
double envelopeValue );
284 bool FindCutLine(
double cutLinePosition,
285 double* cutLineStart = NULL,
286 double *cutLineEnd = NULL)
const;
291 void ExpandCutLine(
double cutLinePosition);
294 bool RemoveCutLine(
double cutLinePosition);
297 void OffsetCutLines(
double t0,
double len);
306 bool HandleXMLTag(
const std::string_view& tag,
const AttributesList &attrs)
override;
307 void HandleXMLEndTag(
const std::string_view& tag)
override;
308 XMLTagHandler *HandleXMLChild(
const std::string_view& tag)
override;
309 void WriteXML(
XMLWriter &xmlFile)
const ;
316 bool SharesBoundaryWithNextClip(
const WaveClip* next)
const;
318 void SetName(
const wxString&
name);
319 const wxString& GetName()
const;
321 sampleCount TimeToSamples(
double time)
const noexcept;
322 double SamplesToTime(
sampleCount s)
const noexcept;
333 void ClearSequence(
double t0,
double t1);
337 double mSequenceOffset { 0 };
338 double mTrimLeft{ 0 };
339 double mTrimRight{ 0 };
348 size_t mAppendBufferLen { 0 };
355 bool mIsPlaceholder {
false };
Utility ClientData::Site to register hooks into a host class that attach client data.
const TranslatableString name
std::shared_ptr< SampleBlockFactory > SampleBlockFactoryPtr
std::shared_ptr< WaveClip > WaveClipHolder
std::vector< WaveClipHolder > WaveClipHolders
std::vector< std::shared_ptr< const WaveClip > > WaveClipConstHolders
Append([](My &table) -> Registry::BaseItemPtr { if(WaveTrackSubViews::slots() > 1) return std::make_unique< Entry >("MultiView", Entry::CheckItem, OnMultiViewID, XXO("&Multi-view"), POPUP_MENU_FN(OnMultiView), table, [](PopupMenuHandler &handler, wxMenu &menu, int id){ auto &table=static_cast< WaveTrackMenuTable & >(handler);auto &track=table.FindWaveTrack();const auto &view=WaveTrackView::Get(track);menu.Check(id, view.GetMultiView());});else return nullptr;})
std::vector< Attribute > AttributesList
Abstraction of a progress dialog with well defined time-to-completion estimate.
Utility to register hooks into a host class that attach client data.
Piecewise linear or piecewise exponential function from double to double.
abstract base class with methods to produce SampleBlock objects
Abstract class allows access to contents of a block of sound samples, serialization as XML,...
A WaveTrack contains WaveClip(s). A WaveClip contains a Sequence. A Sequence is primarily an interfac...
This allows multiple clips to be a part of one WaveTrack.
void SetIsPlaceholder(bool val)
std::unique_ptr< Sequence > mSequence
std::unique_ptr< Envelope > mEnvelope
WaveClip(const WaveClip &) PROHIBITED
const SampleBuffer & GetAppendBuffer() const
bool GetIsPlaceholder() const
const Sequence * GetSequence() const
WaveClipHolders & GetCutLines()
Get access to cut lines list.
void SetColourIndex(int index)
const WaveClipConstHolders & GetCutLines() const
size_t NumCutLines() const
size_t GetAppendBufferLen() const
int GetColourIndex() const
const Envelope * GetEnvelope() const
Site< WaveClip, WaveClipListener > Caches
std::vector< float > ownMin
std::vector< sampleCount > ownWhere
std::vector< float > ownMax
std::vector< float > ownRms
This class is an interface which should be implemented by classes which wish to be able to load and s...
Base class for XMLFileWriter and XMLStringWriter that provides the general functionality for creating...
Positions or offsets within audio files need a wide type.
virtual void MarkChanged()=0
virtual void Invalidate()=0