Include bypass state in snapshots.

This commit is contained in:
Robin Davies
2024-10-06 18:04:08 -04:00
parent c9d7e18116
commit 24beb0edd9
3 changed files with 10 additions and 0 deletions
+4
View File
@@ -228,6 +228,7 @@ void PedalboardItem::ApplySnapshotValue(SnapshotValue*snapshotValue)
this->lv2State(snapshotValue->lv2State_);
this->stateUpdateCount(this->stateUpdateCount()+1);
}
this->isEnabled(snapshotValue->isEnabled_);
}
@@ -294,6 +295,7 @@ void PedalboardItem::AddToSnapshotFromCurrentSettings(Snapshot&snapshot) const
{
SnapshotValue snapshotValue;
snapshotValue.instanceId_ = this->instanceId_;
snapshotValue.isEnabled_ = this->isEnabled_;
for (const ControlValue &value: this->controlValues_)
{
@@ -410,6 +412,7 @@ JSON_MAP_END()
JSON_MAP_BEGIN(SnapshotValue)
JSON_MAP_REFERENCE(SnapshotValue,instanceId)
JSON_MAP_REFERENCE(SnapshotValue,isEnabled)
JSON_MAP_REFERENCE(SnapshotValue,controlValues)
JSON_MAP_REFERENCE(SnapshotValue,lv2State)
JSON_MAP_REFERENCE(SnapshotValue,pathProperties)
@@ -417,6 +420,7 @@ JSON_MAP_END()
JSON_MAP_BEGIN(Snapshot)
JSON_MAP_REFERENCE(Snapshot,name)
JSON_MAP_REFERENCE(Snapshot,isModified)
JSON_MAP_REFERENCE(Snapshot,color)
JSON_MAP_REFERENCE(Snapshot,values)
JSON_MAP_END()
+2
View File
@@ -154,6 +154,7 @@ public:
class SnapshotValue {
public:
uint64_t instanceId_;
bool isEnabled_ = true;
std::vector<ControlValue> controlValues_;
Lv2PluginState lv2State_;
std::map<std::string,std::string> pathProperties_;
@@ -165,6 +166,7 @@ class Snapshot {
public:
std::string name_;
std::string color_;
bool isModified_ = true;
std::vector<SnapshotValue> values_;
DECLARE_JSON_MAP(Snapshot);