A2 UI
This commit is contained in:
Vendored
+2
-2
@@ -337,8 +337,8 @@
|
|||||||
"program": "${command:cmake.launchTargetPath}",
|
"program": "${command:cmake.launchTargetPath}",
|
||||||
"args": [
|
"args": [
|
||||||
"--no-profile",
|
"--no-profile",
|
||||||
"--preset-file", "/home/robin/Downloads/NAM Profiling.piPreset",
|
"--preset-file", "/home/robin/Downloads/A1 Profiling.piPreset",
|
||||||
"--seconds", "100",
|
"--seconds", "1",
|
||||||
"-w"
|
"-w"
|
||||||
],
|
],
|
||||||
"stopAtEntry": false,
|
"stopAtEntry": false,
|
||||||
|
|||||||
@@ -208,8 +208,9 @@ void DBusDispatcher::WaitForClose()
|
|||||||
serviceThread.join();
|
serviceThread.join();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (const std::exception &)
|
catch (const std::exception &e)
|
||||||
{
|
{
|
||||||
|
std::cout << "DBusDispatcher: " << e.what() << std::endl;
|
||||||
}
|
}
|
||||||
if (eventFd != -1)
|
if (eventFd != -1)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ private:
|
|||||||
std::atomic<bool> stopping;
|
std::atomic<bool> stopping;
|
||||||
|
|
||||||
std::vector<CallbackEntry> postedEvents;
|
std::vector<CallbackEntry> postedEvents;
|
||||||
bool threadStarted;
|
bool threadStarted = false;
|
||||||
std::thread serviceThread;
|
std::thread serviceThread;
|
||||||
std::mutex postMutex;
|
std::mutex postMutex;
|
||||||
};
|
};
|
||||||
@@ -80,7 +80,6 @@ PiPedalModel::PiPedalModel()
|
|||||||
atomConverter(pluginHost.GetMapFeature())
|
atomConverter(pluginHost.GetMapFeature())
|
||||||
{
|
{
|
||||||
this->updater = Updater::Create();
|
this->updater = Updater::Create();
|
||||||
this->updater->Start();
|
|
||||||
this->currentUpdateStatus = updater->GetCurrentStatus();
|
this->currentUpdateStatus = updater->GetCurrentStatus();
|
||||||
this->pedalboard = Pedalboard::MakeDefault();
|
this->pedalboard = Pedalboard::MakeDefault();
|
||||||
|
|
||||||
@@ -211,6 +210,10 @@ PiPedalModel::~PiPedalModel()
|
|||||||
void PiPedalModel::Init(const PiPedalConfiguration &configuration)
|
void PiPedalModel::Init(const PiPedalConfiguration &configuration)
|
||||||
{
|
{
|
||||||
std::lock_guard<std::recursive_mutex> lock(mutex); // prevent callbacks while we're initializing.
|
std::lock_guard<std::recursive_mutex> lock(mutex); // prevent callbacks while we're initializing.
|
||||||
|
if (updaterEnabled)
|
||||||
|
{
|
||||||
|
this->updater->Start();
|
||||||
|
}
|
||||||
|
|
||||||
this->configuration = configuration;
|
this->configuration = configuration;
|
||||||
pluginHost.SetConfiguration(configuration);
|
pluginHost.SetConfiguration(configuration);
|
||||||
@@ -3452,3 +3455,8 @@ std::string PiPedalModel::Tone3000ThumbnailDirectory()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PiPedalModel::EnableUpdater(bool enable)
|
||||||
|
{
|
||||||
|
this->updaterEnabled = enable;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -119,6 +119,7 @@ namespace pipedal
|
|||||||
using NetworkChangedListener = std::function<void(void)>;
|
using NetworkChangedListener = std::function<void(void)>;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
bool updaterEnabled = true;
|
||||||
PedalboardItem *GetPedalboardItemForFileProperty(const UiFileProperty &fileProperty);
|
PedalboardItem *GetPedalboardItemForFileProperty(const UiFileProperty &fileProperty);
|
||||||
|
|
||||||
// Tone3000Downloader::Listener implementation
|
// Tone3000Downloader::Listener implementation
|
||||||
@@ -296,7 +297,7 @@ namespace pipedal
|
|||||||
Decrease
|
Decrease
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void EnableUpdater(bool enable);
|
||||||
|
|
||||||
Storage &GetStorage() { return storage; }
|
Storage &GetStorage() { return storage; }
|
||||||
|
|
||||||
|
|||||||
@@ -132,7 +132,9 @@ void profilePlugin(const ProfileOptions &profileOptions)
|
|||||||
throw std::runtime_error(s.str());
|
throw std::runtime_error(s.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
model.EnableUpdater(false);
|
||||||
model.Init(configuration);
|
model.Init(configuration);
|
||||||
|
model.GetPluginHost().asIHost()->SetMaxAudioBufferSize(64);
|
||||||
|
|
||||||
model.LoadLv2PluginInfo();
|
model.LoadLv2PluginInfo();
|
||||||
|
|
||||||
|
|||||||
@@ -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_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";
|
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.
|
// offset 0: an integer with the folloing bits set.
|
||||||
// Must match ToobAmp/src/NeuralAmpModeler_Lv2Extensions.hpp enum TOOB_NAM_METADATA_OFFSETS
|
// Must match ToobAmp/src/NeuralAmpModeler_Lv2Extensions.hpp enum TOOB_NAM_METADATA_OFFSETS
|
||||||
const MAX_SLIMMABLE_WEIGHTS = 16;
|
|
||||||
class TOOB_NAM_METADATA_OFFSETS {
|
class TOOB_NAM_METADATA_OFFSETS {
|
||||||
static readonly flags = 0;
|
static readonly flags = 0;
|
||||||
static readonly preset_version = 1;
|
static readonly preset_version = 1;
|
||||||
@@ -48,11 +62,10 @@ class TOOB_NAM_METADATA_OFFSETS {
|
|||||||
static readonly gain = 3;
|
static readonly gain = 3;
|
||||||
static readonly input_level_dbu = 4;
|
static readonly input_level_dbu = 4;
|
||||||
static readonly output_level_dbu = 5;
|
static readonly output_level_dbu = 5;
|
||||||
static readonly is_a2 = 6;
|
static readonly has_slimmable_weights = 6;
|
||||||
static readonly model_weight = 7;
|
static readonly model_weight = 7;
|
||||||
static readonly slimmable_weights_size = 8;
|
static readonly model_type = 8;
|
||||||
static readonly slimmable_weights = 9;
|
static readonly max_medatadata = 9;
|
||||||
static readonly max_medatadata = TOOB_NAM_METADATA_OFFSETS.slimmable_weights + MAX_SLIMMABLE_WEIGHTS;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -81,12 +94,9 @@ class ModelMetadata {
|
|||||||
this.inputlevelDBU = metadataValues[TOOB_NAM_METADATA_OFFSETS.input_level_dbu];
|
this.inputlevelDBU = metadataValues[TOOB_NAM_METADATA_OFFSETS.input_level_dbu];
|
||||||
this.outputlevelDBU = metadataValues[TOOB_NAM_METADATA_OFFSETS.output_level_dbu];
|
this.outputlevelDBU = metadataValues[TOOB_NAM_METADATA_OFFSETS.output_level_dbu];
|
||||||
this.preset_version = metadataValues[TOOB_NAM_METADATA_OFFSETS.preset_version];
|
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];
|
this.modelWeight = metadataValues[TOOB_NAM_METADATA_OFFSETS.model_weight];
|
||||||
let slimmableWeightsSize = metadataValues[TOOB_NAM_METADATA_OFFSETS.slimmable_weights_size];
|
this.modelType = floatToModelType(metadataValues[TOOB_NAM_METADATA_OFFSETS.model_type]);
|
||||||
for (let i = 0; i < slimmableWeightsSize && i < 16; ++i) {
|
|
||||||
this.slimmable_weights.push(metadataValues[TOOB_NAM_METADATA_OFFSETS.slimmable_weights + i]);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
this.hasModel = false;
|
this.hasModel = false;
|
||||||
this.hasLoudness = false;
|
this.hasLoudness = false;
|
||||||
@@ -96,19 +106,18 @@ class ModelMetadata {
|
|||||||
|
|
||||||
this.loudness = 0;
|
this.loudness = 0;
|
||||||
this.gain = 0;
|
this.gain = 0;
|
||||||
|
this.hasSlimmableWeights = false;
|
||||||
this.inputlevelDBU = 0;
|
this.inputlevelDBU = 0;
|
||||||
this.outputlevelDBU = 0;
|
this.outputlevelDBU = 0;
|
||||||
this.preset_version = 1;
|
this.preset_version = 1;
|
||||||
this.modelWeight = -1;
|
this.modelWeight = -1;
|
||||||
this.isA2 = false;
|
|
||||||
this.slimmable_weights = [];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
preset_version: number;
|
preset_version: number;
|
||||||
isA2: boolean = false;
|
hasSlimmableWeights: boolean = false;
|
||||||
modelWeight: number = 1.0;
|
modelWeight: number = 1.0;
|
||||||
slimmable_weights: number[] = [];
|
modelType: NamModelType;
|
||||||
hasModel: boolean;
|
hasModel: boolean;
|
||||||
hasLoudness: boolean;
|
hasLoudness: boolean;
|
||||||
hasGain: boolean;
|
hasGain: boolean;
|
||||||
@@ -120,10 +129,6 @@ class ModelMetadata {
|
|||||||
inputlevelDBU: number;
|
inputlevelDBU: number;
|
||||||
outputlevelDBU: number;
|
outputlevelDBU: number;
|
||||||
|
|
||||||
hasSlimmableWeights(): boolean {
|
|
||||||
return this.slimmable_weights.length > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -255,7 +260,7 @@ const ToobNamView =
|
|||||||
if (!this.state.showEqSection) {
|
if (!this.state.showEqSection) {
|
||||||
controls.splice(EqPos, 1);
|
controls.splice(EqPos, 1);
|
||||||
}
|
}
|
||||||
if (this.state.modelMetadata.hasSlimmableWeights()) {
|
if (this.state.modelMetadata.hasSlimmableWeights) {
|
||||||
controls.splice(3, 0, this.MakeModelWeightSelector(host));
|
controls.splice(3, 0, this.MakeModelWeightSelector(host));
|
||||||
}
|
}
|
||||||
return controls;
|
return controls;
|
||||||
|
|||||||
Reference in New Issue
Block a user