| 55 | }; |
| 56 | |
| 57 | void BasicEffectUIServices::ExportPresets( |
| 58 | const EffectPlugin &plugin, const EffectSettings &settings) const |
| 59 | { |
| 60 | wxString params; |
| 61 | plugin.SaveSettingsAsString(settings, params); |
| 62 | auto commandId = plugin.GetSquashedName(plugin.GetSymbol().Internal()); |
| 63 | params = commandId.GET() + ":" + params; |
| 64 | |
| 65 | auto path = SelectFile(FileNames::Operation::Presets, |
| 66 | XO("Export Effect Parameters"), |
| 67 | wxEmptyString, |
| 68 | wxEmptyString, |
| 69 | wxEmptyString, |
| 70 | PresetTypes(), |
| 71 | wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER, |
| 72 | nullptr); |
| 73 | if (path.empty()) { |
| 74 | return; |
| 75 | } |
| 76 | |
| 77 | // Create/Open the file |
| 78 | wxFFile f(path, wxT("wb")); |
| 79 | if (!f.IsOpened()) |
| 80 | { |
| 81 | AudacityMessageBox( |
| 82 | XO("Could not open file: \"%s\"").Format( path ), |
| 83 | XO("Error Saving Effect Presets"), |
| 84 | wxICON_EXCLAMATION, |
| 85 | NULL); |
| 86 | return; |
| 87 | } |
| 88 | |
| 89 | f.Write(params); |
| 90 | if (f.Error()) |
| 91 | { |
| 92 | AudacityMessageBox( |
| 93 | XO("Error writing to file: \"%s\"").Format( path ), |
| 94 | XO("Error Saving Effect Presets"), |
| 95 | wxICON_EXCLAMATION, |
| 96 | NULL); |
| 97 | } |
| 98 | |
| 99 | f.Close(); |
| 100 | |
| 101 | |
| 102 | //SetWindowTitle(); |
| 103 | |
| 104 | } |
| 105 | |
| 106 | OptionalMessage BasicEffectUIServices::ImportPresets( |
| 107 | const EffectPlugin &plugin, EffectSettings &settings) const |
nothing calls this directly
no test coverage detected