![]() |
Audacity 3.2.0
|
#include <Channel.h>
Classes | |
struct | ChannelGroupData |
class | ChannelIterator |
class | IntervalIterator |
Public Types | |
enum class | LinkType : int { None = 0 , Group = 2 , Aligned } |
For two tracks describes the type of the linkage. More... | |
using | Attachments = ClientData::Site< ChannelGroupData, ClientData::Cloneable<>, ClientData::DeepCopying > |
Public Member Functions | |
virtual | ~ChannelGroup () |
double | GetStartTime () const |
Get the minimum of Start() values of intervals, or 0 when none. More... | |
double | GetEndTime () const |
Get the maximum of End() values of intervals, or 0 when none. More... | |
void | ShiftBy (double t) |
Change start time by given duration. More... | |
virtual void | MoveTo (double o)=0 |
Change start time to given time point. More... | |
virtual bool | IsLeader () const =0 |
ChannelGroupData & | GetGroupData () |
Make attachment site on demand as needed. More... | |
const ChannelGroupData & | GetGroupData () const |
ChannelGroupData * | FindGroupData () |
Do not make attachment site on demand if absent. More... | |
const ChannelGroupData * | FindGroupData () const |
Do not make attachment site on demand if absent. More... | |
void | Init (const ChannelGroup &other) |
Copy, including cloning of attached objects. More... | |
void | DestroyGroupData () |
Leave all attachments null. More... | |
std::unique_ptr< ChannelGroupData > | DetachGroupData () |
Move attachments out. More... | |
void | AssignGroupData (std::unique_ptr< ChannelGroupData > pGroupData) |
Replace any previous attachments. More... | |
Acesss to channels | |
virtual size_t | NChannels () const =0 |
Report the number of channels. More... | |
template<typename ChannelType = Channel> | |
std::shared_ptr< ChannelType > | GetChannel (size_t iChannel) |
Retrieve a channel, cast to the given type. More... | |
template<typename ChannelType = const Channel> | |
auto | GetChannel (size_t iChannel) const -> std::enable_if_t< std::is_const_v< ChannelType >, std::shared_ptr< ChannelType > > |
template<typename ChannelType = Channel> | |
IteratorRange< ChannelIterator< ChannelType > > | Channels () |
Get range of channels with mutative access. More... | |
template<typename ChannelType = const Channel> | |
auto | Channels () const -> std::enable_if_t< std::is_const_v< ChannelType >, IteratorRange< ChannelIterator< ChannelType > > > |
Get range of channels with read-only access. More... | |
Protected Member Functions | |
virtual std::shared_ptr< Channel > | DoGetChannel (size_t iChannel)=0 |
Retrieve a channel. More... | |
virtual std::shared_ptr< Interval > | DoGetInterval (size_t iInterval)=0 |
Retrieve an interval. More... | |
Private Attributes | |
std::unique_ptr< ChannelGroupData > | mpGroupData |
Acesss to intervals | |
using | Interval = WideChannelGroupInterval |
virtual size_t | NIntervals () const =0 |
Report the number of intervals. More... | |
template<typename IntervalType = Interval> | |
std::shared_ptr< IntervalType > | GetInterval (size_t iInterval) |
Retrieve an interval, cast to the given type. More... | |
template<typename IntervalType = const Interval> | |
auto | GetInterval (size_t iInterval) const -> std::enable_if_t< std::is_const_v< IntervalType >, std::shared_ptr< IntervalType > > |
template<typename IntervalType = Interval> | |
IteratorRange< IntervalIterator< IntervalType > > | Intervals () |
Get range of intervals with mutative access. More... | |
template<typename IntervalType = const Interval> | |
auto | Intervals () const -> std::enable_if_t< std::is_const_v< IntervalType >, IteratorRange< IntervalIterator< IntervalType > > > |
Get range of intervals with read-only access. More... | |
|
strong |
For two tracks describes the type of the linkage.
|
virtualdefault |
void ChannelGroup::AssignGroupData | ( | std::unique_ptr< ChannelGroupData > | pGroupData | ) |
Replace any previous attachments.
Definition at line 106 of file Channel.cpp.
References mpGroupData.
|
inline |
Get range of channels with mutative access.
IsLeader()
Definition at line 408 of file Channel.h.
Referenced by SetTrackVisualsCommand::ApplyInner(), TrackPanelResizeHandle::Click(), TrackShifter::CommonMayMigrateTo(), TrackPanelResizeHandle::Drag(), anonymous_namespace{TrackPanel.cpp}::FindAdjustedChannelHeights(), TrackList::NChannels(), TrackPanelResizeHandle::NextChannel(), TrackPanelResizeHandle::PrevChannel(), ProjectWindow::SetChannelHeights(), ProjectWindow::SetMinimized(), TrackPanelResizeHandle::TrackPanelResizeHandle(), and TrackPanel::UpdateTrackVRuler().
|
inline |
Get range of channels with read-only access.
IsLeader()
void ChannelGroup::DestroyGroupData | ( | ) |
auto ChannelGroup::DetachGroupData | ( | ) |
Move attachments out.
Definition at line 101 of file Channel.cpp.
Referenced by TrackList::SwapChannels().
|
protectedpure virtual |
Retrieve a channel.
!(iChannel < NChannels()) || result
Implemented in UniqueChannelTrack< Base >, UniqueChannelTrack< NoteTrackBase >, and WaveTrack.
|
protectedpure virtual |
Retrieve an interval.
!(iInterval < NIntervals()) || result
Implemented in NoteTrack, TimeTrack, WaveTrack, and LabelTrack.
|
inline |
Do not make attachment site on demand if absent.
Definition at line 553 of file Channel.h.
Referenced by Track::DoSetLinkType(), Track::GetLinkType(), and Track::HasLinkedTrack().
|
inline |
|
inline |
Retrieve a channel, cast to the given type.
Postconditions imply that GetChannel(0)
is always non-null
!(iChannel < NChannels()) || result
Definition at line 344 of file Channel.h.
References anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel.
Referenced by LabelTrackView::CopyTo(), WaveChannelView::CopyTo(), ProjectWindow::IsTrackMinimized(), anonymous_namespace{NoteTrackControls.cpp}::MidiControlsDrawFunction(), CommonTrackInfo::MinimizeSyncLockDrawFunction(), TrackPanel::OnTrackMenu(), and TrackPanel::RefreshTrack().
|
inline |
Postconditions imply that GetChannel(0)
is always non-null
!(iChannel < NChannels()) || result
Definition at line 354 of file Channel.h.
References anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel.
double ChannelGroup::GetEndTime | ( | ) | const |
Get the maximum of End() values of intervals, or 0 when none.
Definition at line 135 of file Channel.cpp.
References Intervals().
Referenced by anonymous_namespace{TrackMenus.cpp}::DoAlign(), TrackList::GetEndTime(), WaveTrack::GetEndTime(), StretchHandle::GetT1(), ModifiedAnalysisTrack::ModifiedAnalysisTrack(), SelectActions::Handler::OnCursorTrackEnd(), ProjectAudioManager::OnRecord(), SelectActions::Handler::OnSelectCursorEnd(), SelectActions::Handler::OnSelectTrackStartToEnd(), NoteTrack::Paste(), SelectionState::SelectTrackLength(), Track::SyncLockAdjust(), and LabelTrack::SyncLockAdjust().
auto ChannelGroup::GetGroupData | ( | ) |
Make attachment site on demand as needed.
Definition at line 111 of file Channel.cpp.
Referenced by RealtimeEffectList::Get(), and GetGroupData().
auto ChannelGroup::GetGroupData | ( | ) | const |
Make attachment site on demand as needed May make new group data on demand, but consider that logically const
Definition at line 119 of file Channel.cpp.
References GetGroupData().
|
inline |
Retrieve an interval, cast to the given type.
!(iInterval < NIntervals()) || result
Definition at line 445 of file Channel.h.
Referenced by Channel::GetInterval().
|
inline |
!(iInterval < NIntervals()) || result
Definition at line 455 of file Channel.h.
double ChannelGroup::GetStartTime | ( | ) | const |
Get the minimum of Start() values of intervals, or 0 when none.
Definition at line 124 of file Channel.cpp.
References Intervals().
Referenced by anonymous_namespace{TrackMenus.cpp}::DoAlign(), anonymous_namespace{NoteTrackView.cpp}::DrawNoteBackground(), anonymous_namespace{NoteTrackView.cpp}::DrawNoteTrack(), TrackList::GetStartTime(), WaveTrack::GetStartTime(), StretchHandle::GetT0(), ModifiedAnalysisTrack::ModifiedAnalysisTrack(), SelectActions::Handler::OnCursorTrackStart(), ExportAudioDialog::OnExport(), SelectActions::Handler::OnSelectStartCursor(), SelectActions::Handler::OnSelectTrackStartToEnd(), and SelectionState::SelectTrackLength().
void ChannelGroup::Init | ( | const ChannelGroup & | other | ) |
Copy, including cloning of attached objects.
Definition at line 89 of file Channel.cpp.
References mpGroupData.
Referenced by Track::Init().
|
inline |
Get range of intervals with mutative access.
Definition at line 513 of file Channel.h.
Referenced by GetEndTime(), and GetStartTime().
|
inline |
Get range of intervals with read-only access.
|
pure virtual |
Implemented in SampleTrack, WritableSampleTrack, Track, and WaveTrack.
Referenced by RealtimeEffectState::AddGroup(), RealtimeEffectManager::AddGroup(), AudioIO::AddState(), RealtimeEffectManager::AddState(), RealtimeEffectManager::MakeNewState(), AudioIO::ReplaceState(), RealtimeEffectManager::ReplaceState(), and WideChannelGroupInterval::WideChannelGroupInterval().
|
pure virtual |
Change start time to given time point.
Implemented in LabelTrack, WaveTrack, NoteTrack, and TimeTrack.
|
pure virtual |
Report the number of channels.
result >= 1
Implemented in UniqueChannelTrack< Base >, UniqueChannelTrack< NoteTrackBase >, WaveTrack, and WritableSampleTrack.
Referenced by anonymous_namespace{FileMenus.cpp}::DoExport(), ProjectAudioManager::DoRecord(), ChannelAttachmentsBase::Get(), TrackList::RegisterPendingChangedTrack(), TrackList::ReplaceOne(), Track::SyncLockAdjust(), and Viewport::ZoomFitVertically().
|
pure virtual |
Report the number of intervals.
Implemented in NoteTrack, TimeTrack, WaveTrack, and LabelTrack.
Referenced by Channel::NIntervals().
|
inline |
Change start time by given duration.
Definition at line 317 of file Channel.h.
Referenced by TrackShifter::DoHorizontalOffset(), and StretchHandle::Stretch().
|
private |
Definition at line 605 of file Channel.h.
Referenced by AssignGroupData(), DestroyGroupData(), and Init().