12#ifndef __AUDACITY_WAVECLIP__
13#define __AUDACITY_WAVECLIP__
22#include <wx/longlong.h>
114 int rate,
int colourIndex);
128 double t0,
double t1);
133 const std::function<
void(
size_t)> & progressReport = {});
143 void SetRate(
int rate);
152 double GetSequenceStartTime() const noexcept;
153 void SetSequenceStartTime(
double startTime);
154 double GetSequenceEndTime() const;
162 double GetPlayStartTime() const noexcept;
163 void SetPlayStartTime(
double time);
165 double GetPlayEndTime() const;
172 void SetTrimLeft(
double trim);
174 double GetTrimLeft() const noexcept;
177 void SetTrimRight(
double trim);
179 double GetTrimRight() const noexcept;
182 void TrimLeft(
double deltaTime);
184 void TrimRight(
double deltaTime);
187 void TrimLeftTo(
double to);
189 void TrimRightTo(
double to);
192 void Offset(
double delta) noexcept;
197 bool WithinPlayRegion(
double t) const;
198 bool BeforePlayStartTime(
double t) const;
199 bool AfterPlayEndTime(
double t) const;
205 sampleCount CountSamples(
double t0,
double t1) const;
208 sampleCount start,
size_t len,
bool mayThrow = true) const;
219 Envelope* GetEnvelope() {
return mEnvelope.get(); }
222 const BlockArray* GetSequenceBlockArray()
const;
238 std::pair<float, float> GetMinMax(
239 double t0,
double t1,
bool mayThrow =
true)
const;
240 float GetRMS(
double t0,
double t1,
bool mayThrow =
true)
const;
245 void UpdateEnvelopeTrackLen();
248 std::shared_ptr<SampleBlock> AppendNewBlock(
252 void AppendSharedBlock(
const std::shared_ptr<SampleBlock> &pBlock);
257 size_t len,
unsigned int stride,
270 void Clear(
double t0,
double t1);
276 void ClearLeft(
double t);
280 void ClearRight(
double t);
284 void ClearAndAddCutLine(
double t0,
double t1);
287 void Paste(
double t0,
const WaveClip* other);
291 void InsertSilence(
double t,
double len,
double *pEnvelopeValue =
nullptr );
295 void AppendSilence(
double len,
double envelopeValue );
306 bool FindCutLine(
double cutLinePosition,
307 double* cutLineStart = NULL,
308 double *cutLineEnd = NULL)
const;
313 void ExpandCutLine(
double cutLinePosition);
316 bool RemoveCutLine(
double cutLinePosition);
319 void OffsetCutLines(
double t0,
double len);
328 bool HandleXMLTag(
const std::string_view& tag,
const AttributesList &attrs)
override;
329 void HandleXMLEndTag(
const std::string_view& tag)
override;
330 XMLTagHandler *HandleXMLChild(
const std::string_view& tag)
override;
331 void WriteXML(
XMLWriter &xmlFile)
const ;
338 bool SharesBoundaryWithNextClip(
const WaveClip* next)
const;
340 void SetName(
const wxString&
name);
341 const wxString& GetName()
const;
343 sampleCount TimeToSamples(
double time)
const noexcept;
344 double SamplesToTime(
sampleCount s)
const noexcept;
350 size_t GetAppendBufferLen()
const;
355 void ClearSequence(
double t0,
double t1);
359 double mSequenceOffset { 0 };
360 double mTrimLeft{ 0 };
361 double mTrimRight{ 0 };
374 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
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
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.
static RegisteredToolbarFactory factory
virtual void MarkChanged()=0
virtual void Invalidate()=0