declares abstract base class Track, TrackList, and iterators over TrackList
More...
#include <algorithm>
#include <atomic>
#include <utility>
#include <list>
#include <optional>
#include <functional>
#include <wx/longlong.h>
#include "Channel.h"
#include "Observer.h"
#include "TrackAttachment.h"
#include "TypeEnumerator.h"
#include "TypeSwitch.h"
#include "XMLTagHandler.h"
Go to the source code of this file.
|
class | TrackId |
| An in-session identifier of track objects across undo states. It does not persist between sessions. More...
|
|
class | Track |
| Abstract base class for an object holding data associated with points on a time axis. More...
|
|
struct | Track::ProtectedCreationArg |
| Empty argument passed to some public constructors. More...
|
|
struct | Track::TypeNames |
| Names of a track type for various purposes. More...
|
|
struct | Track::TypeInfo |
|
struct | Track::DuplicateOptions |
| Choices when duplicating a track. More...
|
|
class | UniqueChannelTrack< Base > |
| Generates overrides of channel-related functions. More...
|
|
class | TrackIter< TrackType > |
| Iterator over only members of a TrackList of the specified subtype, optionally filtered by a predicate; past-end value dereferenceable, to nullptr. More...
|
|
struct | TrackIterRange< TrackType > |
| Range between two TrackIters, usable in range-for statements, and with Visit member functions. More...
|
|
struct | TrackListEvent |
| Notification of changes in individual tracks of TrackList, or of TrackList's composition. More...
|
|
class | TrackList |
| A flat linked list of tracks supporting Add, Remove, Clear, and Contains, serialization of the list of tracks, event notifications. More...
|
|
|
template<typename T > |
std::enable_if_t< std::is_pointer_v< T >, T > | track_cast (Track *track) |
| Encapsulate the checked down-casting of track pointers. More...
|
|
template<typename T > |
std::enable_if_t< std::is_pointer_v< T > &&std::is_const_v< std::remove_pointer_t< T > >, T > | track_cast (const Track *track) |
| Encapsulate the checked down-casting of track pointers. More...
|
|
| ENUMERATE_TRACK_TYPE (Track) |
|
declares abstract base class Track, TrackList, and iterators over TrackList
Audacity: A Digital Audio Editor
Dominic Mazzoni
Definition in file Track.h.
◆ ENUMERATE_TRACK_TYPE
Empty class which will have subclasses.
This macro should be called immediately after the definition of each Track subclass
It must occur at file scope, not within any other namespace
Definition at line 56 of file Track.h.
◆ AttachedTrackObjects
Template generated base class for Track lets it host opaque UI related objects.
Definition at line 100 of file Track.h.
◆ ListOfTracks
◆ ProgressReporter
◆ TrackArray
◆ TrackListHolder
◆ TrackNodePointer
◆ ENUMERATE_TRACK_TYPE()
ENUMERATE_TRACK_TYPE |
( |
Track |
| ) |
|
◆ track_cast() [1/2]
template<typename T >
std::enable_if_t< std::is_pointer_v< T > &&std::is_const_v< std::remove_pointer_t< T > >, T > track_cast |
( |
const Track * |
track | ) |
|
|
inline |
Encapsulate the checked down-casting of track pointers.
Eliminates possibility of error – and not quietly casting away const
Typical usage:
if (auto wt = track_cast<const WaveTrack*>(track)) { ... }
This overload for const pointers can cast only to other const pointer types.
Definition at line 497 of file Track.h.
498{
499 using BareType = std::remove_pointer_t< T >;
500 if (track &&
501 BareType::ClassTypeInfo().IsBaseOf(track->
GetTypeInfo() ))
502 return reinterpret_cast<T>(track);
503 else
504 return nullptr;
505}
virtual const TypeInfo & GetTypeInfo() const =0
◆ track_cast() [2/2]
template<typename T >
std::enable_if_t< std::is_pointer_v< T >, T > track_cast |
( |
Track * |
track | ) |
|
|
inline |
Encapsulate the checked down-casting of track pointers.
Eliminates possibility of error – and not quietly casting away const
Typical usage:
if (auto wt = track_cast<const WaveTrack*>(track)) { ... }
Definition at line 480 of file Track.h.
481{
482 using BareType = std::remove_pointer_t< T >;
483 if (track &&
484 BareType::ClassTypeInfo().IsBaseOf(track->
GetTypeInfo() ))
485 return reinterpret_cast<T>(track);
486 else
487 return nullptr;
488}