| 5888 | } |
| 5889 | |
| 5890 | ScriptingObjects::ScriptingEffect *ScriptingApi::Synth::getEffect(const String &name) |
| 5891 | { |
| 5892 | WARN_IF_AUDIO_THREAD(true, ScriptGuard::ObjectCreation); |
| 5893 | |
| 5894 | if(getScriptProcessor()->objectsCanBeCreated()) |
| 5895 | { |
| 5896 | Processor::Iterator<EffectProcessor> it(owner); |
| 5897 | |
| 5898 | EffectProcessor *fx; |
| 5899 | |
| 5900 | |
| 5901 | while((fx = it.getNextProcessor()) != nullptr) |
| 5902 | { |
| 5903 | if(fx->getId() == name) |
| 5904 | { |
| 5905 | return new ScriptEffect(getScriptProcessor(), fx); |
| 5906 | } |
| 5907 | } |
| 5908 | |
| 5909 | reportScriptError(name + " was not found. "); |
| 5910 | RETURN_IF_NO_THROW(new ScriptEffect(getScriptProcessor(), nullptr)) |
| 5911 | } |
| 5912 | else |
| 5913 | { |
| 5914 | reportIllegalCall("getEffect()", "onInit"); |
| 5915 | RETURN_IF_NO_THROW(new ScriptEffect(getScriptProcessor(), nullptr)) |
| 5916 | } |
| 5917 | } |
| 5918 | |
| 5919 | |
| 5920 | var ScriptingApi::Synth::getAllEffects(String regex) |
no test coverage detected