| 1914 | } |
| 1915 | |
| 1916 | void ModularSynth::OnModuleDeleted(IDrawableModule* module) |
| 1917 | { |
| 1918 | if (!module->CanBeDeleted() || module->IsDeleted()) |
| 1919 | return; |
| 1920 | |
| 1921 | mDeletedModules.push_back(module); |
| 1922 | |
| 1923 | mAudioThreadMutex.Lock("delete"); |
| 1924 | |
| 1925 | std::list<PatchCable*> cablesToRemove; |
| 1926 | for (auto* cable : mPatchCables) |
| 1927 | { |
| 1928 | if (cable->GetOwningModule() == module) |
| 1929 | cablesToRemove.push_back(cable); |
| 1930 | } |
| 1931 | for (auto* cable : cablesToRemove) |
| 1932 | RemoveFromVector(cable, mPatchCables); |
| 1933 | |
| 1934 | RemoveFromVector(dynamic_cast<IAudioSource*>(module), mSources); |
| 1935 | RemoveFromVector(module, mLissajousDrawers); |
| 1936 | TheTransport->RemoveAudioPoller(dynamic_cast<IAudioPoller*>(module)); |
| 1937 | //delete module; TODO(Ryan) deleting is hard... need to clear out everything with a reference to this, or switch to smart pointers |
| 1938 | |
| 1939 | if (module == TheChaosEngine) |
| 1940 | TheChaosEngine = nullptr; |
| 1941 | if (module == TheLFOController) |
| 1942 | TheLFOController = nullptr; |
| 1943 | |
| 1944 | mAudioThreadMutex.Unlock(); |
| 1945 | } |
| 1946 | |
| 1947 | void ModularSynth::MouseReleased(int intX, int intY, int button, const juce::MouseInputSource& source) |
| 1948 | { |
no test coverage detected