Include bypass state in snapshots.
This commit is contained in:
@@ -226,12 +226,14 @@ export class SnapshotValue {
|
|||||||
{
|
{
|
||||||
let result = new SnapshotValue();
|
let result = new SnapshotValue();
|
||||||
result.instanceId = item.instanceId;
|
result.instanceId = item.instanceId;
|
||||||
|
result.isEnabled = item.isEnabled;
|
||||||
result.controlValues = ControlValue.deserializeArray(item.controlValues);
|
result.controlValues = ControlValue.deserializeArray(item.controlValues);
|
||||||
result.lv2State = item.lv2State; // we can do this, because lv2State is immutable.
|
result.lv2State = item.lv2State; // we can do this, because lv2State is immutable.
|
||||||
result.pathProperties = {...item.pathProperties}; // clone the dictionary.
|
result.pathProperties = {...item.pathProperties}; // clone the dictionary.
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
instanceId: number = -1;
|
instanceId: number = -1;
|
||||||
|
isEnabled: boolean = true;
|
||||||
controlValues: ControlValue[] = ControlValue.EmptyArray;
|
controlValues: ControlValue[] = ControlValue.EmptyArray;
|
||||||
lv2State: [boolean,any] = [false,{}];
|
lv2State: [boolean,any] = [false,{}];
|
||||||
pathProperties: {[Name: string]: string} = {};
|
pathProperties: {[Name: string]: string} = {};
|
||||||
@@ -239,6 +241,7 @@ export class SnapshotValue {
|
|||||||
export class Snapshot {
|
export class Snapshot {
|
||||||
deserialize(input: any): Snapshot {
|
deserialize(input: any): Snapshot {
|
||||||
this.values = SnapshotValue.deserializeArray(input.values);
|
this.values = SnapshotValue.deserializeArray(input.values);
|
||||||
|
this.isModified = input.isModified;
|
||||||
this.name = input.name;
|
this.name = input.name;
|
||||||
this.color = input.color;
|
this.color = input.color;
|
||||||
return this;
|
return this;
|
||||||
@@ -273,6 +276,7 @@ export class Snapshot {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
name: string = "";
|
name: string = "";
|
||||||
|
isModified: boolean = false;
|
||||||
color: string = "";
|
color: string = "";
|
||||||
values: SnapshotValue[] = [];
|
values: SnapshotValue[] = [];
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -228,6 +228,7 @@ void PedalboardItem::ApplySnapshotValue(SnapshotValue*snapshotValue)
|
|||||||
this->lv2State(snapshotValue->lv2State_);
|
this->lv2State(snapshotValue->lv2State_);
|
||||||
this->stateUpdateCount(this->stateUpdateCount()+1);
|
this->stateUpdateCount(this->stateUpdateCount()+1);
|
||||||
}
|
}
|
||||||
|
this->isEnabled(snapshotValue->isEnabled_);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -294,6 +295,7 @@ void PedalboardItem::AddToSnapshotFromCurrentSettings(Snapshot&snapshot) const
|
|||||||
{
|
{
|
||||||
SnapshotValue snapshotValue;
|
SnapshotValue snapshotValue;
|
||||||
snapshotValue.instanceId_ = this->instanceId_;
|
snapshotValue.instanceId_ = this->instanceId_;
|
||||||
|
snapshotValue.isEnabled_ = this->isEnabled_;
|
||||||
|
|
||||||
for (const ControlValue &value: this->controlValues_)
|
for (const ControlValue &value: this->controlValues_)
|
||||||
{
|
{
|
||||||
@@ -410,6 +412,7 @@ JSON_MAP_END()
|
|||||||
|
|
||||||
JSON_MAP_BEGIN(SnapshotValue)
|
JSON_MAP_BEGIN(SnapshotValue)
|
||||||
JSON_MAP_REFERENCE(SnapshotValue,instanceId)
|
JSON_MAP_REFERENCE(SnapshotValue,instanceId)
|
||||||
|
JSON_MAP_REFERENCE(SnapshotValue,isEnabled)
|
||||||
JSON_MAP_REFERENCE(SnapshotValue,controlValues)
|
JSON_MAP_REFERENCE(SnapshotValue,controlValues)
|
||||||
JSON_MAP_REFERENCE(SnapshotValue,lv2State)
|
JSON_MAP_REFERENCE(SnapshotValue,lv2State)
|
||||||
JSON_MAP_REFERENCE(SnapshotValue,pathProperties)
|
JSON_MAP_REFERENCE(SnapshotValue,pathProperties)
|
||||||
@@ -417,6 +420,7 @@ JSON_MAP_END()
|
|||||||
|
|
||||||
JSON_MAP_BEGIN(Snapshot)
|
JSON_MAP_BEGIN(Snapshot)
|
||||||
JSON_MAP_REFERENCE(Snapshot,name)
|
JSON_MAP_REFERENCE(Snapshot,name)
|
||||||
|
JSON_MAP_REFERENCE(Snapshot,isModified)
|
||||||
JSON_MAP_REFERENCE(Snapshot,color)
|
JSON_MAP_REFERENCE(Snapshot,color)
|
||||||
JSON_MAP_REFERENCE(Snapshot,values)
|
JSON_MAP_REFERENCE(Snapshot,values)
|
||||||
JSON_MAP_END()
|
JSON_MAP_END()
|
||||||
|
|||||||
@@ -154,6 +154,7 @@ public:
|
|||||||
class SnapshotValue {
|
class SnapshotValue {
|
||||||
public:
|
public:
|
||||||
uint64_t instanceId_;
|
uint64_t instanceId_;
|
||||||
|
bool isEnabled_ = true;
|
||||||
std::vector<ControlValue> controlValues_;
|
std::vector<ControlValue> controlValues_;
|
||||||
Lv2PluginState lv2State_;
|
Lv2PluginState lv2State_;
|
||||||
std::map<std::string,std::string> pathProperties_;
|
std::map<std::string,std::string> pathProperties_;
|
||||||
@@ -165,6 +166,7 @@ class Snapshot {
|
|||||||
public:
|
public:
|
||||||
std::string name_;
|
std::string name_;
|
||||||
std::string color_;
|
std::string color_;
|
||||||
|
bool isModified_ = true;
|
||||||
std::vector<SnapshotValue> values_;
|
std::vector<SnapshotValue> values_;
|
||||||
|
|
||||||
DECLARE_JSON_MAP(Snapshot);
|
DECLARE_JSON_MAP(Snapshot);
|
||||||
|
|||||||
Reference in New Issue
Block a user