![]() |
Audacity 3.2.0
|
A kind of Track used to 'warp time'. More...
#include <TimeTrack.h>
Public Member Functions | |
TimeTrack () | |
TimeTrack (const TimeTrack &orig, ProtectedCreationArg &&, double *pT0=nullptr, double *pT1=nullptr) | |
Copy-Constructor - create a NEW TimeTrack:: which is an independent copy of the original. More... | |
virtual | ~TimeTrack () |
const TypeInfo & | GetTypeInfo () const override |
bool | SupportsBasicEditing () const override |
Whether this track type implements cut-copy-paste; by default, true. More... | |
Holder | PasteInto (AudacityProject &) const override |
Find or create the destination track for a paste, maybe in a different project. More... | |
Holder | Cut (double t0, double t1) override |
Holder | Copy (double t0, double t1, bool forClipboard) const override |
void | Clear (double t0, double t1) override |
void | Paste (double t, const Track *src) override |
void | Silence (double t0, double t1) override |
void | InsertSilence (double t, double len) override |
double | GetOffset () const override |
void | SetOffset (double) override |
double | GetStartTime () const override |
double | GetEndTime () const override |
bool | HandleXMLTag (const std::string_view &tag, const AttributesList &attrs) override |
void | HandleXMLEndTag (const std::string_view &tag) override |
XMLTagHandler * | HandleXMLChild (const std::string_view &tag) override |
void | WriteXML (XMLWriter &xmlFile) const override |
BoundedEnvelope * | GetEnvelope () |
const BoundedEnvelope * | GetEnvelope () const |
double | GetRangeLower () const |
double | GetRangeUpper () const |
void | SetRangeLower (double lower) |
void | SetRangeUpper (double upper) |
bool | GetDisplayLog () const |
void | SetDisplayLog (bool displayLog) |
bool | GetInterpolateLog () const |
void | SetInterpolateLog (bool interpolateLog) |
void | testMe () |
![]() | |
TrackId | GetId () const |
template<typename Subclass = Track> | |
std::shared_ptr< Subclass > | SharedPointer () |
template<typename Subclass = const Track> | |
auto | SharedPointer () const -> std::enable_if_t< std::is_const_v< Subclass >, std::shared_ptr< Subclass > > |
std::shared_ptr< Track > | SubstitutePendingChangedTrack () |
std::shared_ptr< const Track > | SubstitutePendingChangedTrack () const |
std::shared_ptr< const Track > | SubstituteOriginalTrack () const |
virtual const TypeInfo & | GetTypeInfo () const =0 |
virtual const TypeNames & | GetTypeNames () const |
virtual bool | SupportsBasicEditing () const |
Whether this track type implements cut-copy-paste; by default, true. More... | |
virtual Holder | PasteInto (AudacityProject &) const =0 |
Find or create the destination track for a paste, maybe in a different project. More... | |
virtual ConstIntervals | GetIntervals () const |
Report times on the track where important intervals begin and end, for UI to snap to. More... | |
virtual Intervals | GetIntervals () |
virtual bool | LinkConsistencyFix (bool doFix=true, bool completeList=true) |
Check consistency of channel groups, and maybe fix it. More... | |
bool | LinkConsistencyCheck (bool completeList) |
Do the non-mutating part of consistency fix only and return status. More... | |
bool | HasOwner () const |
std::shared_ptr< TrackList > | GetOwner () const |
LinkType | GetLinkType () const noexcept |
bool | IsAlignedWithLeader () const |
Returns true if the leader track has link type LinkType::Aligned. More... | |
ChannelGroupData & | GetGroupData () |
const ChannelGroupData & | GetGroupData () const |
Track () | |
Track (const Track &orig, ProtectedCreationArg &&) | |
Track & | operator= (const Track &orig)=delete |
virtual | ~Track () |
void | Init (const Track &orig) |
virtual Holder | Duplicate () const |
const wxString & | GetName () const |
Name is always the same for all channels of a group. More... | |
void | SetName (const wxString &n) |
bool | GetSelected () const |
Selectedness is always the same for all channels of a group. More... | |
virtual void | SetSelected (bool s) |
void | EnsureVisible (bool modifyState=false) |
virtual double | GetOffset () const =0 |
void | Offset (double t) |
virtual void | SetOffset (double o) |
virtual Holder | Cut (double WXUNUSED(t0), double WXUNUSED(t1))=0 |
virtual Holder | Copy (double WXUNUSED(t0), double WXUNUSED(t1), bool forClipboard=true) const =0 |
virtual void | Clear (double WXUNUSED(t0), double WXUNUSED(t1))=0 |
virtual void | Paste (double WXUNUSED(t), const Track *WXUNUSED(src))=0 |
virtual void | SyncLockAdjust (double oldT1, double newT1) |
virtual void | Silence (double WXUNUSED(t0), double WXUNUSED(t1))=0 |
virtual void | InsertSilence (double WXUNUSED(t), double WXUNUSED(len))=0 |
bool | SameKindAs (const Track &track) const |
template<typename R = void, typename ... Functions> | |
R | TypeSwitch (const Functions &...functions) |
Use this function rather than testing track type explicitly and making down-casts. More... | |
template<typename R = void, typename ... Functions> | |
R | TypeSwitch (const Functions &...functions) const |
Use this function rather than testing track type explicitly and making down-casts. More... | |
virtual void | WriteXML (XMLWriter &xmlFile) const =0 |
virtual bool | GetErrorOpening () |
virtual double | GetStartTime () const =0 |
virtual double | GetEndTime () const =0 |
void | Notify (bool allChannels, int code=-1) |
bool | Any () const |
bool | IsSelected () const |
bool | IsLeader () const |
bool | IsSelectedLeader () const |
void | AdjustPositions () |
void | WriteCommonXMLAttributes (XMLWriter &xmlFile, bool includeNameAndSelected=true) const |
bool | HandleCommonXMLAttribute (const std::string_view &attr, const XMLAttributeValueView &valueView) |
![]() | |
XMLTagHandler () | |
virtual | ~XMLTagHandler () |
virtual bool | HandleXMLTag (const std::string_view &tag, const AttributesList &attrs)=0 |
virtual void | HandleXMLEndTag (const std::string_view &WXUNUSED(tag)) |
virtual void | HandleXMLContent (const std::string_view &WXUNUSED(content)) |
virtual XMLTagHandler * | HandleXMLChild (const std::string_view &tag)=0 |
void | ReadXMLEndTag (const char *tag) |
void | ReadXMLContent (const char *s, int len) |
XMLTagHandler * | ReadXMLChild (const char *tag) |
![]() | |
~Site () | |
Site () | |
Site (const Site &other) | |
Site & | operator= (const Site &other) |
Site (Site &&other) | |
Site & | operator= (Site &&other) |
size_t | size () const |
How many attachment pointers are in the Site. More... | |
template<typename Subclass = ClientData> | |
Subclass & | Get (const RegisteredFactory &key) |
Get reference to an attachment, creating on demand if not present, down-cast it to Subclass. More... | |
template<typename Subclass = const ClientData> | |
auto | Get (const RegisteredFactory &key) const -> std::enable_if_t< std::is_const< Subclass >::value, Subclass & > |
Get reference to an attachment, creating on demand if not present, down-cast it to Subclass. More... | |
template<typename Subclass = ClientData> | |
Subclass * | Find (const RegisteredFactory &key) |
Get a (bare) pointer to an attachment, or null, down-cast it to Subclass *; will not create on demand. More... | |
template<typename Subclass = const ClientData> | |
auto | Find (const RegisteredFactory &key) const -> std::enable_if_t< std::is_const< Subclass >::value, Subclass * > |
Get a (bare) pointer to an attachment, or null, down-cast it to Subclass *; will not create on demand. More... | |
template<typename ReplacementPointer > | |
void | Assign (const RegisteredFactory &key, ReplacementPointer &&replacement) |
Reassign Site's pointer to ClientData. More... | |
Static Public Member Functions | |
static wxString | GetDefaultName () |
static TimeTrack * | New (AudacityProject &project) |
static const TypeInfo & | ClassTypeInfo () |
![]() | |
template<typename Subclass = Track> | |
static std::shared_ptr< Subclass > | SharedPointer (Track *pTrack) |
template<typename Subclass = const Track> | |
static std::shared_ptr< Subclass > | SharedPointer (const Track *pTrack) |
static const TypeInfo & | ClassTypeInfo () |
static void | FinishCopy (const Track *n, Track *dest) |
template<typename TrackType > | |
static void | checkTrackType () |
template<typename R , typename TrackType , typename... Functions> | |
static R | CallExecutor (R *, std::tuple<> *, TrackType &, const Functions &...) |
template<typename R , typename TrackType , typename... Functions, typename Executor , typename... Executors> | |
static R | CallExecutor (R *, std::tuple< Executor, Executors... > *, TrackType &track, const Functions &...functions) |
template<typename ... Executors> | |
static constexpr unsigned | UsedCases (std::tuple< Executors... > *) |
template<typename Tag , bool IsConst, typename R , typename ... TrackTypes, typename ... Functions> | |
static R | DoTypeSwitch (std::conditional_t< IsConst, const Track, Track > &track, TypeList::List< TrackTypes... >, const Functions &...functions) |
Deduce two packs from arguments. More... | |
![]() | |
static size_t | slots () |
How many static factories have been registered with this specialization of Site. More... | |
Private Types | |
using | Holder = std::unique_ptr< TimeTrack > |
Private Member Functions | |
void | CleanState () |
void | Init (const TimeTrack &orig) |
Copy the metadata from another track but not the points. More... | |
Track::Holder | Clone () const override |
Private Attributes | |
std::unique_ptr< BoundedEnvelope > | mEnvelope |
bool | mDisplayLog |
bool | mRescaleXMLValues |
Additional Inherited Members | |
![]() | |
enum class | LinkType : int { None = 0 , Group = 2 , Aligned } |
For two tracks describes the type of the linkage. More... | |
using | ChannelGroupAttachments = ClientData::Site< ChannelGroupData, ClientData::Cloneable<>, ClientData::DeepCopying > |
Hosting of objects attached by higher level code. More... | |
using | AttachedObjects = ::AttachedTrackObjects |
Alias for my base type. More... | |
using | IntervalData = TrackIntervalData |
using | Interval = TrackInterval |
using | Intervals = std::vector< Interval > |
using | ConstInterval = ConstTrackInterval |
using | ConstIntervals = std::vector< ConstInterval > |
using | Holder = std::shared_ptr< Track > |
template<typename R = void> | |
using | Continuation = std::function< R() > |
Type of arguments passed as optional second parameter to TypeSwitch() cases. More... | |
using | Fallthrough = Continuation<> |
Type of arguments passed as optional second parameter to TypeSwitch<void>() cases. More... | |
![]() | |
using | DataType = ClientData |
using | DataPointer = Pointer< ClientData > |
using | DataFactory = std::function< DataPointer(Host &) > |
Type of function from which RegisteredFactory is constructed; it builds attachments. More... | |
![]() | |
std::pair< int, int > | vrulerSize |
![]() | |
void | SetLinkType (LinkType linkType, bool completeList=true) |
![]() | |
template<typename Function > | |
void | ForEach (const Function &function) |
Invoke function on each ClientData object that has been created in this . More... | |
template<typename Function > | |
void | ForEach (const Function &function) const |
Invoke function on each ClientData object that has been created in this . More... | |
template<typename Function > | |
ClientData * | FindIf (const Function &function) |
Return pointer to first attachment in this that is not null and satisfies a predicate, or nullptr. More... | |
template<typename Function > | |
const ClientData * | FindIf (const Function &function) const |
Return pointer to first attachment in this that is not null and satisfies a predicate, or nullptr. More... | |
void | BuildAll () |
For each RegisteredFactory, if the corresponding attachment is absent in this , build and store it. More... | |
![]() | |
std::weak_ptr< TrackList > | mList |
TrackNodePointer | mNode {} |
Holds iterator to self, so that TrackList::Find can be constant-time. More... | |
int | mIndex |
0-based position of this track in its TrackList More... | |
double | mOffset |
A kind of Track used to 'warp time'.
Definition at line 22 of file TimeTrack.h.
|
private |
Definition at line 115 of file TimeTrack.h.
TimeTrack::TimeTrack | ( | ) |
Definition at line 49 of file TimeTrack.cpp.
References CleanState().
TimeTrack::TimeTrack | ( | const TimeTrack & | orig, |
ProtectedCreationArg && | a, | ||
double * | pT0 = nullptr , |
||
double * | pT1 = nullptr |
||
) |
Copy-Constructor - create a NEW TimeTrack:: which is an independent copy of the original.
Calls TimeTrack::Init() to copy the track metadata, then does a bunch of manipulations on the Envelope:: members in order to copy one to the other - unfortunately both lack a copy-constructor to encapsulate this.
orig | The original track to copy from |
pT0 | if not null, then the start of the sub-range to copy |
pT1 | if not null, then the end of the sub-range to copy |
Definition at line 69 of file TimeTrack.cpp.
References GetRangeLower(), GetRangeUpper(), Init(), mEnvelope, SetRangeLower(), and SetRangeUpper().
|
virtual |
Definition at line 98 of file TimeTrack.cpp.
|
static |
Definition at line 134 of file TimeTrack.cpp.
References typeInfo().
|
private |
Definition at line 54 of file TimeTrack.cpp.
References GetDefaultName(), mDisplayLog, mEnvelope, Track::SetName(), SetRangeLower(), SetRangeUpper(), TIMETRACK_MAX, and TIMETRACK_MIN.
Referenced by TimeTrack().
|
override |
Definition at line 188 of file TimeTrack.cpp.
References anonymous_namespace{TimeTrack.cpp}::GetRate(), and mEnvelope.
Referenced by Cut().
|
overrideprivatevirtual |
Implements Track.
Definition at line 217 of file TimeTrack.cpp.
|
override |
Definition at line 171 of file TimeTrack.cpp.
Referenced by Cut().
|
override |
Definition at line 164 of file TimeTrack.cpp.
References Clear(), and Copy().
|
static |
Definition at line 36 of file TimeTrack.cpp.
References _.
Referenced by CleanState().
|
inline |
Definition at line 94 of file TimeTrack.h.
Referenced by anonymous_namespace{TimeTrackView.cpp}::DrawHorzRulerAndCurve(), anonymous_namespace{TimeTrackView.cpp}::DrawTimeTrack(), anonymous_namespace{EnvelopeHandle.cpp}::GetTimeTrackData(), and Init().
|
inlineoverridevirtual |
|
inline |
Definition at line 83 of file TimeTrack.h.
Referenced by anonymous_namespace{TimeTrackView.cpp}::DrawHorzRulerAndCurve(), anonymous_namespace{TimeTrackView.cpp}::DrawTimeTrack(), AUPImportFileHandle::HandleEnvelope(), and testMe().
|
inline |
Definition at line 84 of file TimeTrack.h.
bool TimeTrack::GetInterpolateLog | ( | ) | const |
Definition at line 224 of file TimeTrack.cpp.
References mEnvelope.
Referenced by TimeTrackMenuTable::OnTimeTrackLogInt().
|
inlineoverridevirtual |
double TimeTrack::GetRangeLower | ( | ) | const |
Definition at line 102 of file TimeTrack.cpp.
References mEnvelope.
Referenced by anonymous_namespace{TimeTrackView.cpp}::DrawHorzRulerAndCurve(), anonymous_namespace{TimeTrackView.cpp}::DrawTimeTrack(), anonymous_namespace{EnvelopeHandle.cpp}::GetTimeTrackData(), HandleXMLEndTag(), HandleXMLTag(), TimeTrackMenuTable::OnSetTimeTrackRange(), PasteInto(), and TimeTrack().
double TimeTrack::GetRangeUpper | ( | ) | const |
Definition at line 107 of file TimeTrack.cpp.
References mEnvelope.
Referenced by anonymous_namespace{TimeTrackView.cpp}::DrawHorzRulerAndCurve(), anonymous_namespace{TimeTrackView.cpp}::DrawTimeTrack(), anonymous_namespace{EnvelopeHandle.cpp}::GetTimeTrackData(), HandleXMLEndTag(), HandleXMLTag(), TimeTrackMenuTable::OnSetTimeTrackRange(), PasteInto(), and TimeTrack().
|
inlineoverridevirtual |
|
overridevirtual |
Implements Track.
Definition at line 129 of file TimeTrack.cpp.
References typeInfo().
|
overridevirtual |
|
override |
Definition at line 277 of file TimeTrack.cpp.
References GetRangeLower(), GetRangeUpper(), mEnvelope, mRescaleXMLValues, TIMETRACK_MAX, and TIMETRACK_MIN.
|
overridevirtual |
Implements XMLTagHandler.
Definition at line 233 of file TimeTrack.cpp.
References GetRangeLower(), GetRangeUpper(), Track::HandleCommonXMLAttribute(), mEnvelope, mRescaleXMLValues, SetDisplayLog(), SetInterpolateLog(), SetRangeLower(), and SetRangeUpper().
|
private |
Copy the metadata from another track but not the points.
Copies the Name, DefaultName, Range and Display data from the source track
orig | the TimeTrack to copy from |
Definition at line 91 of file TimeTrack.cpp.
References GetDisplayLog(), Track::GetName(), Track::Init(), SetDisplayLog(), and Track::SetName().
Referenced by TimeTrack().
|
override |
Definition at line 212 of file TimeTrack.cpp.
References mEnvelope.
|
static |
Definition at line 41 of file TimeTrack.cpp.
References TrackList::Get().
|
override |
Definition at line 194 of file TimeTrack.cpp.
References anonymous_namespace{TimeTrack.cpp}::GetRate(), mEnvelope, and Track::TypeSwitch().
|
overridevirtual |
Find or create the destination track for a paste, maybe in a different project.
use_count()
can tell whether it is new Implements Track.
Definition at line 144 of file TimeTrack.cpp.
References PackedArray::begin(), TrackList::Get(), GetRangeLower(), and GetRangeUpper().
|
inline |
Definition at line 95 of file TimeTrack.h.
Referenced by HandleXMLTag(), Init(), TimeTrackMenuTable::OnTimeTrackLin(), and TimeTrackMenuTable::OnTimeTrackLog().
void TimeTrack::SetInterpolateLog | ( | bool | interpolateLog | ) |
Definition at line 229 of file TimeTrack.cpp.
References mEnvelope.
Referenced by HandleXMLTag(), and TimeTrackMenuTable::OnTimeTrackLogInt().
|
inlineoverridevirtual |
void TimeTrack::SetRangeLower | ( | double | lower | ) |
Definition at line 112 of file TimeTrack.cpp.
References mEnvelope.
Referenced by CleanState(), HandleXMLTag(), TimeTrackMenuTable::OnSetTimeTrackRange(), and TimeTrack().
void TimeTrack::SetRangeUpper | ( | double | upper | ) |
Definition at line 117 of file TimeTrack.cpp.
References mEnvelope.
Referenced by CleanState(), HandleXMLTag(), TimeTrackMenuTable::OnSetTimeTrackRange(), and TimeTrack().
|
override |
Definition at line 208 of file TimeTrack.cpp.
|
overridevirtual |
Whether this track type implements cut-copy-paste; by default, true.
Reimplemented from Track.
Definition at line 139 of file TimeTrack.cpp.
void TimeTrack::testMe | ( | ) |
Definition at line 313 of file TimeTrack.cpp.
References Envelope::Flatten(), GetEnvelope(), Envelope::InsertOrReplace(), Envelope::Integral(), and Envelope::IntegralOfInverse().
|
overridevirtual |
Implements Track.
Definition at line 295 of file TimeTrack.cpp.
References Track::WriteCommonXMLAttributes(), and wxT().
|
private |
Definition at line 105 of file TimeTrack.h.
Referenced by CleanState().
|
private |
Definition at line 104 of file TimeTrack.h.
Referenced by CleanState(), Clear(), GetInterpolateLog(), GetRangeLower(), GetRangeUpper(), HandleXMLChild(), HandleXMLEndTag(), HandleXMLTag(), InsertSilence(), Paste(), SetInterpolateLog(), SetRangeLower(), SetRangeUpper(), and TimeTrack().
|
private |
Definition at line 106 of file TimeTrack.h.
Referenced by HandleXMLEndTag(), and HandleXMLTag().