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 }
220 if (nonWaveToo) {
221 const auto range = trackList.Any<const PlayableTrack>() +
222 (selectedOnly ? &Track::IsSelected : &Track::Any);
223 for (auto pTrack : range)
224 if (!track_cast<const SampleTrack *>(pTrack))
225 if (auto pSequence =
226 std::dynamic_pointer_cast<const OtherPlayableSequence>(
227 pTrack->shared_from_this())
228 )
229 result.otherPlayableSequences.push_back(pSequence);
230 }
232 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:288
bool Any() const
Definition: Track.cpp:285
auto Any() -> TrackIterRange< TrackType >
Definition: Track.h:1079
A Track that contains audio waveform data.
Definition: WaveTrack.h:222
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(), ProjectAudioManager::OnRecord(), and ProjectAudioManager::PlayPlayRegion().

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