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:138
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)
const char * end(const char *str) noexcept
Definition: StringUtils.h:106
const char * begin(const char *str) noexcept
Definition: StringUtils.h:101