This function is used only in the macro programming user interface
| 167 | |
| 168 | // This function is used only in the macro programming user interface |
| 169 | wxString EffectAndCommandPluginManager::GetEffectParameters(const PluginID& ID) |
| 170 | { |
| 171 | auto pair = EffectManager::Get().GetEffectAndDefaultSettings(ID); |
| 172 | if (auto effect = pair.first) |
| 173 | { |
| 174 | assert(pair.second); // postcondition |
| 175 | wxString parms; |
| 176 | |
| 177 | effect->SaveSettingsAsString(*pair.second, parms); |
| 178 | |
| 179 | // Some effects don't have automatable parameters and will not return |
| 180 | // anything, so try to get the active preset (current or factory). |
| 181 | if (parms.empty()) |
| 182 | { |
| 183 | parms = EffectManager::Get().GetDefaultPreset(ID); |
| 184 | } |
| 185 | |
| 186 | return parms; |
| 187 | } |
| 188 | |
| 189 | AudacityCommand* command = GetAudacityCommand(ID); |
| 190 | |
| 191 | if (command) |
| 192 | { |
| 193 | wxString parms; |
| 194 | |
| 195 | command->SaveSettingsAsString(parms); |
| 196 | |
| 197 | // Some effects don't have automatable parameters and will not return |
| 198 | // anything, so try to get the active preset (current or factory). |
| 199 | if (parms.empty()) |
| 200 | { |
| 201 | parms = EffectManager::Get().GetDefaultPreset(ID); |
| 202 | } |
| 203 | |
| 204 | return parms; |
| 205 | } |
| 206 | return wxEmptyString; |
| 207 | } |
| 208 | |
| 209 | // This function is used only in the macro programming user interface |
| 210 | bool EffectAndCommandPluginManager::SetEffectParameters( |
no test coverage detected