Audacity 3.2.0
ExportUtils.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 ExportUtils.h
6
7 Dominic Mazzoni
8
9 Vitaly Sverchinsky split from ExportPlugin.h
10
11**********************************************************************/
12
13#pragma once
14
15#include "ExportTypes.h"
16#include "ExportPlugin.h"
17
18#include <functional>
19
20class AudacityProject;
21class TrackList;
22class WaveTrack;
23
24template <typename TrackType> struct TrackIterRange;
25
26enum class AudiocomTrace
27{
28 ignore,
34 SaveProjectSaveToCloudMenu, // user chose "Save Project" and then saw the
35 // dialog and chose "Save to Cloud"
36 PrefsPanel, // The Cloud preference panel also has a "Link Account" button
41};
42
43class IMPORT_EXPORT_API ExportUtils final
44{
45public:
46
47 static TrackIterRange<const WaveTrack> FindExportWaveTracks(const TrackList& tracks, bool selectedOnly);
48
49 static bool HasSelectedAudio(const AudacityProject& project);
50
51 static ExportProcessor::Parameters ParametersFromEditor(const ExportOptionsEditor& editor);
52
54 {
55 Handled,
57 Cancel,
58 };
59
60 using ExportHook = std::function<ExportHookResult(
62 AudiocomTrace, bool)>;
63
64 using Priority = unsigned;
65 static constexpr Priority DEFAULT_EXPORT_HOOK_PRIORITY = 0;
66
67 static void RegisterExportHook(ExportHook hook, Priority = DEFAULT_EXPORT_HOOK_PRIORITY);
68 static void PerformInteractiveExport(
70 AudiocomTrace trace, bool selectedOnly);
71};
72
AudiocomTrace
Definition: ExportUtils.h:27
@ LinkAudiocomAccountHelpMenu
@ UpdateCloudAudioPreviewMenu
@ SaveProjectSaveToCloudMenu
@ ShareAudioExportExtraMenu
@ ProjectOpenedAndUploadResumed
wxString FileExtension
File extension, not including any leading dot.
Definition: Identifier.h:224
@ Cancel
Open was cancelled by the extension.
@ Handled
Save was handled by the extension.
@ Continue
Save was not handled by the extension.
const auto tracks
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
Editor objects are used to retrieve a set of export options, and configure exporting parameters accor...
std::vector< std::tuple< ExportOptionID, ExportValue > > Parameters
Definition: ExportPlugin.h:93
unsigned Priority
Definition: ExportUtils.h:64
std::function< ExportHookResult(AudacityProject &, const FileExtension &, AudiocomTrace, bool)> ExportHook
Definition: ExportUtils.h:62
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
Range between two TrackIters, usable in range-for statements, and with Visit member functions.
Definition: Track.h:682