catch error if NAM model fails to load

This commit is contained in:
Mike Oliphant
2023-03-13 08:51:42 -07:00
parent c4f129214e
commit 819d0a3d2e
4 changed files with 10 additions and 4 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
add_library(neural_amp_modeler MODULE
nam_lv2.cpp
nam_plugin.cpp
nam_plugin.hpp
nam_plugin.h
dsp.h
dsp.cpp
get_dsp.cpp
+1 -1
View File
@@ -11,7 +11,7 @@
#include <lv2/log/logger.h>
#include <lv2/worker/worker.h>
#include "nam_plugin.hpp"
#include "nam_plugin.h"
// LV2 Functions
static LV2_Handle instantiate(
+8 -2
View File
@@ -6,7 +6,7 @@
#include <lv2/atom/util.h>
#include <lv2/patch/patch.h>
#include "nam_plugin.hpp"
#include "nam_plugin.h"
namespace NAM {
Plugin::Plugin(float rate)
@@ -49,7 +49,13 @@ namespace NAM {
if (file_path && (file_path->size > 0))
{
namModel = get_dsp((const char*)LV2_ATOM_BODY_CONST(file_path));
try
{
namModel = get_dsp((const char*)LV2_ATOM_BODY_CONST(file_path));
}
catch (std::exception& e)
{
}
}
}
}