From b43d5183158b3a7e6da932ff4acaa5da364f7b5f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 22 Feb 2011 07:08:16 +0000 Subject: Tidy. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3008 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/NodeModule.cpp | 46 ++++++++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp index 7e75d501..ea4c8079 100644 --- a/src/gui/NodeModule.cpp +++ b/src/gui/NodeModule.cpp @@ -53,13 +53,19 @@ NodeModule::NodeModule(boost::shared_ptr canvas, SharedPtrsignal_new_port.connect(sigc::bind(sigc::mem_fun(this, &NodeModule::add_port), true)); - node->signal_removed_port.connect(sigc::hide_return(sigc::mem_fun(this, &NodeModule::remove_port))); - node->signal_property.connect(sigc::mem_fun(this, &NodeModule::property_changed)); - node->signal_moved.connect(sigc::mem_fun(this, &NodeModule::rename)); + node->signal_new_port.connect( + sigc::bind(sigc::mem_fun(this, &NodeModule::add_port), true)); + node->signal_removed_port.connect( + sigc::hide_return(sigc::mem_fun(this, &NodeModule::remove_port))); + node->signal_property.connect( + sigc::mem_fun(this, &NodeModule::property_changed)); + node->signal_moved.connect( + sigc::mem_fun(this, &NodeModule::rename)); + PluginModel* plugin = dynamic_cast(node->plugin()); - if (plugin) + if (plugin) { plugin->signal_changed.connect(sigc::mem_fun(this, &NodeModule::plugin_changed)); + } } @@ -76,15 +82,18 @@ NodeModule::create_menu() Glib::RefPtr xml = GladeFactory::new_glade_reference(); xml->get_widget_derived("object_menu", _menu); _menu->init(_node); - _menu->signal_embed_gui.connect(sigc::mem_fun(this, &NodeModule::embed_gui)); - _menu->signal_popup_gui.connect(sigc::hide_return(sigc::mem_fun(this, &NodeModule::popup_gui))); - + _menu->signal_embed_gui.connect( + sigc::mem_fun(this, &NodeModule::embed_gui)); + _menu->signal_popup_gui.connect( + sigc::hide_return(sigc::mem_fun(this, &NodeModule::popup_gui))); set_menu(_menu); } boost::shared_ptr -NodeModule::create(boost::shared_ptr canvas, SharedPtr node, bool human) +NodeModule::create(boost::shared_ptr canvas, + SharedPtr node, + bool human) { boost::shared_ptr ret; @@ -94,10 +103,12 @@ NodeModule::create(boost::shared_ptr canvas, SharedPtr n else ret = boost::shared_ptr(new NodeModule(canvas, node)); - for (GraphObject::Properties::const_iterator m = node->properties().begin(); m != node->properties().end(); ++m) + for (GraphObject::Properties::const_iterator m = node->properties().begin(); + m != node->properties().end(); ++m) ret->property_changed(m->first, m->second); - for (NodeModel::Ports::const_iterator p = node->ports().begin(); p != node->ports().end(); ++p) + for (NodeModel::Ports::const_iterator p = node->ports().begin(); + p != node->ports().end(); ++p) ret->add_port(*p, false); ret->set_stacked_border(node->polyphonic()); @@ -191,7 +202,6 @@ NodeModule::embed_gui(bool embed) if (!_plugin_ui) { const PluginModel* const pm = dynamic_cast(_node->plugin()); - assert(pm); _plugin_ui = pm->ui(App::instance().world(), _node); } @@ -221,9 +231,12 @@ NodeModule::embed_gui(bool embed) FlowCanvas::Module::embed(NULL); _plugin_ui.reset(); - for (NodeModel::Ports::const_iterator p = _node->ports().begin(); p != _node->ports().end(); ++p) + for (NodeModel::Ports::const_iterator p = _node->ports().begin(); + p != _node->ports().end(); ++p) if ((*p)->is_output() && App::instance().can_control(p->get())) - App::instance().engine()->set_property((*p)->path(), uris.ingen_broadcast, false); + App::instance().engine()->set_property((*p)->path(), + uris.ingen_broadcast, + false); } if (embed && _embed_item) { @@ -339,8 +352,9 @@ NodeModule::on_gui_window_close() void NodeModule::set_control_values() { - uint32_t index=0; - for (NodeModel::Ports::const_iterator p = _node->ports().begin(); p != _node->ports().end(); ++p) { + uint32_t index = 0; + for (NodeModel::Ports::const_iterator p = _node->ports().begin(); + p != _node->ports().end(); ++p) { if (App::instance().can_control(p->get())) value_changed(index, (*p)->value()); ++index; -- cgit v1.2.1