Adding persist - T2

Adding model persist so that the apply can be used for testing. Previous did not  persist as intented.
This commit is contained in:
Extremesecrecy
2025-07-25 19:58:43 -07:00
parent bce2e68ee3
commit c33c69899c
5 changed files with 22 additions and 5 deletions
+5 -2
View File
@@ -1911,7 +1911,7 @@ void PiPedalModel::SetOnboarding(bool value)
SetJackServerSettings(this->jackServerSettings); SetJackServerSettings(this->jackServerSettings);
} }
void PiPedalModel::SetJackServerSettings(const JackServerSettings &jackServerSettings) void PiPedalModel::SetJackServerSettings(const JackServerSettings &jackServerSettings, bool persist)
{ {
std::unique_lock<std::recursive_mutex> guard(mutex); std::unique_lock<std::recursive_mutex> guard(mutex);
@@ -1932,7 +1932,10 @@ void PiPedalModel::SetJackServerSettings(const JackServerSettings &jackServerSet
} }
#if ALSA_HOST #if ALSA_HOST
storage.SetJackServerSettings(jackServerSettings); if (persist)
{
storage.SetJackServerSettings(jackServerSettings);
}
FireJackConfigurationChanged(this->jackConfiguration); FireJackConfigurationChanged(this->jackConfiguration);
+1 -1
View File
@@ -449,7 +449,7 @@ namespace pipedal
return this->audioHost->getJackStatus(); return this->audioHost->getJackStatus();
} }
JackServerSettings GetJackServerSettings(); JackServerSettings GetJackServerSettings();
void SetJackServerSettings(const JackServerSettings &jackServerSettings); void SetJackServerSettings(const JackServerSettings &jackServerSettings, bool persist = true);
void ListenForMidiEvent(int64_t clientId, int64_t clientHandle); void ListenForMidiEvent(int64_t clientId, int64_t clientHandle);
void CancelListenForMidiEvent(int64_t clientId, int64_t clientHandle); void CancelListenForMidiEvent(int64_t clientId, int64_t clientHandle);
+9 -1
View File
@@ -1285,8 +1285,16 @@ public:
JackServerSettings jackServerSettings; JackServerSettings jackServerSettings;
pReader->read(&jackServerSettings); pReader->read(&jackServerSettings);
CheckJackServerSettings(jackServerSettings); CheckJackServerSettings(jackServerSettings);
this->model.SetJackServerSettings(jackServerSettings); this->model.SetJackServerSettings(jackServerSettings, true);
this->Reply(replyTo, "setJackserverSettings"); this->Reply(replyTo, "setJackserverSettings");
}
else if (message == "applyJackServerSettings")
{
JackServerSettings jackServerSettings;
pReader->read(&jackServerSettings);
CheckJackServerSettings(jackServerSettings);
this->model.SetJackServerSettings(jackServerSettings, false);
this->Reply(replyTo, "applyJackServerSettings");
} }
else if (message == "setGovernorSettings") else if (message == "setGovernorSettings")
{ {
@@ -544,7 +544,7 @@ const JackServerSettingsDialog = withStyles(
// Apply immediately so the status display can confirm // Apply immediately so the status display can confirm
// whether the selected devices are working. // whether the selected devices are working.
s.valid = true; s.valid = true;
this.model.setJackServerSettings(s); this.model.applyJackServerSettings(s);
this.startStatusTimer(); this.startStatusTimer();
} }
}; };
+6
View File
@@ -2530,6 +2530,12 @@ export class PiPedalModel //implements PiPedalModel
this.showAlert(error); this.showAlert(error);
}); });
} }
applyJackServerSettings(jackServerSettings: JackServerSettings): void {
this.webSocket?.request<void>("applyJackServerSettings", jackServerSettings)
.catch((error) => {
this.showAlert(error);
});
}
updateVst3State(pedalboard: Pedalboard) { updateVst3State(pedalboard: Pedalboard) {
// let it = pedalboard.itemsGenerator(); // let it = pedalboard.itemsGenerator();