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);
|
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);
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user