WiFi Channel Settings.

This commit is contained in:
Robin Davies
2021-08-20 10:35:37 -04:00
parent 140f2abd39
commit f6aa331d77
40 changed files with 2409 additions and 597 deletions
+31 -9
View File
@@ -95,7 +95,6 @@ void PiPedalModel::Load(const PiPedalConfiguration &configuration)
this->jackHost->SetNotificationCallbacks(this);
if (configuration.GetMLock())
{
#ifndef NO_MLOCK
@@ -126,10 +125,8 @@ void PiPedalModel::Load(const PiPedalConfiguration &configuration)
catch (PiPedalException &e)
{
Lv2Log::error("Failed to load initial plugin. (%s)", e.what());
}
}
}
IPiPedalModelSubscriber *PiPedalModel::GetNotificationSubscriber(int64_t clientId)
@@ -278,7 +275,6 @@ void PiPedalModel::setPedalBoard(int64_t clientId, PedalBoard &pedalBoard)
}
}
void PiPedalModel::setPedalBoardItemEnable(int64_t clientId, int64_t pedalItemId, bool enabled)
{
std::lock_guard(this->mutex);
@@ -318,7 +314,6 @@ PedalBoard PiPedalModel::getPreset(int64_t instanceId)
return this->storage.GetPreset(instanceId);
}
void PiPedalModel::setPresetChanged(int64_t clientId, bool value)
{
if (value != this->hasPresetChanged)
@@ -369,14 +364,13 @@ int64_t PiPedalModel::saveCurrentPresetAs(int64_t clientId, const std::string &n
return result;
}
int64_t PiPedalModel::uploadPreset(const BankFile&bankFile,int64_t uploadAfter)
int64_t PiPedalModel::uploadPreset(const BankFile &bankFile, int64_t uploadAfter)
{
std::lock_guard(this->mutex);
int64_t newPreset = this->storage.UploadPreset(bankFile,uploadAfter);
int64_t newPreset = this->storage.UploadPreset(bankFile, uploadAfter);
firePresetsChanged(-1);
return newPreset;
}
void PiPedalModel::loadPreset(int64_t clientId, int64_t instanceId)
@@ -462,6 +456,35 @@ bool PiPedalModel::renamePreset(int64_t clientId, int64_t instanceId, const std:
}
}
void PiPedalModel::setWifiConfigSettings(const WifiConfigSettings &wifiConfigSettings)
{
std::lock_guard lock(this->mutex);
// xxx Commit to local!
this->storage.SetWifiConfigSettings(wifiConfigSettings);
{
IPiPedalModelSubscriber **t = new IPiPedalModelSubscriber *[this->subscribers.size()];
for (size_t i = 0; i < subscribers.size(); ++i)
{
t[i] = this->subscribers[i];
}
size_t n = this->subscribers.size();
WifiConfigSettings tWifiConfigSettings = storage.GetWifiConfigSettings(); // (the passwordless version)
for (size_t i = 0; i < n; ++i)
{
t[i]->OnWifiConfigSettingsChanged(tWifiConfigSettings);
}
delete[] t;
}
}
WifiConfigSettings PiPedalModel::getWifiConfigSettings()
{
std::lock_guard lock(this->mutex);
return this->storage.GetWifiConfigSettings();
}
JackConfiguration PiPedalModel::getJackConfiguration()
{
std::lock_guard lock(this->mutex); // copy atomically.
@@ -983,4 +1006,3 @@ void PiPedalModel::cancelListenForMidiEvent(int64_t clientId, int64_t clientHand
jackHost->SetListenForMidiEvent(false);
}
}