From 24beb0edd9d3448f49d6129b9941bc2c3071f38f Mon Sep 17 00:00:00 2001 From: Robin Davies Date: Sun, 6 Oct 2024 18:04:08 -0400 Subject: [PATCH 01/11] Include bypass state in snapshots. --- react/src/Pedalboard.tsx | 4 ++++ src/Pedalboard.cpp | 4 ++++ src/Pedalboard.hpp | 2 ++ 3 files changed, 10 insertions(+) diff --git a/react/src/Pedalboard.tsx b/react/src/Pedalboard.tsx index 5a8d010..414d060 100644 --- a/react/src/Pedalboard.tsx +++ b/react/src/Pedalboard.tsx @@ -226,12 +226,14 @@ export class SnapshotValue { { let result = new SnapshotValue(); result.instanceId = item.instanceId; + result.isEnabled = item.isEnabled; result.controlValues = ControlValue.deserializeArray(item.controlValues); result.lv2State = item.lv2State; // we can do this, because lv2State is immutable. result.pathProperties = {...item.pathProperties}; // clone the dictionary. return result; } instanceId: number = -1; + isEnabled: boolean = true; controlValues: ControlValue[] = ControlValue.EmptyArray; lv2State: [boolean,any] = [false,{}]; pathProperties: {[Name: string]: string} = {}; @@ -239,6 +241,7 @@ export class SnapshotValue { export class Snapshot { deserialize(input: any): Snapshot { this.values = SnapshotValue.deserializeArray(input.values); + this.isModified = input.isModified; this.name = input.name; this.color = input.color; return this; @@ -273,6 +276,7 @@ export class Snapshot { return result; } name: string = ""; + isModified: boolean = false; color: string = ""; values: SnapshotValue[] = []; }; diff --git a/src/Pedalboard.cpp b/src/Pedalboard.cpp index 0e24eb3..6a27f1c 100644 --- a/src/Pedalboard.cpp +++ b/src/Pedalboard.cpp @@ -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() diff --git a/src/Pedalboard.hpp b/src/Pedalboard.hpp index a538692..579dc2f 100644 --- a/src/Pedalboard.hpp +++ b/src/Pedalboard.hpp @@ -154,6 +154,7 @@ public: class SnapshotValue { public: uint64_t instanceId_; + bool isEnabled_ = true; std::vector controlValues_; Lv2PluginState lv2State_; std::map pathProperties_; @@ -165,6 +166,7 @@ class Snapshot { public: std::string name_; std::string color_; + bool isModified_ = true; std::vector values_; DECLARE_JSON_MAP(Snapshot); From 4567c698aec88d4e34f57b2eadc37975e68e3e71 Mon Sep 17 00:00:00 2001 From: Robin Davies Date: Tue, 8 Oct 2024 02:38:12 -0400 Subject: [PATCH 02/11] Add a static DHCP route to work around Android routing bug. --- PiPedalCommon/src/WifiConfigSettings.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/PiPedalCommon/src/WifiConfigSettings.cpp b/PiPedalCommon/src/WifiConfigSettings.cpp index 1cc1da6..9cce565 100644 --- a/PiPedalCommon/src/WifiConfigSettings.cpp +++ b/PiPedalCommon/src/WifiConfigSettings.cpp @@ -300,6 +300,18 @@ namespace pipedal::priv connection["ipv4"]["method"] = sdbus::Variant(std::string("shared")); connection["ipv6"]["method"] = sdbus::Variant(std::string("ignore")); + + connection["ipv4"]["address-data"] = sdbus::Variant(std::vector>{{ + {"address", sdbus::Variant("192.168.4.1")}, + {"prefix", sdbus::Variant(uint32_t(24))} + }}); + connection["ipv4"]["dhcp-send-hostname"] = sdbus::Variant(true); + connection["ipv4"]["dhcp-hostname"] = sdbus::Variant("raspberrypi"); + connection["ipv4"]["dhcp-options"] = sdbus::Variant(std::vector{ + "option:classless-static-route,192.168.4.0/24,0.0.0.0,0.0.0.0/0,192.168.4.1" + //"option:classless-static-route,192.168.4.0/24,192.168.4.1" + }); + auto connection_path = AddConnection(connection); return connection_path; } From 94b20727836a0c9103f5c10c566f8777e2aea194 Mon Sep 17 00:00:00 2001 From: Robin Davies Date: Tue, 8 Oct 2024 02:38:56 -0400 Subject: [PATCH 03/11] Fix Wifi config dialog layout on large screens. --- react/src/WifiConfigDialog.tsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/react/src/WifiConfigDialog.tsx b/react/src/WifiConfigDialog.tsx index 1affb61..0fcbc05 100644 --- a/react/src/WifiConfigDialog.tsx +++ b/react/src/WifiConfigDialog.tsx @@ -223,6 +223,10 @@ const WifiConfigDialog = withStyles(styles, { withTheme: true })( this.state.newPassword; } + onEnterKey() { + this.handleOk(false); + } + handleOk(wifiWarningGiven: boolean) { let hasError = false; if (this.state.autoStartMode !== 0) { @@ -334,8 +338,11 @@ const WifiConfigDialog = withStyles(styles, { withTheme: true })( }; let enabled = this.state.autoStartMode !== 0; return ( - { this.handleOk(false); }} + > {(this.state.fullScreen || !this.state.compactHeight) && ( Wi-fi Auto-Hotspot @@ -353,8 +360,8 @@ const WifiConfigDialog = withStyles(styles, { withTheme: true })( }} > - - Auto-start hotspot when + + Auto-start hotspot when...