diff options
author | David Robillard <d@drobilla.net> | 2006-09-15 01:20:54 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2006-09-15 01:20:54 +0000 |
commit | a135a764751a356ac34c2f35f8ce2c009872f1fd (patch) | |
tree | fd70a03cad997bbaeac6bed50c5b17be442aad9e /src/progs/ingenuity | |
parent | f9f760893e4fa1ff850becf7d98bd4c6af8b8d73 (diff) | |
download | ingen-a135a764751a356ac34c2f35f8ce2c009872f1fd.tar.gz ingen-a135a764751a356ac34c2f35f8ce2c009872f1fd.tar.bz2 ingen-a135a764751a356ac34c2f35f8ce2c009872f1fd.zip |
Fixed FlowCanvas #include directives (to include FLOWCANVAS prefix).
Renamed classes/files in Ingenuity to make more sense (and kill "Om").
Patch port fixes.
git-svn-id: http://svn.drobilla.net/lad/ingen@136 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/progs/ingenuity')
-rw-r--r-- | src/progs/ingenuity/App.cpp | 4 | ||||
-rw-r--r-- | src/progs/ingenuity/App.h | 4 | ||||
-rw-r--r-- | src/progs/ingenuity/DSSIModule.cpp | 4 | ||||
-rw-r--r-- | src/progs/ingenuity/DSSIModule.h | 6 | ||||
-rw-r--r-- | src/progs/ingenuity/LoadPluginWindow.cpp | 2 | ||||
-rw-r--r-- | src/progs/ingenuity/Makefile.am | 20 | ||||
-rw-r--r-- | src/progs/ingenuity/NodeMenu.h | 2 | ||||
-rw-r--r-- | src/progs/ingenuity/NodeModule.cpp (renamed from src/progs/ingenuity/OmModule.cpp) | 33 | ||||
-rw-r--r-- | src/progs/ingenuity/NodeModule.h (renamed from src/progs/ingenuity/OmModule.h) | 14 | ||||
-rw-r--r-- | src/progs/ingenuity/PatchCanvas.cpp (renamed from src/progs/ingenuity/OmFlowCanvas.cpp) | 161 | ||||
-rw-r--r-- | src/progs/ingenuity/PatchCanvas.h (renamed from src/progs/ingenuity/OmFlowCanvas.h) | 20 | ||||
-rw-r--r-- | src/progs/ingenuity/PatchPort.cpp (renamed from src/progs/ingenuity/OmPatchPort.cpp) | 10 | ||||
-rw-r--r-- | src/progs/ingenuity/PatchPort.h (renamed from src/progs/ingenuity/OmPatchPort.h) | 14 | ||||
-rw-r--r-- | src/progs/ingenuity/PatchPortModule.cpp (renamed from src/progs/ingenuity/OmPortModule.cpp) | 18 | ||||
-rw-r--r-- | src/progs/ingenuity/PatchPortModule.h (renamed from src/progs/ingenuity/OmPortModule.h) | 18 | ||||
-rw-r--r-- | src/progs/ingenuity/PatchView.cpp | 4 | ||||
-rw-r--r-- | src/progs/ingenuity/PatchView.h | 6 | ||||
-rw-r--r-- | src/progs/ingenuity/PatchWindow.cpp | 2 | ||||
-rw-r--r-- | src/progs/ingenuity/PatchWindow.h | 2 | ||||
-rw-r--r-- | src/progs/ingenuity/Port.cpp (renamed from src/progs/ingenuity/OmPort.cpp) | 25 | ||||
-rw-r--r-- | src/progs/ingenuity/Port.h (renamed from src/progs/ingenuity/OmPort.h) | 26 | ||||
-rw-r--r-- | src/progs/ingenuity/SubpatchModule.cpp | 10 | ||||
-rw-r--r-- | src/progs/ingenuity/SubpatchModule.h | 9 |
23 files changed, 164 insertions, 250 deletions
diff --git a/src/progs/ingenuity/App.cpp b/src/progs/ingenuity/App.cpp index 60482d77..78d2e971 100644 --- a/src/progs/ingenuity/App.cpp +++ b/src/progs/ingenuity/App.cpp @@ -22,7 +22,7 @@ #include <libgnomecanvasmm.h> #include <time.h> #include <sys/time.h> -#include "OmModule.h" +#include "NodeModule.h" #include "ControlPanel.h" #include "SubpatchModule.h" #include "LoadPluginWindow.h" @@ -49,7 +49,7 @@ using namespace Ingen::Client; namespace Ingenuity { -class OmPort; +class Port; /// Singleton instance diff --git a/src/progs/ingenuity/App.h b/src/progs/ingenuity/App.h index d166c37b..553175fb 100644 --- a/src/progs/ingenuity/App.h +++ b/src/progs/ingenuity/App.h @@ -49,9 +49,7 @@ class LoadPatchWindow; class MessagesWindow; class ConfigWindow; class IngenuityObject; -class OmModule; -class OmPort; -class OmFlowCanvas; +class PatchCanvas; class PatchTreeView; class PatchTreeWindow; class ConnectWindow; diff --git a/src/progs/ingenuity/DSSIModule.cpp b/src/progs/ingenuity/DSSIModule.cpp index 5d235be4..670c8efb 100644 --- a/src/progs/ingenuity/DSSIModule.cpp +++ b/src/progs/ingenuity/DSSIModule.cpp @@ -20,8 +20,8 @@ namespace Ingenuity { -DSSIModule::DSSIModule(OmFlowCanvas* canvas, CountedPtr<NodeModel> node) -: OmModule(canvas, node) +DSSIModule::DSSIModule(PatchCanvas* canvas, CountedPtr<NodeModel> node) +: NodeModule(canvas, node) { } diff --git a/src/progs/ingenuity/DSSIModule.h b/src/progs/ingenuity/DSSIModule.h index 6cffb891..e281a2b7 100644 --- a/src/progs/ingenuity/DSSIModule.h +++ b/src/progs/ingenuity/DSSIModule.h @@ -17,7 +17,7 @@ #ifndef DSSIMODULE_H #define DSSIMODULE_H -#include "OmModule.h" +#include "NodeModule.h" namespace Ingenuity { @@ -27,10 +27,10 @@ class DSSIController; * * \ingroup Ingenuity */ -class DSSIModule : public OmModule +class DSSIModule : public Ingenuity::NodeModule { public: - DSSIModule(OmFlowCanvas* canvas, CountedPtr<NodeModel> node); + DSSIModule(PatchCanvas* canvas, CountedPtr<NodeModel> node); virtual ~DSSIModule() {} void on_double_click(GdkEventButton* ev); diff --git a/src/progs/ingenuity/LoadPluginWindow.cpp b/src/progs/ingenuity/LoadPluginWindow.cpp index 5235dacd..e99550e5 100644 --- a/src/progs/ingenuity/LoadPluginWindow.cpp +++ b/src/progs/ingenuity/LoadPluginWindow.cpp @@ -26,7 +26,7 @@ #include "Store.h" #include "ModelEngineInterface.h" #include "PatchView.h" -#include "OmFlowCanvas.h" +#include "PatchCanvas.h" using std::cout; using std::cerr; using std::endl; diff --git a/src/progs/ingenuity/Makefile.am b/src/progs/ingenuity/Makefile.am index aaa832f3..0290f37e 100644 --- a/src/progs/ingenuity/Makefile.am +++ b/src/progs/ingenuity/Makefile.am @@ -24,8 +24,8 @@ ingenuity_SOURCES = \ main.cpp \ NodeMenu.h \ NodeMenu.cpp \ - OmFlowCanvas.h \ - OmFlowCanvas.cpp \ + PatchCanvas.h \ + PatchCanvas.cpp \ BreadCrumb.h \ BreadCrumbBox.h \ BreadCrumbBox.cpp \ @@ -59,18 +59,18 @@ ingenuity_SOURCES = \ WindowFactory.cpp \ ../../common/types.h \ ../../common/Path.h \ - OmModule.h \ - OmModule.cpp \ - OmPortModule.h \ - OmPortModule.cpp \ + NodeModule.h \ + NodeModule.cpp \ + PatchPortModule.h \ + PatchPortModule.cpp \ DSSIModule.h \ DSSIModule.cpp \ SubpatchModule.h \ SubpatchModule.cpp \ - OmPort.h \ - OmPort.cpp \ - OmPatchPort.h \ - OmPatchPort.cpp \ + Port.h \ + Port.cpp \ + PatchPort.h \ + PatchPort.cpp \ NewSubpatchWindow.h \ NewSubpatchWindow.cpp \ ConfigWindow.h \ diff --git a/src/progs/ingenuity/NodeMenu.h b/src/progs/ingenuity/NodeMenu.h index a80b7a69..1846ed56 100644 --- a/src/progs/ingenuity/NodeMenu.h +++ b/src/progs/ingenuity/NodeMenu.h @@ -31,7 +31,7 @@ namespace Ingenuity { class Controller; class NodeControlWindow; class NodePropertiesWindow; -class OmFlowCanvas; +class PatchCanvas; /** Controller for a Node. * diff --git a/src/progs/ingenuity/OmModule.cpp b/src/progs/ingenuity/NodeModule.cpp index 489b035a..9384917b 100644 --- a/src/progs/ingenuity/OmModule.cpp +++ b/src/progs/ingenuity/NodeModule.cpp @@ -14,15 +14,15 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "OmModule.h" +#include "NodeModule.h" #include <cassert> #include "util/Atom.h" #include "App.h" #include "ModelEngineInterface.h" -#include "OmFlowCanvas.h" +#include "PatchCanvas.h" #include "PatchModel.h" #include "NodeModel.h" -#include "OmPort.h" +#include "Port.h" #include "GladeFactory.h" #include "RenameWindow.h" #include "PatchWindow.h" @@ -31,7 +31,7 @@ namespace Ingenuity { -OmModule::OmModule(OmFlowCanvas* canvas, CountedPtr<NodeModel> node) +NodeModule::NodeModule(PatchCanvas* canvas, CountedPtr<NodeModel> node) : LibFlowCanvas::Module(canvas, node->path().name()), m_node(node), m_menu(node) @@ -51,17 +51,17 @@ OmModule::OmModule(OmFlowCanvas* canvas, CountedPtr<NodeModel> node) move_to(x.get_float(), y.get_float()); } else { double x, y; - ((OmFlowCanvas*)m_canvas)->get_new_module_location(x, y); + ((PatchCanvas*)m_canvas)->get_new_module_location(x, y); } - node->new_port_sig.connect(sigc::mem_fun(this, &OmModule::add_port)); - node->removed_port_sig.connect(sigc::mem_fun(this, &OmModule::remove_port)); - node->metadata_update_sig.connect(sigc::mem_fun(this, &OmModule::metadata_update)); + node->new_port_sig.connect(sigc::mem_fun(this, &NodeModule::add_port)); + node->removed_port_sig.connect(sigc::mem_fun(this, &NodeModule::remove_port)); + node->metadata_update_sig.connect(sigc::mem_fun(this, &NodeModule::metadata_update)); } void -OmModule::create_all_ports() +NodeModule::create_all_ports() { for (PortModelList::const_iterator i = m_node->ports().begin(); i != m_node->ports().end(); ++i) { @@ -77,15 +77,16 @@ OmModule::create_all_ports() void -OmModule::add_port(CountedPtr<PortModel> port) +NodeModule::add_port(CountedPtr<PortModel> port) { - new OmPort(this, port); + cerr << "FIXME: port leak\n"; + new Port(this, port); resize(); } void -OmModule::remove_port(CountedPtr<PortModel> port) +NodeModule::remove_port(CountedPtr<PortModel> port) { LibFlowCanvas::Port* canvas_port = get_port(port->path().name()); delete canvas_port; @@ -93,14 +94,14 @@ OmModule::remove_port(CountedPtr<PortModel> port) void -OmModule::show_control_window() +NodeModule::show_control_window() { App::instance().window_factory()->present_controls(m_node); } void -OmModule::store_location() +NodeModule::store_location() { const float x = static_cast<float>(property_x()); const float y = static_cast<float>(property_y()); @@ -118,14 +119,14 @@ OmModule::store_location() void -OmModule::on_right_click(GdkEventButton* event) +NodeModule::on_right_click(GdkEventButton* event) { m_menu.popup(event->button, event->time); } void -OmModule::metadata_update(const string& key, const Atom& value) +NodeModule::metadata_update(const string& key, const Atom& value) { if (key == "module-x" && value.type() == Atom::FLOAT) move_to(value.get_float(), property_y()); diff --git a/src/progs/ingenuity/OmModule.h b/src/progs/ingenuity/NodeModule.h index e20391c6..5b4ec922 100644 --- a/src/progs/ingenuity/OmModule.h +++ b/src/progs/ingenuity/NodeModule.h @@ -35,8 +35,8 @@ using namespace Ingen::Client; namespace Ingenuity { -class OmFlowCanvas; -class OmPort; +class PatchCanvas; +class Port; /** A module in a patch. @@ -46,14 +46,14 @@ class OmPort; * * \ingroup Ingenuity */ -class OmModule : public LibFlowCanvas::Module +class NodeModule : public LibFlowCanvas::Module { public: - OmModule(OmFlowCanvas* canvas, CountedPtr<NodeModel> node); - virtual ~OmModule() {} + NodeModule(PatchCanvas* canvas, CountedPtr<NodeModel> node); + virtual ~NodeModule() {} - virtual OmPort* port(const string& port_name) { - return (OmPort*)Module::get_port(port_name); + virtual Ingenuity::Port* port(const string& port_name) { + return (Ingenuity::Port*)Module::get_port(port_name); } virtual void store_location(); diff --git a/src/progs/ingenuity/OmFlowCanvas.cpp b/src/progs/ingenuity/PatchCanvas.cpp index 35b5c064..fd84443c 100644 --- a/src/progs/ingenuity/OmFlowCanvas.cpp +++ b/src/progs/ingenuity/PatchCanvas.cpp @@ -14,20 +14,21 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "OmFlowCanvas.h" +#include "PatchCanvas.h" #include <cassert> #include <flowcanvas/FlowCanvas.h> #include "App.h" #include "ModelEngineInterface.h" #include "PatchModel.h" #include "PatchWindow.h" +#include "PatchPortModule.h" #include "LoadPluginWindow.h" #include "LoadSubpatchWindow.h" #include "NewSubpatchWindow.h" -#include "OmPort.h" +#include "Port.h" #include "NodeModel.h" -#include "OmModule.h" -#include "OmPortModule.h" +#include "NodeModule.h" +#include "PatchPortModule.h" #include "SubpatchModule.h" #include "GladeFactory.h" #include "WindowFactory.h" @@ -35,7 +36,7 @@ namespace Ingenuity { -OmFlowCanvas::OmFlowCanvas(CountedPtr<PatchModel> patch, int width, int height) +PatchCanvas::PatchCanvas(CountedPtr<PatchModel> patch, int width, int height) : FlowCanvas(width, height), m_patch(patch), m_last_click_x(0), @@ -58,41 +59,41 @@ OmFlowCanvas::OmFlowCanvas(CountedPtr<PatchModel> patch, int width, int height) // Add port menu items m_menu_add_audio_input->signal_activate().connect( - sigc::bind(sigc::mem_fun(this, &OmFlowCanvas::menu_add_port), + sigc::bind(sigc::mem_fun(this, &PatchCanvas::menu_add_port), "audio_input", "AUDIO", false)); m_menu_add_audio_output->signal_activate().connect( - sigc::bind(sigc::mem_fun(this, &OmFlowCanvas::menu_add_port), + sigc::bind(sigc::mem_fun(this, &PatchCanvas::menu_add_port), "audio_output", "AUDIO", true)); m_menu_add_control_input->signal_activate().connect( - sigc::bind(sigc::mem_fun(this, &OmFlowCanvas::menu_add_port), + sigc::bind(sigc::mem_fun(this, &PatchCanvas::menu_add_port), "control_input", "CONTROL", false)); m_menu_add_control_output->signal_activate().connect( - sigc::bind(sigc::mem_fun(this, &OmFlowCanvas::menu_add_port), + sigc::bind(sigc::mem_fun(this, &PatchCanvas::menu_add_port), "control_output", "CONTROL", true)); m_menu_add_midi_input->signal_activate().connect( - sigc::bind(sigc::mem_fun(this, &OmFlowCanvas::menu_add_port), + sigc::bind(sigc::mem_fun(this, &PatchCanvas::menu_add_port), "midi_input", "MIDI", false)); m_menu_add_midi_output->signal_activate().connect( - sigc::bind(sigc::mem_fun(this, &OmFlowCanvas::menu_add_port), + sigc::bind(sigc::mem_fun(this, &PatchCanvas::menu_add_port), "midi_output", "MIDI", true)); // Connect to model signals to track state - m_patch->new_node_sig.connect(sigc::mem_fun(this, &OmFlowCanvas::add_node)); - m_patch->removed_node_sig.connect(sigc::mem_fun(this, &OmFlowCanvas::remove_node)); - m_patch->new_port_sig.connect(sigc::mem_fun(this, &OmFlowCanvas::add_port)); - m_patch->removed_port_sig.connect(sigc::mem_fun(this, &OmFlowCanvas::remove_port)); - m_patch->new_connection_sig.connect(sigc::mem_fun(this, &OmFlowCanvas::connection)); - m_patch->removed_connection_sig.connect(sigc::mem_fun(this, &OmFlowCanvas::disconnection)); + m_patch->new_node_sig.connect(sigc::mem_fun(this, &PatchCanvas::add_node)); + m_patch->removed_node_sig.connect(sigc::mem_fun(this, &PatchCanvas::remove_node)); + m_patch->new_port_sig.connect(sigc::mem_fun(this, &PatchCanvas::add_port)); + m_patch->removed_port_sig.connect(sigc::mem_fun(this, &PatchCanvas::remove_port)); + m_patch->new_connection_sig.connect(sigc::mem_fun(this, &PatchCanvas::connection)); + m_patch->removed_connection_sig.connect(sigc::mem_fun(this, &PatchCanvas::disconnection)); // Connect widget signals to do things - m_menu_load_plugin->signal_activate().connect(sigc::mem_fun(this, &OmFlowCanvas::menu_load_plugin)); - m_menu_load_patch->signal_activate().connect(sigc::mem_fun(this, &OmFlowCanvas::menu_load_patch)); - m_menu_new_patch->signal_activate().connect(sigc::mem_fun(this, &OmFlowCanvas::menu_new_patch)); + m_menu_load_plugin->signal_activate().connect(sigc::mem_fun(this, &PatchCanvas::menu_load_plugin)); + m_menu_load_patch->signal_activate().connect(sigc::mem_fun(this, &PatchCanvas::menu_load_patch)); + m_menu_new_patch->signal_activate().connect(sigc::mem_fun(this, &PatchCanvas::menu_new_patch)); } void -OmFlowCanvas::build_canvas() { +PatchCanvas::build_canvas() { // Create modules for nodes for (NodeModelMap::const_iterator i = m_patch->nodes().begin(); @@ -104,7 +105,7 @@ OmFlowCanvas::build_canvas() { for (PortModelList::const_iterator i = m_patch->ports().begin(); i != m_patch->ports().end(); ++i) { cerr << "FIXME: PORT MODULE LEAK!" << endl; - new OmPortModule(this, *i); + new PatchPortModule(this, *i); } // Create connections @@ -116,7 +117,7 @@ OmFlowCanvas::build_canvas() { void -OmFlowCanvas::add_node(CountedPtr<NodeModel> nm) +PatchCanvas::add_node(CountedPtr<NodeModel> nm) { cerr << "FIXME: MODULE LEAK!" << endl; @@ -124,12 +125,12 @@ OmFlowCanvas::add_node(CountedPtr<NodeModel> nm) if (pm) new SubpatchModule(this, pm); else - new OmModule(this, nm); + new NodeModule(this, nm); } void -OmFlowCanvas::remove_node(CountedPtr<NodeModel> nm) +PatchCanvas::remove_node(CountedPtr<NodeModel> nm) { LibFlowCanvas::Module* module = get_module(nm->path().name()); delete module; @@ -137,16 +138,16 @@ OmFlowCanvas::remove_node(CountedPtr<NodeModel> nm) void -OmFlowCanvas::add_port(CountedPtr<PortModel> pm) +PatchCanvas::add_port(CountedPtr<PortModel> pm) { cerr << "FIXME: PORT MODULE LEAK!" << endl; - new OmPortModule(this, pm); + new PatchPortModule(this, pm); } void -OmFlowCanvas::remove_port(CountedPtr<PortModel> pm) +PatchCanvas::remove_port(CountedPtr<PortModel> pm) { cerr << "FIXME: PORT REMOVE" << endl; //LibFlowCanvas::Module* module = get_module(pm->path().name()); @@ -155,7 +156,7 @@ OmFlowCanvas::remove_port(CountedPtr<PortModel> pm) void -OmFlowCanvas::connection(CountedPtr<ConnectionModel> cm) +PatchCanvas::connection(CountedPtr<ConnectionModel> cm) { // Deal with port "anonymous nodes" for this patch's own ports... const Path& src_parent_path = cm->src_port_path().parent(); @@ -166,8 +167,8 @@ OmFlowCanvas::connection(CountedPtr<ConnectionModel> cm) const string& dst_parent_name = (dst_parent_path == m_patch->path()) ? "" : dst_parent_path.name(); - Port* src_port = get_port(src_parent_name, cm->src_port_path().name()); - Port* dst_port = get_port(dst_parent_name, cm->dst_port_path().name()); + LibFlowCanvas::Port* src_port = get_port(src_parent_name, cm->src_port_path().name()); + LibFlowCanvas::Port* dst_port = get_port(dst_parent_name, cm->dst_port_path().name()); assert(src_port && dst_port); add_connection(src_port, dst_port); @@ -175,15 +176,15 @@ OmFlowCanvas::connection(CountedPtr<ConnectionModel> cm) void -OmFlowCanvas::disconnection(const Path& src_port_path, const Path& dst_port_path) +PatchCanvas::disconnection(const Path& src_port_path, const Path& dst_port_path) { const string& src_node_name = src_port_path.parent().name(); const string& src_port_name = src_port_path.name(); const string& dst_node_name = dst_port_path.parent().name(); const string& dst_port_name = dst_port_path.name(); - Port* src_port = get_port(src_node_name, src_port_name); - Port* dst_port = get_port(dst_node_name, dst_port_name); + LibFlowCanvas::Port* src_port = get_port(src_node_name, src_port_name); + LibFlowCanvas::Port* dst_port = get_port(dst_node_name, dst_port_name); if (src_port && dst_port) { remove_connection(src_port, dst_port); @@ -204,14 +205,15 @@ OmFlowCanvas::disconnection(const Path& src_port_path, const Path& dst_port_path void -OmFlowCanvas::connect(const Port* src_port, const Port* dst_port) +PatchCanvas::connect(const LibFlowCanvas::Port* src_port, const LibFlowCanvas::Port* dst_port) { assert(src_port != NULL); assert(dst_port != NULL); - const OmPort* const src = static_cast<const OmPort* const>(src_port); - const OmPort* const dst = static_cast<const OmPort* const>(dst_port); - + const Ingenuity::Port* const src = dynamic_cast<const Ingenuity::Port* const>(src_port); + const Ingenuity::Port* const dst = dynamic_cast<const Ingenuity::Port* const>(dst_port); + assert(src && dst); + // Midi binding/learn shortcut if (src->model()->type() == PortModel::MIDI && dst->model()->type() == PortModel::CONTROL) @@ -244,18 +246,18 @@ OmFlowCanvas::connect(const Port* src_port, const Port* dst_port) void -OmFlowCanvas::disconnect(const Port* src_port, const Port* dst_port) +PatchCanvas::disconnect(const LibFlowCanvas::Port* src_port, const LibFlowCanvas::Port* dst_port) { assert(src_port != NULL); assert(dst_port != NULL); - App::instance().engine()->disconnect(((OmPort*)src_port)->model()->path(), - ((OmPort*)dst_port)->model()->path()); + App::instance().engine()->disconnect(((Ingenuity::Port*)src_port)->model()->path(), + ((Ingenuity::Port*)dst_port)->model()->path()); } bool -OmFlowCanvas::canvas_event(GdkEvent* event) +PatchCanvas::canvas_event(GdkEvent* event) { assert(event != NULL); @@ -284,15 +286,15 @@ OmFlowCanvas::canvas_event(GdkEvent* event) void -OmFlowCanvas::destroy_selected() +PatchCanvas::destroy_selected() { for (list<Module*>::iterator m = m_selected_modules.begin(); m != m_selected_modules.end(); ++m) - App::instance().engine()->destroy(((OmModule*)(*m))->node()->path()); + App::instance().engine()->destroy(((NodeModule*)(*m))->node()->path()); } string -OmFlowCanvas::generate_port_name(const string& base) { +PatchCanvas::generate_port_name(const string& base) { string name = base; char num_buf[5]; @@ -311,23 +313,17 @@ OmFlowCanvas::generate_port_name(const string& base) { void -OmFlowCanvas::menu_add_port(const string& name, const string& type, bool is_output) +PatchCanvas::menu_add_port(const string& name, const string& type, bool is_output) { const Path& path = m_patch->path().base() + generate_port_name(name); - App::instance().engine()->create_port(path, type, is_output); - - char temp_buf[16]; - snprintf(temp_buf, 16, "%d", m_last_click_x); - App::instance().engine()->set_metadata(path, "module-x", temp_buf); - snprintf(temp_buf, 16, "%d", m_last_click_y); - App::instance().engine()->set_metadata(path, "module-y", temp_buf); + App::instance().engine()->create_port_with_data(path, type, is_output, get_initial_data()); } /** Try to guess a suitable location for a new module. */ void -OmFlowCanvas::get_new_module_location(double& x, double& y) +PatchCanvas::get_new_module_location(double& x, double& y) { int scroll_x; int scroll_y; @@ -337,57 +333,8 @@ OmFlowCanvas::get_new_module_location(double& x, double& y) } -/* -void -OmFlowCanvas::menu_add_audio_input() -{ - string name = "audio_in"; - App::instance().engine()->create_port(m_patch_controller->path().base() + name, "AUDIO", false); -} - - -void -OmFlowCanvas::menu_add_audio_output() -{ - string name = "audio_out"; - App::instance().engine()->create_port(m_patch_controller->path().base() + name, "AUDIO", true); -} - - -void -OmFlowCanvas::menu_add_control_input() -{ - string name = "control_in"; - App::instance().engine()->create_port(m_patch_controller->path().base() + name, "CONTROL", false); -} - - -void -OmFlowCanvas::menu_add_control_output() -{ - string name = "control_out"; - App::instance().engine()->create_port(m_patch_controller->path().base() + name, "CONTROL", true); -} - - -void -OmFlowCanvas::menu_add_midi_input() -{ - string name = "midi_in"; - App::instance().engine()->create_port(m_patch_controller->path().base() + name, "MIDI", false); -} - - -void -OmFlowCanvas::menu_add_midi_output() -{ - string name = "midi_out"; - App::instance().engine()->create_port(m_patch_controller->path().base() + name, "MIDI", true); -} -*/ - MetadataMap -OmFlowCanvas::get_initial_data() +PatchCanvas::get_initial_data() { MetadataMap result; @@ -398,21 +345,21 @@ OmFlowCanvas::get_initial_data() } void -OmFlowCanvas::menu_load_plugin() +PatchCanvas::menu_load_plugin() { App::instance().window_factory()->present_load_plugin(m_patch, get_initial_data()); } void -OmFlowCanvas::menu_load_patch() +PatchCanvas::menu_load_patch() { App::instance().window_factory()->present_load_subpatch(m_patch, get_initial_data()); } void -OmFlowCanvas::menu_new_patch() +PatchCanvas::menu_new_patch() { App::instance().window_factory()->present_new_subpatch(m_patch, get_initial_data()); } diff --git a/src/progs/ingenuity/OmFlowCanvas.h b/src/progs/ingenuity/PatchCanvas.h index ffbaa363..c6abeeb0 100644 --- a/src/progs/ingenuity/OmFlowCanvas.h +++ b/src/progs/ingenuity/PatchCanvas.h @@ -36,20 +36,20 @@ using Ingen::Client::MetadataMap; namespace Ingenuity { -class OmModule; +class NodeModule; /** Patch canvas widget. * * \ingroup Ingenuity */ -class OmFlowCanvas : public LibFlowCanvas::FlowCanvas +class PatchCanvas : public LibFlowCanvas::FlowCanvas { public: - OmFlowCanvas(CountedPtr<PatchModel> patch, int width, int height); + PatchCanvas(CountedPtr<PatchModel> patch, int width, int height); - OmModule* find_module(const string& name) - { return (OmModule*)FlowCanvas::get_module(name); } + NodeModule* find_module(const string& name) + { return (NodeModule*)FlowCanvas::get_module(name); } void add_node(CountedPtr<NodeModel> nm); void remove_node(CountedPtr<NodeModel> nm); @@ -68,12 +68,6 @@ public: private: string generate_port_name(const string& base); void menu_add_port(const string& name, const string& type, bool is_output); - /*void menu_add_audio_input(); - void menu_add_audio_output(); - void menu_add_control_input(); - void menu_add_control_output(); - void menu_add_midi_input(); - void menu_add_midi_output();*/ void menu_load_plugin(); void menu_new_patch(); void menu_load_patch(); @@ -84,8 +78,8 @@ private: bool canvas_event(GdkEvent* event); - void connect(const Port* src_port, const Port* dst_port); - void disconnect(const Port* src_port, const Port* dst_port); + void connect(const LibFlowCanvas::Port* src_port, const LibFlowCanvas::Port* dst_port); + void disconnect(const LibFlowCanvas::Port* src_port, const LibFlowCanvas::Port* dst_port); CountedPtr<PatchModel> m_patch; diff --git a/src/progs/ingenuity/OmPatchPort.cpp b/src/progs/ingenuity/PatchPort.cpp index 0d3acf76..7fc75dc8 100644 --- a/src/progs/ingenuity/OmPatchPort.cpp +++ b/src/progs/ingenuity/PatchPort.cpp @@ -14,11 +14,11 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "OmPatchPort.h" +#include "PatchPort.h" #include <cassert> #include <iostream> #include "PortModel.h" -#include "OmPortModule.h" +#include "PatchPortModule.h" #include "ControlModel.h" #include "Configuration.h" #include "App.h" @@ -28,7 +28,7 @@ using namespace Ingen::Client; namespace Ingenuity { -OmPatchPort::OmPatchPort(OmPortModule* module, CountedPtr<PortModel> pm) +PatchPort::PatchPort(PatchPortModule* module, CountedPtr<PortModel> pm) : Port(module, pm->path().name(), !pm->is_input(), App::instance().configuration()->get_port_color(pm.get())), m_port_model(pm) { @@ -38,9 +38,9 @@ OmPatchPort::OmPatchPort(OmPortModule* module, CountedPtr<PortModel> pm) #if 0 void -OmPatchPort::set_name(const string& n) +PatchPort::set_name(const string& n) { - cerr << "********** OmPatchPort::set_name broken **********************" << endl; + cerr << "********** PatchPort::set_name broken **********************" << endl; /* FIXME: move to PortController string new_path = Path::parent(m_port_model->path()) +"/"+ n; diff --git a/src/progs/ingenuity/OmPatchPort.h b/src/progs/ingenuity/PatchPort.h index e7d5765f..1b8eb389 100644 --- a/src/progs/ingenuity/OmPatchPort.h +++ b/src/progs/ingenuity/PatchPort.h @@ -14,8 +14,8 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef OMPATCHPORT_H -#define OMPATCHPORT_H +#ifndef PATCHPORT_H +#define PATCHPORT_H #include <cassert> #include <string> @@ -31,19 +31,19 @@ namespace Ingenuity { class FlowCanvas; class PatchWindow; -class OmPortModule; +class PatchPortModule; /** A Port (on a pseudo node) in a patch canvas, to represent a port on that patch. * * \ingroup Ingenuity */ -class OmPatchPort : public LibFlowCanvas::Port +class PatchPort : public LibFlowCanvas::Port { public: - OmPatchPort(OmPortModule* module, CountedPtr<PortModel> pm); + PatchPort(PatchPortModule* module, CountedPtr<PortModel> pm); - virtual ~OmPatchPort() {} + virtual ~PatchPort() {} //void set_name(const string& n); @@ -56,4 +56,4 @@ private: } // namespace Ingenuity -#endif // OMPATCHPORT_H +#endif // PATCHPORT_H diff --git a/src/progs/ingenuity/OmPortModule.cpp b/src/progs/ingenuity/PatchPortModule.cpp index 7496a6a6..17bc6a2a 100644 --- a/src/progs/ingenuity/OmPortModule.cpp +++ b/src/progs/ingenuity/PatchPortModule.cpp @@ -14,23 +14,23 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "OmPortModule.h" +#include "PatchPortModule.h" #include <cassert> #include "App.h" #include "ModelEngineInterface.h" -#include "OmFlowCanvas.h" +#include "PatchCanvas.h" #include "PatchModel.h" #include "NodeModel.h" -#include "OmPort.h" +#include "Port.h" #include "GladeFactory.h" #include "RenameWindow.h" #include "PatchWindow.h" -#include "OmPatchPort.h" +#include "PatchPort.h" namespace Ingenuity { -OmPortModule::OmPortModule(OmFlowCanvas* canvas, CountedPtr<PortModel> port) +PatchPortModule::PatchPortModule(PatchCanvas* canvas, CountedPtr<PortModel> port) : LibFlowCanvas::Module(canvas, "", 0, 0), // FIXME: coords? m_port(port), m_patch_port(NULL) @@ -47,7 +47,7 @@ OmPortModule::OmPortModule(OmFlowCanvas* canvas, CountedPtr<PortModel> port) if (m_patch_port) delete m_patch_port; - m_patch_port = new OmPatchPort(this, port); + m_patch_port = new PatchPort(this, port); } resize(); @@ -64,12 +64,12 @@ OmPortModule::OmPortModule(OmFlowCanvas* canvas, CountedPtr<PortModel> port) move_to(default_x, default_y); } - port->metadata_update_sig.connect(sigc::mem_fun(this, &OmPortModule::metadata_update)); + port->metadata_update_sig.connect(sigc::mem_fun(this, &PatchPortModule::metadata_update)); } void -OmPortModule::store_location() +PatchPortModule::store_location() { const float x = static_cast<float>(property_x()); const float y = static_cast<float>(property_y()); @@ -86,7 +86,7 @@ OmPortModule::store_location() void -OmPortModule::metadata_update(const string& key, const Atom& value) +PatchPortModule::metadata_update(const string& key, const Atom& value) { if (key == "module-x" && value.type() == Atom::FLOAT) move_to(value.get_float(), property_y()); diff --git a/src/progs/ingenuity/OmPortModule.h b/src/progs/ingenuity/PatchPortModule.h index 028f3c78..56f259e9 100644 --- a/src/progs/ingenuity/OmPortModule.h +++ b/src/progs/ingenuity/PatchPortModule.h @@ -21,7 +21,7 @@ #include <libgnomecanvasmm.h> #include <flowcanvas/Module.h> #include "util/Atom.h" -#include "OmPatchPort.h" +#include "PatchPort.h" using std::string; namespace Ingen { namespace Client { @@ -33,8 +33,8 @@ using namespace Ingen::Client; namespace Ingenuity { -class OmFlowCanvas; -class OmPort; +class PatchCanvas; +class Port; /** A "module" to represent a patch's port on it's own canvas. @@ -43,16 +43,12 @@ class OmPort; * * \ingroup Ingenuity */ -class OmPortModule : public LibFlowCanvas::Module +class PatchPortModule : public LibFlowCanvas::Module { public: - OmPortModule(OmFlowCanvas* canvas, CountedPtr<PortModel> port); - virtual ~OmPortModule() {} + PatchPortModule(PatchCanvas* canvas, CountedPtr<PortModel> port); + virtual ~PatchPortModule() {} - //virtual OmPort* port(const string& port_name) { - // return (OmPort*)Module::port(port_name); - //} - virtual void store_location(); //void on_right_click(GdkEventButton* event) { m_port->show_menu(event); } @@ -66,7 +62,7 @@ protected: void metadata_update(const string& key, const Atom& value); CountedPtr<PortModel> m_port; - OmPatchPort* m_patch_port; ///< Port on this 'anonymous' module + PatchPort* m_patch_port; ///< Port on this 'anonymous' module }; diff --git a/src/progs/ingenuity/PatchView.cpp b/src/progs/ingenuity/PatchView.cpp index 0ae82f45..e8cf9e5f 100644 --- a/src/progs/ingenuity/PatchView.cpp +++ b/src/progs/ingenuity/PatchView.cpp @@ -20,7 +20,7 @@ #include <fstream> #include "App.h" #include "ModelEngineInterface.h" -#include "OmFlowCanvas.h" +#include "PatchCanvas.h" #include "LoadPluginWindow.h" #include "PatchModel.h" #include "NewSubpatchWindow.h" @@ -62,7 +62,7 @@ PatchView::set_patch(CountedPtr<PatchModel> patch) assert(_breadcrumb_container); // ensure created _patch = patch; - _canvas = new OmFlowCanvas(patch, 1600*2, 1200*2); + _canvas = new PatchCanvas(patch, 1600*2, 1200*2); _canvas_scrolledwindow->add(*_canvas); diff --git a/src/progs/ingenuity/PatchView.h b/src/progs/ingenuity/PatchView.h index a6484b97..d0c9c4c4 100644 --- a/src/progs/ingenuity/PatchView.h +++ b/src/progs/ingenuity/PatchView.h @@ -36,7 +36,7 @@ using namespace Ingen::Client; namespace Ingenuity { -class OmFlowCanvas; +class PatchCanvas; class LoadPluginWindow; class NewSubpatchWindow; class LoadSubpatchWindow; @@ -57,7 +57,7 @@ public: PatchView(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& glade_xml); ~PatchView(); - OmFlowCanvas* canvas() const { return _canvas; } + PatchCanvas* canvas() const { return _canvas; } CountedPtr<PatchModel> patch() const { return _patch; } Gtk::Viewport* breadcrumb_container() const { return _breadcrumb_container; } @@ -75,7 +75,7 @@ private: void zoom_full(); CountedPtr<PatchModel> _patch; - OmFlowCanvas* _canvas; + PatchCanvas* _canvas; Gtk::ScrolledWindow* _canvas_scrolledwindow; diff --git a/src/progs/ingenuity/PatchWindow.cpp b/src/progs/ingenuity/PatchWindow.cpp index d3bfd14b..edf2e9d0 100644 --- a/src/progs/ingenuity/PatchWindow.cpp +++ b/src/progs/ingenuity/PatchWindow.cpp @@ -20,7 +20,7 @@ #include <fstream> #include "App.h" #include "ModelEngineInterface.h" -#include "OmFlowCanvas.h" +#include "PatchCanvas.h" #include "LoadPluginWindow.h" #include "PatchModel.h" #include "NewSubpatchWindow.h" diff --git a/src/progs/ingenuity/PatchWindow.h b/src/progs/ingenuity/PatchWindow.h index 79284cb5..0ab5fe48 100644 --- a/src/progs/ingenuity/PatchWindow.h +++ b/src/progs/ingenuity/PatchWindow.h @@ -42,7 +42,7 @@ using namespace Ingen::Client; namespace Ingenuity { -class OmFlowCanvas; +class PatchCanvas; class LoadPluginWindow; class LoadPatchWindow; class NewSubpatchWindow; diff --git a/src/progs/ingenuity/OmPort.cpp b/src/progs/ingenuity/Port.cpp index e2a32652..e6f70e16 100644 --- a/src/progs/ingenuity/OmPort.cpp +++ b/src/progs/ingenuity/Port.cpp @@ -14,11 +14,11 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "OmPort.h" +#include "Port.h" #include <cassert> #include <iostream> #include "PortModel.h" -#include "OmModule.h" +#include "NodeModule.h" #include "ControlModel.h" #include "Configuration.h" #include "App.h" @@ -28,30 +28,13 @@ using namespace Ingen::Client; namespace Ingenuity { -OmPort::OmPort(Module* module, CountedPtr<PortModel> pm) -: Port(module, pm->path().name(), pm->is_input(), App::instance().configuration()->get_port_color(pm.get())), +Port::Port(NodeModule* module, CountedPtr<PortModel> pm) +: LibFlowCanvas::Port(module, pm->path().name(), pm->is_input(), App::instance().configuration()->get_port_color(pm.get())), m_port_model(pm) { assert(module); assert(m_port_model); } -#if 0 -void -OmPort::set_name(const string& n) -{ - cerr << "********** OmPort::set_name broken **********************" << endl; - - /* FIXME: move to PortController - string new_path = Path::parent(m_port_model->path()) +"/"+ n; - - for (list<ControlPanel*>::iterator i = m_control_panels.begin(); i != m_control_panels.end(); ++i) - (*i)->rename_port(m_port_model->path(), new_path); - - Port::set_name(n); - m_port_model->path(new_path); - */ -} -#endif } // namespace Ingenuity diff --git a/src/progs/ingenuity/OmPort.h b/src/progs/ingenuity/Port.h index cedad156..16edd71a 100644 --- a/src/progs/ingenuity/OmPort.h +++ b/src/progs/ingenuity/Port.h @@ -14,8 +14,8 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef OMPORT_H -#define OMPORT_H +#ifndef PORT_H +#define PORT_H #include <cassert> #include <string> @@ -23,30 +23,24 @@ #include "util/CountedPtr.h" namespace Ingen { namespace Client { class PortModel; } } -using namespace Ingen::Client; -using namespace LibFlowCanvas; -using std::string; using std::list; +using Ingen::Client::PortModel; namespace Ingenuity { - -class FlowCanvas; -class PatchWindow; -class OmModule; + +class NodeModule; -/** A Port on an OmModule. +/** A Port on an Module. * * \ingroup Ingenuity */ -class OmPort : public LibFlowCanvas::Port +class Port : public LibFlowCanvas::Port { public: - OmPort(Module* module, CountedPtr<PortModel> pm); + Port(NodeModule* module, CountedPtr<PortModel> pm); - virtual ~OmPort() {} + virtual ~Port() {} - //void set_name(const string& n); - CountedPtr<PortModel> model() const { return m_port_model; } private: @@ -56,4 +50,4 @@ private: } // namespace Ingenuity -#endif // OMPORT_H +#endif // PORT_H diff --git a/src/progs/ingenuity/SubpatchModule.cpp b/src/progs/ingenuity/SubpatchModule.cpp index 47465b09..585ccee3 100644 --- a/src/progs/ingenuity/SubpatchModule.cpp +++ b/src/progs/ingenuity/SubpatchModule.cpp @@ -19,20 +19,20 @@ #include <iostream> #include "App.h" #include "ModelEngineInterface.h" -#include "OmModule.h" +#include "NodeModule.h" #include "NodeControlWindow.h" #include "PatchModel.h" #include "PatchWindow.h" -#include "OmFlowCanvas.h" -#include "OmPort.h" +#include "PatchCanvas.h" +#include "Port.h" #include "WindowFactory.h" using std::cerr; using std::cout; using std::endl; namespace Ingenuity { -SubpatchModule::SubpatchModule(OmFlowCanvas* canvas, CountedPtr<PatchModel> patch) -: OmModule(canvas, patch), +SubpatchModule::SubpatchModule(PatchCanvas* canvas, CountedPtr<PatchModel> patch) +: NodeModule(canvas, patch), m_patch(patch) { assert(canvas); diff --git a/src/progs/ingenuity/SubpatchModule.h b/src/progs/ingenuity/SubpatchModule.h index 0f52ae2b..571ae0fd 100644 --- a/src/progs/ingenuity/SubpatchModule.h +++ b/src/progs/ingenuity/SubpatchModule.h @@ -20,9 +20,10 @@ #include <string> #include <libgnomecanvasmm.h> -#include "OmModule.h" +#include "NodeModule.h" #include "util/CountedPtr.h" #include "PatchModel.h" +#include "PatchPortModule.h" using std::string; using std::list; namespace Ingen { namespace Client { @@ -35,7 +36,7 @@ using namespace Ingen::Client; namespace Ingenuity { -class OmFlowCanvas; +class PatchCanvas; class NodeControlWindow; @@ -43,10 +44,10 @@ class NodeControlWindow; * * \ingroup Ingenuity */ -class SubpatchModule : public OmModule +class SubpatchModule : public NodeModule { public: - SubpatchModule(OmFlowCanvas* canvas, CountedPtr<PatchModel> controller); + SubpatchModule(PatchCanvas* canvas, CountedPtr<PatchModel> controller); virtual ~SubpatchModule() {} void on_double_click(GdkEventButton* ev); |