This commit is contained in:
Robin E.R. Davies
2026-05-20 09:30:55 -04:00
parent 7343ced278
commit 5ee86c519f
7 changed files with 42 additions and 25 deletions
+2 -2
View File
@@ -337,8 +337,8 @@
"program": "${command:cmake.launchTargetPath}",
"args": [
"--no-profile",
"--preset-file", "/home/robin/Downloads/NAM Profiling.piPreset",
"--seconds", "100",
"--preset-file", "/home/robin/Downloads/A1 Profiling.piPreset",
"--seconds", "1",
"-w"
],
"stopAtEntry": false,
+2 -1
View File
@@ -208,8 +208,9 @@ void DBusDispatcher::WaitForClose()
serviceThread.join();
}
}
catch (const std::exception &)
catch (const std::exception &e)
{
std::cout << "DBusDispatcher: " << e.what() << std::endl;
}
if (eventFd != -1)
{
+1 -1
View File
@@ -78,7 +78,7 @@ private:
std::atomic<bool> stopping;
std::vector<CallbackEntry> postedEvents;
bool threadStarted;
bool threadStarted = false;
std::thread serviceThread;
std::mutex postMutex;
};
+9 -1
View File
@@ -80,7 +80,6 @@ PiPedalModel::PiPedalModel()
atomConverter(pluginHost.GetMapFeature())
{
this->updater = Updater::Create();
this->updater->Start();
this->currentUpdateStatus = updater->GetCurrentStatus();
this->pedalboard = Pedalboard::MakeDefault();
@@ -211,6 +210,10 @@ PiPedalModel::~PiPedalModel()
void PiPedalModel::Init(const PiPedalConfiguration &configuration)
{
std::lock_guard<std::recursive_mutex> lock(mutex); // prevent callbacks while we're initializing.
if (updaterEnabled)
{
this->updater->Start();
}
this->configuration = configuration;
pluginHost.SetConfiguration(configuration);
@@ -3452,3 +3455,8 @@ std::string PiPedalModel::Tone3000ThumbnailDirectory()
}
void PiPedalModel::EnableUpdater(bool enable)
{
this->updaterEnabled = enable;
}
+2 -1
View File
@@ -119,6 +119,7 @@ namespace pipedal
using NetworkChangedListener = std::function<void(void)>;
private:
bool updaterEnabled = true;
PedalboardItem *GetPedalboardItemForFileProperty(const UiFileProperty &fileProperty);
// Tone3000Downloader::Listener implementation
@@ -296,7 +297,7 @@ namespace pipedal
Decrease
};
void EnableUpdater(bool enable);
Storage &GetStorage() { return storage; }
+2
View File
@@ -132,7 +132,9 @@ void profilePlugin(const ProfileOptions &profileOptions)
throw std::runtime_error(s.str());
}
model.EnableUpdater(false);
model.Init(configuration);
model.GetPluginHost().asIHost()->SetMaxAudioBufferSize(64);
model.LoadLv2PluginInfo();
+24 -19
View File
@@ -38,9 +38,23 @@ import { CustomPluginControl } from './PluginControl';
const TOOB_NAM__MODEL_METADATA_URI = "http://two-play.com/plugins/toob-nam#model_metadata";
const TOOB_NAM__MODEL_WEIGHT_URI = "http://two-play.com/plugins/toob-nam#modelWeight";
enum NamModelType {
None = 0,
A1 = 1,
A2 = 2
};
function floatToModelType(value: number): NamModelType {
switch (value) {
case 0: return NamModelType.None;
case 1: return NamModelType.A1;
case 2: return NamModelType.A2;
default: return NamModelType.None;
}
}
// offset 0: an integer with the folloing bits set.
// Must match ToobAmp/src/NeuralAmpModeler_Lv2Extensions.hpp enum TOOB_NAM_METADATA_OFFSETS
const MAX_SLIMMABLE_WEIGHTS = 16;
class TOOB_NAM_METADATA_OFFSETS {
static readonly flags = 0;
static readonly preset_version = 1;
@@ -48,11 +62,10 @@ class TOOB_NAM_METADATA_OFFSETS {
static readonly gain = 3;
static readonly input_level_dbu = 4;
static readonly output_level_dbu = 5;
static readonly is_a2 = 6;
static readonly has_slimmable_weights = 6;
static readonly model_weight = 7;
static readonly slimmable_weights_size = 8;
static readonly slimmable_weights = 9;
static readonly max_medatadata = TOOB_NAM_METADATA_OFFSETS.slimmable_weights + MAX_SLIMMABLE_WEIGHTS;
static readonly model_type = 8;
static readonly max_medatadata = 9;
};
@@ -81,12 +94,9 @@ class ModelMetadata {
this.inputlevelDBU = metadataValues[TOOB_NAM_METADATA_OFFSETS.input_level_dbu];
this.outputlevelDBU = metadataValues[TOOB_NAM_METADATA_OFFSETS.output_level_dbu];
this.preset_version = metadataValues[TOOB_NAM_METADATA_OFFSETS.preset_version];
this.isA2 = metadataValues[TOOB_NAM_METADATA_OFFSETS.is_a2] !== 0;
this.hasSlimmableWeights = metadataValues[TOOB_NAM_METADATA_OFFSETS.has_slimmable_weights] !== 0;
this.modelWeight = metadataValues[TOOB_NAM_METADATA_OFFSETS.model_weight];
let slimmableWeightsSize = metadataValues[TOOB_NAM_METADATA_OFFSETS.slimmable_weights_size];
for (let i = 0; i < slimmableWeightsSize && i < 16; ++i) {
this.slimmable_weights.push(metadataValues[TOOB_NAM_METADATA_OFFSETS.slimmable_weights + i]);
}
this.modelType = floatToModelType(metadataValues[TOOB_NAM_METADATA_OFFSETS.model_type]);
} else {
this.hasModel = false;
this.hasLoudness = false;
@@ -96,19 +106,18 @@ class ModelMetadata {
this.loudness = 0;
this.gain = 0;
this.hasSlimmableWeights = false;
this.inputlevelDBU = 0;
this.outputlevelDBU = 0;
this.preset_version = 1;
this.modelWeight = -1;
this.isA2 = false;
this.slimmable_weights = [];
}
}
preset_version: number;
isA2: boolean = false;
hasSlimmableWeights: boolean = false;
modelWeight: number = 1.0;
slimmable_weights: number[] = [];
modelType: NamModelType;
hasModel: boolean;
hasLoudness: boolean;
hasGain: boolean;
@@ -120,10 +129,6 @@ class ModelMetadata {
inputlevelDBU: number;
outputlevelDBU: number;
hasSlimmableWeights(): boolean {
return this.slimmable_weights.length > 0;
}
}
@@ -255,7 +260,7 @@ const ToobNamView =
if (!this.state.showEqSection) {
controls.splice(EqPos, 1);
}
if (this.state.modelMetadata.hasSlimmableWeights()) {
if (this.state.modelMetadata.hasSlimmableWeights) {
controls.splice(3, 0, this.MakeModelWeightSelector(host));
}
return controls;