diff options
author | Robin Gareus <robin@gareus.org> | 2018-12-02 01:37:33 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2018-12-02 01:37:33 +0100 |
commit | ae4604a24b765bf23148305438097f35b5e5fb48 (patch) | |
tree | e260276d6c603e0f4dcf364dd34452c3862b8c31 /libs/ardour/audio_unit.cc | |
parent | 53a0199a06f2256af4f8f9995ee676fa844df102 (diff) |
Implement AU plugin-preset removal
Diffstat (limited to 'libs/ardour/audio_unit.cc')
-rw-r--r-- | libs/ardour/audio_unit.cc | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/libs/ardour/audio_unit.cc b/libs/ardour/audio_unit.cc index e55d0c61c8..812d004e6a 100644 --- a/libs/ardour/audio_unit.cc +++ b/libs/ardour/audio_unit.cc @@ -2220,8 +2220,31 @@ AUPlugin::load_preset (PresetRecord r) } void -AUPlugin::do_remove_preset (std::string) +AUPlugin::do_remove_preset (std::string preset_name) { + vector<Glib::ustring> v; + + std::string m = maker(); + std::string n = name(); + + strip_whitespace_edges (m); + strip_whitespace_edges (n); + + v.push_back (Glib::get_home_dir()); + v.push_back ("Library"); + v.push_back ("Audio"); + v.push_back ("Presets"); + v.push_back (m); + v.push_back (n); + v.push_back (preset_name + preset_suffix); + + Glib::ustring user_preset_path = Glib::build_filename (v); + + DEBUG_TRACE (DEBUG::AudioUnits, string_compose("AU Deleting Preset file %1\n", user_preset_path)); + + if (g_unlink (user_preset_path.c_str())) { + error << string_compose (X_("Could not delete preset at \"%1\": %2"), user_preset_path, strerror (errno)) << endmsg; + } } string |