This function is used only in the macro programming user interface
| 135 | |
| 136 | // This function is used only in the macro programming user interface |
| 137 | wxString EffectManager::GetPreset( |
| 138 | const PluginID& ID, const wxString& params, EffectPresetDialog dialog) |
| 139 | { |
| 140 | auto effect = GetEffect(ID); |
| 141 | |
| 142 | if (!effect) |
| 143 | { |
| 144 | return wxEmptyString; |
| 145 | } |
| 146 | |
| 147 | CommandParameters eap(params); |
| 148 | |
| 149 | wxString preset; |
| 150 | if (eap.HasEntry(wxT("Use Preset"))) |
| 151 | { |
| 152 | preset = eap.Read(wxT("Use Preset")); |
| 153 | } |
| 154 | |
| 155 | if (const auto answer = dialog(*effect, preset)) |
| 156 | preset = *answer; |
| 157 | else |
| 158 | preset = wxEmptyString; |
| 159 | |
| 160 | if (preset.empty()) |
| 161 | { |
| 162 | return preset; |
| 163 | } |
| 164 | |
| 165 | // This cleans a config "file" backed by a string in memory. |
| 166 | eap.DeleteAll(); |
| 167 | |
| 168 | eap.Write(wxT("Use Preset"), preset); |
| 169 | eap.GetParameters(preset); |
| 170 | |
| 171 | return preset; |
| 172 | } |
| 173 | |
| 174 | // This function is used only in the macro programming user interface |
| 175 | wxString EffectManager::GetDefaultPreset(const PluginID & ID) |
no test coverage detected