Audacity 3.2.0
Public Member Functions | List of all members
NoteTrack::Interval Struct Reference

#include <NoteTrack.h>

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

Public Member Functions

 ~Interval () override
 
std::shared_ptr< ChannelIntervalDoGetChannel (size_t iChannel) override
 Retrieve a channel. More...
 
 WideChannelGroupInterval (const ChannelGroup &group, double start, double end)
 
- Public Member Functions inherited from WideChannelGroupInterval
 WideChannelGroupInterval (const ChannelGroup &group, double start, double end)
 
 ~WideChannelGroupInterval () override
 
size_t NChannels () const
 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 (double start, double end)
 
virtual ~ChannelGroupInterval ()
 
double Start () const
 
double End () const
 

Additional Inherited Members

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

Detailed Description

Definition at line 193 of file NoteTrack.h.

Constructor & Destructor Documentation

◆ ~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 103 of file NoteTrack.cpp.

104{
105 if (iChannel == 0)
106 return std::make_shared<ChannelInterval>();
107 return {};
108}

References anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel.

◆ WideChannelGroupInterval()

WideChannelGroupInterval::WideChannelGroupInterval ( const ChannelGroup group,
double  start,
double  end 
)

Initialize immutable properties, constraining number of channels to equal that of the containing group

Precondition
group.IsLeader()
start <= end
Postcondition
NChannels() == group.NChannels()

Definition at line 72 of file Channel.cpp.

23 : ChannelGroupInterval{ start, end }
24 , mNChannels{ group.NChannels() }
25{
26 assert(group.IsLeader());
27 assert(mNChannels >= 1); // Post of ChannelGroup::NChannels
28}
virtual bool IsLeader() const =0
virtual size_t NChannels() const =0
Report the number of channels.
A start and an end time, and whatever else subclasses associate with them.
Definition: Channel.h:30
const size_t mNChannels
Definition: Channel.h:174
auto end(const Ptr< Type, BaseDeleter > &p)
Enables range-for.
Definition: PackedArray.h:159

References Channel::DoGetChannelGroup(), and Channel::FindChannelIndex().

Here is the call graph for this function:

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