Browse Source

Make Patch::reset load the system template

tags/v1.0.0
Andrew Belt 5 years ago
parent
commit
df222e691b
1 changed files with 10 additions and 11 deletions
  1. +10
    -11
      src/patch.cpp

+ 10
- 11
src/patch.cpp View File

@@ -47,24 +47,22 @@ void PatchManager::init(std::string path) {
return;
}

this->path = "";
if (load(asset::user("template.vcv"))) {
return;
}

if (load(asset::system("template.vcv"))) {
return;
}
reset();
}

void PatchManager::reset() {
APP->history->clear();
APP->scene->rack->clear();
APP->scene->rackScroll->reset();
// Fails silently if file does not exist
load(asset::user("template.vcv"));
legacy = 0;

path = "";
if (load(asset::user("template.vcv"))) {
return;
}

if (load(asset::system("template.vcv"))) {
return;
}
}

void PatchManager::resetDialog() {
@@ -170,6 +168,7 @@ bool PatchManager::load(std::string path) {
APP->history->clear();
APP->scene->rack->clear();
APP->scene->rackScroll->reset();
legacy = 0;
fromJson(rootJ);
return true;
}


Loading…
Cancel
Save