Audacity 3.2.0
Classes | Public Member Functions | Protected Member Functions | List of all members
WideChannelGroupInterval Class Referenceabstract

#include <Channel.h>

Inheritance diagram for WideChannelGroupInterval:
[legend]
Collaboration diagram for WideChannelGroupInterval:
[legend]

Classes

class  ChannelIterator
 

Public Member Functions

 ~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
 

Protected Member Functions

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

Detailed Description

Start and end time, and channel width, and whatever else subclasses associate with them

Start and end and number of channels are immutable, but subclasses may add other mutable data

Invariant
Start() <= End()

Definition at line 56 of file Channel.h.

Constructor & Destructor Documentation

◆ ~WideChannelGroupInterval()

WideChannelGroupInterval::~WideChannelGroupInterval ( )
overridedefault

Member Function Documentation

◆ Channels() [1/2]

template<typename IntervalType = ChannelInterval>
IteratorRange< ChannelIterator< IntervalType > > WideChannelGroupInterval::Channels ( )
inline

Get range of ChannelInterval objects with mutative access.

Definition at line 135 of file Channel.h.

136 {
137 return { { this, 0 }, { this, NChannels() } };
138 }
virtual size_t NChannels() const =0
Report the number of channels.

◆ Channels() [2/2]

template<typename IntervalType = const ChannelInterval>
auto WideChannelGroupInterval::Channels ( ) const -> std::enable_if_t<std::is_const_v<IntervalType>, IteratorRange<ChannelIterator<IntervalType>> >
inline

Get range of channels with read-only access.

Definition at line 142 of file Channel.h.

146 {
147 return { { this, 0 }, { this, NChannels() } };
148 }

◆ DoGetChannel()

virtual std::shared_ptr< ChannelInterval > WideChannelGroupInterval::DoGetChannel ( size_t  iChannel)
protectedpure virtual

Retrieve a channel.

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

Implemented in NoteTrack::Interval, WaveClip, and LabelTrack::Interval.

◆ GetChannel() [1/2]

template<typename IntervalType = ChannelInterval>
std::shared_ptr< IntervalType > WideChannelGroupInterval::GetChannel ( size_t  iChannel)
inline

Retrieve a channel, cast to the given type.

Postconditions imply that GetChannel(0) is always non-null

Postcondition
if IntervalType is default, then: result: !(iChannel < NChannels()) || result

Definition at line 74 of file Channel.h.

75 {
76 return
77 std::dynamic_pointer_cast<IntervalType>(DoGetChannel(iChannel));
78 }
virtual std::shared_ptr< ChannelInterval > DoGetChannel(size_t iChannel)=0
Retrieve a channel.

References anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel.

◆ GetChannel() [2/2]

template<typename IntervalType = const ChannelInterval>
auto WideChannelGroupInterval::GetChannel ( size_t  iChannel) const -> std::enable_if_t<std::is_const_v<IntervalType>, std::shared_ptr<IntervalType>>
inline

Postconditions imply that GetChannel(0) is always non-null

Postcondition
if IntervalType is default, then: result: !(iChannel < NChannels()) || result

Definition at line 84 of file Channel.h.

87 {
88 return std::dynamic_pointer_cast<IntervalType>(
90 }

References anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel.

◆ NChannels()

virtual size_t WideChannelGroupInterval::NChannels ( ) const
pure virtual

Report the number of channels.

Postcondition
result: result >= 1

Implemented in NoteTrack::Interval, WaveClip, and LabelTrack::Interval.

Referenced by WaveTrack::ClearAndPasteAtSameTempo().

Here is the caller graph for this function:

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