| 5778 | |
| 5779 | |
| 5780 | ScriptingObjects::ScriptingMidiProcessor *ScriptingApi::Synth::getMidiProcessor(const String &name) |
| 5781 | { |
| 5782 | if(name == getProcessor()->getId()) |
| 5783 | { |
| 5784 | reportScriptError("You can't get a reference to yourself!"); |
| 5785 | } |
| 5786 | |
| 5787 | if(getScriptProcessor()->objectsCanBeCreated()) |
| 5788 | { |
| 5789 | Processor::Iterator<MidiProcessor> it(owner); |
| 5790 | |
| 5791 | MidiProcessor *mp; |
| 5792 | |
| 5793 | while((mp = it.getNextProcessor()) != nullptr) |
| 5794 | { |
| 5795 | if(mp->getId() == name) |
| 5796 | { |
| 5797 | return new ScriptingObjects::ScriptingMidiProcessor(getScriptProcessor(), mp); |
| 5798 | } |
| 5799 | } |
| 5800 | |
| 5801 | reportScriptError(name + " was not found. "); |
| 5802 | |
| 5803 | RETURN_IF_NO_THROW(new ScriptMidiProcessor(getScriptProcessor(), nullptr)) |
| 5804 | } |
| 5805 | else |
| 5806 | { |
| 5807 | reportIllegalCall("getMidiProcessor()", "onInit"); |
| 5808 | |
| 5809 | RETURN_IF_NO_THROW(new ScriptMidiProcessor(getScriptProcessor(), nullptr)) |
| 5810 | |
| 5811 | } |
| 5812 | } |
| 5813 | |
| 5814 | |
| 5815 | ScriptingObjects::ScriptingSynth *ScriptingApi::Synth::getChildSynth(const String &name) |
nothing calls this directly
no test coverage detected