Audacity 3.2.0
WaveTrackUtils.h
Go to the documentation of this file.
1/*!********************************************************************
2*
3 Audacity: A Digital Audio Editor
4
5 @file WaveTrackUtils.h
6
7 Vitaly Sverchinsky
8
9 @brief Contains some useful wave track external routines grouped into a single namespace
10
11 **********************************************************************/
12
13#pragma once
14
15#include <algorithm>
16
17class ViewInfo;
18class WaveClip;
19
21{
23 bool IsClipSelected(const ViewInfo& viewInfo, const WaveClip& waveClip);
24
25 template<typename Iter>
26 Iter SelectedClip(const ViewInfo& viewInfo, Iter begin, Iter end)
27 {
28 return std::find_if(begin, end,
29 [&](auto& pClip) { return IsClipSelected(viewInfo, *pClip); });
30 }
31
32};
This allows multiple clips to be a part of one WaveTrack.
Definition: WaveClip.h:113
auto end(const Ptr< Type, BaseDeleter > &p)
Enables range-for.
Definition: PackedArray.h:159
auto begin(const Ptr< Type, BaseDeleter > &p)
Enables range-for.
Definition: PackedArray.h:150
bool IsClipSelected(const ViewInfo &viewInfo, const WaveClip &waveClip)
Decide whether a clip is selected from its start and end times (only)
Iter SelectedClip(const ViewInfo &viewInfo, Iter begin, Iter end)