Audacity 3.2.0
TestWaveTrackMaker.cpp
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*!********************************************************************
3
4 Audacity: A Digital Audio Editor
5
6 TestWaveTrackMaker.cpp
7
8 Matthieu Hodgkinson
9
10**********************************************************************/
11#include "TestWaveTrackMaker.h"
12#include "MockedAudio.h"
13#include "MockedPrefs.h"
14#include "Project.h"
15
16MockedPrefs prefs;
17MockedAudio audio;
19const auto tracks = TrackList::Create(project.get());
20
23 : mSampleRate { sampleRate }
24 , mFactory { factory }
25{
26}
27
28std::shared_ptr<WaveTrack>
30{
31 const auto track = WaveTrack::Create(
33 tracks->Add(track);
34 for (const auto& clip : clips)
35 track->InsertInterval(clip, true);
36 return track;
37}
38
39std::shared_ptr<WaveTrack>
41{
42 return Track(WaveClipHolders { clip });
43}
static RegisteredToolbarFactory factory
std::shared_ptr< SampleBlockFactory > SampleBlockFactoryPtr
Definition: SampleBlock.h:31
const auto tracks
MockedAudio audio
const auto project
MockedPrefs prefs
std::shared_ptr< WaveClip > WaveClipHolder
Definition: WaveClip.h:43
std::vector< WaveClipHolder > WaveClipHolders
Definition: WaveClip.h:45
static std::shared_ptr< AudacityProject > Create()
Use this factory function.
Definition: Project.cpp:78
TestWaveTrackMaker(int sampleRate, SampleBlockFactoryPtr)
std::shared_ptr< WaveTrack > Track(const WaveClipHolders &clips) const
const SampleBlockFactoryPtr mFactory
static TrackListHolder Create(AudacityProject *pOwner)
Definition: Track.cpp:330
static Holder Create(const SampleBlockFactoryPtr &pFactory, sampleFormat format, double rate)
Factory builds all AttachedTrackObjects.
Definition: WaveTrack.cpp:503