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:
@@ -1911,7 +1911,7 @@ void PiPedalModel::SetOnboarding(bool value)
|
||||
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);
|
||||
|
||||
@@ -1932,7 +1932,10 @@ void PiPedalModel::SetJackServerSettings(const JackServerSettings &jackServerSet
|
||||
}
|
||||
|
||||
#if ALSA_HOST
|
||||
storage.SetJackServerSettings(jackServerSettings);
|
||||
if (persist)
|
||||
{
|
||||
storage.SetJackServerSettings(jackServerSettings);
|
||||
}
|
||||
|
||||
FireJackConfigurationChanged(this->jackConfiguration);
|
||||
|
||||
|
||||
@@ -449,7 +449,7 @@ namespace pipedal
|
||||
return this->audioHost->getJackStatus();
|
||||
}
|
||||
JackServerSettings GetJackServerSettings();
|
||||
void SetJackServerSettings(const JackServerSettings &jackServerSettings);
|
||||
void SetJackServerSettings(const JackServerSettings &jackServerSettings, bool persist = true);
|
||||
|
||||
void ListenForMidiEvent(int64_t clientId, int64_t clientHandle);
|
||||
void CancelListenForMidiEvent(int64_t clientId, int64_t clientHandle);
|
||||
|
||||
@@ -1285,8 +1285,16 @@ public:
|
||||
JackServerSettings jackServerSettings;
|
||||
pReader->read(&jackServerSettings);
|
||||
CheckJackServerSettings(jackServerSettings);
|
||||
this->model.SetJackServerSettings(jackServerSettings);
|
||||
this->model.SetJackServerSettings(jackServerSettings, true);
|
||||
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")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user