Audacity 3.2.0
Functions
anonymous_namespace{PendingTracks.cpp} Namespace Reference

Functions

auto finder (TrackId id, int &distance)
 

Function Documentation

◆ finder()

auto anonymous_namespace{PendingTracks.cpp}::finder ( TrackId  id,
int &  distance 
)

Definition at line 60 of file PendingTracks.cpp.

60 {
61 // Predicate returns true if any channel of the track's channel group has
62 // the given id and as a side-effect reports the position of the channel in
63 // the group
64 return [id, &distance](const auto &pTrack) {
65 const auto channels = TrackList::Channels(&*pTrack);
66 const auto begin = channels.begin();
67 const auto end = channels.end();
68 const auto pred = [id](const auto &ptr) { return ptr->GetId() == id; };
69 auto iter = std::find_if(begin, end, pred);
70 if (iter == end) {
71 distance = -1;
72 return false;
73 }
74 else {
75 distance = std::distance(begin, iter);
76 return true;
77 }
78 };
79}
int id
static auto Channels(TrackType *pTrack) -> TrackIterRange< TrackType >
Definition: Track.h:1164
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(), TrackList::Channels(), details::end(), and id.

Referenced by CommandManager::Populator::AddGlobalCommand(), CommandManager::Populator::AddItem(), CommandManager::Populator::AddItemList(), MenuRegistry::CommandGroupItem::CommandGroupItem(), Effect::Delegate(), EffectUI::DoEffect(), EffectBase::DoEffect(), CommandManager::DoRepeatProcess(), CommandManager::ExecuteCommand(), MenuRegistry::FinderScope::FinderScope(), CommandManager::Populator::NewIdentifier(), and TrackPanel::TrackPanel().

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