Audacity 3.2.0
ExportPlugin.cpp
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 ExportPlugin.cpp
6
7 Dominic Mazzoni
8
9**********************************************************************/
10
11#include "ExportPlugin.h"
12#include "wxFileNameWrapper.h"
13
15 : mMessage(msg)
16{
17}
18
19const wxString& ExportException::What() const noexcept
20{
21 return mMessage;
22}
23
25 : mFileName(filename)
26{
27}
28
29
31{
32 return mFileName;
33}
34
35
36// Untranslated ErrorCodes like "MP3:1882" are used since we don't yet have
37// a good user facing error message. They allow us to
38// distinguish where the error occurred, and we can update the landing
39// page as we learn more about when (if ever) these errors actually happen.
40// The number happens to at one time have been a line number, but all
41// we need from them is that they be distinct.
43 : mMessage(XO("Unable to export.\nError %s").Format(code))
44 , mHelpPageId("Error:_Unable_to_export")
45{
46
47}
48
50 : mMessage(std::move(message))
51 , mHelpPageId(helpPage)
52{
53}
54
55const wxString& ExportErrorException::GetHelpPageId() const noexcept
56{
57 return mHelpPageId;
58}
59
61{
62 return mMessage;
63}
64
66
68
71
72std::vector<std::string> ExportPlugin::GetMimeTypes(int formatIndex) const
73{
74 return {};
75}
76
77bool ExportPlugin::ParseConfig(int, const rapidjson::Value&, ExportProcessor::Parameters&) const
78{
79 return false;
80}
81
82bool ExportPlugin::CheckFileName(wxFileName&, int) const
83{
84 return true;
85}
XO("Cut/Copy/Paste")
wxFileNameWrapper mFileName
Definition: ExportPlugin.h:72
const wxFileNameWrapper & GetFileName() const noexcept
ExportDiskFullError(const wxFileNameWrapper &fileName)
const TranslatableString & GetMessage() const noexcept
const wxString & GetHelpPageId() const noexcept
TranslatableString mMessage
Definition: ExportPlugin.h:55
ExportErrorException(const wxString &errorCode)
ExportException(const wxString &msg)
const wxString mMessage
Definition: ExportPlugin.h:45
const wxString & What() const noexcept
virtual std::vector< std::string > GetMimeTypes(int formatIndex) const
virtual ~ExportPlugin()
virtual bool CheckFileName(wxFileName &filename, int format=0) const
virtual bool ParseConfig(int formatIndex, const rapidjson::Value &config, ExportProcessor::Parameters &parameters) const
Attempt to parse configuration JSON object and produce a suitable set of parameters....
virtual ~ExportProcessorDelegate()
virtual ~ExportProcessor()
std::vector< std::tuple< ExportOptionID, ExportValue > > Parameters
Definition: ExportPlugin.h:93
Abstract base class used in importing a file.
Holds a msgid for the translation catalog; may also bind format arguments.
STL namespace.