diff options
author | David Robillard <d@drobilla.net> | 2012-08-18 23:05:06 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-08-18 23:05:06 +0000 |
commit | 317627ef40f7654c298aa1ac707851c852259e3a (patch) | |
tree | 38f7ed57aafb7b3b8e21e6caa3429a39207e4a9a /src/gui | |
parent | 160b2baf7df8b960f22619c013b3197c0dc51c2b (diff) | |
download | ingen-317627ef40f7654c298aa1ac707851c852259e3a.tar.gz ingen-317627ef40f7654c298aa1ac707851c852259e3a.tar.bz2 ingen-317627ef40f7654c298aa1ac707851c852259e3a.zip |
Node => Block
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4720 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/App.cpp | 2 | ||||
-rw-r--r-- | src/gui/LoadPatchWindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/LoadPluginWindow.cpp | 36 | ||||
-rw-r--r-- | src/gui/LoadPluginWindow.hpp | 2 | ||||
-rw-r--r-- | src/gui/NewSubpatchWindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/NodeMenu.cpp | 26 | ||||
-rw-r--r-- | src/gui/NodeMenu.hpp | 4 | ||||
-rw-r--r-- | src/gui/NodeModule.cpp | 99 | ||||
-rw-r--r-- | src/gui/NodeModule.hpp | 22 | ||||
-rw-r--r-- | src/gui/PatchBox.cpp | 14 | ||||
-rw-r--r-- | src/gui/PatchCanvas.cpp | 42 | ||||
-rw-r--r-- | src/gui/PatchCanvas.hpp | 4 | ||||
-rw-r--r-- | src/gui/PatchPortModule.cpp | 2 | ||||
-rw-r--r-- | src/gui/PatchPortModule.hpp | 1 | ||||
-rw-r--r-- | src/gui/PatchView.cpp | 4 | ||||
-rw-r--r-- | src/gui/Port.cpp | 18 | ||||
-rw-r--r-- | src/gui/PortMenu.cpp | 28 | ||||
-rw-r--r-- | src/gui/PortPropertiesWindow.cpp | 4 | ||||
-rw-r--r-- | src/gui/PropertiesWindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/PropertiesWindow.hpp | 2 | ||||
-rw-r--r-- | src/gui/SubpatchModule.cpp | 6 | ||||
-rw-r--r-- | src/gui/SubpatchModule.hpp | 3 | ||||
-rw-r--r-- | src/gui/WindowFactory.cpp | 6 | ||||
-rw-r--r-- | src/gui/WindowFactory.hpp | 6 |
24 files changed, 166 insertions, 171 deletions
diff --git a/src/gui/App.cpp b/src/gui/App.cpp index cfba10c7..de35de54 100644 --- a/src/gui/App.cpp +++ b/src/gui/App.cpp @@ -112,7 +112,7 @@ App::create(Ingen::World* world) app->_about_dialog->property_logo_icon_name() = "ingen"; gtk_window_set_default_icon_name("ingen"); - // Set style for embedded node GUIs + // Set style for embedded block GUIs const string rc_style = "style \"ingen_embedded_node_gui_style\" {\n" "bg[NORMAL] = \"#212222\"\n" diff --git a/src/gui/LoadPatchWindow.cpp b/src/gui/LoadPatchWindow.cpp index 57c932af..7ba348a6 100644 --- a/src/gui/LoadPatchWindow.cpp +++ b/src/gui/LoadPatchWindow.cpp @@ -22,8 +22,8 @@ #include <glibmm/miscutils.h> #include "ingen/Interface.hpp" +#include "ingen/client/BlockModel.hpp" #include "ingen/client/ClientStore.hpp" -#include "ingen/client/NodeModel.hpp" #include "ingen/client/PatchModel.hpp" #include "ingen/runtime_paths.hpp" diff --git a/src/gui/LoadPluginWindow.cpp b/src/gui/LoadPluginWindow.cpp index 69a4f53c..f5f7a7d7 100644 --- a/src/gui/LoadPluginWindow.cpp +++ b/src/gui/LoadPluginWindow.cpp @@ -50,7 +50,7 @@ LoadPluginWindow::LoadPluginWindow(BaseObjectType* cobject, { xml->get_widget("load_plugin_plugins_treeview", _plugins_treeview); xml->get_widget("load_plugin_polyphonic_checkbutton", _polyphonic_checkbutton); - xml->get_widget("load_plugin_name_entry", _node_name_entry); + xml->get_widget("load_plugin_name_entry", _name_entry); xml->get_widget("load_plugin_add_button", _add_button); xml->get_widget("load_plugin_close_button", _close_button); @@ -98,7 +98,7 @@ LoadPluginWindow::LoadPluginWindow(BaseObjectType* cobject, sigc::mem_fun(this, &LoadPluginWindow::add_clicked)); _search_entry->signal_changed().connect( sigc::mem_fun(this, &LoadPluginWindow::filter_changed)); - _node_name_entry->signal_changed().connect( + _name_entry->signal_changed().connect( sigc::mem_fun(this, &LoadPluginWindow::name_changed)); #ifdef HAVE_NEW_GTKMM @@ -131,7 +131,7 @@ LoadPluginWindow::name_changed() { // Toggle add button sensitivity according name legality if (_selection->get_selected_rows().size() == 1) { - const string sym = _node_name_entry->get_text(); + const string sym = _name_entry->get_text(); if (!Raul::Symbol::is_valid(sym)) { _add_button->property_sensitive() = false; } else if (_app->store()->find(_patch->path().child(Raul::Symbol(sym))) @@ -282,8 +282,8 @@ LoadPluginWindow::plugin_selection_changed() size_t n_selected = _selection->get_selected_rows().size(); if (n_selected == 0) { _name_offset = 0; - _node_name_entry->set_text(""); - _node_name_entry->set_sensitive(false); + _name_entry->set_text(""); + _name_entry->set_sensitive(false); } else if (n_selected == 1) { Gtk::TreeModel::iterator iter = _plugins_liststore->get_iter( *_selection->get_selected_rows().begin()); @@ -292,17 +292,17 @@ LoadPluginWindow::plugin_selection_changed() boost::shared_ptr<const PluginModel> p = row.get_value( _plugins_columns._col_plugin); _name_offset = _app->store()->child_name_offset( - _patch->path(), p->default_node_symbol()); - _node_name_entry->set_text(generate_module_name(p, _name_offset)); - _node_name_entry->set_sensitive(true); + _patch->path(), p->default_block_symbol()); + _name_entry->set_text(generate_module_name(p, _name_offset)); + _name_entry->set_sensitive(true); } else { _name_offset = 0; - _node_name_entry->set_text(""); - _node_name_entry->set_sensitive(false); + _name_entry->set_text(""); + _name_entry->set_sensitive(false); } } else { - _node_name_entry->set_text(""); - _node_name_entry->set_sensitive(false); + _name_entry->set_text(""); + _name_entry->set_sensitive(false); } } @@ -317,7 +317,7 @@ LoadPluginWindow::generate_module_name(SharedPtr<const PluginModel> plugin, int offset) { std::stringstream ss; - ss << plugin->default_node_symbol(); + ss << plugin->default_block_symbol(); if (offset != 0) ss << "_" << offset; return ss.str(); @@ -330,14 +330,14 @@ LoadPluginWindow::load_plugin(const Gtk::TreeModel::iterator& iter) Gtk::TreeModel::Row row = *iter; SharedPtr<const PluginModel> plugin = row.get_value(_plugins_columns._col_plugin); bool polyphonic = _polyphonic_checkbutton->get_active(); - string name = _node_name_entry->get_text(); + string name = _name_entry->get_text(); if (name.empty()) name = generate_module_name(plugin, _name_offset); if (name.empty() || !Raul::Symbol::is_valid(name)) { Gtk::MessageDialog dialog(*this, - "Unable to chose a default name for this node. Please enter a name.", + "Unable to choose a default name, please provide one", false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true); dialog.run(); @@ -345,7 +345,7 @@ LoadPluginWindow::load_plugin(const Gtk::TreeModel::iterator& iter) Raul::Path path = _patch->path().child(Raul::Symbol::symbolify(name)); Resource::Properties props = _initial_data; props.insert(make_pair(uris.rdf_type, - uris.ingen_Node)); + uris.ingen_Block)); props.insert(make_pair(uris.ingen_prototype, _app->forge().alloc_uri(plugin->uri()))); props.insert(make_pair(uris.ingen_polyphonic, @@ -354,10 +354,10 @@ LoadPluginWindow::load_plugin(const Gtk::TreeModel::iterator& iter) if (_selection->get_selected_rows().size() == 1) { _name_offset = (_name_offset == 0) ? 2 : _name_offset + 1; - _node_name_entry->set_text(generate_module_name(plugin, _name_offset)); + _name_entry->set_text(generate_module_name(plugin, _name_offset)); } - // Cascade next node + // Cascade next block Raul::Atom& x = _initial_data.find(uris.ingen_canvasX)->second; x = _app->forge().make(x.get_float() + 20.0f); Raul::Atom& y = _initial_data.find(uris.ingen_canvasY)->second; diff --git a/src/gui/LoadPluginWindow.hpp b/src/gui/LoadPluginWindow.hpp index 081bc6cc..e9b874a2 100644 --- a/src/gui/LoadPluginWindow.hpp +++ b/src/gui/LoadPluginWindow.hpp @@ -147,7 +147,7 @@ private: bool _refresh_list; Gtk::TreeView* _plugins_treeview; Gtk::CheckButton* _polyphonic_checkbutton; - Gtk::Entry* _node_name_entry; + Gtk::Entry* _name_entry; Gtk::Button* _close_button; Gtk::Button* _add_button; Gtk::ComboBox* _filter_combo; diff --git a/src/gui/NewSubpatchWindow.cpp b/src/gui/NewSubpatchWindow.cpp index fbdc5f0d..1124afb3 100644 --- a/src/gui/NewSubpatchWindow.cpp +++ b/src/gui/NewSubpatchWindow.cpp @@ -101,7 +101,7 @@ NewSubpatchWindow::ok_clicked() props.insert(make_pair(_app->uris().ingen_enabled, _app->forge().make(bool(true)))); _app->interface()->put(GraphObject::path_to_uri(path), props, Resource::INTERNAL); - // Set external (node perspective) properties + // Set external (block perspective) properties props = _initial_data; props.insert(make_pair(_app->uris().rdf_type, _app->uris().ingen_Patch)); _app->interface()->put(GraphObject::path_to_uri(path), _initial_data, Resource::EXTERNAL); diff --git a/src/gui/NodeMenu.cpp b/src/gui/NodeMenu.cpp index 35a35c39..fe01c713 100644 --- a/src/gui/NodeMenu.cpp +++ b/src/gui/NodeMenu.cpp @@ -21,7 +21,7 @@ #include "ingen/Interface.hpp" #include "ingen/Log.hpp" -#include "ingen/client/NodeModel.hpp" +#include "ingen/client/BlockModel.hpp" #include "ingen/client/PluginModel.hpp" #include "lv2/lv2plug.in/ns/ext/presets/presets.h" @@ -49,9 +49,9 @@ NodeMenu::NodeMenu(BaseObjectType* cobject, } void -NodeMenu::init(App& app, SharedPtr<const Client::NodeModel> node) +NodeMenu::init(App& app, SharedPtr<const Client::BlockModel> block) { - ObjectMenu::init(app, node); + ObjectMenu::init(app, block); _learn_menuitem->signal_activate().connect(sigc::mem_fun(this, &NodeMenu::on_menu_learn)); @@ -62,11 +62,11 @@ NodeMenu::init(App& app, SharedPtr<const Client::NodeModel> node) _randomize_menuitem->signal_activate().connect( sigc::mem_fun(this, &NodeMenu::on_menu_randomize)); - const PluginModel* plugin = dynamic_cast<const PluginModel*>(node->plugin()); + const PluginModel* plugin = dynamic_cast<const PluginModel*>(block->plugin()); if (plugin && plugin->type() == PluginModel::LV2 && plugin->has_ui()) { _popup_gui_menuitem->show(); _embed_gui_menuitem->show(); - const Raul::Atom& ui_embedded = node->get_property( + const Raul::Atom& ui_embedded = block->get_property( _app->uris().ingen_uiEmbedded); _embed_gui_menuitem->set_active( ui_embedded.is_valid() && ui_embedded.get_bool()); @@ -150,11 +150,11 @@ NodeMenu::on_menu_randomize() { _app->interface()->bundle_begin(); - const NodeModel* const nm = (const NodeModel*)_object.get(); - for (NodeModel::Ports::const_iterator i = nm->ports().begin(); i != nm->ports().end(); ++i) { + const BlockModel* const bm = (const BlockModel*)_object.get(); + for (BlockModel::Ports::const_iterator i = bm->ports().begin(); i != bm->ports().end(); ++i) { if ((*i)->is_input() && _app->can_control(i->get())) { float min = 0.0f, max = 1.0f; - nm->port_value_range(*i, min, max, _app->sample_rate()); + bm->port_value_range(*i, min, max, _app->sample_rate()); const float val = g_random_double_range(0.0, 1.0) * (max - min) + min; _app->interface()->set_property( (*i)->uri(), @@ -175,8 +175,8 @@ NodeMenu::on_menu_disconnect() void NodeMenu::on_preset_activated(const std::string& uri) { - const NodeModel* const node = (const NodeModel*)_object.get(); - const PluginModel* const plugin = dynamic_cast<const PluginModel*>(node->plugin()); + const BlockModel* const block = (const BlockModel*)_object.get(); + const PluginModel* const plugin = dynamic_cast<const PluginModel*>(block->plugin()); LilvNode* port_pred = lilv_new_uri(plugin->lilv_world(), LV2_CORE__port); @@ -202,7 +202,7 @@ NodeMenu::on_preset_activated(const std::string& uri) const LilvNode* sym = lilv_nodes_get_first(symbols); _app->interface()->set_property( GraphObject::path_to_uri( - node->path().child(Raul::Symbol(lilv_node_as_string(sym)))), + block->path().child(Raul::Symbol(lilv_node_as_string(sym)))), _app->uris().ingen_value, _app->forge().make(lilv_node_as_float(val))); } @@ -224,8 +224,8 @@ NodeMenu::on_preset_clicked(const std::string& uri, GdkEventButton* ev) bool NodeMenu::has_control_inputs() { - const NodeModel* const nm = (const NodeModel*)_object.get(); - for (NodeModel::Ports::const_iterator i = nm->ports().begin(); i != nm->ports().end(); ++i) + const BlockModel* const bm = (const BlockModel*)_object.get(); + for (BlockModel::Ports::const_iterator i = bm->ports().begin(); i != bm->ports().end(); ++i) if ((*i)->is_input() && (*i)->is_numeric()) return true; diff --git a/src/gui/NodeMenu.hpp b/src/gui/NodeMenu.hpp index 07a25367..b307b9a4 100644 --- a/src/gui/NodeMenu.hpp +++ b/src/gui/NodeMenu.hpp @@ -24,7 +24,7 @@ #include <gtkmm/menushell.h> #include "ObjectMenu.hpp" -#include "ingen/client/NodeModel.hpp" +#include "ingen/client/BlockModel.hpp" #include "raul/SharedPtr.hpp" namespace Ingen { @@ -40,7 +40,7 @@ public: NodeMenu(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& xml); - void init(App& app, SharedPtr<const Client::NodeModel> node); + void init(App& app, SharedPtr<const Client::BlockModel> block); bool has_control_inputs(); diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp index 89ecc4a1..bbd569fc 100644 --- a/src/gui/NodeModule.cpp +++ b/src/gui/NodeModule.cpp @@ -23,7 +23,7 @@ #include "ingen/Interface.hpp" #include "ingen/Log.hpp" -#include "ingen/client/NodeModel.hpp" +#include "ingen/client/BlockModel.hpp" #include "ingen/client/PatchModel.hpp" #include "ingen/client/PluginModel.hpp" #include "ingen/client/PluginUI.hpp" @@ -49,22 +49,20 @@ using namespace Client; namespace GUI { -NodeModule::NodeModule(PatchCanvas& canvas, - SharedPtr<const NodeModel> node) - : Ganv::Module(canvas, node->path().symbol(), 0, 0, true) - , _node(node) +NodeModule::NodeModule(PatchCanvas& canvas, + SharedPtr<const BlockModel> block) + : Ganv::Module(canvas, block->path().symbol(), 0, 0, true) + , _block(block) , _gui_widget(NULL) , _gui_window(NULL) { - assert(_node); - - node->signal_new_port().connect( + block->signal_new_port().connect( sigc::mem_fun(this, &NodeModule::new_port_view)); - node->signal_removed_port().connect( + block->signal_removed_port().connect( sigc::hide_return(sigc::mem_fun(this, &NodeModule::delete_port_view))); - node->signal_property().connect( + block->signal_property().connect( sigc::mem_fun(this, &NodeModule::property_changed)); - node->signal_moved().connect( + block->signal_moved().connect( sigc::mem_fun(this, &NodeModule::rename)); signal_event().connect( @@ -73,7 +71,7 @@ NodeModule::NodeModule(PatchCanvas& canvas, signal_moved().connect( sigc::mem_fun(this, &NodeModule::store_location)); - const PluginModel* plugin = dynamic_cast<const PluginModel*>(node->plugin()); + const PluginModel* plugin = dynamic_cast<const PluginModel*>(block->plugin()); if (plugin) { plugin->signal_changed().connect( sigc::mem_fun(this, &NodeModule::plugin_changed)); @@ -90,7 +88,7 @@ bool NodeModule::show_menu(GdkEventButton* ev) { WidgetFactory::get_widget_derived("object_menu", _menu); - _menu->init(app(), _node); + _menu->init(app(), _block); _menu->signal_embed_gui.connect( sigc::mem_fun(this, &NodeModule::on_embed_gui_toggled)); _menu->signal_popup_gui.connect( @@ -100,27 +98,25 @@ NodeModule::show_menu(GdkEventButton* ev) } NodeModule* -NodeModule::create(PatchCanvas& canvas, - SharedPtr<const NodeModel> node, - bool human) +NodeModule::create(PatchCanvas& canvas, + SharedPtr<const BlockModel> block, + bool human) { - NodeModule* ret; - - SharedPtr<const PatchModel> patch = PtrCast<const PatchModel>(node); - if (patch) - ret = new SubpatchModule(canvas, patch); - else - ret = new NodeModule(canvas, node); - - for (GraphObject::Properties::const_iterator m = node->properties().begin(); - m != node->properties().end(); ++m) + SharedPtr<const PatchModel> patch = PtrCast<const PatchModel>(block); + + NodeModule* ret = (patch) + ? new SubpatchModule(canvas, patch) + : new NodeModule(canvas, block); + + for (GraphObject::Properties::const_iterator m = block->properties().begin(); + m != block->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 (BlockModel::Ports::const_iterator p = block->ports().begin(); + p != block->ports().end(); ++p) ret->new_port_view(*p); - ret->set_stacked(node->polyphonic()); + ret->set_stacked(block->polyphonic()); if (human) ret->show_human_names(human); // FIXME: double port iteration @@ -140,9 +136,9 @@ NodeModule::show_human_names(bool b) const URIs& uris = app().uris(); if (b) { - set_label(node()->label().c_str()); + set_label(block()->label().c_str()); } else { - set_label(node()->symbol().c_str()); + set_label(block()->symbol().c_str()); } for (iterator i = begin(); i != end(); ++i) { @@ -153,7 +149,7 @@ NodeModule::show_human_names(bool b) if (name_property.type() == uris.forge.String) { label = name_property.get_string(); } else { - Glib::ustring hn = node()->plugin_model()->port_human_name( + Glib::ustring hn = block()->plugin_model()->port_human_name( port->model()->index()); if (!hn.empty()) label = hn; @@ -210,7 +206,7 @@ void NodeModule::on_embed_gui_toggled(bool embed) { embed_gui(embed); - app().interface()->set_property(_node->uri(), + app().interface()->set_property(_block->uri(), app().uris().ingen_uiEmbedded, app().forge().make(embed)); } @@ -225,8 +221,8 @@ NodeModule::embed_gui(bool embed) } if (!_plugin_ui) { - const PluginModel* const pm = dynamic_cast<const PluginModel*>(_node->plugin()); - _plugin_ui = pm->ui(app().world(), _node); + const PluginModel* const pm = dynamic_cast<const PluginModel*>(_block->plugin()); + _plugin_ui = pm->ui(app().world(), _block); } if (_plugin_ui) { @@ -257,7 +253,7 @@ void NodeModule::rename() { if (app().configuration()->name_style() == Configuration::PATH) { - set_label(_node->path().symbol()); + set_label(_block->path().symbol()); } } @@ -295,23 +291,23 @@ NodeModule::delete_port_view(SharedPtr<const PortModel> model) delete p; } else { app().log().warn(Raul::fmt("Failed to find port %1% on module %2%\n") - % model->path() % _node->path()); + % model->path() % _block->path()); } } bool NodeModule::popup_gui() { - if (_node->plugin() && _node->plugin()->type() == PluginModel::LV2) { + if (_block->plugin() && _block->plugin()->type() == PluginModel::LV2) { if (_plugin_ui) { app().log().warn("LV2 GUI already embedded, cannot pop up\n"); return false; } - const PluginModel* const plugin = dynamic_cast<const PluginModel*>(_node->plugin()); + const PluginModel* const plugin = dynamic_cast<const PluginModel*>(_block->plugin()); assert(plugin); - _plugin_ui = plugin->ui(app().world(), _node); + _plugin_ui = plugin->ui(app().world(), _block); if (_plugin_ui) { GtkWidget* c_widget = (GtkWidget*)_plugin_ui->get_widget(); @@ -321,7 +317,7 @@ NodeModule::popup_gui() if (!_plugin_ui->is_resizable()) { _gui_window->set_resizable(false); } - _gui_window->set_title(_node->path() + " UI - Ingen"); + _gui_window->set_title(_block->path() + " UI - Ingen"); _gui_window->set_role("plugin_ui"); _gui_window->add(*_gui_widget); _gui_widget->show_all(); @@ -333,7 +329,7 @@ NodeModule::popup_gui() return true; } else { - app().log().warn(Raul::fmt("No LV2 GUI for %1%\n") % _node->path()); + app().log().warn(Raul::fmt("No LV2 GUI for %1%\n") % _block->path()); } } @@ -353,10 +349,11 @@ void NodeModule::set_control_values() { uint32_t index = 0; - for (NodeModel::Ports::const_iterator p = _node->ports().begin(); - p != _node->ports().end(); ++p) { - if (app().can_control(p->get())) + for (BlockModel::Ports::const_iterator p = _block->ports().begin(); + p != _block->ports().end(); ++p) { + if (app().can_control(p->get())) { value_changed(index, (*p)->value()); + } ++index; } } @@ -387,8 +384,8 @@ NodeModule::store_location(double ax, double ay) const Raul::Atom x(app().forge().make(static_cast<float>(ax))); const Raul::Atom y(app().forge().make(static_cast<float>(ay))); - if (x != _node->get_property(uris.ingen_canvasX) || - y != _node->get_property(uris.ingen_canvasY)) + if (x != _block->get_property(uris.ingen_canvasX) || + y != _block->get_property(uris.ingen_canvasY)) { Resource::Properties remove; remove.insert(make_pair(uris.ingen_canvasX, uris.wildcard)); @@ -396,7 +393,7 @@ NodeModule::store_location(double ax, double ay) Resource::Properties add; add.insert(make_pair(uris.ingen_canvasX, x)); add.insert(make_pair(uris.ingen_canvasY, y)); - app().interface()->delta(_node->uri(), remove, add); + app().interface()->delta(_block->uri(), remove, add); } } @@ -435,12 +432,12 @@ NodeModule::set_selected(gboolean b) Ganv::Module::set_selected(b); #if 0 if (b) { - PatchWindow* win = app().window_factory()->parent_patch_window(node()); + PatchWindow* win = app().window_factory()->parent_patch_window(block()); if (win) { std::string doc; bool html = false; - if (node()->plugin_model()) { - doc = node()->plugin_model()->documentation(&html); + if (block()->plugin_model()) { + doc = block()->plugin_model()->documentation(&html); } if (!doc.empty()) { win->show_documentation(doc, html); diff --git a/src/gui/NodeModule.hpp b/src/gui/NodeModule.hpp index 42ad0fc4..73295d1a 100644 --- a/src/gui/NodeModule.hpp +++ b/src/gui/NodeModule.hpp @@ -25,7 +25,7 @@ namespace Raul { class Atom; } namespace Ingen { namespace Client { - class NodeModel; + class BlockModel; class PluginUI; class PortModel; } } @@ -47,9 +47,9 @@ class NodeModule : public Ganv::Module { public: static NodeModule* create( - PatchCanvas& canvas, - SharedPtr<const Client::NodeModel> node, - bool human_names); + PatchCanvas& canvas, + SharedPtr<const Client::BlockModel> block, + bool human_names); virtual ~NodeModule(); @@ -63,10 +63,10 @@ public: void show_human_names(bool b); void set_selected(gboolean b); - SharedPtr<const Client::NodeModel> node() const { return _node; } + SharedPtr<const Client::BlockModel> block() const { return _block; } protected: - NodeModule(PatchCanvas& canvas, SharedPtr<const Client::NodeModel> node); + NodeModule(PatchCanvas& canvas, SharedPtr<const Client::BlockModel> block); virtual bool on_double_click(GdkEventButton* ev); @@ -89,11 +89,11 @@ protected: bool show_menu(GdkEventButton* ev); - SharedPtr<const Client::NodeModel> _node; - NodeMenu* _menu; - SharedPtr<Client::PluginUI> _plugin_ui; - Gtk::Widget* _gui_widget; - Gtk::Window* _gui_window; ///< iff popped up + SharedPtr<const Client::BlockModel> _block; + NodeMenu* _menu; + SharedPtr<Client::PluginUI> _plugin_ui; + Gtk::Widget* _gui_widget; + Gtk::Window* _gui_window; ///< iff popped up }; } // namespace GUI diff --git a/src/gui/PatchBox.cpp b/src/gui/PatchBox.cpp index 9150585a..ea3de513 100644 --- a/src/gui/PatchBox.cpp +++ b/src/gui/PatchBox.cpp @@ -257,7 +257,7 @@ PatchBox::set_patch(SharedPtr<const PatchModel> patch, _menu_view_control_window->property_sensitive() = false; - for (NodeModel::Ports::const_iterator p = patch->ports().begin(); + for (BlockModel::Ports::const_iterator p = patch->ports().begin(); p != patch->ports().end(); ++p) { if (_app->can_control(p->get())) { _menu_view_control_window->property_sensitive() = true; @@ -296,7 +296,7 @@ PatchBox::patch_port_removed(SharedPtr<const PortModel> port) if (!(port->is_input() && _app->can_control(port.get()))) return; - for (NodeModel::Ports::const_iterator i = _patch->ports().begin(); + for (BlockModel::Ports::const_iterator i = _patch->ports().begin(); i != _patch->ports().end(); ++i) { if ((*i)->is_input() && _app->can_control(i->get())) { _menu_view_control_window->property_sensitive() = true; @@ -342,14 +342,14 @@ PatchBox::show_status(const ObjectModel* model) std::stringstream msg; msg << model->path(); - const PortModel* port = 0; - const NodeModel* node = 0; + const PortModel* port = 0; + const BlockModel* block = 0; if ((port = dynamic_cast<const PortModel*>(model))) { show_port_status(port, port->value()); - } else if ((node = dynamic_cast<const NodeModel*>(model))) { - const PluginModel* plugin = dynamic_cast<const PluginModel*>(node->plugin()); + } else if ((block = dynamic_cast<const BlockModel*>(model))) { + const PluginModel* plugin = dynamic_cast<const PluginModel*>(block->plugin()); if (plugin) msg << ((boost::format(" (%1%)") % plugin->human_name()).str()); _status_bar->push(msg.str(), STATUS_CONTEXT_HOVER); @@ -362,7 +362,7 @@ PatchBox::show_port_status(const PortModel* port, const Raul::Atom& value) std::stringstream msg; msg << port->path(); - const NodeModel* parent = dynamic_cast<const NodeModel*>(port->parent().get()); + const BlockModel* parent = dynamic_cast<const BlockModel*>(port->parent().get()); if (parent) { const PluginModel* plugin = dynamic_cast<const PluginModel*>(parent->plugin()); if (plugin) { diff --git a/src/gui/PatchCanvas.cpp b/src/gui/PatchCanvas.cpp index bc103d50..d680a9b8 100644 --- a/src/gui/PatchCanvas.cpp +++ b/src/gui/PatchCanvas.cpp @@ -30,7 +30,7 @@ #include "ingen/Log.hpp" #include "ingen/World.hpp" #include "ingen/client/ClientStore.hpp" -#include "ingen/client/NodeModel.hpp" +#include "ingen/client/BlockModel.hpp" #include "ingen/client/PatchModel.hpp" #include "ingen/client/PluginModel.hpp" #include "ingen/serialisation/Serialiser.hpp" @@ -123,10 +123,10 @@ PatchCanvas::PatchCanvas(App& app, sigc::mem_fun(this, &PatchCanvas::disconnect)); // Connect to model signals to track state - _patch->signal_new_node().connect( - sigc::mem_fun(this, &PatchCanvas::add_node)); - _patch->signal_removed_node().connect( - sigc::mem_fun(this, &PatchCanvas::remove_node)); + _patch->signal_new_block().connect( + sigc::mem_fun(this, &PatchCanvas::add_block)); + _patch->signal_removed_block().connect( + sigc::mem_fun(this, &PatchCanvas::remove_block)); _patch->signal_new_port().connect( sigc::mem_fun(this, &PatchCanvas::add_port)); _patch->signal_removed_port().connect( @@ -289,15 +289,15 @@ PatchCanvas::build() { const Store::const_range kids = _app.store()->children_range(_patch); - // Create modules for nodes + // Create modules for blocks for (Store::const_iterator i = kids.first; i != kids.second; ++i) { - SharedPtr<NodeModel> node = PtrCast<NodeModel>(i->second); - if (node && node->parent() == _patch) - add_node(node); + SharedPtr<BlockModel> block = PtrCast<BlockModel>(i->second); + if (block && block->parent() == _patch) + add_block(block); } // Create pseudo modules for ports (ports on this canvas, not on our module) - for (NodeModel::Ports::const_iterator i = _patch->ports().begin(); + for (BlockModel::Ports::const_iterator i = _patch->ports().begin(); i != _patch->ports().end(); ++i) { add_port(*i); } @@ -392,30 +392,30 @@ PatchCanvas::add_plugin(SharedPtr<PluginModel> p) } void -PatchCanvas::add_node(SharedPtr<const NodeModel> nm) +PatchCanvas::add_block(SharedPtr<const BlockModel> bm) { - SharedPtr<const PatchModel> pm = PtrCast<const PatchModel>(nm); + SharedPtr<const PatchModel> pm = PtrCast<const PatchModel>(bm); NodeModule* module; if (pm) { module = SubpatchModule::create(*this, pm, _human_names); } else { - module = NodeModule::create(*this, nm, _human_names); + module = NodeModule::create(*this, bm, _human_names); //const PluginModel* plugm = dynamic_cast<const PluginModel*>(nm->plugin()); //if (plugm && !plugm->icon_path().empty()) // module->set_icon(_app.icon_from_path(plugm->icon_path(), 100).operator->()); } module->show(); - _views.insert(std::make_pair(nm, module)); - if (_pastees.find(nm->path()) != _pastees.end()) { + _views.insert(std::make_pair(bm, module)); + if (_pastees.find(bm->path()) != _pastees.end()) { module->set_selected(true); } } void -PatchCanvas::remove_node(SharedPtr<const NodeModel> nm) +PatchCanvas::remove_block(SharedPtr<const BlockModel> bm) { - Views::iterator i = _views.find(nm); + Views::iterator i = _views.find(bm); if (i != _views.end()) { const guint n_ports = i->second->num_ports(); @@ -617,7 +617,7 @@ destroy_node(GanvNode* node, void* data) NodeModule* node_module = dynamic_cast<NodeModule*>(module); if (node_module) { - app->interface()->del(node_module->node()->uri()); + app->interface()->del(node_module->block()->uri()); } else { PatchPortModule* port_module = dynamic_cast<PatchPortModule*>(module); if (port_module) { @@ -656,7 +656,7 @@ serialise_node(GanvNode* node, void* data) NodeModule* node_module = dynamic_cast<NodeModule*>(module); if (node_module) { - serialiser->serialise(node_module->node()); + serialiser->serialise(node_module->block()); } else { PatchPortModule* port_module = dynamic_cast<PatchPortModule*>(module); if (port_module) { @@ -828,7 +828,7 @@ PatchCanvas::load_plugin(WeakPtr<PluginModel> weak_plugin) if (!plugin) return; - Raul::Symbol symbol = plugin->default_node_symbol(); + Raul::Symbol symbol = plugin->default_block_symbol(); unsigned offset = _app.store()->child_name_offset(_patch->path(), symbol); if (offset != 0) { std::stringstream ss; @@ -841,7 +841,7 @@ PatchCanvas::load_plugin(WeakPtr<PluginModel> weak_plugin) // FIXME: polyphony? GraphObject::Properties props = get_initial_data(); - props.insert(make_pair(uris.rdf_type, uris.ingen_Node)); + props.insert(make_pair(uris.rdf_type, uris.ingen_Block)); props.insert(make_pair(uris.ingen_prototype, uris.forge.alloc_uri(plugin->uri()))); _app.interface()->put(GraphObject::path_to_uri(path), props); diff --git a/src/gui/PatchCanvas.hpp b/src/gui/PatchCanvas.hpp index 47b645d6..04c30ed3 100644 --- a/src/gui/PatchCanvas.hpp +++ b/src/gui/PatchCanvas.hpp @@ -64,8 +64,8 @@ public: bool show_port_names() const { return _show_port_names; } void add_plugin(SharedPtr<Client::PluginModel> pm); - void add_node(SharedPtr<const Client::NodeModel> nm); - void remove_node(SharedPtr<const Client::NodeModel> nm); + void add_block(SharedPtr<const Client::BlockModel> bm); + void remove_block(SharedPtr<const Client::BlockModel> bm); void add_port(SharedPtr<const Client::PortModel> pm); void remove_port(SharedPtr<const Client::PortModel> pm); void connection(SharedPtr<const Client::EdgeModel> cm); diff --git a/src/gui/PatchPortModule.cpp b/src/gui/PatchPortModule.cpp index a260c35e..ec0e6a04 100644 --- a/src/gui/PatchPortModule.cpp +++ b/src/gui/PatchPortModule.cpp @@ -19,7 +19,7 @@ #include <utility> #include "ingen/Interface.hpp" -#include "ingen/client/NodeModel.hpp" +#include "ingen/client/BlockModel.hpp" #include "ingen/client/PatchModel.hpp" #include "App.hpp" diff --git a/src/gui/PatchPortModule.hpp b/src/gui/PatchPortModule.hpp index 90f9cd6d..b48bbfc4 100644 --- a/src/gui/PatchPortModule.hpp +++ b/src/gui/PatchPortModule.hpp @@ -30,7 +30,6 @@ namespace Raul { class Atom; } namespace Ingen { namespace Client { class PortModel; - class NodeModel; } } namespace Ingen { diff --git a/src/gui/PatchView.cpp b/src/gui/PatchView.cpp index e81d16f7..efb37d11 100644 --- a/src/gui/PatchView.cpp +++ b/src/gui/PatchView.cpp @@ -134,7 +134,7 @@ PatchView::canvas_item_entered(Gnome::Canvas::Item* item) { NodeModule* m = dynamic_cast<NodeModule*>(item); if (m) - signal_object_entered.emit(m->node().get()); + signal_object_entered.emit(m->block().get()); const Port* p = dynamic_cast<const Port*>(item); if (p) @@ -146,7 +146,7 @@ PatchView::canvas_item_left(Gnome::Canvas::Item* item) { NodeModule* m = dynamic_cast<NodeModule*>(item); if (m) { - signal_object_left.emit(m->node().get()); + signal_object_left.emit(m->block().get()); return; } diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp index 265b4caf..88d81fcd 100644 --- a/src/gui/Port.cpp +++ b/src/gui/Port.cpp @@ -50,7 +50,7 @@ Port::create(App& app, if (name.type() == app.forge().String) { label = name.get_string(); } else { - const SharedPtr<const NodeModel> parent(PtrCast<const NodeModel>(pm->parent())); + const SharedPtr<const BlockModel> parent(PtrCast<const BlockModel>(pm->parent())); if (parent && parent->plugin_model()) label = parent->plugin_model()->port_human_name(pm->index()); } @@ -111,7 +111,7 @@ Port::update_metadata() { SharedPtr<const PortModel> pm = _port_model.lock(); if (_app.can_control(pm.get()) && pm->is_numeric()) { - boost::shared_ptr<const NodeModel> parent = PtrCast<const NodeModel>(pm->parent()); + boost::shared_ptr<const BlockModel> parent = PtrCast<const BlockModel>(pm->parent()); if (parent) { float min = 0.0f; float max = 1.0f; @@ -182,10 +182,10 @@ Port::on_scale_point_activated(float f) Gtk::Menu* Port::build_enum_menu() { - SharedPtr<const NodeModel> node = PtrCast<NodeModel>(model()->parent()); - Gtk::Menu* menu = Gtk::manage(new Gtk::Menu()); + SharedPtr<const BlockModel> block = PtrCast<BlockModel>(model()->parent()); + Gtk::Menu* menu = Gtk::manage(new Gtk::Menu()); - PluginModel::ScalePoints points = node->plugin_model()->port_scale_points( + PluginModel::ScalePoints points = block->plugin_model()->port_scale_points( model()->index()); for (PluginModel::ScalePoints::iterator i = points.begin(); i != points.end(); ++i) { @@ -354,10 +354,10 @@ Port::set_selected(gboolean b) Ganv::Port::set_selected(b); SharedPtr<const PortModel> pm = _port_model.lock(); if (pm && b) { - SharedPtr<const NodeModel> node = PtrCast<NodeModel>(pm->parent()); - PatchWindow* win = _app.window_factory()->parent_patch_window(node); - if (win && node->plugin_model()) { - const std::string& doc = node->plugin_model()->port_documentation( + SharedPtr<const BlockModel> block = PtrCast<BlockModel>(pm->parent()); + PatchWindow* win = _app.window_factory()->parent_patch_window(block); + if (win && block->plugin_model()) { + const std::string& doc = block->plugin_model()->port_documentation( pm->index()); if (!doc.empty()) { win->show_documentation(doc, false); diff --git a/src/gui/PortMenu.cpp b/src/gui/PortMenu.cpp index a5b907c3..a23e3b84 100644 --- a/src/gui/PortMenu.cpp +++ b/src/gui/PortMenu.cpp @@ -121,9 +121,9 @@ PortMenu::on_menu_set_max() void PortMenu::on_menu_reset_range() { - const URIs& uris = _app->uris(); - SharedPtr<const PortModel> model = PtrCast<const PortModel>(_object); - SharedPtr<const NodeModel> parent = PtrCast<const NodeModel>(_object->parent()); + const URIs& uris = _app->uris(); + SharedPtr<const PortModel> model = PtrCast<const PortModel>(_object); + SharedPtr<const BlockModel> parent = PtrCast<const BlockModel>(_object->parent()); float min, max; parent->default_port_value_range(model, min, max); @@ -142,12 +142,12 @@ PortMenu::on_menu_reset_range() void PortMenu::on_menu_expose() { - const URIs& uris = _app->uris(); - SharedPtr<const PortModel> port = PtrCast<const PortModel>(_object); - SharedPtr<const NodeModel> node = PtrCast<const NodeModel>(port->parent()); + const URIs& uris = _app->uris(); + SharedPtr<const PortModel> port = PtrCast<const PortModel>(_object); + SharedPtr<const BlockModel> block = PtrCast<const BlockModel>(port->parent()); - const std::string label = node->label() + " " + node->port_label(port); - const Raul::Path path = Raul::Path(node->path() + Raul::Symbol("_" + port->symbol())); + const std::string label = block->label() + " " + block->port_label(port); + const Raul::Path path = Raul::Path(block->path() + Raul::Symbol("_" + port->symbol())); Ingen::Resource r(*_object.get()); r.remove_property(uris.lv2_index, uris.wildcard); @@ -155,12 +155,12 @@ PortMenu::on_menu_expose() r.set_property(uris.lv2_name, _app->forge().alloc(label.c_str())); // TODO: Pretty kludgey coordinates - const float node_x = node->get_property(uris.ingen_canvasX).get_float(); - const float node_y = node->get_property(uris.ingen_canvasY).get_float(); - const float x_off = (label.length() * 16.0f) * (port->is_input() ? -1 : 1); - const float y_off = port->index() * 32.0f; - r.set_property(uris.ingen_canvasX, _app->forge().make(node_x + x_off)); - r.set_property(uris.ingen_canvasY, _app->forge().make(node_y + y_off)); + const float block_x = block->get_property(uris.ingen_canvasX).get_float(); + const float block_y = block->get_property(uris.ingen_canvasY).get_float(); + const float x_off = (label.length() * 16.0f) * (port->is_input() ? -1 : 1); + const float y_off = port->index() * 32.0f; + r.set_property(uris.ingen_canvasX, _app->forge().make(block_x + x_off)); + r.set_property(uris.ingen_canvasY, _app->forge().make(block_y + y_off)); _app->interface()->put(GraphObject::path_to_uri(path), r.properties()); diff --git a/src/gui/PortPropertiesWindow.cpp b/src/gui/PortPropertiesWindow.cpp index f6af2563..a4b2d5fc 100644 --- a/src/gui/PortPropertiesWindow.cpp +++ b/src/gui/PortPropertiesWindow.cpp @@ -18,7 +18,7 @@ #include <list> #include "ingen/Interface.hpp" -#include "ingen/client/NodeModel.hpp" +#include "ingen/client/BlockModel.hpp" #include "ingen/client/PluginModel.hpp" #include "App.hpp" @@ -66,7 +66,7 @@ PortPropertiesWindow::present(SharedPtr<const PortModel> pm) set_title(pm->path() + " Properties - Ingen"); float min = 0.0f, max = 1.0f; - boost::shared_ptr<NodeModel> parent = PtrCast<NodeModel>(_port_model->parent()); + boost::shared_ptr<BlockModel> parent = PtrCast<BlockModel>(_port_model->parent()); if (parent) parent->port_value_range(_port_model, min, max, _app->sample_rate()); diff --git a/src/gui/PropertiesWindow.cpp b/src/gui/PropertiesWindow.cpp index 2acb7ffe..e49e2021 100644 --- a/src/gui/PropertiesWindow.cpp +++ b/src/gui/PropertiesWindow.cpp @@ -24,7 +24,7 @@ #include "ingen/Interface.hpp" #include "ingen/Log.hpp" #include "ingen/World.hpp" -#include "ingen/client/NodeModel.hpp" +#include "ingen/client/BlockModel.hpp" #include "ingen/client/PluginModel.hpp" #include "App.hpp" diff --git a/src/gui/PropertiesWindow.hpp b/src/gui/PropertiesWindow.hpp index e62fb07f..7ba5e5b6 100644 --- a/src/gui/PropertiesWindow.hpp +++ b/src/gui/PropertiesWindow.hpp @@ -30,7 +30,7 @@ #include "raul/SharedPtr.hpp" -#include "ingen/client/NodeModel.hpp" +#include "ingen/client/BlockModel.hpp" #include "Window.hpp" diff --git a/src/gui/SubpatchModule.cpp b/src/gui/SubpatchModule.cpp index 5425677c..efd29805 100644 --- a/src/gui/SubpatchModule.cpp +++ b/src/gui/SubpatchModule.cpp @@ -67,8 +67,8 @@ SubpatchModule::store_location(double ax, double ay) const Raul::Atom x(app().forge().make(static_cast<float>(ax))); const Raul::Atom y(app().forge().make(static_cast<float>(ay))); - if (x != _node->get_property(uris.ingen_canvasX) || - y != _node->get_property(uris.ingen_canvasY)) + if (x != _block->get_property(uris.ingen_canvasX) || + y != _block->get_property(uris.ingen_canvasY)) { Resource::Properties remove; remove.insert(make_pair(uris.ingen_canvasX, uris.wildcard)); @@ -78,7 +78,7 @@ SubpatchModule::store_location(double ax, double ay) Resource::Property(x, Resource::EXTERNAL))); add.insert(make_pair(uris.ingen_canvasY, Resource::Property(y, Resource::EXTERNAL))); - app().interface()->delta(_node->uri(), remove, add); + app().interface()->delta(_block->uri(), remove, add); } } diff --git a/src/gui/SubpatchModule.hpp b/src/gui/SubpatchModule.hpp index 727f681d..8d7dbecc 100644 --- a/src/gui/SubpatchModule.hpp +++ b/src/gui/SubpatchModule.hpp @@ -24,9 +24,8 @@ namespace Ingen { namespace Client { class PatchModel; - class NodeModel; - class PortModel; class PatchWindow; + class PortModel; } } namespace Ingen { diff --git a/src/gui/WindowFactory.cpp b/src/gui/WindowFactory.cpp index 98af4c19..1f0e0310 100644 --- a/src/gui/WindowFactory.cpp +++ b/src/gui/WindowFactory.cpp @@ -112,12 +112,12 @@ WindowFactory::patch_window(SharedPtr<const PatchModel> patch) } PatchWindow* -WindowFactory::parent_patch_window(SharedPtr<const NodeModel> node) +WindowFactory::parent_patch_window(SharedPtr<const BlockModel> block) { - if (!node) + if (!block) return NULL; - return patch_window(PtrCast<PatchModel>(node->parent())); + return patch_window(PtrCast<PatchModel>(block->parent())); } /** Present a PatchWindow for a Patch. diff --git a/src/gui/WindowFactory.hpp b/src/gui/WindowFactory.hpp index 0712c656..465bfa80 100644 --- a/src/gui/WindowFactory.hpp +++ b/src/gui/WindowFactory.hpp @@ -25,9 +25,9 @@ namespace Ingen { namespace Client { -class PatchModel; -class NodeModel; +class BlockModel; class ObjectModel; +class PatchModel; } namespace GUI { @@ -57,7 +57,7 @@ public: PatchBox* patch_box(SharedPtr<const Client::PatchModel> patch); PatchWindow* patch_window(SharedPtr<const Client::PatchModel> patch); - PatchWindow* parent_patch_window(SharedPtr<const Client::NodeModel> node); + PatchWindow* parent_patch_window(SharedPtr<const Client::BlockModel> block); void present_patch( SharedPtr<const Client::PatchModel> model, |