| 222 | } |
| 223 | |
| 224 | void Prefab::ButtonClicked(ClickButton* button, double time) |
| 225 | { |
| 226 | using namespace juce; |
| 227 | if (button == mSaveButton) |
| 228 | { |
| 229 | FileChooser chooser("Save prefab as...", File(ofToDataPath("prefabs/prefab.pfb")), "*.pfb", true, false, TheSynth->GetFileChooserParent()); |
| 230 | if (chooser.browseForFileToSave(true)) |
| 231 | { |
| 232 | std::string savePath = chooser.getResult().getFullPathName().toStdString(); |
| 233 | SavePrefab(savePath); |
| 234 | } |
| 235 | } |
| 236 | |
| 237 | if (button == mLoadButton) |
| 238 | { |
| 239 | FileChooser chooser("Load prefab...", File(ofToDataPath("prefabs")), "*.pfb", true, false, TheSynth->GetFileChooserParent()); |
| 240 | if (chooser.browseForFileToOpen()) |
| 241 | { |
| 242 | std::string loadPath = chooser.getResult().getFullPathName().toStdString(); |
| 243 | LoadPrefab(ofToDataPath(loadPath)); |
| 244 | } |
| 245 | } |
| 246 | |
| 247 | if (button == mDisbandButton) |
| 248 | { |
| 249 | auto modules = mModuleContainer.GetModules(); |
| 250 | for (auto* module : modules) |
| 251 | GetOwningContainer()->TakeModule(module); |
| 252 | GetOwningContainer()->DeleteModule(this); |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | void Prefab::CheckboxUpdated(Checkbox* checkbox, double time) |
| 257 | { |
nothing calls this directly
no test coverage detected