Audacity 3.2.0
ExportUtils.cpp
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 ExportUtils.cpp
6
7 Dominic Mazzoni
8
9 Vitaly Sverchinsky split from ExportPlugin.h
10
11**********************************************************************/
12
13#include "ExportUtils.h"
14#include "Track.h"
15#include "WaveTrack.h"
16
17//TODO: used in many places in anticipation that Exporter yields same result, fix that
19{
20 bool anySolo =
21 !(tracks.Any<const WaveTrack>() + &WaveTrack::GetSolo).empty();
22
23 return tracks.Any<const WaveTrack>()
24 + (selectedOnly ? &Track::IsSelected : &Track::Any)
26}
27
29{
31 for(int i = 0, count = editor.GetOptionsCount(); i < count; ++i)
32 {
33 ExportOption option;
34 ExportValue value;
35 if(editor.GetOption(i, option) && editor.GetValue(option.id, value))
36 parameters.emplace_back(option.id, value);
37 }
38 return parameters;
39}
40
std::variant< bool, int, double, std::string > ExportValue
A type of option values (parameters) used by exporting plugins.
Definition: ExportTypes.h:38
const auto tracks
declares abstract base class Track, TrackList, and iterators over TrackList
Editor objects are used to retrieve a set of export options, and configure exporting parameters accor...
virtual bool GetValue(ExportOptionID id, ExportValue &value) const =0
virtual bool GetOption(int index, ExportOption &option) const =0
virtual int GetOptionsCount() const =0
std::vector< std::tuple< ExportOptionID, ExportValue > > Parameters
Definition: ExportPlugin.h:93
static TrackIterRange< const WaveTrack > FindExportWaveTracks(const TrackList &tracks, bool selectedOnly)
Definition: ExportUtils.cpp:18
static ExportProcessor::Parameters ParametersFromEditor(const ExportOptionsEditor &editor)
Definition: ExportUtils.cpp:28
bool GetNotSolo() const
Definition: PlayableTrack.h:50
bool IsSelected() const
Definition: Track.cpp:288
bool Any() const
Definition: Track.cpp:285
A flat linked list of tracks supporting Add, Remove, Clear, and Contains, serialization of the list o...
Definition: Track.h:993
A Track that contains audio waveform data.
Definition: WaveTrack.h:227
bool GetMute() const override
May vary asynchronously.
Definition: WaveTrack.cpp:2830
bool GetSolo() const override
May vary asynchronously.
Definition: WaveTrack.cpp:2835
A type that provides a description of an exporting option. Isn't allowed to change except non-type re...
Definition: ExportTypes.h:43
ExportOptionID id
Internal option id.
Definition: ExportTypes.h:56
Range between two TrackIters, usable in range-for statements, and with Visit member functions.
Definition: Track.h:825