From 5372f9182de410217bbc410af73e4e31efb4c24c Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 22 Mar 2019 14:06:51 +0100 Subject: NO-OP: reduce scope --- libs/ardour/plugin_insert.cc | 53 ++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 26 deletions(-) (limited to 'libs/ardour') diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc index 3a7aff34ab..72fbae606b 100644 --- a/libs/ardour/plugin_insert.cc +++ b/libs/ardour/plugin_insert.cc @@ -2498,40 +2498,41 @@ void PluginInsert::set_control_ids (const XMLNode& node, int version) { const XMLNodeList& nlist = node.children(); - XMLNodeConstIterator iter; - set::const_iterator p; - for (iter = nlist.begin(); iter != nlist.end(); ++iter) { - if ((*iter)->name() == Controllable::xml_node_name) { + for (XMLNodeConstIterator iter = nlist.begin(); iter != nlist.end(); ++iter) { + if ((*iter)->name() != Controllable::xml_node_name) { + continue; + } - uint32_t p = (uint32_t)-1; + uint32_t p = (uint32_t)-1; #ifdef LV2_SUPPORT - std::string str; - if ((*iter)->get_property (X_("symbol"), str)) { - boost::shared_ptr lv2plugin = boost::dynamic_pointer_cast (_plugins[0]); - if (lv2plugin) { - p = lv2plugin->port_index(str.c_str()); - } + std::string str; + if ((*iter)->get_property (X_("symbol"), str)) { + boost::shared_ptr lv2plugin = boost::dynamic_pointer_cast (_plugins[0]); + if (lv2plugin) { + p = lv2plugin->port_index(str.c_str()); } + } #endif - if (p == (uint32_t)-1) { - (*iter)->get_property (X_("parameter"), p); - } - - if (p != (uint32_t)-1) { + if (p == (uint32_t)-1) { + (*iter)->get_property (X_("parameter"), p); + } - /* this may create the new controllable */ + if (p == (uint32_t)-1) { + continue; + } - boost::shared_ptr c = control (Evoral::Parameter (PluginAutomation, 0, p)); + /* this may create the new controllable */ + boost::shared_ptr c = control (Evoral::Parameter (PluginAutomation, 0, p)); #ifndef NO_PLUGIN_STATE - if (!c) { - continue; - } - boost::shared_ptr ac = boost::dynamic_pointer_cast (c); - if (ac) { - ac->set_state (**iter, version); - } + if (!c) { + continue; + } + boost::shared_ptr ac = boost::dynamic_pointer_cast (c); + if (ac) { + ac->set_state (**iter, version); + } #endif } } @@ -2661,7 +2662,7 @@ PluginInsert::set_state(const XMLNode& node, int version) if (_plugins.empty()) { /* if we are adding the first plugin, we will need to set - up automatable controls. + * up automatable controls. */ add_plugin (plugin); create_automatable_parameters (); -- cgit v1.2.3