Audacity 3.2.0
Public Member Functions | Private Attributes | List of all members
NoteTrack::Interval Struct Referencefinal

#include <NoteTrack.h>

Inheritance diagram for NoteTrack::Interval:
[legend]
Collaboration diagram for NoteTrack::Interval:
[legend]

Public Member Functions

 Interval (const NoteTrack &track)
 
 ~Interval () override
 
std::shared_ptr< ChannelIntervalDoGetChannel (size_t iChannel) override
 Retrieve a channel. More...
 
double Start () const override
 
double End () const override
 
size_t NChannels () const override
 Report the number of channels. More...
 
- Public Member Functions inherited from WideChannelGroupInterval
 ~WideChannelGroupInterval () override
 
virtual size_t NChannels () const =0
 Report the number of channels. More...
 
template<typename IntervalType = ChannelInterval>
std::shared_ptr< IntervalType > GetChannel (size_t iChannel)
 Retrieve a channel, cast to the given type. More...
 
template<typename IntervalType = const ChannelInterval>
auto GetChannel (size_t iChannel) const -> std::enable_if_t< std::is_const_v< IntervalType >, std::shared_ptr< IntervalType > >
 
template<typename IntervalType = ChannelInterval>
IteratorRange< ChannelIterator< IntervalType > > Channels ()
 Get range of ChannelInterval objects with mutative access. More...
 
template<typename IntervalType = const ChannelInterval>
auto Channels () const -> std::enable_if_t< std::is_const_v< IntervalType >, IteratorRange< ChannelIterator< IntervalType > > >
 Get range of channels with read-only access. More...
 
- Public Member Functions inherited from ChannelGroupInterval
 ChannelGroupInterval ()=default
 
virtual ~ChannelGroupInterval ()
 
virtual double Start () const =0
 
virtual double End () const =0
 

Private Attributes

const std::shared_ptr< const NoteTrackmpTrack
 

Additional Inherited Members

virtual std::shared_ptr< ChannelIntervalDoGetChannel (size_t iChannel)=0
 Retrieve a channel. More...
 

Detailed Description

Definition at line 184 of file NoteTrack.h.

Constructor & Destructor Documentation

◆ Interval()

NoteTrack::Interval::Interval ( const NoteTrack track)
explicit

Definition at line 93 of file NoteTrack.cpp.

94 : mpTrack{ track.SharedPointer<const NoteTrack>() }
95{}
A Track that is used for Midi notes. (Somewhat old code).
Definition: NoteTrack.h:78
std::shared_ptr< Subclass > SharedPointer()
Definition: Track.h:146
const std::shared_ptr< const NoteTrack > mpTrack
Definition: NoteTrack.h:193

◆ ~Interval()

NoteTrack::Interval::~Interval ( )
overridedefault

Member Function Documentation

◆ DoGetChannel()

std::shared_ptr< ChannelInterval > NoteTrack::Interval::DoGetChannel ( size_t  iChannel)
overridevirtual

Retrieve a channel.

Postcondition
result: !(iChannel < NChannels()) || result

Implements WideChannelGroupInterval.

Definition at line 115 of file NoteTrack.cpp.

116{
117 if (iChannel == 0)
118 return std::make_shared<ChannelInterval>();
119 return {};
120}

References anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel.

◆ End()

double NoteTrack::Interval::End ( ) const
overridevirtual
Postcondition
result: Start() < result

Implements ChannelGroupInterval.

Definition at line 104 of file NoteTrack.cpp.

105{
106 return Start() + mpTrack->GetSeq().get_real_dur();
107}
double Start() const override
Definition: NoteTrack.cpp:99

◆ NChannels()

size_t NoteTrack::Interval::NChannels ( ) const
overridevirtual

Report the number of channels.

Postcondition
result: result >= 1

Implements WideChannelGroupInterval.

Definition at line 109 of file NoteTrack.cpp.

110{
111 return 1;
112}

◆ Start()

double NoteTrack::Interval::Start ( ) const
overridevirtual
Postcondition
result: result < End()

Implements ChannelGroupInterval.

Definition at line 99 of file NoteTrack.cpp.

100{
101 return mpTrack->mOrigin;
102}

Member Data Documentation

◆ mpTrack

const std::shared_ptr<const NoteTrack> NoteTrack::Interval::mpTrack
private
Invariant
not null

Definition at line 193 of file NoteTrack.h.


The documentation for this struct was generated from the following files: