From 5a3ece0784dba17712999d1f29eb0c28f2ded0e4 Mon Sep 17 00:00:00 2001 From: Robin Davies Date: Thu, 10 Mar 2022 12:02:41 -0500 Subject: [PATCH 1/4] Select first plugin if no selection. Fixes #22 --- react/public/var/config.json | 2 +- react/src/MainPage.tsx | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/react/public/var/config.json b/react/public/var/config.json index 93f81dd..60e144f 100644 --- a/react/public/var/config.json +++ b/react/public/var/config.json @@ -1,5 +1,5 @@ { - "socket_server_port": 8080, + "socket_server_port": 80, "socket_server_address": "*", "max_upload_size": 1048576, diff --git a/react/src/MainPage.tsx b/react/src/MainPage.tsx index 36af67d..486e798 100644 --- a/react/src/MainPage.tsx +++ b/react/src/MainPage.tsx @@ -114,11 +114,17 @@ export const MainPage = constructor(props: MainProps) { super(props); this.model = PiPedalModelFactory.getInstance(); + let pedalboard = this.model.pedalBoard.get(); + let selectedPedal = -1; + if (pedalboard.items.length !== 0) + { + selectedPedal = pedalboard.items[0].instanceId; + } this.state = { - selectedPedal: -1, + selectedPedal: selectedPedal, loadDialogOpen: false, - pedalBoard: this.model.pedalBoard.get(), + pedalBoard: pedalboard, addMenuAnchorEl: null, splitControlBar: this.windowSize.width < SPLIT_CONTROLBAR_THRESHHOLD, horizontalScrollLayout: this.windowSize.height < HORIZONTAL_CONTROL_SCROLL_HEIGHT_BREAK, @@ -188,7 +194,15 @@ export const MainPage = this.model.loadPluginPreset(instanceId, presetInstanceId); } onPedalBoardChanged(value: PedalBoard) { - this.setState({ pedalBoard: value }); + let selectedItem = -1; + if (value.items.length !== 0) + { + selectedItem = value.items[0].instanceId; + } + this.setState({ + pedalBoard: value, + selectedPedal: selectedItem + }); } onDeletePedal(instanceId: number): void { let result = this.model.deletePedalBoardPedal(instanceId); From 3299c6b29ba11c1478964e042d15e2a2bdb90017 Mon Sep 17 00:00:00 2001 From: Robin Davies Date: Thu, 10 Mar 2022 12:30:09 -0500 Subject: [PATCH 2/4] Home directory for pipedal_d required. Fixes #19 --- src/ConfigMain.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ConfigMain.cpp b/src/ConfigMain.cpp index ae413e2..58183e1 100644 --- a/src/ConfigMain.cpp +++ b/src/ConfigMain.cpp @@ -350,8 +350,7 @@ void InstallJackService() } // lock account for login. silentSysExec("passwd -l " JACK_SERVICE_ACCOUNT_NAME); - } - + } // Add to audio groups. // sysExec(USERMOD_BIN " -a -G " JACK_SERVICE_GROUP_NAME " " JACK_SERVICE_ACCOUNT_NAME); sysExec(USERMOD_BIN " -a -G" AUDIO_SERVICE_GROUP_NAME " " JACK_SERVICE_ACCOUNT_NAME); @@ -449,13 +448,13 @@ void Install(const std::filesystem::path &programPrefix, const std::string endpo if (!userExists(SERVICE_ACCOUNT_NAME)) { - if (sysExec(USERADD_BIN " " SERVICE_ACCOUNT_NAME " -g " SERVICE_GROUP_NAME " -M -N -r") != EXIT_SUCCESS) + if (sysExec(USERADD_BIN " " SERVICE_ACCOUNT_NAME " -g " SERVICE_GROUP_NAME " -m --home /var/pipedal/home -N -r") != EXIT_SUCCESS) { // throw PiPedalException("Failed to create service account."); } // lock account for login. silentSysExec("passwd -l " SERVICE_ACCOUNT_NAME); - } + } // Add to audio groups. sysExec(USERMOD_BIN " -a -G " AUDIO_SERVICE_GROUP_NAME " " SERVICE_ACCOUNT_NAME); From 613f19a69b9308aa52903c920897d2cfe97d841d Mon Sep 17 00:00:00 2001 From: Robin Davies Date: Thu, 10 Mar 2022 12:57:03 -0500 Subject: [PATCH 3/4] Switch to c++20, pipedal Fixes #21 --- src/ConfigMain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ConfigMain.cpp b/src/ConfigMain.cpp index ae413e2..fd5c6ff 100644 --- a/src/ConfigMain.cpp +++ b/src/ConfigMain.cpp @@ -449,7 +449,7 @@ void Install(const std::filesystem::path &programPrefix, const std::string endpo if (!userExists(SERVICE_ACCOUNT_NAME)) { - if (sysExec(USERADD_BIN " " SERVICE_ACCOUNT_NAME " -g " SERVICE_GROUP_NAME " -M -N -r") != EXIT_SUCCESS) + if (sysExec(USERADD_BIN " " SERVICE_ACCOUNT_NAME " -g " SERVICE_GROUP_NAME " -m -N -r") != EXIT_SUCCESS) { // throw PiPedalException("Failed to create service account."); } From 0ca1eb11d647c30319eec0a1f34829bdddb496ec Mon Sep 17 00:00:00 2001 From: Robin Davies Date: Thu, 10 Mar 2022 12:57:42 -0500 Subject: [PATCH 4/4] To C++ 20 --- .vscode/c_cpp_properties.json | 2 +- src/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 2111419..28cd883 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -8,7 +8,7 @@ ], "compilerPath": "/usr/bin/gcc", "cStandard": "c17", - "cppStandard": "c++17", + "cppStandard": "c++20", "intelliSenseMode": "linux-gcc-arm64", "compileCommands": "${workspaceFolder}/build/compile_commands.json", "configurationProvider": "ms-vscode.cmake-tools" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4921510..30c64ad 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -61,7 +61,7 @@ endif() # specify the C++ standard -set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED True) set (USE_SANITIZE False)