| 492 | } |
| 493 | |
| 494 | bool PresetController::createUserBank(const std::string &name) |
| 495 | { |
| 496 | auto path = filesystem::get().user_banks + "/" + name + ".bank"; |
| 497 | if (std::ifstream(path, std::ios::in).is_open()) |
| 498 | return false; |
| 499 | auto file = std::ofstream(path, std::ios::out); |
| 500 | if (!file.is_open()) |
| 501 | return false; |
| 502 | file << "amSynth\nEOF\n"; |
| 503 | file.close(); |
| 504 | return true; |
| 505 | } |