This commit is contained in:
Robin E.R. Davies
2026-02-04 15:05:37 -05:00
parent f0c3995a8f
commit e5beb97466
35 changed files with 3815 additions and 317 deletions
+38 -17
View File
@@ -46,6 +46,7 @@
#include "DummyAudioDriver.hpp"
#include "AudioFiles.hpp"
#include "CrashGuard.hpp"
#include "Tone3000Downloader.hpp"
#ifndef NO_MLOCK
#include <sys/mman.h>
@@ -135,10 +136,15 @@ void PiPedalModel::Close()
std::unique_ptr<AudioHost> oldAudioHost;
{
std::lock_guard<std::recursive_mutex> lock(mutex);
if (closed)
{
return;
}
if (tone3000Downloader)
{
tone3000Downloader->Close();
}
closed = true;
CancelAudioRetry();
@@ -225,6 +231,38 @@ void PiPedalModel::Init(const PiPedalConfiguration &configuration)
#endif
}
int64_t PiPedalModel::DownloadModelsFromTone3000(
int64_t clientId,
const std::string &downloadPath,
const std::string &tone3000Url)
{
std::lock_guard<std::recursive_mutex> lock(mutex);
if (!tone3000Downloader)
{
tone3000Downloader = Tone3000Downloader::Create();
}
return tone3000Downloader->RequestDownload(
downloadPath,
tone3000Url
);
}
void PiPedalModel::CancelTone3000Download(
int64_t clientId,
int64_t downloadHandle
)
{
std::lock_guard<std::recursive_mutex> lock(mutex);
if (tone3000Downloader)
{
tone3000Downloader->CancelDownload(downloadHandle);
}
}
void PiPedalModel::LoadLv2PluginInfo()
{
// Not all Lv2 directories have the lv2 base declarations. Load a full set of plugin classes generated on a default /usr/local/lib/lv2 directory.
@@ -3289,23 +3327,6 @@ void PiPedalModel::SetPedalboardItemTitle(int64_t instanceId, const std::string
this->FirePedalboardChanged(-1, false);
}
void PiPedalModel::SetTone3000Auth(const std::string &apiKey)
{
std::lock_guard<std::recursive_mutex> lock(mutex);
storage.SetTone3000Auth(apiKey);
std::vector<IPiPedalModelSubscriber::ptr> t{subscribers.begin(), subscribers.end()};
bool hasAuth = apiKey != "";
for (auto &subscriber : t)
{
subscriber->OnTone3000AuthChanged(hasAuth);
}
}
bool PiPedalModel::HasTone3000Auth() const
{
return storage.GetTone3000Auth() != "";
}
std::vector<PresetIndexEntry> PiPedalModel::RequestBankPresets(int64_t bankInstanceId)
{
std::lock_guard<std::recursive_mutex> lock(mutex);