Audacity 3.2.0
Classes | Typedefs | Functions | Variables
anonymous_namespace{WaveChannelView.cpp} Namespace Reference

Classes

struct  PlacementArray
 

Typedefs

using PMF = bool(WaveTrackAffordanceControls::*)(AudacityProject &)
 

Functions

template<typename Iter >
Iter SelectedClip (const ViewInfo &viewInfo, Iter begin, Iter end)
 
template<typename Iter , typename Comp >
std::shared_ptr< WaveChannelIntervalNextClipLooped (ViewInfo &viewInfo, Iter begin, Iter end, Comp comp)
 
bool AnyAffordance (AudacityProject &project, WaveChannelView &view, PMF pmf)
 

Variables

static const ChannelGroup::Attachments::RegisteredFactory key { [](auto &) { return std::make_unique<PlacementArray>(); } }
 

Typedef Documentation

◆ PMF

using anonymous_namespace{WaveChannelView.cpp}::PMF = typedef bool (WaveTrackAffordanceControls::*)(AudacityProject &)

Definition at line 1452 of file WaveChannelView.cpp.

Function Documentation

◆ AnyAffordance()

bool anonymous_namespace{WaveChannelView.cpp}::AnyAffordance ( AudacityProject project,
WaveChannelView view,
PMF  pmf 
)

Definition at line 1453 of file WaveChannelView.cpp.

1454{
1455 const auto pWaveChannel = view.FindWaveChannel();
1456 const auto pTrack = &pWaveChannel->GetTrack();
1457 auto& channelView = ChannelView::Get(**pTrack->Channels().begin());
1458 if (const auto affordance =
1459 std::dynamic_pointer_cast<WaveTrackAffordanceControls>(
1460 channelView.GetAffordanceControls()).get()
1461 ; affordance && (affordance->*pmf)(project)
1462 )
1463 return true;
1464 return false;
1465}
const auto project
static ChannelView & Get(Channel &channel)
std::shared_ptr< WaveChannel > FindWaveChannel()

References WaveChannelView::FindWaveChannel(), ChannelView::Get(), and project.

Referenced by WaveChannelView::CopySelectedText(), WaveChannelView::CutSelectedText(), WaveChannelView::PasteText(), and WaveChannelView::SelectAllText().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ NextClipLooped()

template<typename Iter , typename Comp >
std::shared_ptr< WaveChannelInterval > anonymous_namespace{WaveChannelView.cpp}::NextClipLooped ( ViewInfo viewInfo,
Iter  begin,
Iter  end,
Comp  comp 
)

Definition at line 1193 of file WaveChannelView.cpp.

1194 {
1195 auto it = SelectedClip(viewInfo, begin, end);
1196 if (it == end)
1197 it = std::find_if(begin, end, comp);
1198 else
1199 it = std::next(it);
1200
1201 if (it == end)
1202 return *begin;
1203 return *it;
1204 }
Iter SelectedClip(const ViewInfo &viewInfo, Iter begin, Iter end)
const char * end(const char *str) noexcept
Definition: StringUtils.h:106
const char * begin(const char *str) noexcept
Definition: StringUtils.h:101

References details::begin(), details::end(), and SelectedClip().

Referenced by WaveChannelView::SelectNextClip().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SelectedClip()

template<typename Iter >
Iter anonymous_namespace{WaveChannelView.cpp}::SelectedClip ( const ViewInfo viewInfo,
Iter  begin,
Iter  end 
)

Decide whether a clip is selected from its start and end times (only)

Definition at line 1180 of file WaveChannelView.cpp.

1181 {
1183 const auto isClipSelected =
1184 [&viewInfo](const std::shared_ptr<WaveChannelInterval> &pClip) {
1185 return pClip->GetPlayStartTime() == viewInfo.selectedRegion.t0() &&
1186 pClip->GetPlayEndTime() == viewInfo.selectedRegion.t1();
1187 };
1188 return std::find_if(begin, end, isClipSelected);
1189 }
double t1() const
Definition: ViewInfo.h:36
double t0() const
Definition: ViewInfo.h:35
NotifyingSelectedRegion selectedRegion
Definition: ViewInfo.h:215

References details::begin(), details::end(), ViewInfo::selectedRegion, NotifyingSelectedRegion::t0(), and NotifyingSelectedRegion::t1().

Referenced by NextClipLooped().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ key

const ChannelGroup::Attachments::RegisteredFactory anonymous_namespace{WaveChannelView.cpp}::key { [](auto &) { return std::make_unique<PlacementArray>(); } }
static