| 747 | } |
| 748 | |
| 749 | void PatchCableSource::LoadState(FileStreamIn& in) |
| 750 | { |
| 751 | bool doDummyLoad = false; |
| 752 | if (sIsLoadingModulePreset) |
| 753 | doDummyLoad = true; |
| 754 | |
| 755 | if (!doDummyLoad) |
| 756 | ClearPatchCables(); |
| 757 | |
| 758 | int size; |
| 759 | in >> size; |
| 760 | |
| 761 | for (int i = 0; i < size; ++i) |
| 762 | { |
| 763 | std::string path; |
| 764 | in >> path; |
| 765 | |
| 766 | if (!doDummyLoad) |
| 767 | { |
| 768 | IClickable* target = TheSynth->FindModule(path, false); |
| 769 | if (target == nullptr) |
| 770 | { |
| 771 | try |
| 772 | { |
| 773 | target = TheSynth->FindUIControl(path); |
| 774 | } |
| 775 | catch (UnknownUIControlException& e) |
| 776 | { |
| 777 | } |
| 778 | } |
| 779 | |
| 780 | if (TheSynth->IsDuplicatingModule() && mType == kConnectionType_Modulator) |
| 781 | target = nullptr; //TODO(Ryan) make it so that when you're duplicating a group, modulators preserve connections to the new copies of controls within that group |
| 782 | |
| 783 | mPatchCables.push_back(new PatchCable(this)); |
| 784 | assert(i == (int)mPatchCables.size() - 1); |
| 785 | SetPatchCableTarget(mPatchCables[i], target, false); |
| 786 | } |
| 787 | } |
| 788 | |
| 789 | if (!doDummyLoad) |
| 790 | mOwner->PostRepatch(this, false); |
| 791 | } |
| 792 | |
| 793 | void NoteHistory::AddEvent(double time, bool on, int data) |
| 794 | { |
nothing calls this directly
no test coverage detected