Audacity 3.2.0
TransportUtilities.cpp File Reference
#include "TransportUtilities.h"
#include <thread>
#include "AudioIO.h"
#include "AudioIOSequences.h"
#include "CommandContext.h"
#include "Project.h"
#include "ProjectAudioIO.h"
#include "ProjectAudioManager.h"
#include "SampleTrack.h"
#include "StretchingSequence.h"
#include "ViewInfo.h"
#include "toolbars/ControlToolBar.h"
#include "ProgressDialog.h"
#include "WaveTrack.h"
Include dependency graph for TransportUtilities.cpp:

Go to the source code of this file.


TransportSequences MakeTransportTracks (TrackList &trackList, bool selectedOnly, bool nonWaveToo)

Function Documentation

◆ MakeTransportTracks()

TransportSequences MakeTransportTracks ( TrackList trackList,
bool  selectedOnly,
bool  nonWaveToo = false 
nonWaveTooif true, collect all PlayableTracks

Definition at line 208 of file TransportUtilities.cpp.

211 TransportSequences result;
212 {
213 const auto range = trackList.Any<WaveTrack>()
214 + (selectedOnly ? &Track::IsSelected : &Track::Any);
215 for (auto pTrack : range)
216 result.playbackSequences.push_back(
217 StretchingSequence::Create(*pTrack, pTrack->GetClipInterfaces()));
218 }
219 if (nonWaveToo) {
220 const auto range = trackList.Any<const PlayableTrack>() +
221 (selectedOnly ? &Track::IsSelected : &Track::Any);
222 for (auto pTrack : range)
223 if (!track_cast<const SampleTrack *>(pTrack))
224 if (auto pSequence =
225 std::dynamic_pointer_cast<const OtherPlayableSequence>(
226 pTrack->shared_from_this())
227 )
228 result.otherPlayableSequences.push_back(pSequence);
229 }
230 return result;
AudioTrack subclass that can also be audibly replayed by the program.
Definition: PlayableTrack.h:40
static std::shared_ptr< StretchingSequence > Create(const PlayableSequence &, const ClipConstHolders &clips)
bool IsSelected() const
Definition: Track.cpp:258
bool Any() const
Definition: Track.cpp:255
auto Any() -> TrackIterRange< TrackType >
Definition: Track.h:950
A Track that contains audio waveform data.
Definition: WaveTrack.h:203
std::vector< std::shared_ptr< const OtherPlayableSequence > > otherPlayableSequences
Definition: AudioIO.h:73
ConstPlayableSequences playbackSequences
Definition: AudioIO.h:70

References TrackList::Any(), Track::Any(), StretchingSequence::Create(), Track::IsSelected(), TransportSequences::otherPlayableSequences, and TransportSequences::playbackSequences.

Referenced by EffectPreview(), anonymous_namespace{TransportMenus.cpp}::OnPunchAndRoll(), ProjectAudioManager::OnRecord(), and ProjectAudioManager::PlayPlayRegion().

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