Audacity 3.2.0
ExportPluginHelpers.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 ExportPluginHelpers.h
6
7 Dominic Mazzoni
8
9 Vitaly Sverchinsky split from ExportPlugin.h
10
11**********************************************************************/
12
13#pragma once
14
15#include <memory>
16
17#include "ExportPlugin.h"
18#include "ExportTypes.h"
19#include "SampleFormat.h"
20
21class TrackList;
22class WaveTrack;
23class Mixer;
24
25namespace MixerOptions
26{
27class Downmix;
28}
29
31class IMPORT_EXPORT_API ExportPluginHelpers final
32{
33public:
34 static std::unique_ptr<Mixer> CreateMixer(
35 const AudacityProject& project, bool selectionOnly, double startTime,
36 double stopTime, unsigned numOutChannels, size_t outBufferSize,
37 bool outInterleaved, double outRate, sampleFormat outFormat,
38 MixerOptions::Downmix* mixerSpec);
39
42 static ExportResult UpdateProgress(ExportProcessorDelegate& delegate, Mixer& mixer, double t0, double t1);
43
44 template<typename T>
45 static T GetParameterValue(const ExportProcessor::Parameters& parameters, int id, T defaultValue = T())
46 {
47 auto it = std::find_if(
48 parameters.begin(),
49 parameters.end(),
50 [=](const auto& t) { return std::get<0>(t) == id; });
51 if(it != parameters.end())
52 {
53 if(auto value = std::get_if<T>(&std::get<1>(*it)))
54 return *value;
55 }
56 return defaultValue;
57 }
58};
ExportResult
Definition: ExportTypes.h:24
sampleFormat
The ordering of these values with operator < agrees with the order of increasing bit width.
Definition: SampleFormat.h:30
const auto project
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
Utility class that provides helper functions for ExportPlugin.
static T GetParameterValue(const ExportProcessor::Parameters &parameters, int id, T defaultValue=T())
std::vector< std::tuple< ExportOptionID, ExportValue > > Parameters
Definition: ExportPlugin.h:93
Functions for doing the mixdown of the tracks.
Definition: Mix.h:31
A matrix of booleans, one row per input channel, column per output.
Definition: MixerOptions.h:32
A flat linked list of tracks supporting Add, Remove, Clear, and Contains, serialization of the list o...
Definition: Track.h:850
A Track that contains audio waveform data.
Definition: WaveTrack.h:203