From 852232ad279b1436d3fd075a745c262334c172f8 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 13 Apr 2011 01:44:46 +0000 Subject: [PATCH] Tolerate LV2 plugins that call persist/file state functions early. git-svn-id: svn://localhost/ardour2/branches/3.0@9343 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/lv2_plugin.cc | 12 +++++++++--- libs/ardour/processor.cc | 8 ++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc index f3e30cb786..9978cec1dd 100644 --- a/libs/ardour/lv2_plugin.cc +++ b/libs/ardour/lv2_plugin.cc @@ -428,7 +428,9 @@ LV2Plugin::lv2_files_abstract_path(LV2_Files_Host_Data host_data, const char* absolute_path) { LV2Plugin* me = (LV2Plugin*)host_data; - assert(me->_insert_id != PBD::ID("0")); + if (me->_insert_id == PBD::ID("0")) { + return g_strdup(absolute_path); + } const std::string state_dir = Glib::build_filename(me->_session.plugins_dir(), me->_insert_id.to_s()); @@ -452,7 +454,9 @@ LV2Plugin::lv2_files_absolute_path(LV2_Files_Host_Data host_data, const char* abstract_path) { LV2Plugin* me = (LV2Plugin*)host_data; - assert(me->_insert_id != PBD::ID("0")); + if (me->_insert_id == PBD::ID("0")) { + return g_strdup(abstract_path); + } char* ret = NULL; if (g_path_is_absolute(abstract_path)) { @@ -477,7 +481,9 @@ LV2Plugin::lv2_files_new_file_path(LV2_Files_Host_Data host_data, const char* relative_path) { LV2Plugin* me = (LV2Plugin*)host_data; - assert(me->_insert_id != PBD::ID("0")); + if (me->_insert_id == PBD::ID("0")) { + return g_strdup(relative_path); + } const std::string state_dir = Glib::build_filename(me->_session.plugins_dir(), me->_insert_id.to_s()); diff --git a/libs/ardour/processor.cc b/libs/ardour/processor.cc index 66d45a4174..ef94d1b50a 100644 --- a/libs/ardour/processor.cc +++ b/libs/ardour/processor.cc @@ -68,7 +68,7 @@ Processor::Processor(Session& session, const string& name) , _configured(false) , _display_to_user (true) , _pre_fader (false) - , _ui_pointer (0) + , _ui_pointer (0) { } @@ -82,7 +82,7 @@ Processor::Processor (const Processor& other) , _configured(false) , _display_to_user (true) , _pre_fader (false) - , _ui_pointer (0) + , _ui_pointer (0) { } @@ -130,7 +130,7 @@ Processor::state (bool full_state) stringstream sstr; for (set::iterator x = _visible_controls.begin(); x != _visible_controls.end(); ++x) { - + if (x != _visible_controls.begin()) { sstr << ' '; } @@ -298,5 +298,5 @@ Processor::set_pre_fader (bool p) void Processor::set_ui (void* p) { - _ui_pointer = p; + _ui_pointer = p; }