Upload/Download banks.

This commit is contained in:
Robin Davies
2021-08-22 21:07:04 -04:00
parent 865e23b413
commit 1bb68548ba
11 changed files with 407 additions and 80 deletions
+18
View File
@@ -93,6 +93,16 @@ public:
presets_.erase(presets_.begin()+from);
presets_.insert(presets_.begin()+to,std::move(t));
}
void updateNextIndex() {
int64_t t = 0;
for (size_t i = 0; i < this->presets_.size(); ++i)
{
int64_t instanceId = this->presets_[i]->instanceId();
if (instanceId > t) t = instanceId;
}
this->nextInstanceId_ = t;
}
int64_t addPreset(const PedalBoard&preset, int64_t afterItem = -1)
{
if (hasName(preset.name()))
@@ -221,6 +231,14 @@ public:
DECLARE_JSON_MAP(BankIndex);
bool hasName(const std::string&name) const {
for (size_t i = 0; i < this->entries_.size(); ++i)
{
if (this->entries_[i].name() == name) return true;
}
return false;
}
void move(size_t from, size_t to)
{
if (from >= this->entries_.size()) {