19#include <wx/filedlg.h>
24 wxWindow &parent, wxDialog &dialog,
EffectEditor *,
bool forceModal)
const
28 dialog.SetMinSize(dialog.GetSize());
34 return dialog.ShowModal();
51 {
XO(
"Presets"), {
wxT(
"txt") },
true },
65 auto path =
SelectFile(FileNames::Operation::Presets,
66 XO(
"Export Effect Parameters"),
71 wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER,
78 wxFFile f(path,
wxT(
"wb"));
82 XO(
"Could not open file: \"%s\"").
Format( path ),
83 XO(
"Error Saving Effect Presets"),
93 XO(
"Error writing to file: \"%s\"").
Format( path ),
94 XO(
"Error Saving Effect Presets"),
111 auto path =
SelectFile(FileNames::Operation::Presets,
112 XO(
"Import Effect Parameters"),
117 wxFD_OPEN | wxRESIZE_BORDER,
135 if (
ident != commandId) {
138 if ((
params.Length() < 2 ) || (
ident.Length() < 2) ||
139 (
ident.Length() > 30))
143 XO(
"%s: is not a valid presets file.\n")
144 .
Format(wxFileNameFromPath(path)));
150 XO(
"%s: is for a different Effect, Generator or Analyzer.\n")
151 .
Format(wxFileNameFromPath(path)));
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption, long style, wxWindow *parent, int x, int y)
static const FileNames::FileTypes & PresetTypes()
EffectDistortionSettings params
std::optional< std::unique_ptr< EffectSettingsAccess::Message > > OptionalMessage
static CommandHandlerObject & ident(AudacityProject &project)
FilePath SelectFile(FileNames::Operation op, const TranslatableString &message, const FilePath &default_path, const FilePath &default_filename, const FileExtension &default_extension, const FileTypes &fileTypes, int flags, wxWindow *parent)
static Settings & settings()
bool ValidateUI(const EffectPlugin &context, EffectSettings &) const override
void ExportPresets(const EffectPlugin &plugin, const EffectSettings &settings) const override
int ShowClientInterface(const EffectPlugin &plugin, wxWindow &parent, wxDialog &dialog, EffectEditor *pEditor, bool forceModal) const override
bool CloseUI() const override
void ShowOptions(const EffectPlugin &plugin) const override
OptionalMessage ImportPresets(const EffectPlugin &plugin, EffectSettings &settings) const override
virtual ComponentInterfaceSymbol GetSymbol() const =0
const wxString & Internal() const
bool SupportsRealtime() const
static Identifier GetSquashedName(const Identifier &ident)
A utility that strips spaces and CamelCases a name.
Factory of instances of an effect.
virtual bool SaveSettingsAsString(const EffectSettings &settings, wxString &parms) const =0
virtual OptionalMessage LoadSettingsFromString(const wxString &parms, EffectSettings &settings) const =0
static int DoMessageBox(const EffectPlugin &plugin, const TranslatableString &message, long style=DefaultMessageBoxStyle, const TranslatableString &titleStr={})
std::vector< FileType > FileTypes
FILES_API const FileType AllFiles
Externalized state of a plug-in.