diff options
author | David Robillard <d@drobilla.net> | 2012-08-19 02:24:38 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-08-19 02:24:38 +0000 |
commit | 800c329a0b77f9044923885abe0728028eca8350 (patch) | |
tree | f2d4a9d06fd6978e193de95ba60bfffe3d15a998 /src | |
parent | 317627ef40f7654c298aa1ac707851c852259e3a (diff) | |
download | ingen-800c329a0b77f9044923885abe0728028eca8350.tar.gz ingen-800c329a0b77f9044923885abe0728028eca8350.tar.bz2 ingen-800c329a0b77f9044923885abe0728028eca8350.zip |
Patch => Graph
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4721 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
118 files changed, 1839 insertions, 1836 deletions
diff --git a/src/AtomWriter.cpp b/src/AtomWriter.cpp index 466c6a7e..34ea62d0 100644 --- a/src/AtomWriter.cpp +++ b/src/AtomWriter.cpp @@ -213,14 +213,14 @@ AtomWriter::disconnect(const Raul::Path& tail, } void -AtomWriter::disconnect_all(const Raul::Path& parent_patch_path, +AtomWriter::disconnect_all(const Raul::Path& graph, const Raul::Path& path) { LV2_Atom_Forge_Frame msg; lv2_atom_forge_blank(&_forge, &msg, next_id(), _uris.patch_Delete); lv2_atom_forge_property_head(&_forge, _uris.patch_subject, 0); - forge_uri(GraphObject::path_to_uri(parent_patch_path)); + forge_uri(GraphObject::path_to_uri(graph)); lv2_atom_forge_property_head(&_forge, _uris.patch_body, 0); LV2_Atom_Forge_Frame edge; diff --git a/src/Builder.cpp b/src/Builder.cpp index f0edd438..49f5d76b 100644 --- a/src/Builder.cpp +++ b/src/Builder.cpp @@ -41,7 +41,7 @@ Builder::build(SharedPtr<const GraphObject> object) void Builder::connect(SharedPtr<const GraphObject> object) { - if (object->graph_type() == GraphObject::PATCH) { + if (object->graph_type() == GraphObject::GRAPH) { for (GraphObject::Edges::const_iterator i = object->edges().begin(); i != object->edges().end(); ++i) { _interface.connect(i->second->tail_path(), i->second->head_path()); diff --git a/src/ClashAvoider.cpp b/src/ClashAvoider.cpp index 13afc283..fce60291 100644 --- a/src/ClashAvoider.cpp +++ b/src/ClashAvoider.cpp @@ -170,10 +170,10 @@ ClashAvoider::disconnect(const Raul::Path& tail, } void -ClashAvoider::disconnect_all(const Raul::Path& parent_patch, +ClashAvoider::disconnect_all(const Raul::Path& graph, const Raul::Path& path) { - _target.disconnect_all(map_path(parent_patch), map_path(path)); + _target.disconnect_all(map_path(graph), map_path(path)); } void diff --git a/src/Configuration.cpp b/src/Configuration.cpp index 4db54b65..2a5e69f7 100644 --- a/src/Configuration.cpp +++ b/src/Configuration.cpp @@ -27,11 +27,11 @@ Configuration::Configuration() "clients, can communicate with the engine via any supported protocol, or host the\n" "engine in the same process. Many clients can connect to an engine at once.\n\n" "Examples:\n" - " ingen -e # Run an engine, listen for connections\n" - " ingen -g # Run a GUI, connect to running engine\n" - " ingen -eg # Run an engine and a GUI in one process\n" - " ingen -egl patch.ttl # Run an engine and a GUI and load a patch file\n" - " ingen -egl patch.ingen # Run an engine and a GUI and load a patch bundle") + " ingen -e # Run an engine, listen for connections\n" + " ingen -g # Run a GUI, connect to running engine\n" + " ingen -eg # Run an engine and a GUI in one process\n" + " ingen -egl foo.ttl # Run an engine and a GUI and load a graph\n" + " ingen -egl foo.ingen # Run an engine and a GUI and load a graph") { add("client-port", 'C', "Client port", INT, Value()); add("connect", 'c', "Connect to engine URI", STRING, Value("unix:///tmp/ingen.sock")); @@ -43,9 +43,9 @@ Configuration::Configuration() add("jack-client", 'n', "JACK client name", STRING, Value("ingen")); add("jack-server", 's', "JACK server name", STRING, Value("")); add("uuid", 'u', "JACK session UUID", STRING, Value()); - add("load", 'l', "Load patch", STRING, Value()); + add("load", 'l', "Load graph", STRING, Value()); add("packet-size", 'k', "Maximum UDP packet size", INT, Value(4096)); - add("path", 'L', "Target path for loaded patch", STRING, Value()); + add("path", 'L', "Target path for loaded graph", STRING, Value()); add("queue-size", 'q', "Event queue size", INT, Value(4096)); add("run", 'r', "Run script", STRING, Value()); } diff --git a/src/Resource.cpp b/src/Resource.cpp index a317ff67..7db46a81 100644 --- a/src/Resource.cpp +++ b/src/Resource.cpp @@ -110,7 +110,7 @@ Resource::get_property(const Raul::URI& uri) const bool Resource::type(const URIs& uris, const Properties& properties, - bool& patch, + bool& graph, bool& block, bool& port, bool& is_output) @@ -118,15 +118,15 @@ Resource::type(const URIs& uris, typedef Resource::Properties::const_iterator iterator; const std::pair<iterator, iterator> types_range = properties.equal_range(uris.rdf_type); - patch = block = port = is_output = false; + graph = block = port = is_output = false; for (iterator i = types_range.first; i != types_range.second; ++i) { const Raul::Atom& atom = i->second; if (atom.type() != uris.forge.URI && atom.type() != uris.forge.URID) { continue; // Non-URI type, ignore garbage data } - if (atom == uris.ingen_Patch) { - patch = true; + if (atom == uris.ingen_Graph) { + graph = true; } else if (atom == uris.ingen_Block) { block = true; } else if (atom == uris.lv2_InputPort) { @@ -138,13 +138,13 @@ Resource::type(const URIs& uris, } } - if (patch && block && !port) { // => patch + if (graph && block && !port) { // => graph block = false; return true; - } else if (port && (patch || block)) { // nonsense + } else if (port && (graph || block)) { // nonsense port = false; return false; - } else if (patch || block || port) { // recognized type + } else if (graph || block || port) { // recognized type return true; } else { // unknown return false; diff --git a/src/URIs.cpp b/src/URIs.cpp index 227b6162..78f57f58 100644 --- a/src/URIs.cpp +++ b/src/URIs.cpp @@ -57,8 +57,8 @@ URIs::URIs(Forge& f, URIMap* map) , doap_name (forge, map, "http://usefulinc.com/ns/doap#name") , ingen_Block (forge, map, NS_INGEN "Block") , ingen_Edge (forge, map, NS_INGEN "Edge") + , ingen_Graph (forge, map, NS_INGEN "Graph") , ingen_Internal (forge, map, NS_INGEN "Internal") - , ingen_Patch (forge, map, NS_INGEN "Patch") , ingen_activity (forge, map, NS_INGEN "activity") , ingen_block (forge, map, NS_INGEN "block") , ingen_broadcast (forge, map, NS_INGEN "broadcast") diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp index 07b44b84..6d4cbfd4 100644 --- a/src/client/ClientStore.cpp +++ b/src/client/ClientStore.cpp @@ -19,7 +19,7 @@ #include "ingen/client/EdgeModel.hpp" #include "ingen/client/BlockModel.hpp" #include "ingen/client/ObjectModel.hpp" -#include "ingen/client/PatchModel.hpp" +#include "ingen/client/GraphModel.hpp" #include "ingen/client/PluginModel.hpp" #include "ingen/client/PortModel.hpp" #include "ingen/client/SigClientInterface.hpp" @@ -223,9 +223,9 @@ ClientStore::put(const Raul::URI& uri, std::cerr << "}" << endl; #endif - bool is_patch, is_block, is_port, is_output; + bool is_graph, is_block, is_port, is_output; Resource::type(uris(), properties, - is_patch, is_block, is_port, is_output); + is_graph, is_block, is_port, is_output); // Check if uri is a plugin Iterator t = properties.find(_uris.rdf_type); @@ -233,8 +233,8 @@ ClientStore::put(const Raul::URI& uri, const Raul::Atom& type(t->second); const Raul::URI type_uri(type.get_uri()); const Plugin::Type plugin_type(Plugin::type_from_uri(type_uri)); - if (plugin_type == Plugin::Patch) { - is_patch = true; + if (plugin_type == Plugin::Graph) { + is_graph = true; } else if (plugin_type != Plugin::NIL) { SharedPtr<PluginModel> p( new PluginModel(uris(), uri, type_uri, properties)); @@ -258,11 +258,11 @@ ClientStore::put(const Raul::URI& uri, } if (path.is_root()) { - is_patch = true; + is_graph = true; } - if (is_patch) { - SharedPtr<PatchModel> model(new PatchModel(uris(), path)); + if (is_graph) { + SharedPtr<GraphModel> model(new GraphModel(uris(), path)); model->set_properties(properties); add_object(model); } else if (is_block) { @@ -373,29 +373,29 @@ ClientStore::set_property(const Raul::URI& subject_uri, } } -SharedPtr<PatchModel> -ClientStore::connection_patch(const Raul::Path& tail_path, +SharedPtr<GraphModel> +ClientStore::connection_graph(const Raul::Path& tail_path, const Raul::Path& head_path) { - SharedPtr<PatchModel> patch; + SharedPtr<GraphModel> graph; if (tail_path.parent() == head_path.parent()) - patch = PtrCast<PatchModel>(_object(tail_path.parent())); + graph = PtrCast<GraphModel>(_object(tail_path.parent())); - if (!patch && tail_path.parent() == head_path.parent().parent()) - patch = PtrCast<PatchModel>(_object(tail_path.parent())); + if (!graph && tail_path.parent() == head_path.parent().parent()) + graph = PtrCast<GraphModel>(_object(tail_path.parent())); - if (!patch && tail_path.parent().parent() == head_path.parent()) - patch = PtrCast<PatchModel>(_object(head_path.parent())); + if (!graph && tail_path.parent().parent() == head_path.parent()) + graph = PtrCast<GraphModel>(_object(head_path.parent())); - if (!patch) - patch = PtrCast<PatchModel>(_object(tail_path.parent().parent())); + if (!graph) + graph = PtrCast<GraphModel>(_object(tail_path.parent().parent())); - if (!patch) - _log.error(Raul::fmt("Unable to find path for edge %1% => %2%\n") + if (!graph) + _log.error(Raul::fmt("Unable to find graph for edge %1% => %2%\n") % tail_path % head_path); - return patch; + return graph; } bool @@ -406,13 +406,13 @@ ClientStore::attempt_connection(const Raul::Path& tail_path, SharedPtr<PortModel> head = PtrCast<PortModel>(_object(head_path)); if (tail && head) { - SharedPtr<PatchModel> patch = connection_patch(tail_path, head_path); + SharedPtr<GraphModel> graph = connection_graph(tail_path, head_path); SharedPtr<EdgeModel> cm(new EdgeModel(tail, head)); tail->connected_to(head); head->connected_to(tail); - patch->add_edge(cm); + graph->add_edge(cm); return true; } else { _log.warn(Raul::fmt("Failed to connect %1% => %2%\n") @@ -441,26 +441,26 @@ ClientStore::disconnect(const Raul::Path& src_path, if (head) head->disconnected_from(tail); - SharedPtr<PatchModel> patch = connection_patch(src_path, dst_path); - if (patch) - patch->remove_edge(tail.get(), head.get()); + SharedPtr<GraphModel> graph = connection_graph(src_path, dst_path); + if (graph) + graph->remove_edge(tail.get(), head.get()); } void -ClientStore::disconnect_all(const Raul::Path& parent_patch, +ClientStore::disconnect_all(const Raul::Path& parent_graph, const Raul::Path& path) { - SharedPtr<PatchModel> patch = PtrCast<PatchModel>(_object(parent_patch)); + SharedPtr<GraphModel> graph = PtrCast<GraphModel>(_object(parent_graph)); SharedPtr<ObjectModel> object = _object(path); - if (!patch || !object) { + if (!graph || !object) { _log.error(Raul::fmt("Bad disconnect all notification %1% in %2%\n") - % path % parent_patch); + % path % parent_graph); return; } - const PatchModel::Edges edges = patch->edges(); - for (PatchModel::Edges::const_iterator i = edges.begin(); + const GraphModel::Edges edges = graph->edges(); + for (GraphModel::Edges::const_iterator i = edges.begin(); i != edges.end(); ++i) { SharedPtr<EdgeModel> c = PtrCast<EdgeModel>(i->second); if (c->tail()->parent() == object @@ -469,7 +469,7 @@ ClientStore::disconnect_all(const Raul::Path& parent_patch, || c->head()->path() == path) { c->tail()->disconnected_from(c->head()); c->head()->disconnected_from(c->tail()); - patch->remove_edge(c->tail().get(), c->head().get()); + graph->remove_edge(c->tail().get(), c->head().get()); } } } diff --git a/src/client/PatchModel.cpp b/src/client/GraphModel.cpp index 9b622cda..88943978 100644 --- a/src/client/PatchModel.cpp +++ b/src/client/GraphModel.cpp @@ -16,11 +16,11 @@ #include <cassert> +#include "ingen/URIs.hpp" +#include "ingen/client/BlockModel.hpp" #include "ingen/client/ClientStore.hpp" #include "ingen/client/EdgeModel.hpp" -#include "ingen/client/BlockModel.hpp" -#include "ingen/client/PatchModel.hpp" -#include "ingen/URIs.hpp" +#include "ingen/client/GraphModel.hpp" using namespace std; @@ -28,7 +28,7 @@ namespace Ingen { namespace Client { void -PatchModel::add_child(SharedPtr<ObjectModel> c) +GraphModel::add_child(SharedPtr<ObjectModel> c) { assert(c->parent().get() == this); @@ -45,7 +45,7 @@ PatchModel::add_child(SharedPtr<ObjectModel> c) } bool -PatchModel::remove_child(SharedPtr<ObjectModel> o) +GraphModel::remove_child(SharedPtr<ObjectModel> o) { assert(o->path().is_child_of(path())); assert(o->parent().get() == this); @@ -82,7 +82,7 @@ PatchModel::remove_child(SharedPtr<ObjectModel> o) } void -PatchModel::clear() +GraphModel::clear() { _edges.clear(); @@ -93,7 +93,7 @@ PatchModel::clear() } SharedPtr<EdgeModel> -PatchModel::get_edge(const GraphObject* tail, const GraphObject* head) +GraphModel::get_edge(const GraphObject* tail, const GraphObject* head) { Edges::iterator i = _edges.find(make_pair(tail, head)); if (i != _edges.end()) @@ -102,15 +102,15 @@ PatchModel::get_edge(const GraphObject* tail, const GraphObject* head) return SharedPtr<EdgeModel>(); } -/** Add a connection to this patch. +/** Add a connection to this graph. * * A reference to @a cm is taken, released on deletion or removal. * If @a cm only contains paths (not pointers to the actual ports), the ports * will be found and set. The ports referred to not existing as children of - * this patch is a fatal error. + * this graph is a fatal error. */ void -PatchModel::add_edge(SharedPtr<EdgeModel> cm) +GraphModel::add_edge(SharedPtr<EdgeModel> cm) { // Store should have 'resolved' the connection already assert(cm); @@ -138,7 +138,7 @@ PatchModel::add_edge(SharedPtr<EdgeModel> cm) } void -PatchModel::remove_edge(const GraphObject* tail, const GraphObject* head) +GraphModel::remove_edge(const GraphObject* tail, const GraphObject* head) { Edges::iterator i = _edges.find(make_pair(tail, head)); if (i != _edges.end()) { @@ -149,21 +149,21 @@ PatchModel::remove_edge(const GraphObject* tail, const GraphObject* head) } bool -PatchModel::enabled() const +GraphModel::enabled() const { const Raul::Atom& enabled = get_property(_uris.ingen_enabled); return (enabled.is_valid() && enabled.get_bool()); } uint32_t -PatchModel::internal_poly() const +GraphModel::internal_poly() const { const Raul::Atom& poly = get_property(_uris.ingen_polyphony); return poly.is_valid() ? poly.get_int32() : 1; } bool -PatchModel::polyphonic() const +GraphModel::polyphonic() const { const Raul::Atom& poly = get_property(_uris.ingen_polyphonic); return poly.is_valid() && poly.get_bool(); diff --git a/src/client/PluginModel.cpp b/src/client/PluginModel.cpp index 53736a3e..371e6b46 100644 --- a/src/client/PluginModel.cpp +++ b/src/client/PluginModel.cpp @@ -24,7 +24,7 @@ #include "raul/Atom.hpp" #include "raul/Path.hpp" -#include "ingen/client/PatchModel.hpp" +#include "ingen/client/GraphModel.hpp" #include "ingen/client/PluginModel.hpp" #include "ingen/client/PluginUI.hpp" diff --git a/src/client/wscript b/src/client/wscript index c85ee5ab..c2b12ef3 100644 --- a/src/client/wscript +++ b/src/client/wscript @@ -14,8 +14,8 @@ def build(bld): obj.source = ''' BlockModel.cpp ClientStore.cpp + GraphModel.cpp ObjectModel.cpp - PatchModel.cpp PluginModel.cpp PluginUI.cpp PortModel.cpp diff --git a/src/gui/App.cpp b/src/gui/App.cpp index de35de54..96bb1254 100644 --- a/src/gui/App.cpp +++ b/src/gui/App.cpp @@ -29,7 +29,7 @@ #include "ingen/World.hpp" #include "ingen/client/ClientStore.hpp" #include "ingen/client/ObjectModel.hpp" -#include "ingen/client/PatchModel.hpp" +#include "ingen/client/GraphModel.hpp" #include "ingen/client/SigClientInterface.hpp" #include "ingen/runtime_paths.hpp" #include "lilv/lilv.h" @@ -41,10 +41,10 @@ #include "LoadPluginWindow.hpp" #include "MessagesWindow.hpp" #include "NodeModule.hpp" -#include "PatchTreeWindow.hpp" -#include "PatchWindow.hpp" +#include "GraphTreeWindow.hpp" +#include "GraphWindow.hpp" #include "Port.hpp" -#include "SubpatchModule.hpp" +#include "SubgraphModule.hpp" #include "ThreadedLoader.hpp" #include "WidgetFactory.hpp" #include "WindowFactory.hpp" @@ -78,11 +78,11 @@ App::App(Ingen::World* world) WidgetFactory::get_widget_derived("connect_win", _connect_window); WidgetFactory::get_widget_derived("messages_win", _messages_window); - WidgetFactory::get_widget_derived("patch_tree_win", _patch_tree_window); + WidgetFactory::get_widget_derived("graph_tree_win", _graph_tree_window); WidgetFactory::get_widget("about_win", _about_dialog); _connect_window->init_dialog(*this); _messages_window->init_window(*this); - _patch_tree_window->init_window(*this); + _graph_tree_window->init_window(*this); _about_dialog->property_program_name() = "Ingen"; _about_dialog->property_logo_icon_name() = "ingen"; @@ -140,7 +140,7 @@ App::run() // Run main iterations here until we're attached to the engine. Otherwise // with 'ingen -egl' we'd get a bunch of notifications about load - // immediately before even knowing about the root patch or plugins) + // immediately before even knowing about the root graph or plugins) while (!_connect_window->attached()) if (_main->iteration()) break; @@ -163,7 +163,7 @@ App::attach(SharedPtr<SigClientInterface> client) _store = SharedPtr<ClientStore>(new ClientStore(_world->uris(), _world->log(), _world->interface(), client)); _loader = SharedPtr<ThreadedLoader>(new ThreadedLoader(*this, _world->interface())); - _patch_tree_window->init(*this, *_store); + _graph_tree_window->init(*this, *_store); _client->signal_response().connect( sigc::mem_fun(this, &App::response)); diff --git a/src/gui/App.hpp b/src/gui/App.hpp index 32c59300..ac909b2f 100644 --- a/src/gui/App.hpp +++ b/src/gui/App.hpp @@ -40,7 +40,7 @@ namespace Ingen { class World; namespace Client { class ClientStore; - class PatchModel; + class GraphModel; class PluginModel; class PortModel; class SigClientInterface; @@ -55,9 +55,9 @@ namespace Ingen { namespace GUI { class MessagesWindow; -class PatchCanvas; -class PatchTreeView; -class PatchTreeWindow; +class GraphCanvas; +class GraphTreeView; +class GraphTreeWindow; class ConnectWindow; class Configuration; class ThreadedLoader; @@ -100,7 +100,7 @@ public: ConnectWindow* connect_window() const { return _connect_window; } MessagesWindow* messages_dialog() const { return _messages_window; } - PatchTreeWindow* patch_tree() const { return _patch_tree_window; } + GraphTreeWindow* graph_tree() const { return _graph_tree_window; } Configuration* configuration() const { return _configuration; } WindowFactory* window_factory() const { return _window_factory; } @@ -158,7 +158,7 @@ protected: ConnectWindow* _connect_window; MessagesWindow* _messages_window; - PatchTreeWindow* _patch_tree_window; + GraphTreeWindow* _graph_tree_window; Gtk::AboutDialog* _about_dialog; WindowFactory* _window_factory; diff --git a/src/gui/BreadCrumbs.cpp b/src/gui/BreadCrumbs.cpp index 29b149a5..bc6fc756 100644 --- a/src/gui/BreadCrumbs.cpp +++ b/src/gui/BreadCrumbs.cpp @@ -39,14 +39,14 @@ BreadCrumbs::BreadCrumbs(App& app) set_can_focus(false); } -SharedPtr<PatchView> +SharedPtr<GraphView> BreadCrumbs::view(const Raul::Path& path) { for (std::list<BreadCrumb*>::const_iterator i = _breadcrumbs.begin(); i != _breadcrumbs.end(); ++i) if ((*i)->path() == path) return (*i)->view(); - return SharedPtr<PatchView>(); + return SharedPtr<GraphView>(); } /** Sets up the crumbs to display @a path. @@ -55,7 +55,7 @@ BreadCrumbs::view(const Raul::Path& path) * children preserved. */ void -BreadCrumbs::build(Raul::Path path, SharedPtr<PatchView> view) +BreadCrumbs::build(Raul::Path path, SharedPtr<GraphView> view) { bool old_enable_signal = _enable_signal; _enable_signal = false; @@ -68,7 +68,7 @@ BreadCrumbs::build(Raul::Path path, SharedPtr<PatchView> view) if (!(*i)->view()) (*i)->set_view(view); - // views are expensive, having two around for the same patch is a bug + // views are expensive, having two around for the same graph is a bug assert((*i)->view() == view); } else { @@ -103,7 +103,7 @@ BreadCrumbs::build(Raul::Path path, SharedPtr<PatchView> view) _breadcrumbs.back()->set_active(true); // Rebuild from scratch - // Getting here is bad unless absolutely necessary, since the PatchView cache is lost + // Getting here is bad unless absolutely necessary, since the GraphView cache is lost } else { _full_path = path; @@ -147,10 +147,10 @@ BreadCrumbs::build(Raul::Path path, SharedPtr<PatchView> view) */ BreadCrumbs::BreadCrumb* BreadCrumbs::create_crumb(const Raul::Path& path, - SharedPtr<PatchView> view) + SharedPtr<GraphView> view) { BreadCrumb* but = manage(new BreadCrumb(path, - (view && path == view->patch()->path()) ? view : SharedPtr<PatchView>())); + (view && path == view->graph()->path()) ? view : SharedPtr<GraphView>())); but->signal_toggled().connect(sigc::bind(sigc::mem_fun( this, &BreadCrumbs::breadcrumb_clicked), but)); @@ -168,7 +168,7 @@ BreadCrumbs::breadcrumb_clicked(BreadCrumb* crumb) // Tried to turn off the current active button, bad user, no cookie crumb->set_active(true); } else { - signal_patch_selected.emit(crumb->path(), crumb->view()); + signal_graph_selected.emit(crumb->path(), crumb->view()); if (crumb->path() != _active_path) crumb->set_active(false); } diff --git a/src/gui/BreadCrumbs.hpp b/src/gui/BreadCrumbs.hpp index 43c7f011..cdb11583 100644 --- a/src/gui/BreadCrumbs.hpp +++ b/src/gui/BreadCrumbs.hpp @@ -26,15 +26,15 @@ #include "raul/Path.hpp" #include "raul/SharedPtr.hpp" -#include "ingen/client/PatchModel.hpp" +#include "ingen/client/GraphModel.hpp" -#include "PatchView.hpp" +#include "GraphView.hpp" namespace Ingen { namespace GUI { /** Collection of breadcrumb buttons forming a path. - * This doubles as a cache for PatchViews. + * This doubles as a cache for GraphViews. * * \ingroup GUI */ @@ -43,17 +43,17 @@ class BreadCrumbs : public Gtk::HBox public: explicit BreadCrumbs(App& app); - SharedPtr<PatchView> view(const Raul::Path& path); + SharedPtr<GraphView> view(const Raul::Path& path); - void build(Raul::Path path, SharedPtr<PatchView> view); + void build(Raul::Path path, SharedPtr<GraphView> view); - sigc::signal<void, const Raul::Path&, SharedPtr<PatchView> > signal_patch_selected; + sigc::signal<void, const Raul::Path&, SharedPtr<GraphView> > signal_graph_selected; private: /** Breadcrumb button. * - * Each Breadcrumb stores a reference to a PatchView for quick switching. - * So, the amount of allocated PatchViews at a given time is equal to the + * Each Breadcrumb stores a reference to a GraphView for quick switching. + * So, the amount of allocated GraphViews at a given time is equal to the * number of visible breadcrumbs (which is the perfect cache for GUI * responsiveness balanced with mem consumption). * @@ -62,24 +62,24 @@ private: class BreadCrumb : public Gtk::ToggleButton { public: - BreadCrumb(const Raul::Path& path, SharedPtr<PatchView> view = SharedPtr<PatchView>()) + BreadCrumb(const Raul::Path& path, SharedPtr<GraphView> view = SharedPtr<GraphView>()) : _path(path) , _view(view) { - assert(!view || view->patch()->path() == path); + assert(!view || view->graph()->path() == path); set_border_width(0); set_path(path); set_can_focus(false); show_all(); } - void set_view(SharedPtr<PatchView> view) { - assert(!view || view->patch()->path() == _path); + void set_view(SharedPtr<GraphView> view) { + assert(!view || view->graph()->path() == _path); _view = view; } const Raul::Path& path() const { return _path; } - SharedPtr<PatchView> view() const { return _view; } + SharedPtr<GraphView> view() const { return _view; } void set_path(const Raul::Path& path) { remove(); @@ -89,17 +89,17 @@ private: lab->show(); add(*lab); - if (_view && _view->patch()->path() != path) + if (_view && _view->graph()->path() != path) _view.reset(); } private: Raul::Path _path; - SharedPtr<PatchView> _view; + SharedPtr<GraphView> _view; }; BreadCrumb* create_crumb(const Raul::Path& path, - SharedPtr<PatchView> view = SharedPtr<PatchView>()); + SharedPtr<GraphView> view = SharedPtr<GraphView>()); void breadcrumb_clicked(BreadCrumb* crumb); diff --git a/src/gui/Configuration.hpp b/src/gui/Configuration.hpp index c3aec5fc..75c352e9 100644 --- a/src/gui/Configuration.hpp +++ b/src/gui/Configuration.hpp @@ -49,8 +49,8 @@ public: void apply_settings(); - const std::string& patch_folder() { return _patch_folder; } - void set_patch_folder(const std::string& f) { _patch_folder = f; } + const std::string& graph_folder() { return _graph_folder; } + void set_graph_folder(const std::string& f) { _graph_folder = f; } uint32_t get_port_color(const Client::PortModel* p); @@ -62,8 +62,8 @@ public: private: App& _app; - /** Most recent patch folder shown in open dialog */ - std::string _patch_folder; + /** Most recent graph folder shown in open dialog */ + std::string _graph_folder; NameStyle _name_style; diff --git a/src/gui/ConnectWindow.cpp b/src/gui/ConnectWindow.cpp index ea196175..73874449 100644 --- a/src/gui/ConnectWindow.cpp +++ b/src/gui/ConnectWindow.cpp @@ -28,7 +28,7 @@ #include "ingen/Module.hpp" #include "ingen/World.hpp" #include "ingen/client/ClientStore.hpp" -#include "ingen/client/PatchModel.hpp" +#include "ingen/client/GraphModel.hpp" #include "ingen/client/ThreadedSigClientInterface.hpp" #include "ingen_config.h" @@ -324,7 +324,7 @@ void ConnectWindow::on_hide() { Gtk::Dialog::on_hide(); - if (_app->window_factory()->num_open_patch_windows() == 0) + if (_app->window_factory()->num_open_graph_windows() == 0) quit(); } @@ -414,15 +414,15 @@ ConnectWindow::gtk_callback() } else if (_connect_stage == 2) { _app->interface()->get(GraphObject::root_uri()); if (_widgets_loaded) - _progress_label->set_text(string("Requesting root patch...")); + _progress_label->set_text(string("Requesting root graph...")); ++_connect_stage; } else if (_connect_stage == 3) { if (_app->store()->size() > 0) { - SharedPtr<const PatchModel> root = PtrCast<const PatchModel>( + SharedPtr<const GraphModel> root = PtrCast<const GraphModel>( _app->store()->object(Raul::Path("/"))); if (root) { set_connected_to(_app->interface()); - _app->window_factory()->present_patch(root); + _app->window_factory()->present_graph(root); _app->interface()->get(Raul::URI("ingen:plugins")); if (_widgets_loaded) _progress_label->set_text(string("Loading plugins...")); diff --git a/src/gui/Edge.hpp b/src/gui/Edge.hpp index 0bc22a79..cf1dafe8 100644 --- a/src/gui/Edge.hpp +++ b/src/gui/Edge.hpp @@ -28,7 +28,7 @@ namespace Client { class EdgeModel; } namespace GUI { -/** An Edge in a Patch. +/** An Edge in a Graph. * * \ingroup GUI */ diff --git a/src/gui/PatchBox.cpp b/src/gui/GraphBox.cpp index ea3de513..b0847f4a 100644 --- a/src/gui/PatchBox.cpp +++ b/src/gui/GraphBox.cpp @@ -25,20 +25,20 @@ #include "ingen/Interface.hpp" #include "ingen/client/ClientStore.hpp" -#include "ingen/client/PatchModel.hpp" +#include "ingen/client/GraphModel.hpp" #include "App.hpp" #include "BreadCrumbs.hpp" #include "Configuration.hpp" #include "ConnectWindow.hpp" -#include "LoadPatchWindow.hpp" +#include "LoadGraphWindow.hpp" #include "LoadPluginWindow.hpp" #include "MessagesWindow.hpp" -#include "NewSubpatchWindow.hpp" -#include "PatchCanvas.hpp" -#include "PatchTreeWindow.hpp" -#include "PatchView.hpp" -#include "PatchWindow.hpp" +#include "NewSubgraphWindow.hpp" +#include "GraphCanvas.hpp" +#include "GraphTreeWindow.hpp" +#include "GraphView.hpp" +#include "GraphWindow.hpp" #include "ThreadedLoader.hpp" #include "WidgetFactory.hpp" #include "WindowFactory.hpp" @@ -55,10 +55,10 @@ using namespace Client; namespace GUI { static const int STATUS_CONTEXT_ENGINE = 0; -static const int STATUS_CONTEXT_PATCH = 1; +static const int STATUS_CONTEXT_GRAPH = 1; static const int STATUS_CONTEXT_HOVER = 2; -PatchBox::PatchBox(BaseObjectType* cobject, +GraphBox::GraphBox(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& xml) : Gtk::VBox(cobject) , _app(NULL) @@ -69,106 +69,106 @@ PatchBox::PatchBox(BaseObjectType* cobject, { property_visible() = false; - xml->get_widget("patch_win_alignment", _alignment); - xml->get_widget("patch_win_status_bar", _status_bar); - //xml->get_widget("patch_win_status_bar", _status_bar); - //xml->get_widget("patch_open_menuitem", _menu_open); - xml->get_widget("patch_import_menuitem", _menu_import); - //xml->get_widget("patch_open_into_menuitem", _menu_open_into); - xml->get_widget("patch_save_menuitem", _menu_save); - xml->get_widget("patch_save_as_menuitem", _menu_save_as); - xml->get_widget("patch_draw_menuitem", _menu_draw); - xml->get_widget("patch_cut_menuitem", _menu_cut); - xml->get_widget("patch_copy_menuitem", _menu_copy); - xml->get_widget("patch_paste_menuitem", _menu_paste); - xml->get_widget("patch_delete_menuitem", _menu_delete); - xml->get_widget("patch_select_all_menuitem", _menu_select_all); - xml->get_widget("patch_close_menuitem", _menu_close); - xml->get_widget("patch_quit_menuitem", _menu_quit); - xml->get_widget("patch_view_control_window_menuitem", _menu_view_control_window); - xml->get_widget("patch_view_engine_window_menuitem", _menu_view_engine_window); - xml->get_widget("patch_properties_menuitem", _menu_view_patch_properties); - xml->get_widget("patch_fullscreen_menuitem", _menu_fullscreen); - xml->get_widget("patch_human_names_menuitem", _menu_human_names); - xml->get_widget("patch_show_port_names_menuitem", _menu_show_port_names); - xml->get_widget("patch_zoom_in_menuitem", _menu_zoom_in); - xml->get_widget("patch_zoom_out_menuitem", _menu_zoom_out); - xml->get_widget("patch_zoom_normal_menuitem", _menu_zoom_normal); - xml->get_widget("patch_status_bar_menuitem", _menu_show_status_bar); - xml->get_widget("patch_arrange_menuitem", _menu_arrange); - xml->get_widget("patch_view_messages_window_menuitem", _menu_view_messages_window); - xml->get_widget("patch_view_patch_tree_window_menuitem", _menu_view_patch_tree_window); - xml->get_widget("patch_help_about_menuitem", _menu_help_about); - xml->get_widget("patch_documentation_paned", _doc_paned); - xml->get_widget("patch_documentation_scrolledwindow", _doc_scrolledwindow); + xml->get_widget("graph_win_alignment", _alignment); + xml->get_widget("graph_win_status_bar", _status_bar); + //xml->get_widget("graph_win_status_bar", _status_bar); + //xml->get_widget("graph_open_menuitem", _menu_open); + xml->get_widget("graph_import_menuitem", _menu_import); + //xml->get_widget("graph_open_into_menuitem", _menu_open_into); + xml->get_widget("graph_save_menuitem", _menu_save); + xml->get_widget("graph_save_as_menuitem", _menu_save_as); + xml->get_widget("graph_draw_menuitem", _menu_draw); + xml->get_widget("graph_cut_menuitem", _menu_cut); + xml->get_widget("graph_copy_menuitem", _menu_copy); + xml->get_widget("graph_paste_menuitem", _menu_paste); + xml->get_widget("graph_delete_menuitem", _menu_delete); + xml->get_widget("graph_select_all_menuitem", _menu_select_all); + xml->get_widget("graph_close_menuitem", _menu_close); + xml->get_widget("graph_quit_menuitem", _menu_quit); + xml->get_widget("graph_view_control_window_menuitem", _menu_view_control_window); + xml->get_widget("graph_view_engine_window_menuitem", _menu_view_engine_window); + xml->get_widget("graph_properties_menuitem", _menu_view_graph_properties); + xml->get_widget("graph_fullscreen_menuitem", _menu_fullscreen); + xml->get_widget("graph_human_names_menuitem", _menu_human_names); + xml->get_widget("graph_show_port_names_menuitem", _menu_show_port_names); + xml->get_widget("graph_zoom_in_menuitem", _menu_zoom_in); + xml->get_widget("graph_zoom_out_menuitem", _menu_zoom_out); + xml->get_widget("graph_zoom_normal_menuitem", _menu_zoom_normal); + xml->get_widget("graph_status_bar_menuitem", _menu_show_status_bar); + xml->get_widget("graph_arrange_menuitem", _menu_arrange); + xml->get_widget("graph_view_messages_window_menuitem", _menu_view_messages_window); + xml->get_widget("graph_view_graph_tree_window_menuitem", _menu_view_graph_tree_window); + xml->get_widget("graph_help_about_menuitem", _menu_help_about); + xml->get_widget("graph_documentation_paned", _doc_paned); + xml->get_widget("graph_documentation_scrolledwindow", _doc_scrolledwindow); _menu_view_control_window->property_sensitive() = false; _menu_import->signal_activate().connect( - sigc::mem_fun(this, &PatchBox::event_import)); + sigc::mem_fun(this, &GraphBox::event_import)); _menu_save->signal_activate().connect( - sigc::mem_fun(this, &PatchBox::event_save)); + sigc::mem_fun(this, &GraphBox::event_save)); _menu_save_as->signal_activate().connect( - sigc::mem_fun(this, &PatchBox::event_save_as)); + sigc::mem_fun(this, &GraphBox::event_save_as)); _menu_draw->signal_activate().connect( - sigc::mem_fun(this, &PatchBox::event_draw)); + sigc::mem_fun(this, &GraphBox::event_draw)); _menu_copy->signal_activate().connect( - sigc::mem_fun(this, &PatchBox::event_copy)); + sigc::mem_fun(this, &GraphBox::event_copy)); _menu_paste->signal_activate().connect( - sigc::mem_fun(this, &PatchBox::event_paste)); + sigc::mem_fun(this, &GraphBox::event_paste)); _menu_delete->signal_activate().connect( - sigc::mem_fun(this, &PatchBox::event_delete)); + sigc::mem_fun(this, &GraphBox::event_delete)); _menu_select_all->signal_activate().connect( - sigc::mem_fun(this, &PatchBox::event_select_all)); + sigc::mem_fun(this, &GraphBox::event_select_all)); _menu_close->signal_activate().connect( - sigc::mem_fun(this, &PatchBox::event_close)); + sigc::mem_fun(this, &GraphBox::event_close)); _menu_quit->signal_activate().connect( - sigc::mem_fun(this, &PatchBox::event_quit)); + sigc::mem_fun(this, &GraphBox::event_quit)); _menu_fullscreen->signal_activate().connect( - sigc::mem_fun(this, &PatchBox::event_fullscreen_toggled)); + sigc::mem_fun(this, &GraphBox::event_fullscreen_toggled)); _menu_human_names->signal_activate().connect( - sigc::mem_fun(this, &PatchBox::event_human_names_toggled)); + sigc::mem_fun(this, &GraphBox::event_human_names_toggled)); _menu_show_status_bar->signal_activate().connect( - sigc::mem_fun(this, &PatchBox::event_status_bar_toggled)); + sigc::mem_fun(this, &GraphBox::event_status_bar_toggled)); _menu_show_port_names->signal_activate().connect( - sigc::mem_fun(this, &PatchBox::event_port_names_toggled)); + sigc::mem_fun(this, &GraphBox::event_port_names_toggled)); _menu_arrange->signal_activate().connect( - sigc::mem_fun(this, &PatchBox::event_arrange)); + sigc::mem_fun(this, &GraphBox::event_arrange)); _menu_quit->signal_activate().connect( - sigc::mem_fun(this, &PatchBox::event_quit)); + sigc::mem_fun(this, &GraphBox::event_quit)); _menu_zoom_in->signal_activate().connect( - sigc::mem_fun(this, &PatchBox::event_zoom_in)); + sigc::mem_fun(this, &GraphBox::event_zoom_in)); _menu_zoom_out->signal_activate().connect( - sigc::mem_fun(this, &PatchBox::event_zoom_out)); + sigc::mem_fun(this, &GraphBox::event_zoom_out)); _menu_zoom_normal->signal_activate().connect( - sigc::mem_fun(this, &PatchBox::event_zoom_normal)); + sigc::mem_fun(this, &GraphBox::event_zoom_normal)); _menu_view_engine_window->signal_activate().connect( - sigc::mem_fun(this, &PatchBox::event_show_engine)); - _menu_view_patch_properties->signal_activate().connect( - sigc::mem_fun(this, &PatchBox::event_show_properties)); + sigc::mem_fun(this, &GraphBox::event_show_engine)); + _menu_view_graph_properties->signal_activate().connect( + sigc::mem_fun(this, &GraphBox::event_show_properties)); Glib::RefPtr<Gtk::Clipboard> clipboard = Gtk::Clipboard::get(); clipboard->signal_owner_change().connect( - sigc::mem_fun(this, &PatchBox::event_clipboard_changed)); + sigc::mem_fun(this, &GraphBox::event_clipboard_changed)); } -PatchBox::~PatchBox() +GraphBox::~GraphBox() { delete _breadcrumbs; } -SharedPtr<PatchBox> -PatchBox::create(App& app, SharedPtr<const PatchModel> patch) +SharedPtr<GraphBox> +GraphBox::create(App& app, SharedPtr<const GraphModel> graph) { - PatchBox* result = NULL; - Glib::RefPtr<Gtk::Builder> xml = WidgetFactory::create("patch_win"); - xml->get_widget_derived("patch_win_vbox", result); + GraphBox* result = NULL; + Glib::RefPtr<Gtk::Builder> xml = WidgetFactory::create("graph_win"); + xml->get_widget_derived("graph_win_vbox", result); result->init_box(app); - result->set_patch(patch, SharedPtr<PatchView>()); - return SharedPtr<PatchBox>(result); + result->set_graph(graph, SharedPtr<GraphView>()); + return SharedPtr<GraphBox>(result); } void -PatchBox::init_box(App& app) +GraphBox::init_box(App& app) { _app = &app; @@ -180,41 +180,41 @@ PatchBox::init_box(App& app) _menu_view_messages_window->signal_activate().connect( sigc::mem_fun<void>(_app->messages_dialog(), &MessagesWindow::present)); - _menu_view_patch_tree_window->signal_activate().connect( - sigc::mem_fun<void>(_app->patch_tree(), &PatchTreeWindow::present)); + _menu_view_graph_tree_window->signal_activate().connect( + sigc::mem_fun<void>(_app->graph_tree(), &GraphTreeWindow::present)); _menu_help_about->signal_activate().connect(sigc::hide_return( sigc::mem_fun(_app, &App::show_about))); _breadcrumbs = new BreadCrumbs(*_app); - _breadcrumbs->signal_patch_selected.connect( - sigc::mem_fun(this, &PatchBox::set_patch_from_path)); + _breadcrumbs->signal_graph_selected.connect( + sigc::mem_fun(this, &GraphBox::set_graph_from_path)); } void -PatchBox::set_patch_from_path(const Raul::Path& path, SharedPtr<PatchView> view) +GraphBox::set_graph_from_path(const Raul::Path& path, SharedPtr<GraphView> view) { if (view) { - assert(view->patch()->path() == path); - _app->window_factory()->present_patch(view->patch(), _window, view); + assert(view->graph()->path() == path); + _app->window_factory()->present_graph(view->graph(), _window, view); } else { - SharedPtr<const PatchModel> model = PtrCast<const PatchModel>( + SharedPtr<const GraphModel> model = PtrCast<const GraphModel>( _app->store()->object(path)); if (model) { - _app->window_factory()->present_patch(model, _window); + _app->window_factory()->present_graph(model, _window); } } } -/** Sets the patch for this box and initializes everything. +/** Sets the graph for this box and initializes everything. * * If @a view is NULL, a new view will be created. */ void -PatchBox::set_patch(SharedPtr<const PatchModel> patch, - SharedPtr<PatchView> view) +GraphBox::set_graph(SharedPtr<const GraphModel> graph, + SharedPtr<GraphView> view) { - if (!patch || patch == _patch) + if (!graph || graph == _graph) return; _enable_signal = false; @@ -225,16 +225,16 @@ PatchBox::set_patch(SharedPtr<const PatchModel> patch, _entered_connection.disconnect(); _left_connection.disconnect(); - _status_bar->pop(STATUS_CONTEXT_PATCH); + _status_bar->pop(STATUS_CONTEXT_GRAPH); - _patch = patch; + _graph = graph; _view = view; if (!_view) - _view = _breadcrumbs->view(patch->path()); + _view = _breadcrumbs->view(graph->path()); if (!_view) - _view = PatchView::create(*_app, patch); + _view = GraphView::create(*_app, graph); assert(_view); @@ -252,38 +252,38 @@ PatchBox::set_patch(SharedPtr<const PatchModel> patch, _view->breadcrumb_container()->add(*_breadcrumbs); _view->breadcrumb_container()->show(); - _breadcrumbs->build(patch->path(), _view); + _breadcrumbs->build(graph->path(), _view); _breadcrumbs->show(); _menu_view_control_window->property_sensitive() = false; - for (BlockModel::Ports::const_iterator p = patch->ports().begin(); - p != patch->ports().end(); ++p) { + for (BlockModel::Ports::const_iterator p = graph->ports().begin(); + p != graph->ports().end(); ++p) { if (_app->can_control(p->get())) { _menu_view_control_window->property_sensitive() = true; break; } } - new_port_connection = patch->signal_new_port().connect( - sigc::mem_fun(this, &PatchBox::patch_port_added)); - removed_port_connection = patch->signal_removed_port().connect( - sigc::mem_fun(this, &PatchBox::patch_port_removed)); + new_port_connection = graph->signal_new_port().connect( + sigc::mem_fun(this, &GraphBox::graph_port_added)); + removed_port_connection = graph->signal_removed_port().connect( + sigc::mem_fun(this, &GraphBox::graph_port_removed)); show(); _alignment->show_all(); hide_documentation(); _view->signal_object_entered.connect( - sigc::mem_fun(this, &PatchBox::object_entered)); + sigc::mem_fun(this, &GraphBox::object_entered)); _view->signal_object_left.connect( - sigc::mem_fun(this, &PatchBox::object_left)); + sigc::mem_fun(this, &GraphBox::object_left)); _enable_signal = true; } void -PatchBox::patch_port_added(SharedPtr<const PortModel> port) +GraphBox::graph_port_added(SharedPtr<const PortModel> port) { if (port->is_input() && _app->can_control(port.get())) { _menu_view_control_window->property_sensitive() = true; @@ -291,13 +291,13 @@ PatchBox::patch_port_added(SharedPtr<const PortModel> port) } void -PatchBox::patch_port_removed(SharedPtr<const PortModel> port) +GraphBox::graph_port_removed(SharedPtr<const PortModel> port) { if (!(port->is_input() && _app->can_control(port.get()))) return; - for (BlockModel::Ports::const_iterator i = _patch->ports().begin(); - i != _patch->ports().end(); ++i) { + for (BlockModel::Ports::const_iterator i = _graph->ports().begin(); + i != _graph->ports().end(); ++i) { if ((*i)->is_input() && _app->can_control(i->get())) { _menu_view_control_window->property_sensitive() = true; return; @@ -308,7 +308,7 @@ PatchBox::patch_port_removed(SharedPtr<const PortModel> port) } void -PatchBox::show_documentation(const std::string& doc, bool html) +GraphBox::show_documentation(const std::string& doc, bool html) { #ifdef HAVE_WEBKIT WebKitWebView* view = WEBKIT_WEB_VIEW(webkit_web_view_new()); @@ -329,7 +329,7 @@ PatchBox::show_documentation(const std::string& doc, bool html) } void -PatchBox::hide_documentation() +GraphBox::hide_documentation() { _doc_scrolledwindow->remove(); _doc_scrolledwindow->hide(); @@ -337,7 +337,7 @@ PatchBox::hide_documentation() } void -PatchBox::show_status(const ObjectModel* model) +GraphBox::show_status(const ObjectModel* model) { std::stringstream msg; msg << model->path(); @@ -357,7 +357,7 @@ PatchBox::show_status(const ObjectModel* model) } void -PatchBox::show_port_status(const PortModel* port, const Raul::Atom& value) +GraphBox::show_port_status(const PortModel* port, const Raul::Atom& value) { std::stringstream msg; msg << port->path(); @@ -381,61 +381,61 @@ PatchBox::show_port_status(const PortModel* port, const Raul::Atom& value) } void -PatchBox::object_entered(const ObjectModel* model) +GraphBox::object_entered(const ObjectModel* model) { show_status(model); } void -PatchBox::object_left(const ObjectModel* model) +GraphBox::object_left(const ObjectModel* model) { - _status_bar->pop(STATUS_CONTEXT_PATCH); + _status_bar->pop(STATUS_CONTEXT_GRAPH); _status_bar->pop(STATUS_CONTEXT_HOVER); } void -PatchBox::event_show_engine() +GraphBox::event_show_engine() { - if (_patch) + if (_graph) _app->connect_window()->show(); } void -PatchBox::event_clipboard_changed(GdkEventOwnerChange* ev) +GraphBox::event_clipboard_changed(GdkEventOwnerChange* ev) { Glib::RefPtr<Gtk::Clipboard> clipboard = Gtk::Clipboard::get(); _menu_paste->set_sensitive(clipboard->wait_is_text_available()); } void -PatchBox::event_show_properties() +GraphBox::event_show_properties() { - _app->window_factory()->present_properties(_patch); + _app->window_factory()->present_properties(_graph); } void -PatchBox::event_import() +GraphBox::event_import() { - _app->window_factory()->present_load_patch(_patch); + _app->window_factory()->present_load_graph(_graph); } void -PatchBox::event_save() +GraphBox::event_save() { - const Raul::Atom& document = _patch->get_property(_app->uris().ingen_document); + const Raul::Atom& document = _graph->get_property(_app->uris().ingen_document); if (!document.is_valid() || document.type() != _app->uris().forge.URI) { event_save_as(); } else { - _app->loader()->save_patch(_patch, document.get_uri()); + _app->loader()->save_graph(_graph, document.get_uri()); _status_bar->push( - (boost::format("Saved %1% to %2%") % _patch->path().c_str() + (boost::format("Saved %1% to %2%") % _graph->path().c_str() % document.get_uri()).str(), - STATUS_CONTEXT_PATCH); + STATUS_CONTEXT_GRAPH); } } int -PatchBox::message_dialog(const Glib::ustring& message, +GraphBox::message_dialog(const Glib::ustring& message, const Glib::ustring& secondary_text, Gtk::MessageType type, Gtk::ButtonsType buttons) @@ -449,11 +449,11 @@ PatchBox::message_dialog(const Glib::ustring& message, } void -PatchBox::event_save_as() +GraphBox::event_save_as() { const URIs& uris = _app->uris(); while (true) { - Gtk::FileChooserDialog dialog("Save Patch", Gtk::FILE_CHOOSER_ACTION_SAVE); + Gtk::FileChooserDialog dialog("Save Graph", Gtk::FILE_CHOOSER_ACTION_SAVE); if (_window) { dialog.set_transient_for(*_window); } @@ -468,11 +468,11 @@ PatchBox::event_save_as() dialog.set_filter(filt); // Set current folder to most sensible default - const Raul::Atom& document = _patch->get_property(uris.ingen_document); + const Raul::Atom& document = _graph->get_property(uris.ingen_document); if (document.type() == uris.forge.URI) dialog.set_uri(document.get_uri()); - else if (_app->configuration()->patch_folder().length() > 0) - dialog.set_current_folder(_app->configuration()->patch_folder()); + else if (_app->configuration()->graph_folder().length() > 0) + dialog.set_current_folder(_app->configuration()->graph_folder()); if (dialog.run() != Gtk::RESPONSE_OK) break; @@ -485,7 +485,7 @@ PatchBox::event_save_as() basename += ".ingen"; } else if (filename.substr(filename.length() - 10) != ".ingen") { message_dialog( - "<b>Ingen patches must be saved to Ingen bundles (*.ingen).</b>", + "<b>Ingen graphs must be saved to Ingen bundles (*.ingen).</b>", "", Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK); continue; } @@ -500,7 +500,7 @@ PatchBox::event_save_as() continue; } - //_patch->set_property(uris.lv2_symbol, Atom(symbol.c_str())); + //_graph->set_property(uris.lv2_symbol, Atom(symbol.c_str())); bool confirm = true; if (Glib::file_test(filename, Glib::FILE_TEST_IS_DIR)) { @@ -535,24 +535,24 @@ PatchBox::event_save_as() if (confirm) { const Glib::ustring uri = Glib::filename_to_uri(filename); - _app->loader()->save_patch(_patch, uri); - const_cast<PatchModel*>(_patch.get())->set_property( + _app->loader()->save_graph(_graph, uri); + const_cast<GraphModel*>(_graph.get())->set_property( uris.ingen_document, _app->forge().alloc_uri(uri.c_str()), Resource::EXTERNAL); _status_bar->push( - (boost::format("Saved %1% to %2%") % _patch->path().c_str() + (boost::format("Saved %1% to %2%") % _graph->path().c_str() % filename).str(), - STATUS_CONTEXT_PATCH); + STATUS_CONTEXT_GRAPH); } - _app->configuration()->set_patch_folder(dialog.get_current_folder()); + _app->configuration()->set_graph_folder(dialog.get_current_folder()); break; } } void -PatchBox::event_draw() +GraphBox::event_draw() { Gtk::FileChooserDialog dialog("Draw to DOT", Gtk::FILE_CHOOSER_ACTION_SAVE); if (_window) { @@ -582,80 +582,80 @@ PatchBox::event_draw() _view->canvas()->export_dot(filename.c_str()); _status_bar->push( (boost::format("Rendered %1% to %2%") - % _patch->path() % filename).str(), - STATUS_CONTEXT_PATCH); + % _graph->path() % filename).str(), + STATUS_CONTEXT_GRAPH); } } } void -PatchBox::event_copy() +GraphBox::event_copy() { if (_view) _view->canvas()->copy_selection(); } void -PatchBox::event_paste() +GraphBox::event_paste() { if (_view) _view->canvas()->paste(); } void -PatchBox::event_delete() +GraphBox::event_delete() { if (_view) _view->canvas()->destroy_selection(); } void -PatchBox::event_select_all() +GraphBox::event_select_all() { if (_view) _view->canvas()->select_all(); } void -PatchBox::event_close() +GraphBox::event_close() { if (_window) { - _app->window_factory()->remove_patch_window(_window); + _app->window_factory()->remove_graph_window(_window); } } void -PatchBox::event_quit() +GraphBox::event_quit() { _app->quit(_window); } void -PatchBox::event_zoom_in() +GraphBox::event_zoom_in() { _view->canvas()->set_font_size(_view->canvas()->get_font_size() + 1.0); } void -PatchBox::event_zoom_out() +GraphBox::event_zoom_out() { _view->canvas()->set_font_size(_view->canvas()->get_font_size() - 1.0); } void -PatchBox::event_zoom_normal() +GraphBox::event_zoom_normal() { _view->canvas()->set_scale(1.0, _view->canvas()->get_default_font_size()); } void -PatchBox::event_arrange() +GraphBox::event_arrange() { _view->canvas()->arrange(); } void -PatchBox::event_fullscreen_toggled() +GraphBox::event_fullscreen_toggled() { // FIXME: ugh, use GTK signals to track state and know for sure static bool is_fullscreen = false; @@ -672,7 +672,7 @@ PatchBox::event_fullscreen_toggled() } void -PatchBox::event_status_bar_toggled() +GraphBox::event_status_bar_toggled() { if (_menu_show_status_bar->get_active()) _status_bar->show(); @@ -681,7 +681,7 @@ PatchBox::event_status_bar_toggled() } void -PatchBox::event_human_names_toggled() +GraphBox::event_human_names_toggled() { _view->canvas()->show_human_names(_menu_human_names->get_active()); if (_menu_human_names->get_active()) @@ -691,7 +691,7 @@ PatchBox::event_human_names_toggled() } void -PatchBox::event_port_names_toggled() +GraphBox::event_port_names_toggled() { if (_menu_show_port_names->get_active()) { _view->canvas()->set_direction(GANV_DIRECTION_RIGHT); diff --git a/src/gui/PatchBox.hpp b/src/gui/GraphBox.hpp index f69f98b7..e8ee3d8b 100644 --- a/src/gui/PatchBox.hpp +++ b/src/gui/GraphBox.hpp @@ -14,8 +14,8 @@ along with Ingen. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef INGEN_GUI_PATCH_BOX_HPP -#define INGEN_GUI_PATCH_BOX_HPP +#ifndef INGEN_GUI_GRAPH_BOX_HPP +#define INGEN_GUI_GRAPH_BOX_HPP #include <string> @@ -40,7 +40,7 @@ class Path; namespace Ingen { namespace Client { -class PatchModel; +class GraphModel; class PortModel; class ObjectModel; } @@ -48,52 +48,52 @@ class ObjectModel; namespace GUI { class BreadCrumbs; -class LoadPatchBox; +class LoadGraphBox; class LoadPluginWindow; -class NewSubpatchWindow; -class PatchDescriptionWindow; -class PatchView; -class PatchWindow; -class SubpatchModule; +class NewSubgraphWindow; +class GraphDescriptionWindow; +class GraphView; +class GraphWindow; +class SubgraphModule; -/** A window for a patch. +/** A window for a graph. * * \ingroup GUI */ -class PatchBox : public Gtk::VBox +class GraphBox : public Gtk::VBox { public: - PatchBox(BaseObjectType* cobject, + GraphBox(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& xml); - ~PatchBox(); + ~GraphBox(); - static SharedPtr<PatchBox> create( - App& app, SharedPtr<const Client::PatchModel> patch); + static SharedPtr<GraphBox> create( + App& app, SharedPtr<const Client::GraphModel> graph); void init_box(App& app); - void set_patch(SharedPtr<const Client::PatchModel> pc, - SharedPtr<PatchView> view); + void set_graph(SharedPtr<const Client::GraphModel> graph, + SharedPtr<GraphView> view); - void set_window(PatchWindow* win) { _window = win; } + void set_window(GraphWindow* win) { _window = win; } void show_documentation(const std::string& doc, bool html); void hide_documentation(); - SharedPtr<const Client::PatchModel> patch() const { return _patch; } - SharedPtr<PatchView> view() const { return _view; } + SharedPtr<const Client::GraphModel> graph() const { return _graph; } + SharedPtr<GraphView> view() const { return _view; } void show_port_status(const Client::PortModel* model, const Raul::Atom& value); - void set_patch_from_path(const Raul::Path& path, SharedPtr<PatchView> view); + void set_graph_from_path(const Raul::Path& path, SharedPtr<GraphView> view); void object_entered(const Client::ObjectModel* model); void object_left(const Client::ObjectModel* model); private: - void patch_port_added(SharedPtr<const Client::PortModel> port); - void patch_port_removed(SharedPtr<const Client::PortModel> port); + void graph_port_added(SharedPtr<const Client::PortModel> port); + void graph_port_removed(SharedPtr<const Client::PortModel> port); void show_status(const Client::ObjectModel* model); int message_dialog(const Glib::ustring& message, @@ -124,9 +124,9 @@ private: void event_clipboard_changed(GdkEventOwnerChange* ev); App* _app; - SharedPtr<const Client::PatchModel> _patch; - SharedPtr<PatchView> _view; - PatchWindow* _window; + SharedPtr<const Client::GraphModel> _graph; + SharedPtr<GraphView> _view; + GraphWindow* _window; sigc::connection new_port_connection; sigc::connection removed_port_connection; @@ -153,9 +153,9 @@ private: Gtk::MenuItem* _menu_arrange; Gtk::MenuItem* _menu_view_engine_window; Gtk::MenuItem* _menu_view_control_window; - Gtk::MenuItem* _menu_view_patch_properties; + Gtk::MenuItem* _menu_view_graph_properties; Gtk::MenuItem* _menu_view_messages_window; - Gtk::MenuItem* _menu_view_patch_tree_window; + Gtk::MenuItem* _menu_view_graph_tree_window; Gtk::MenuItem* _menu_help_about; Gtk::VBox* _vbox; @@ -179,4 +179,4 @@ private: } // namespace GUI } // namespace Ingen -#endif // INGEN_GUI_PATCH_BOX_HPP +#endif // INGEN_GUI_GRAPH_BOX_HPP diff --git a/src/gui/PatchCanvas.cpp b/src/gui/GraphCanvas.cpp index d680a9b8..e6fe3db7 100644 --- a/src/gui/PatchCanvas.cpp +++ b/src/gui/GraphCanvas.cpp @@ -31,21 +31,21 @@ #include "ingen/World.hpp" #include "ingen/client/ClientStore.hpp" #include "ingen/client/BlockModel.hpp" -#include "ingen/client/PatchModel.hpp" +#include "ingen/client/GraphModel.hpp" #include "ingen/client/PluginModel.hpp" #include "ingen/serialisation/Serialiser.hpp" #include "lv2/lv2plug.in/ns/ext/atom/atom.h" #include "App.hpp" #include "Edge.hpp" +#include "GraphCanvas.hpp" +#include "GraphPortModule.hpp" +#include "GraphWindow.hpp" #include "LoadPluginWindow.hpp" -#include "NewSubpatchWindow.hpp" +#include "NewSubgraphWindow.hpp" #include "NodeModule.hpp" -#include "PatchCanvas.hpp" -#include "PatchPortModule.hpp" -#include "PatchWindow.hpp" #include "Port.hpp" -#include "SubpatchModule.hpp" +#include "SubgraphModule.hpp" #include "ThreadedLoader.hpp" #include "WidgetFactory.hpp" #include "WindowFactory.hpp" @@ -62,13 +62,13 @@ using namespace Client; namespace GUI { -PatchCanvas::PatchCanvas(App& app, - SharedPtr<const PatchModel> patch, +GraphCanvas::GraphCanvas(App& app, + SharedPtr<const GraphModel> graph, int width, int height) : Canvas(width, height) , _app(app) - , _patch(patch) + , _graph(graph) , _auto_position_count(0) , _last_click_x(0) , _last_click_y(0) @@ -89,79 +89,79 @@ PatchCanvas::PatchCanvas(App& app, xml->get_widget("canvas_menu_add_event_input", _menu_add_event_input); xml->get_widget("canvas_menu_add_event_output", _menu_add_event_output); xml->get_widget("canvas_menu_load_plugin", _menu_load_plugin); - xml->get_widget("canvas_menu_load_patch", _menu_load_patch); - xml->get_widget("canvas_menu_new_patch", _menu_new_patch); + xml->get_widget("canvas_menu_load_graph", _menu_load_graph); + xml->get_widget("canvas_menu_new_graph", _menu_new_graph); xml->get_widget("canvas_menu_edit", _menu_edit); const URIs& uris = _app.uris(); // Add port menu items _menu_add_audio_input->signal_activate().connect( - sigc::bind(sigc::mem_fun(this, &PatchCanvas::menu_add_port), + sigc::bind(sigc::mem_fun(this, &GraphCanvas::menu_add_port), "audio_in", "Audio In", uris.lv2_AudioPort, false)); _menu_add_audio_output->signal_activate().connect( - sigc::bind(sigc::mem_fun(this, &PatchCanvas::menu_add_port), + sigc::bind(sigc::mem_fun(this, &GraphCanvas::menu_add_port), "audio_out", "Audio Out", uris.lv2_AudioPort, true)); _menu_add_control_input->signal_activate().connect( - sigc::bind(sigc::mem_fun(this, &PatchCanvas::menu_add_port), + sigc::bind(sigc::mem_fun(this, &GraphCanvas::menu_add_port), "control_in", "Control In", uris.lv2_ControlPort, false)); _menu_add_control_output->signal_activate().connect( - sigc::bind(sigc::mem_fun(this, &PatchCanvas::menu_add_port), + sigc::bind(sigc::mem_fun(this, &GraphCanvas::menu_add_port), "control_out", "Control Out", uris.lv2_ControlPort, true)); _menu_add_event_input->signal_activate().connect( - sigc::bind(sigc::mem_fun(this, &PatchCanvas::menu_add_port), + sigc::bind(sigc::mem_fun(this, &GraphCanvas::menu_add_port), "event_in", "Event In", uris.atom_AtomPort, false)); _menu_add_event_output->signal_activate().connect( - sigc::bind(sigc::mem_fun(this, &PatchCanvas::menu_add_port), + sigc::bind(sigc::mem_fun(this, &GraphCanvas::menu_add_port), "event_out", "Event Out", uris.atom_AtomPort, true)); signal_event.connect( - sigc::mem_fun(this, &PatchCanvas::on_event)); + sigc::mem_fun(this, &GraphCanvas::on_event)); signal_connect.connect( - sigc::mem_fun(this, &PatchCanvas::connect)); + sigc::mem_fun(this, &GraphCanvas::connect)); signal_disconnect.connect( - sigc::mem_fun(this, &PatchCanvas::disconnect)); + sigc::mem_fun(this, &GraphCanvas::disconnect)); // Connect to model signals to track state - _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( - sigc::mem_fun(this, &PatchCanvas::remove_port)); - _patch->signal_new_edge().connect( - sigc::mem_fun(this, &PatchCanvas::connection)); - _patch->signal_removed_edge().connect( - sigc::mem_fun(this, &PatchCanvas::disconnection)); + _graph->signal_new_block().connect( + sigc::mem_fun(this, &GraphCanvas::add_block)); + _graph->signal_removed_block().connect( + sigc::mem_fun(this, &GraphCanvas::remove_block)); + _graph->signal_new_port().connect( + sigc::mem_fun(this, &GraphCanvas::add_port)); + _graph->signal_removed_port().connect( + sigc::mem_fun(this, &GraphCanvas::remove_port)); + _graph->signal_new_edge().connect( + sigc::mem_fun(this, &GraphCanvas::connection)); + _graph->signal_removed_edge().connect( + sigc::mem_fun(this, &GraphCanvas::disconnection)); _app.store()->signal_new_plugin().connect( - sigc::mem_fun(this, &PatchCanvas::add_plugin)); + sigc::mem_fun(this, &GraphCanvas::add_plugin)); // Connect widget signals to do things _menu_load_plugin->signal_activate().connect( - sigc::mem_fun(this, &PatchCanvas::menu_load_plugin)); - _menu_load_patch->signal_activate().connect( - sigc::mem_fun(this, &PatchCanvas::menu_load_patch)); - _menu_new_patch->signal_activate().connect( - sigc::mem_fun(this, &PatchCanvas::menu_new_patch)); + sigc::mem_fun(this, &GraphCanvas::menu_load_plugin)); + _menu_load_graph->signal_activate().connect( + sigc::mem_fun(this, &GraphCanvas::menu_load_graph)); + _menu_new_graph->signal_activate().connect( + sigc::mem_fun(this, &GraphCanvas::menu_new_graph)); } void -PatchCanvas::show_menu(bool position, unsigned button, uint32_t time) +GraphCanvas::show_menu(bool position, unsigned button, uint32_t time) { if (!_internal_menu) build_menus(); if (position) - _menu->popup(sigc::mem_fun(this, &PatchCanvas::auto_menu_position), button, time); + _menu->popup(sigc::mem_fun(this, &GraphCanvas::auto_menu_position), button, time); else _menu->popup(button, time); } void -PatchCanvas::build_menus() +GraphCanvas::build_menus() { // Build (or clear existing) internal plugin menu if (_internal_menu) { @@ -202,7 +202,7 @@ PatchCanvas::build_menus() * @a plugin class into @a menu */ size_t -PatchCanvas::build_plugin_class_menu( +GraphCanvas::build_plugin_class_menu( Gtk::Menu* menu, const LilvPluginClass* plugin_class, const LilvPluginClasses* classes, @@ -253,7 +253,7 @@ PatchCanvas::build_plugin_class_menu( } void -PatchCanvas::build_plugin_menu() +GraphCanvas::build_plugin_menu() { if (_plugin_menu) { _plugin_menu->items().clear(); @@ -285,26 +285,26 @@ PatchCanvas::build_plugin_menu() } void -PatchCanvas::build() +GraphCanvas::build() { - const Store::const_range kids = _app.store()->children_range(_patch); + const Store::const_range kids = _app.store()->children_range(_graph); // Create modules for blocks for (Store::const_iterator i = kids.first; i != kids.second; ++i) { SharedPtr<BlockModel> block = PtrCast<BlockModel>(i->second); - if (block && block->parent() == _patch) + if (block && block->parent() == _graph) add_block(block); } // Create pseudo modules for ports (ports on this canvas, not on our module) - for (BlockModel::Ports::const_iterator i = _patch->ports().begin(); - i != _patch->ports().end(); ++i) { + for (BlockModel::Ports::const_iterator i = _graph->ports().begin(); + i != _graph->ports().end(); ++i) { add_port(*i); } // Create edges - for (PatchModel::Edges::const_iterator i = _patch->edges().begin(); - i != _patch->edges().end(); ++i) { + for (GraphModel::Edges::const_iterator i = _graph->edges().begin(); + i != _graph->edges().end(); ++i) { connection(PtrCast<EdgeModel>(i->second)); } } @@ -319,33 +319,33 @@ show_module_human_names(GanvNode* node, void* data) if (nmod) nmod->show_human_names(b); - PatchPortModule* pmod = dynamic_cast<PatchPortModule*>(module); + GraphPortModule* pmod = dynamic_cast<GraphPortModule*>(module); if (pmod) pmod->show_human_names(b); } } void -PatchCanvas::show_human_names(bool b) +GraphCanvas::show_human_names(bool b) { _human_names = b; for_each_node(show_module_human_names, &b); } void -PatchCanvas::show_port_names(bool b) +GraphCanvas::show_port_names(bool b) { ganv_canvas_set_direction(gobj(), b ? GANV_DIRECTION_RIGHT : GANV_DIRECTION_DOWN); } void -PatchCanvas::add_plugin(SharedPtr<PluginModel> p) +GraphCanvas::add_plugin(SharedPtr<PluginModel> p) { typedef ClassMenus::iterator iterator; if (_internal_menu && p->type() == Plugin::Internal) { _internal_menu->items().push_back( Gtk::Menu_Helpers::MenuElem( p->human_name(), - sigc::bind(sigc::mem_fun(this, &PatchCanvas::load_plugin), p))); + sigc::bind(sigc::mem_fun(this, &GraphCanvas::load_plugin), p))); } else if (_plugin_menu && p->type() == Plugin::LV2 && p->lilv_plugin()) { if (lilv_plugin_is_replaced(p->lilv_plugin())) { //info << (boost::format("[Menu] LV2 plugin <%s> hidden") % p->uri()) << endl; @@ -365,7 +365,7 @@ PatchCanvas::add_plugin(SharedPtr<PluginModel> p) _classless_menu->items().push_back( Gtk::Menu_Helpers::MenuElem( p->human_name(), - sigc::bind(sigc::mem_fun(this, &PatchCanvas::load_plugin), p))); + sigc::bind(sigc::mem_fun(this, &GraphCanvas::load_plugin), p))); if (!_classless_menu->is_visible()) _classless_menu->show(); } else { @@ -377,12 +377,12 @@ PatchCanvas::add_plugin(SharedPtr<PluginModel> p) menu->items().push_back( Gtk::Menu_Helpers::ImageMenuElem( p->human_name(), *image, - sigc::bind(sigc::mem_fun(this, &PatchCanvas::load_plugin), p))); + sigc::bind(sigc::mem_fun(this, &GraphCanvas::load_plugin), p))); } else { menu->items().push_back( Gtk::Menu_Helpers::MenuElem( p->human_name(), - sigc::bind(sigc::mem_fun(this, &PatchCanvas::load_plugin), p))); + sigc::bind(sigc::mem_fun(this, &GraphCanvas::load_plugin), p))); } if (!i->second.item->is_visible()) i->second.item->show(); @@ -392,12 +392,12 @@ PatchCanvas::add_plugin(SharedPtr<PluginModel> p) } void -PatchCanvas::add_block(SharedPtr<const BlockModel> bm) +GraphCanvas::add_block(SharedPtr<const BlockModel> bm) { - SharedPtr<const PatchModel> pm = PtrCast<const PatchModel>(bm); + SharedPtr<const GraphModel> pm = PtrCast<const GraphModel>(bm); NodeModule* module; if (pm) { - module = SubpatchModule::create(*this, pm, _human_names); + module = SubgraphModule::create(*this, pm, _human_names); } else { module = NodeModule::create(*this, bm, _human_names); //const PluginModel* plugm = dynamic_cast<const PluginModel*>(nm->plugin()); @@ -413,7 +413,7 @@ PatchCanvas::add_block(SharedPtr<const BlockModel> bm) } void -PatchCanvas::remove_block(SharedPtr<const BlockModel> bm) +GraphCanvas::remove_block(SharedPtr<const BlockModel> bm) { Views::iterator i = _views.find(bm); @@ -428,19 +428,19 @@ PatchCanvas::remove_block(SharedPtr<const BlockModel> bm) } void -PatchCanvas::add_port(SharedPtr<const PortModel> pm) +GraphCanvas::add_port(SharedPtr<const PortModel> pm) { - PatchPortModule* view = PatchPortModule::create(*this, pm, _human_names); + GraphPortModule* view = GraphPortModule::create(*this, pm, _human_names); _views.insert(std::make_pair(pm, view)); view->show(); } void -PatchCanvas::remove_port(SharedPtr<const PortModel> pm) +GraphCanvas::remove_port(SharedPtr<const PortModel> pm) { Views::iterator i = _views.find(pm); - // Port on this patch + // Port on this graph if (i != _views.end()) { delete i->second; _views.erase(i); @@ -454,13 +454,13 @@ PatchCanvas::remove_port(SharedPtr<const PortModel> pm) } Ganv::Port* -PatchCanvas::get_port_view(SharedPtr<PortModel> port) +GraphCanvas::get_port_view(SharedPtr<PortModel> port) { Ganv::Module* module = _views[port]; - // Port on this patch + // Port on this graph if (module) { - PatchPortModule* ppm = dynamic_cast<PatchPortModule*>(module); + GraphPortModule* ppm = dynamic_cast<GraphPortModule*>(module); return ppm ? *ppm->begin() : dynamic_cast<Ganv::Port*>(module); @@ -480,7 +480,7 @@ PatchCanvas::get_port_view(SharedPtr<PortModel> port) } void -PatchCanvas::connection(SharedPtr<const EdgeModel> cm) +GraphCanvas::connection(SharedPtr<const EdgeModel> cm) { Ganv::Port* const tail = get_port_view(cm->tail()); Ganv::Port* const head = get_port_view(cm->head()); @@ -494,7 +494,7 @@ PatchCanvas::connection(SharedPtr<const EdgeModel> cm) } void -PatchCanvas::disconnection(SharedPtr<const EdgeModel> cm) +GraphCanvas::disconnection(SharedPtr<const EdgeModel> cm) { Ganv::Port* const src = get_port_view(cm->tail()); Ganv::Port* const dst = get_port_view(cm->head()); @@ -508,7 +508,7 @@ PatchCanvas::disconnection(SharedPtr<const EdgeModel> cm) } void -PatchCanvas::connect(Ganv::Node* tail, +GraphCanvas::connect(Ganv::Node* tail, Ganv::Node* head) { const Ingen::GUI::Port* const src @@ -524,7 +524,7 @@ PatchCanvas::connect(Ganv::Node* tail, } void -PatchCanvas::disconnect(Ganv::Node* tail, +GraphCanvas::disconnect(Ganv::Node* tail, Ganv::Node* head) { const Ingen::GUI::Port* const t = dynamic_cast<Ingen::GUI::Port*>(tail); @@ -534,7 +534,7 @@ PatchCanvas::disconnect(Ganv::Node* tail, } void -PatchCanvas::auto_menu_position(int& x, int& y, bool& push_in) +GraphCanvas::auto_menu_position(int& x, int& y, bool& push_in) { std::pair<int, int> scroll_offsets; get_scroll_offsets(scroll_offsets.first, scroll_offsets.second); @@ -556,7 +556,7 @@ PatchCanvas::auto_menu_position(int& x, int& y, bool& push_in) } bool -PatchCanvas::on_event(GdkEvent* event) +GraphCanvas::on_event(GdkEvent* event) { assert(event); @@ -595,9 +595,9 @@ PatchCanvas::on_event(GdkEvent* event) } void -PatchCanvas::clear_selection() +GraphCanvas::clear_selection() { - PatchWindow* win = _app.window_factory()->patch_window(_patch); + GraphWindow* win = _app.window_factory()->graph_window(_graph); if (win) { win->hide_documentation(); } @@ -619,7 +619,7 @@ destroy_node(GanvNode* node, void* data) if (node_module) { app->interface()->del(node_module->block()->uri()); } else { - PatchPortModule* port_module = dynamic_cast<PatchPortModule*>(module); + GraphPortModule* port_module = dynamic_cast<GraphPortModule*>(module); if (port_module) { app->interface()->del(port_module->port()->uri()); } @@ -638,7 +638,7 @@ destroy_edge(GanvEdge* edge, void* data) } void -PatchCanvas::destroy_selection() +GraphCanvas::destroy_selection() { for_each_selected_node(destroy_node, &_app); for_each_selected_edge(destroy_edge, &_app); @@ -658,7 +658,7 @@ serialise_node(GanvNode* node, void* data) if (node_module) { serialiser->serialise(node_module->block()); } else { - PatchPortModule* port_module = dynamic_cast<PatchPortModule*>(module); + GraphPortModule* port_module = dynamic_cast<GraphPortModule*>(module); if (port_module) { serialiser->serialise(port_module->port()); } @@ -680,11 +680,11 @@ serialise_edge(GanvEdge* edge, void* data) } void -PatchCanvas::copy_selection() +GraphCanvas::copy_selection() { static const char* base_uri = "http://drobilla.net/ns/ingen/selection/"; Serialisation::Serialiser serialiser(*_app.world()); - serialiser.start_to_string(_patch->path(), base_uri); + serialiser.start_to_string(_graph->path(), base_uri); for_each_selected_node(serialise_node, &serialiser); for_each_selected_edge(serialise_edge, &serialiser); @@ -697,7 +697,7 @@ PatchCanvas::copy_selection() } void -PatchCanvas::paste() +GraphCanvas::paste() { Glib::ustring str = Gtk::Clipboard::get()->wait_for_text(); SharedPtr<Serialisation::Parser> parser = _app.loader()->parser(); @@ -717,13 +717,13 @@ PatchCanvas::paste() clipboard.set_plugins(_app.store()->plugins()); // mkdir -p - string to_create = _patch->path().substr(1); + string to_create = _graph->path().substr(1); string created = "/"; Resource::Properties props; props.insert(make_pair(uris.rdf_type, - uris.ingen_Patch)); + uris.ingen_Graph)); props.insert(make_pair(uris.ingen_polyphony, - _app.forge().make(int32_t(_patch->internal_poly())))); + _app.forge().make(int32_t(_graph->internal_poly())))); clipboard.put(GraphObject::root_uri(), props); size_t first_slash; while (to_create != "/" && !to_create.empty() @@ -734,14 +734,14 @@ PatchCanvas::paste() to_create = to_create.substr(first_slash + 1); } - if (!_patch->path().is_root()) - clipboard.put(_patch->uri(), props); + if (!_graph->path().is_root()) + clipboard.put(_graph->uri(), props); boost::optional<Raul::Path> parent; boost::optional<Raul::Symbol> symbol; - if (!_patch->path().is_root()) { - parent = _patch->path(); + if (!_graph->path().is_root()) { + parent = _graph->path(); } ClashAvoider avoider(*_app.store().get(), clipboard, &clipboard); @@ -750,7 +750,7 @@ PatchCanvas::paste() parent, symbol); for (Store::iterator i = clipboard.begin(); i != clipboard.end(); ++i) { - if (_patch->path().is_root() && i->first.is_root()) + if (_graph->path().is_root() && i->first.is_root()) continue; GraphObject::Properties& props = i->second->properties(); @@ -769,11 +769,11 @@ PatchCanvas::paste() _pastees.insert(i->first); } - builder.connect(PtrCast<const PatchModel>(clipboard.object(_patch->path()))); + builder.connect(PtrCast<const GraphModel>(clipboard.object(_graph->path()))); } void -PatchCanvas::generate_port_name( +GraphCanvas::generate_port_name( const string& sym_base, string& symbol, const string& name_base, string& name) { @@ -786,7 +786,7 @@ PatchCanvas::generate_port_name( snprintf(num_buf, sizeof(num_buf), "%u", i); symbol = sym_base + "_"; symbol += num_buf; - if (!_patch->get_port(Raul::Symbol::symbolify(symbol))) + if (!_graph->get_port(Raul::Symbol::symbolify(symbol))) break; } @@ -796,12 +796,12 @@ PatchCanvas::generate_port_name( } void -PatchCanvas::menu_add_port(const string& sym_base, const string& name_base, +GraphCanvas::menu_add_port(const string& sym_base, const string& name_base, const Raul::URI& type, bool is_output) { string sym, name; generate_port_name(sym_base, sym, name_base, name); - const Raul::Path& path = _patch->path().child(Raul::Symbol(sym)); + const Raul::Path& path = _graph->path().child(Raul::Symbol(sym)); const URIs& uris = _app.uris(); @@ -815,21 +815,21 @@ PatchCanvas::menu_add_port(const string& sym_base, const string& name_base, props.insert(make_pair(uris.rdf_type, is_output ? uris.lv2_OutputPort : uris.lv2_InputPort)); props.insert(make_pair(uris.lv2_index, - _app.forge().make(int32_t(_patch->num_ports())))); + _app.forge().make(int32_t(_graph->num_ports())))); props.insert(make_pair(uris.lv2_name, _app.forge().alloc(name.c_str()))); _app.interface()->put(GraphObject::path_to_uri(path), props); } void -PatchCanvas::load_plugin(WeakPtr<PluginModel> weak_plugin) +GraphCanvas::load_plugin(WeakPtr<PluginModel> weak_plugin) { SharedPtr<PluginModel> plugin = weak_plugin.lock(); if (!plugin) return; Raul::Symbol symbol = plugin->default_block_symbol(); - unsigned offset = _app.store()->child_name_offset(_patch->path(), symbol); + unsigned offset = _app.store()->child_name_offset(_graph->path(), symbol); if (offset != 0) { std::stringstream ss; ss << symbol << "_" << offset; @@ -837,7 +837,7 @@ PatchCanvas::load_plugin(WeakPtr<PluginModel> weak_plugin) } const URIs& uris = _app.uris(); - const Raul::Path path = _patch->path().child(symbol); + const Raul::Path path = _graph->path().child(symbol); // FIXME: polyphony? GraphObject::Properties props = get_initial_data(); @@ -850,7 +850,7 @@ PatchCanvas::load_plugin(WeakPtr<PluginModel> weak_plugin) /** Try to guess a suitable location for a new module. */ void -PatchCanvas::get_new_module_location(double& x, double& y) +GraphCanvas::get_new_module_location(double& x, double& y) { int scroll_x; int scroll_y; @@ -860,7 +860,7 @@ PatchCanvas::get_new_module_location(double& x, double& y) } GraphObject::Properties -PatchCanvas::get_initial_data(Resource::Graph ctx) +GraphCanvas::get_initial_data(Resource::Graph ctx) { GraphObject::Properties result; const URIs& uris = _app.uris(); @@ -876,24 +876,24 @@ PatchCanvas::get_initial_data(Resource::Graph ctx) } void -PatchCanvas::menu_load_plugin() +GraphCanvas::menu_load_plugin() { _app.window_factory()->present_load_plugin( - _patch, get_initial_data()); + _graph, get_initial_data()); } void -PatchCanvas::menu_load_patch() +GraphCanvas::menu_load_graph() { - _app.window_factory()->present_load_subpatch( - _patch, get_initial_data(Resource::EXTERNAL)); + _app.window_factory()->present_load_subgraph( + _graph, get_initial_data(Resource::EXTERNAL)); } void -PatchCanvas::menu_new_patch() +GraphCanvas::menu_new_graph() { - _app.window_factory()->present_new_subpatch( - _patch, get_initial_data(Resource::EXTERNAL)); + _app.window_factory()->present_new_subgraph( + _graph, get_initial_data(Resource::EXTERNAL)); } } // namespace GUI diff --git a/src/gui/PatchCanvas.hpp b/src/gui/GraphCanvas.hpp index 04c30ed3..9144518a 100644 --- a/src/gui/PatchCanvas.hpp +++ b/src/gui/GraphCanvas.hpp @@ -14,8 +14,8 @@ along with Ingen. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef INGEN_GUI_PATCHCANVAS_HPP -#define INGEN_GUI_PATCHCANVAS_HPP +#ifndef INGEN_GUI_GRAPHCANVAS_HPP +#define INGEN_GUI_GRAPHCANVAS_HPP #include <string> #include <map> @@ -30,31 +30,31 @@ #include "raul/SharedPtr.hpp" #include "raul/Path.hpp" -#include "ingen/client/EdgeModel.hpp" -#include "ingen/GraphObject.hpp" #include "NodeModule.hpp" +#include "ingen/GraphObject.hpp" +#include "ingen/client/EdgeModel.hpp" namespace Ingen { -namespace Client { class PatchModel; } +namespace Client { class GraphModel; } namespace GUI { class NodeModule; -/** Patch canvas widget. +/** Graph canvas widget. * * \ingroup GUI */ -class PatchCanvas : public Ganv::Canvas +class GraphCanvas : public Ganv::Canvas { public: - PatchCanvas(App& app, - SharedPtr<const Client::PatchModel> patch, + GraphCanvas(App& app, + SharedPtr<const Client::GraphModel> graph, int width, int height); - virtual ~PatchCanvas() {} + virtual ~GraphCanvas() {} App& app() { return _app; } @@ -93,8 +93,8 @@ private: const Raul::URI& type, bool is_output); void menu_load_plugin(); - void menu_new_patch(); - void menu_load_patch(); + void menu_new_graph(); + void menu_load_graph(); void load_plugin(WeakPtr<Client::PluginModel> plugin); void build_menus(); @@ -124,7 +124,7 @@ private: Ganv::Node* dst); App& _app; - SharedPtr<const Client::PatchModel> _patch; + SharedPtr<const Client::GraphModel> _graph; typedef std::map<SharedPtr<const Client::ObjectModel>, Ganv::Module*> Views; Views _views; @@ -160,8 +160,8 @@ private: Gtk::MenuItem* _menu_add_event_input; Gtk::MenuItem* _menu_add_event_output; Gtk::MenuItem* _menu_load_plugin; - Gtk::MenuItem* _menu_load_patch; - Gtk::MenuItem* _menu_new_patch; + Gtk::MenuItem* _menu_load_graph; + Gtk::MenuItem* _menu_new_graph; Gtk::CheckMenuItem* _menu_edit; bool _human_names; @@ -171,4 +171,4 @@ private: } // namespace GUI } // namespace Ingen -#endif // INGEN_GUI_PATCHCANVAS_HPP +#endif // INGEN_GUI_GRAPHCANVAS_HPP diff --git a/src/gui/PatchPortModule.cpp b/src/gui/GraphPortModule.cpp index ec0e6a04..38735088 100644 --- a/src/gui/PatchPortModule.cpp +++ b/src/gui/GraphPortModule.cpp @@ -20,13 +20,13 @@ #include "ingen/Interface.hpp" #include "ingen/client/BlockModel.hpp" -#include "ingen/client/PatchModel.hpp" +#include "ingen/client/GraphModel.hpp" #include "App.hpp" #include "Configuration.hpp" -#include "PatchCanvas.hpp" -#include "PatchPortModule.hpp" -#include "PatchWindow.hpp" +#include "GraphCanvas.hpp" +#include "GraphPortModule.hpp" +#include "GraphWindow.hpp" #include "Port.hpp" #include "PortMenu.hpp" #include "RenameWindow.hpp" @@ -41,30 +41,30 @@ using namespace Client; namespace GUI { -PatchPortModule::PatchPortModule(PatchCanvas& canvas, +GraphPortModule::GraphPortModule(GraphCanvas& canvas, SharedPtr<const Client::PortModel> model) : Ganv::Module(canvas, "", 0, 0, false) // FIXME: coords? , _model(model) { assert(model); - assert(PtrCast<const PatchModel>(model->parent())); + assert(PtrCast<const GraphModel>(model->parent())); set_stacked(model->polyphonic()); model->signal_property().connect( - sigc::mem_fun(this, &PatchPortModule::property_changed)); + sigc::mem_fun(this, &GraphPortModule::property_changed)); signal_moved().connect( - sigc::mem_fun(this, &PatchPortModule::store_location)); + sigc::mem_fun(this, &GraphPortModule::store_location)); } -PatchPortModule* -PatchPortModule::create(PatchCanvas& canvas, +GraphPortModule* +GraphPortModule::create(GraphCanvas& canvas, SharedPtr<const PortModel> model, bool human) { - PatchPortModule* ret = new PatchPortModule(canvas, model); + GraphPortModule* ret = new GraphPortModule(canvas, model); Port* port = Port::create(canvas.app(), *ret, model, human, true); ret->set_port(port); @@ -77,19 +77,19 @@ PatchPortModule::create(PatchCanvas& canvas, } App& -PatchPortModule::app() const +GraphPortModule::app() const { - return ((PatchCanvas*)canvas())->app(); + return ((GraphCanvas*)canvas())->app(); } bool -PatchPortModule::show_menu(GdkEventButton* ev) +GraphPortModule::show_menu(GdkEventButton* ev) { return _port->show_menu(ev); } void -PatchPortModule::store_location(double ax, double ay) +GraphPortModule::store_location(double ax, double ay) { const URIs& uris = app().uris(); @@ -112,7 +112,7 @@ PatchPortModule::store_location(double ax, double ay) } void -PatchPortModule::show_human_names(bool b) +GraphPortModule::show_human_names(bool b) { const URIs& uris = app().uris(); const Raul::Atom& name = _model->get_property(uris.lv2_name); @@ -124,13 +124,13 @@ PatchPortModule::show_human_names(bool b) } void -PatchPortModule::set_name(const std::string& n) +GraphPortModule::set_name(const std::string& n) { _port->set_label(n.c_str()); } void -PatchPortModule::property_changed(const Raul::URI& key, const Raul::Atom& value) +GraphPortModule::property_changed(const Raul::URI& key, const Raul::Atom& value) { const URIs& uris = app().uris(); if (value.type() == uris.forge.Float) { @@ -155,7 +155,7 @@ PatchPortModule::property_changed(const Raul::URI& key, const Raul::Atom& value) } void -PatchPortModule::set_selected(gboolean b) +GraphPortModule::set_selected(gboolean b) { if (b != get_selected()) { Module::set_selected(b); diff --git a/src/gui/PatchPortModule.hpp b/src/gui/GraphPortModule.hpp index b48bbfc4..722f35c3 100644 --- a/src/gui/PatchPortModule.hpp +++ b/src/gui/GraphPortModule.hpp @@ -14,8 +14,8 @@ along with Ingen. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef INGEN_GUI_PATCHPORTMODULE_HPP -#define INGEN_GUI_PATCHPORTMODULE_HPP +#ifndef INGEN_GUI_GRAPHPORTMODULE_HPP +#define INGEN_GUI_GRAPHPORTMODULE_HPP #include <string> @@ -35,21 +35,21 @@ namespace Ingen { namespace Client { namespace Ingen { namespace GUI { -class PatchCanvas; +class GraphCanvas; class Port; class PortMenu; -/** A "module" to represent a patch's port on its own canvas. +/** A "module" to represent a graph's port on its own canvas. * * Translation: This is the nameless single port pseudo module thingy. * * \ingroup GUI */ -class PatchPortModule : public Ganv::Module +class GraphPortModule : public Ganv::Module { public: - static PatchPortModule* create( - PatchCanvas& canvas, + static GraphPortModule* create( + GraphCanvas& canvas, SharedPtr<const Client::PortModel> model, bool human); @@ -63,7 +63,7 @@ public: SharedPtr<const Client::PortModel> port() const { return _model; } protected: - PatchPortModule(PatchCanvas& canvas, + GraphPortModule(GraphCanvas& canvas, SharedPtr<const Client::PortModel> model); bool show_menu(GdkEventButton* ev); @@ -80,4 +80,4 @@ protected: } // namespace GUI } // namespace Ingen -#endif // INGEN_GUI_PATCHPORTMODULE_HPP +#endif // INGEN_GUI_GRAPHPORTMODULE_HPP diff --git a/src/gui/GraphTreeWindow.cpp b/src/gui/GraphTreeWindow.cpp new file mode 100644 index 00000000..7ddbb23a --- /dev/null +++ b/src/gui/GraphTreeWindow.cpp @@ -0,0 +1,234 @@ +/* + This file is part of Ingen. + Copyright 2007-2012 David Robillard <http://drobilla.net/> + + Ingen is free software: you can redistribute it and/or modify it under the + terms of the GNU Affero General Public License as published by the Free + Software Foundation, either version 3 of the License, or any later version. + + Ingen is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU Affero General Public License for details. + + You should have received a copy of the GNU Affero General Public License + along with Ingen. If not, see <http://www.gnu.org/licenses/>. +*/ + +#include "App.hpp" +#include "GraphTreeWindow.hpp" +#include "SubgraphModule.hpp" +#include "WindowFactory.hpp" +#include "ingen/Interface.hpp" +#include "ingen/Log.hpp" +#include "ingen/client/ClientStore.hpp" +#include "ingen/client/GraphModel.hpp" +#include "raul/Path.hpp" + +using namespace std; + +namespace Ingen { + +using namespace Client; + +namespace GUI { + +GraphTreeWindow::GraphTreeWindow(BaseObjectType* cobject, + const Glib::RefPtr<Gtk::Builder>& xml) + : Window(cobject) + , _app(NULL) + , _enable_signal(true) +{ + xml->get_widget_derived("graphs_treeview", _graphs_treeview); + + _graph_treestore = Gtk::TreeStore::create(_graph_tree_columns); + _graphs_treeview->set_window(this); + _graphs_treeview->set_model(_graph_treestore); + Gtk::TreeViewColumn* name_col = Gtk::manage(new Gtk::TreeViewColumn( + "Graph", _graph_tree_columns.name_col)); + Gtk::TreeViewColumn* enabled_col = Gtk::manage(new Gtk::TreeViewColumn( + "Run", _graph_tree_columns.enabled_col)); + name_col->set_resizable(true); + name_col->set_expand(true); + + _graphs_treeview->append_column(*name_col); + _graphs_treeview->append_column(*enabled_col); + Gtk::CellRendererToggle* enabled_renderer = dynamic_cast<Gtk::CellRendererToggle*>( + _graphs_treeview->get_column_cell_renderer(1)); + enabled_renderer->property_activatable() = true; + + _graph_tree_selection = _graphs_treeview->get_selection(); + + _graphs_treeview->signal_row_activated().connect( + sigc::mem_fun(this, &GraphTreeWindow::event_graph_activated)); + enabled_renderer->signal_toggled().connect( + sigc::mem_fun(this, &GraphTreeWindow::event_graph_enabled_toggled)); + + _graphs_treeview->columns_autosize(); +} + +void +GraphTreeWindow::init(App& app, ClientStore& store) +{ + _app = &app; + store.signal_new_object().connect( + sigc::mem_fun(this, &GraphTreeWindow::new_object)); +} + +void +GraphTreeWindow::new_object(SharedPtr<ObjectModel> object) +{ + SharedPtr<GraphModel> graph = PtrCast<GraphModel>(object); + if (graph) + add_graph(graph); +} + +void +GraphTreeWindow::add_graph(SharedPtr<GraphModel> pm) +{ + if (!pm->parent()) { + Gtk::TreeModel::iterator iter = _graph_treestore->append(); + Gtk::TreeModel::Row row = *iter; + if (pm->path().is_root()) { + row[_graph_tree_columns.name_col] = _app->interface()->uri(); + } else { + row[_graph_tree_columns.name_col] = pm->symbol().c_str(); + } + row[_graph_tree_columns.enabled_col] = pm->enabled(); + row[_graph_tree_columns.graph_model_col] = pm; + _graphs_treeview->expand_row(_graph_treestore->get_path(iter), true); + } else { + Gtk::TreeModel::Children children = _graph_treestore->children(); + Gtk::TreeModel::iterator c = find_graph(children, pm->parent()); + + if (c != children.end()) { + Gtk::TreeModel::iterator iter = _graph_treestore->append(c->children()); + Gtk::TreeModel::Row row = *iter; + row[_graph_tree_columns.name_col] = pm->symbol().c_str(); + row[_graph_tree_columns.enabled_col] = pm->enabled(); + row[_graph_tree_columns.graph_model_col] = pm; + _graphs_treeview->expand_row(_graph_treestore->get_path(iter), true); + } + } + + pm->signal_property().connect( + sigc::bind(sigc::mem_fun(this, &GraphTreeWindow::graph_property_changed), + pm)); + + pm->signal_moved().connect( + sigc::bind(sigc::mem_fun(this, &GraphTreeWindow::graph_moved), + pm)); + + pm->signal_destroyed().connect( + sigc::bind(sigc::mem_fun(this, &GraphTreeWindow::remove_graph), + pm)); +} + +void +GraphTreeWindow::remove_graph(SharedPtr<GraphModel> pm) +{ + Gtk::TreeModel::iterator i = find_graph(_graph_treestore->children(), pm); + if (i != _graph_treestore->children().end()) + _graph_treestore->erase(i); +} + +Gtk::TreeModel::iterator +GraphTreeWindow::find_graph( + Gtk::TreeModel::Children root, + SharedPtr<Client::ObjectModel> graph) +{ + for (Gtk::TreeModel::iterator c = root.begin(); c != root.end(); ++c) { + SharedPtr<GraphModel> pm = (*c)[_graph_tree_columns.graph_model_col]; + if (graph == pm) { + return c; + } else if ((*c)->children().size() > 0) { + Gtk::TreeModel::iterator ret = find_graph(c->children(), graph); + if (ret != c->children().end()) + return ret; + } + } + return root.end(); +} + +/** Show the context menu for the selected graph in the graphs treeview. + */ +void +GraphTreeWindow::show_graph_menu(GdkEventButton* ev) +{ + Gtk::TreeModel::iterator active = _graph_tree_selection->get_selected(); + if (active) { + Gtk::TreeModel::Row row = *active; + SharedPtr<GraphModel> pm = row[_graph_tree_columns.graph_model_col]; + if (pm) { + _app->log().warn("TODO: graph menu from tree window"); + } + } +} + +void +GraphTreeWindow::event_graph_activated(const Gtk::TreeModel::Path& path, Gtk::TreeView::Column* col) +{ + Gtk::TreeModel::iterator active = _graph_treestore->get_iter(path); + Gtk::TreeModel::Row row = *active; + SharedPtr<GraphModel> pm = row[_graph_tree_columns.graph_model_col]; + + _app->window_factory()->present_graph(pm); +} + +void +GraphTreeWindow::event_graph_enabled_toggled(const Glib::ustring& path_str) +{ + Gtk::TreeModel::Path path(path_str); + Gtk::TreeModel::iterator active = _graph_treestore->get_iter(path); + Gtk::TreeModel::Row row = *active; + + SharedPtr<GraphModel> pm = row[_graph_tree_columns.graph_model_col]; + assert(pm); + + if (_enable_signal) + _app->interface()->set_property( + pm->uri(), + _app->uris().ingen_enabled, + _app->forge().make((bool)!pm->enabled())); +} + +void +GraphTreeWindow::graph_property_changed(const Raul::URI& key, + const Raul::Atom& value, + SharedPtr<GraphModel> graph) +{ + const URIs& uris = _app->uris(); + _enable_signal = false; + if (key == uris.ingen_enabled && value.type() == uris.forge.Bool) { + Gtk::TreeModel::iterator i = find_graph(_graph_treestore->children(), graph); + if (i != _graph_treestore->children().end()) { + Gtk::TreeModel::Row row = *i; + row[_graph_tree_columns.enabled_col] = value.get_bool(); + } else { + _app->log().error(Raul::fmt("Unable to find graph %1%\n") + % graph->path()); + } + } + _enable_signal = true; +} + +void +GraphTreeWindow::graph_moved(SharedPtr<GraphModel> graph) +{ + _enable_signal = false; + + Gtk::TreeModel::iterator i + = find_graph(_graph_treestore->children(), graph); + + if (i != _graph_treestore->children().end()) { + Gtk::TreeModel::Row row = *i; + row[_graph_tree_columns.name_col] = graph->symbol().c_str(); + } else { + _app->log().error(Raul::fmt("Unable to find graph %1%\n") + % graph->path()); + } + + _enable_signal = true; +} + +} // namespace GUI +} // namespace Ingen diff --git a/src/gui/PatchTreeWindow.hpp b/src/gui/GraphTreeWindow.hpp index 86e10370..3bd50b76 100644 --- a/src/gui/PatchTreeWindow.hpp +++ b/src/gui/GraphTreeWindow.hpp @@ -14,8 +14,8 @@ along with Ingen. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef INGEN_GUI_PATCHTREEWINDOW_HPP -#define INGEN_GUI_PATCHTREEWINDOW_HPP +#ifndef INGEN_GUI_GRAPHTREEWINDOW_HPP +#define INGEN_GUI_GRAPHTREEWINDOW_HPP #include <gtkmm/builder.h> #include <gtkmm/treemodel.h> @@ -32,89 +32,92 @@ namespace Client { class ClientStore; class ObjectModel; } namespace GUI { -class PatchWindow; -class PatchTreeView; +class GraphWindow; +class GraphTreeView; -/** Window with a TreeView of all loaded patches. +/** Window with a TreeView of all loaded graphs. * * \ingroup GUI */ -class PatchTreeWindow : public Window +class GraphTreeWindow : public Window { public: - PatchTreeWindow(BaseObjectType* cobject, + GraphTreeWindow(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& xml); void init(App& app, Client::ClientStore& store); void new_object(SharedPtr<Client::ObjectModel> object); - void patch_property_changed(const Raul::URI& key, const Raul::Atom& value, - SharedPtr<Client::PatchModel> pm); + void graph_property_changed(const Raul::URI& key, + const Raul::Atom& value, + SharedPtr<Client::GraphModel> gm); - void patch_moved(SharedPtr<Client::PatchModel> patch); + void graph_moved(SharedPtr<Client::GraphModel> graph); - void add_patch(SharedPtr<Client::PatchModel> pm); - void remove_patch(SharedPtr<Client::PatchModel> pm); - void show_patch_menu(GdkEventButton* ev); + void add_graph(SharedPtr<Client::GraphModel> gm); + void remove_graph(SharedPtr<Client::GraphModel> gm); + void show_graph_menu(GdkEventButton* ev); protected: - void event_patch_activated(const Gtk::TreeModel::Path& path, Gtk::TreeView::Column* col); - void event_patch_enabled_toggled(const Glib::ustring& path_str); + void event_graph_activated(const Gtk::TreeModel::Path& path, + Gtk::TreeView::Column* col); - Gtk::TreeModel::iterator find_patch( + void event_graph_enabled_toggled(const Glib::ustring& path_str); + + Gtk::TreeModel::iterator find_graph( Gtk::TreeModel::Children root, - SharedPtr<Client::ObjectModel> patch); + SharedPtr<Client::ObjectModel> graph); - PatchTreeView* _patches_treeview; + GraphTreeView* _graphs_treeview; - struct PatchTreeModelColumns : public Gtk::TreeModel::ColumnRecord + struct GraphTreeModelColumns : public Gtk::TreeModel::ColumnRecord { - PatchTreeModelColumns() { + GraphTreeModelColumns() { add(name_col); add(enabled_col); - add(patch_model_col); + add(graph_model_col); } Gtk::TreeModelColumn<Glib::ustring> name_col; Gtk::TreeModelColumn<bool> enabled_col; - Gtk::TreeModelColumn<SharedPtr<Client::PatchModel> > patch_model_col; + Gtk::TreeModelColumn<SharedPtr<Client::GraphModel> > graph_model_col; }; App* _app; - PatchTreeModelColumns _patch_tree_columns; - Glib::RefPtr<Gtk::TreeStore> _patch_treestore; - Glib::RefPtr<Gtk::TreeSelection> _patch_tree_selection; + GraphTreeModelColumns _graph_tree_columns; + Glib::RefPtr<Gtk::TreeStore> _graph_treestore; + Glib::RefPtr<Gtk::TreeSelection> _graph_tree_selection; bool _enable_signal; }; -/** Derived TreeView class to support context menus for patches */ -class PatchTreeView : public Gtk::TreeView +/** Derived TreeView class to support context menus for graphs */ +class GraphTreeView : public Gtk::TreeView { public: - PatchTreeView(BaseObjectType* cobject, + GraphTreeView(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& xml) : Gtk::TreeView(cobject) , _window(NULL) {} - void set_window(PatchTreeWindow* win) { _window = win; } + void set_window(GraphTreeWindow* win) { _window = win; } bool on_button_press_event(GdkEventButton* ev) { bool ret = Gtk::TreeView::on_button_press_event(ev); if ((ev->type == GDK_BUTTON_PRESS) && (ev->button == 3)) - _window->show_patch_menu(ev); + _window->show_graph_menu(ev); return ret; } private: - PatchTreeWindow* _window; + GraphTreeWindow* _window; -}; // struct PatchTreeView +}; // struct GraphTreeView } // namespace GUI } // namespace Ingen -#endif // INGEN_GUI_PATCHTREEWINDOW_HPP +#endif // INGEN_GUI_GRAPHTREEWINDOW_HPP diff --git a/src/gui/PatchView.cpp b/src/gui/GraphView.cpp index efb37d11..119438e6 100644 --- a/src/gui/PatchView.cpp +++ b/src/gui/GraphView.cpp @@ -18,14 +18,14 @@ #include <fstream> #include "ingen/Interface.hpp" -#include "ingen/client/PatchModel.hpp" +#include "ingen/client/GraphModel.hpp" #include "App.hpp" #include "LoadPluginWindow.hpp" -#include "NewSubpatchWindow.hpp" -#include "PatchCanvas.hpp" -#include "PatchTreeWindow.hpp" -#include "PatchView.hpp" +#include "NewSubgraphWindow.hpp" +#include "GraphCanvas.hpp" +#include "GraphTreeWindow.hpp" +#include "GraphView.hpp" #include "WidgetFactory.hpp" using namespace std; @@ -36,7 +36,7 @@ using namespace Client; namespace GUI { -PatchView::PatchView(BaseObjectType* cobject, +GraphView::GraphView(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& xml) : Gtk::Box(cobject) , _app(NULL) @@ -45,15 +45,15 @@ PatchView::PatchView(BaseObjectType* cobject, { property_visible() = false; - xml->get_widget("patch_view_breadcrumb_container", _breadcrumb_container); - xml->get_widget("patch_view_toolbar", _toolbar); - xml->get_widget("patch_view_process_but", _process_but); - xml->get_widget("patch_view_poly_spin", _poly_spin); - xml->get_widget("patch_view_refresh_but", _refresh_but); - xml->get_widget("patch_view_save_but", _save_but); - xml->get_widget("patch_view_zoom_full_but", _zoom_full_but); - xml->get_widget("patch_view_zoom_normal_but", _zoom_normal_but); - xml->get_widget("patch_view_scrolledwindow", _canvas_scrolledwindow); + xml->get_widget("graph_view_breadcrumb_container", _breadcrumb_container); + xml->get_widget("graph_view_toolbar", _toolbar); + xml->get_widget("graph_view_process_but", _process_but); + xml->get_widget("graph_view_poly_spin", _poly_spin); + xml->get_widget("graph_view_refresh_but", _refresh_but); + xml->get_widget("graph_view_save_but", _save_but); + xml->get_widget("graph_view_zoom_full_but", _zoom_full_but); + xml->get_widget("graph_view_zoom_normal_but", _zoom_normal_but); + xml->get_widget("graph_view_scrolledwindow", _canvas_scrolledwindow); _toolbar->set_toolbar_style(Gtk::TOOLBAR_ICONS); _canvas_scrolledwindow->property_hadjustment().get_value()->set_step_increment(10); @@ -61,76 +61,76 @@ PatchView::PatchView(BaseObjectType* cobject, } void -PatchView::init(App& app) +GraphView::init(App& app) { _app = &app; } void -PatchView::set_patch(SharedPtr<const PatchModel> patch) +GraphView::set_graph(SharedPtr<const GraphModel> graph) { assert(!_canvas); // FIXME: remove assert(_breadcrumb_container); // ensure created - _patch = patch; - _canvas = SharedPtr<PatchCanvas>(new PatchCanvas(*_app, patch, 1600*2, 1200*2)); + _graph = graph; + _canvas = SharedPtr<GraphCanvas>(new GraphCanvas(*_app, graph, 1600*2, 1200*2)); _canvas->build(); _canvas_scrolledwindow->add(_canvas->widget()); _poly_spin->set_range(1, 128); _poly_spin->set_increments(1, 4); - _poly_spin->set_value(patch->internal_poly()); + _poly_spin->set_value(graph->internal_poly()); - for (GraphObject::Properties::const_iterator i = patch->properties().begin(); - i != patch->properties().end(); ++i) + for (GraphObject::Properties::const_iterator i = graph->properties().begin(); + i != graph->properties().end(); ++i) property_changed(i->first, i->second); // Connect model signals to track state - patch->signal_property().connect( - sigc::mem_fun(this, &PatchView::property_changed)); + graph->signal_property().connect( + sigc::mem_fun(this, &GraphView::property_changed)); // Connect widget signals to do things _process_but->signal_toggled().connect( - sigc::mem_fun(this, &PatchView::process_toggled)); + sigc::mem_fun(this, &GraphView::process_toggled)); _refresh_but->signal_clicked().connect( - sigc::mem_fun(this, &PatchView::refresh_clicked)); + sigc::mem_fun(this, &GraphView::refresh_clicked)); _zoom_normal_but->signal_clicked().connect(sigc::bind(sigc::mem_fun( - _canvas.get(), &PatchCanvas::set_zoom), 1.0)); + _canvas.get(), &GraphCanvas::set_zoom), 1.0)); _zoom_full_but->signal_clicked().connect( - sigc::mem_fun(_canvas.get(), &PatchCanvas::zoom_full)); + sigc::mem_fun(_canvas.get(), &GraphCanvas::zoom_full)); _poly_spin->signal_value_changed().connect( - sigc::mem_fun(*this, &PatchView::poly_changed)); + sigc::mem_fun(*this, &GraphView::poly_changed)); #if 0 _canvas->signal_item_entered.connect( - sigc::mem_fun(*this, &PatchView::canvas_item_entered)); + sigc::mem_fun(*this, &GraphView::canvas_item_entered)); _canvas->signal_item_left.connect( - sigc::mem_fun(*this, &PatchView::canvas_item_left)); + sigc::mem_fun(*this, &GraphView::canvas_item_left)); #endif _canvas->widget().grab_focus(); } -SharedPtr<PatchView> -PatchView::create(App& app, SharedPtr<const PatchModel> patch) +SharedPtr<GraphView> +GraphView::create(App& app, SharedPtr<const GraphModel> graph) { - PatchView* result = NULL; + GraphView* result = NULL; Glib::RefPtr<Gtk::Builder> xml = WidgetFactory::create("warehouse_win"); - xml->get_widget_derived("patch_view_box", result); + xml->get_widget_derived("graph_view_box", result); result->init(app); - result->set_patch(patch); - return SharedPtr<PatchView>(result); + result->set_graph(graph); + return SharedPtr<GraphView>(result); } #if 0 void -PatchView::canvas_item_entered(Gnome::Canvas::Item* item) +GraphView::canvas_item_entered(Gnome::Canvas::Item* item) { NodeModule* m = dynamic_cast<NodeModule*>(item); if (m) @@ -142,7 +142,7 @@ PatchView::canvas_item_entered(Gnome::Canvas::Item* item) } void -PatchView::canvas_item_left(Gnome::Canvas::Item* item) +GraphView::canvas_item_left(Gnome::Canvas::Item* item) { NodeModule* m = dynamic_cast<NodeModule*>(item); if (m) { @@ -157,37 +157,37 @@ PatchView::canvas_item_left(Gnome::Canvas::Item* item) #endif void -PatchView::process_toggled() +GraphView::process_toggled() { if (!_enable_signal) return; _app->interface()->set_property( - _patch->uri(), + _graph->uri(), _app->uris().ingen_enabled, _app->forge().make((bool)_process_but->get_active())); } void -PatchView::poly_changed() +GraphView::poly_changed() { const int poly = _poly_spin->get_value_as_int(); - if (_enable_signal && poly != (int)_patch->internal_poly()) { + if (_enable_signal && poly != (int)_graph->internal_poly()) { _app->interface()->set_property( - _patch->uri(), + _graph->uri(), _app->uris().ingen_polyphony, _app->forge().make(poly)); } } void -PatchView::refresh_clicked() +GraphView::refresh_clicked() { - _app->interface()->get(_patch->uri()); + _app->interface()->get(_graph->uri()); } void -PatchView::property_changed(const Raul::URI& predicate, const Raul::Atom& value) +GraphView::property_changed(const Raul::URI& predicate, const Raul::Atom& value) { _enable_signal = false; if (predicate == _app->uris().ingen_enabled) { diff --git a/src/gui/PatchView.hpp b/src/gui/GraphView.hpp index 14183a89..cae073af 100644 --- a/src/gui/PatchView.hpp +++ b/src/gui/GraphView.hpp @@ -14,8 +14,8 @@ along with Ingen. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef INGEN_GUI_PATCHVIEW_HPP -#define INGEN_GUI_PATCHVIEW_HPP +#ifndef INGEN_GUI_GRAPHVIEW_HPP +#define INGEN_GUI_GRAPHVIEW_HPP #include <gtkmm/box.h> #include <gtkmm/builder.h> @@ -36,7 +36,7 @@ namespace Ingen { namespace Client { class PortModel; class MetadataModel; - class PatchModel; + class GraphModel; class ObjectModel; } @@ -44,35 +44,35 @@ namespace GUI { class App; class LoadPluginWindow; -class NewSubpatchWindow; -class PatchCanvas; -class PatchDescriptionWindow; -class SubpatchModule; +class NewSubgraphWindow; +class GraphCanvas; +class GraphDescriptionWindow; +class SubgraphModule; -/** The patch specific contents of a PatchWindow (ie the canvas and whatever else). +/** The graph specific contents of a GraphWindow (ie the canvas and whatever else). * * \ingroup GUI */ -class PatchView : public Gtk::Box +class GraphView : public Gtk::Box { public: - PatchView(BaseObjectType* cobject, + GraphView(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& xml); void init(App& app); - SharedPtr<PatchCanvas> canvas() const { return _canvas; } - SharedPtr<const Client::PatchModel> patch() const { return _patch; } + SharedPtr<GraphCanvas> canvas() const { return _canvas; } + SharedPtr<const Client::GraphModel> graph() const { return _graph; } Gtk::ToolItem* breadcrumb_container() const { return _breadcrumb_container; } - static SharedPtr<PatchView> create(App& app, - SharedPtr<const Client::PatchModel> patch); + static SharedPtr<GraphView> create(App& app, + SharedPtr<const Client::GraphModel> graph); sigc::signal<void, const Client::ObjectModel*> signal_object_entered; sigc::signal<void, const Client::ObjectModel*> signal_object_left; private: - void set_patch(SharedPtr<const Client::PatchModel> patch); + void set_graph(SharedPtr<const Client::GraphModel> graph); void process_toggled(); void poly_changed(); @@ -90,8 +90,8 @@ private: App* _app; - SharedPtr<const Client::PatchModel> _patch; - SharedPtr<PatchCanvas> _canvas; + SharedPtr<const Client::GraphModel> _graph; + SharedPtr<GraphCanvas> _canvas; Gtk::ScrolledWindow* _canvas_scrolledwindow; Gtk::Toolbar* _toolbar; @@ -109,4 +109,4 @@ private: } // namespace GUI } // namespace Ingen -#endif // INGEN_GUI_PATCHVIEW_HPP +#endif // INGEN_GUI_GRAPHVIEW_HPP diff --git a/src/gui/PatchWindow.cpp b/src/gui/GraphWindow.cpp index 9b3d1a97..0767f76d 100644 --- a/src/gui/PatchWindow.cpp +++ b/src/gui/GraphWindow.cpp @@ -15,18 +15,18 @@ */ #include "ingen/client/ClientStore.hpp" -#include "ingen/client/PatchModel.hpp" +#include "ingen/client/GraphModel.hpp" #include "App.hpp" -#include "PatchCanvas.hpp" -#include "PatchView.hpp" -#include "PatchWindow.hpp" +#include "GraphCanvas.hpp" +#include "GraphView.hpp" +#include "GraphWindow.hpp" #include "WindowFactory.hpp" namespace Ingen { namespace GUI { -PatchWindow::PatchWindow(BaseObjectType* cobject, +GraphWindow::GraphWindow(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& xml) : Window(cobject) , _box(NULL) @@ -36,18 +36,18 @@ PatchWindow::PatchWindow(BaseObjectType* cobject, { property_visible() = false; - xml->get_widget_derived("patch_win_vbox", _box); + xml->get_widget_derived("graph_win_vbox", _box); set_title("Ingen"); } -PatchWindow::~PatchWindow() +GraphWindow::~GraphWindow() { delete _box; } void -PatchWindow::init_window(App& app) +GraphWindow::init_window(App& app) { Window::init_window(app); _box->init_box(app); @@ -55,7 +55,7 @@ PatchWindow::init_window(App& app) } void -PatchWindow::on_show() +GraphWindow::on_show() { if (_position_stored) move(_x, _y); @@ -66,7 +66,7 @@ PatchWindow::on_show() } void -PatchWindow::on_hide() +GraphWindow::on_hide() { _position_stored = true; get_position(_x, _y); diff --git a/src/gui/PatchWindow.hpp b/src/gui/GraphWindow.hpp index b3213327..794619b8 100644 --- a/src/gui/PatchWindow.hpp +++ b/src/gui/GraphWindow.hpp @@ -14,8 +14,8 @@ along with Ingen. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef INGEN_GUI_PATCH_WINDOW_HPP -#define INGEN_GUI_PATCH_WINDOW_HPP +#ifndef INGEN_GUI_GRAPH_WINDOW_HPP +#define INGEN_GUI_GRAPH_WINDOW_HPP #include <string> @@ -23,33 +23,33 @@ #include "raul/SharedPtr.hpp" -#include "PatchBox.hpp" +#include "GraphBox.hpp" #include "Window.hpp" namespace Ingen { namespace Client { - class PatchModel; + class GraphModel; } namespace GUI { -/** A window for a patch. +/** A window for a graph. * * \ingroup GUI */ -class PatchWindow : public Window +class GraphWindow : public Window { public: - PatchWindow(BaseObjectType* cobject, + GraphWindow(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& xml); - ~PatchWindow(); + ~GraphWindow(); void init_window(App& app); - SharedPtr<const Client::PatchModel> patch() const { return _box->patch(); } - PatchBox* box() const { return _box; } + SharedPtr<const Client::GraphModel> graph() const { return _box->graph(); } + GraphBox* box() const { return _box; } void show_documentation(const std::string& doc, bool html) { _box->show_documentation(doc, html); @@ -69,7 +69,7 @@ protected: void on_show(); private: - PatchBox* _box; + GraphBox* _box; bool _position_stored; int _x; int _y; @@ -78,4 +78,4 @@ private: } // namespace GUI } // namespace Ingen -#endif // INGEN_GUI_PATCH_WINDOW_HPP +#endif // INGEN_GUI_GRAPH_WINDOW_HPP diff --git a/src/gui/LoadPatchWindow.cpp b/src/gui/LoadGraphWindow.cpp index 7ba348a6..9f4dde5c 100644 --- a/src/gui/LoadPatchWindow.cpp +++ b/src/gui/LoadGraphWindow.cpp @@ -24,13 +24,13 @@ #include "ingen/Interface.hpp" #include "ingen/client/BlockModel.hpp" #include "ingen/client/ClientStore.hpp" -#include "ingen/client/PatchModel.hpp" +#include "ingen/client/GraphModel.hpp" #include "ingen/runtime_paths.hpp" #include "App.hpp" #include "Configuration.hpp" -#include "LoadPatchWindow.hpp" -#include "PatchView.hpp" +#include "LoadGraphWindow.hpp" +#include "GraphView.hpp" #include "ThreadedLoader.hpp" using namespace std; @@ -41,31 +41,31 @@ using namespace Client; namespace GUI { -LoadPatchWindow::LoadPatchWindow(BaseObjectType* cobject, +LoadGraphWindow::LoadGraphWindow(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& xml) : Gtk::FileChooserDialog(cobject) , _app(NULL) , _merge_ports(false) { - xml->get_widget("load_patch_symbol_label", _symbol_label); - xml->get_widget("load_patch_symbol_entry", _symbol_entry); - xml->get_widget("load_patch_ports_label", _ports_label); - xml->get_widget("load_patch_merge_ports_radio", _merge_ports_radio); - xml->get_widget("load_patch_insert_ports_radio", _insert_ports_radio); - xml->get_widget("load_patch_poly_voices_radio", _poly_voices_radio); - xml->get_widget("load_patch_poly_from_file_radio", _poly_from_file_radio); - xml->get_widget("load_patch_poly_spinbutton", _poly_spinbutton); - xml->get_widget("load_patch_ok_button", _ok_button); - xml->get_widget("load_patch_cancel_button", _cancel_button); + xml->get_widget("load_graph_symbol_label", _symbol_label); + xml->get_widget("load_graph_symbol_entry", _symbol_entry); + xml->get_widget("load_graph_ports_label", _ports_label); + xml->get_widget("load_graph_merge_ports_radio", _merge_ports_radio); + xml->get_widget("load_graph_insert_ports_radio", _insert_ports_radio); + xml->get_widget("load_graph_poly_voices_radio", _poly_voices_radio); + xml->get_widget("load_graph_poly_from_file_radio", _poly_from_file_radio); + xml->get_widget("load_graph_poly_spinbutton", _poly_spinbutton); + xml->get_widget("load_graph_ok_button", _ok_button); + xml->get_widget("load_graph_cancel_button", _cancel_button); _cancel_button->signal_clicked().connect( - sigc::mem_fun(this, &LoadPatchWindow::cancel_clicked)); + sigc::mem_fun(this, &LoadGraphWindow::cancel_clicked)); _ok_button->signal_clicked().connect( - sigc::mem_fun(this, &LoadPatchWindow::ok_clicked)); + sigc::mem_fun(this, &LoadGraphWindow::ok_clicked)); _merge_ports_radio->signal_toggled().connect( - sigc::mem_fun(this, &LoadPatchWindow::merge_ports_selected)); + sigc::mem_fun(this, &LoadGraphWindow::merge_ports_selected)); _insert_ports_radio->signal_toggled().connect( - sigc::mem_fun(this, &LoadPatchWindow::insert_ports_selected)); + sigc::mem_fun(this, &LoadGraphWindow::insert_ports_selected)); _poly_from_file_radio->signal_toggled().connect(sigc::bind( sigc::mem_fun(_poly_spinbutton, &Gtk::SpinButton::set_sensitive), false)); @@ -74,11 +74,11 @@ LoadPatchWindow::LoadPatchWindow(BaseObjectType* cobject, true)); signal_selection_changed().connect( - sigc::mem_fun(this, &LoadPatchWindow::selection_changed)); + sigc::mem_fun(this, &LoadGraphWindow::selection_changed)); Gtk::FileFilter filt; filt.add_pattern("*.ttl"); - filt.set_name("Ingen patch files (*.ttl)"); + filt.set_name("Ingen graph files (*.ttl)"); filt.add_pattern("*.ingen"); filt.set_name("Ingen bundles (*.ingen)"); @@ -87,19 +87,19 @@ LoadPatchWindow::LoadPatchWindow(BaseObjectType* cobject, property_select_multiple() = true; // Add global examples directory to "shortcut folders" (bookmarks) - const string examples_dir = Ingen::data_file_path("patches"); + const string examples_dir = Ingen::data_file_path("graphs"); if (Glib::file_test(examples_dir, Glib::FILE_TEST_IS_DIR)) { add_shortcut_folder(examples_dir); } } void -LoadPatchWindow::present(SharedPtr<const PatchModel> patch, +LoadGraphWindow::present(SharedPtr<const GraphModel> graph, bool import, GraphObject::Properties data) { _import = import; - set_patch(patch); + set_graph(graph); _symbol_label->property_visible() = !import; _symbol_entry->property_visible() = !import; _ports_label->property_visible() = _import; @@ -109,43 +109,43 @@ LoadPatchWindow::present(SharedPtr<const PatchModel> patch, Gtk::Window::present(); } -/** Sets the patch model for this window and initializes everything. +/** Sets the graph model for this window and initializes everything. * * This function MUST be called before using the window in any way! */ void -LoadPatchWindow::set_patch(SharedPtr<const PatchModel> patch) +LoadGraphWindow::set_graph(SharedPtr<const GraphModel> graph) { - _patch = patch; + _graph = graph; _symbol_entry->set_text(""); _symbol_entry->set_sensitive(!_import); - _poly_spinbutton->set_value(patch->internal_poly()); + _poly_spinbutton->set_value(graph->internal_poly()); } void -LoadPatchWindow::on_show() +LoadGraphWindow::on_show() { - if (_app->configuration()->patch_folder().length() > 0) - set_current_folder(_app->configuration()->patch_folder()); + if (_app->configuration()->graph_folder().length() > 0) + set_current_folder(_app->configuration()->graph_folder()); Gtk::FileChooserDialog::on_show(); } void -LoadPatchWindow::merge_ports_selected() +LoadGraphWindow::merge_ports_selected() { _merge_ports = true; } void -LoadPatchWindow::insert_ports_selected() +LoadGraphWindow::insert_ports_selected() { _merge_ports = false; } void -LoadPatchWindow::ok_clicked() +LoadGraphWindow::ok_clicked() { - if (!_patch) { + if (!_graph) { hide(); return; } @@ -161,15 +161,15 @@ LoadPatchWindow::ok_clicked() return; if (_import) { - // If unset load_patch will load value + // If unset load_graph will load value boost::optional<Raul::Path> parent; boost::optional<Raul::Symbol> symbol; - if (!_patch->path().is_root()) { - parent = _patch->path().parent(); - symbol = _patch->symbol(); + if (!_graph->path().is_root()) { + parent = _graph->path().parent(); + symbol = _graph->symbol(); } - _app->loader()->load_patch(true, get_filename(), + _app->loader()->load_graph(true, get_filename(), parent, symbol, _initial_data); } else { @@ -187,24 +187,24 @@ LoadPatchWindow::ok_clicked() symbol = avoid_symbol_clash(symbol); - _app->loader()->load_patch(false, *i, - _patch->path(), symbol, _initial_data); + _app->loader()->load_graph(false, *i, + _graph->path(), symbol, _initial_data); } } - _patch.reset(); + _graph.reset(); hide(); } void -LoadPatchWindow::cancel_clicked() +LoadGraphWindow::cancel_clicked() { - _patch.reset(); + _graph.reset(); hide(); } Raul::Symbol -LoadPatchWindow::symbol_from_filename(const Glib::ustring& filename) +LoadGraphWindow::symbol_from_filename(const Glib::ustring& filename) { std::string symbol_str = Glib::path_get_basename(get_filename()); symbol_str = symbol_str.substr(0, symbol_str.find('.')); @@ -212,10 +212,10 @@ LoadPatchWindow::symbol_from_filename(const Glib::ustring& filename) } Raul::Symbol -LoadPatchWindow::avoid_symbol_clash(const Raul::Symbol& symbol) +LoadGraphWindow::avoid_symbol_clash(const Raul::Symbol& symbol) { unsigned offset = _app->store()->child_name_offset( - _patch->path(), symbol); + _graph->path(), symbol); if (offset != 0) { std::stringstream ss; @@ -227,7 +227,7 @@ LoadPatchWindow::avoid_symbol_clash(const Raul::Symbol& symbol) } void -LoadPatchWindow::selection_changed() +LoadGraphWindow::selection_changed() { if (_import) return; diff --git a/src/gui/LoadPatchWindow.hpp b/src/gui/LoadGraphWindow.hpp index a919a648..2af8e9d2 100644 --- a/src/gui/LoadPatchWindow.hpp +++ b/src/gui/LoadGraphWindow.hpp @@ -14,8 +14,8 @@ along with Ingen. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef INGEN_GUI_LOADSUBPATCHWINDOW_HPP -#define INGEN_GUI_LOADSUBPATCHWINDOW_HPP +#ifndef INGEN_GUI_LOADGRAPHWINDOW_HPP +#define INGEN_GUI_LOADGRAPHWINDOW_HPP #include <gtkmm/builder.h> #include <gtkmm/button.h> @@ -31,27 +31,27 @@ namespace Ingen { -namespace Client { class PatchModel; } +namespace Client { class GraphModel; } namespace GUI { -/** 'Add Subpatch' window. +/** 'Load Graph' Window. * * Loaded from XML as a derived object. * * \ingroup GUI */ -class LoadPatchWindow : public Gtk::FileChooserDialog +class LoadGraphWindow : public Gtk::FileChooserDialog { public: - LoadPatchWindow(BaseObjectType* cobject, + LoadGraphWindow(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& xml); void init(App& app) { _app = &app; } - void set_patch(SharedPtr<const Client::PatchModel> patch); + void set_graph(SharedPtr<const Client::GraphModel> graph); - void present(SharedPtr<const Client::PatchModel> patch, + void present(SharedPtr<const Client::GraphModel> graph, bool import, GraphObject::Properties data); @@ -73,7 +73,7 @@ private: GraphObject::Properties _initial_data; - SharedPtr<const Client::PatchModel> _patch; + SharedPtr<const Client::GraphModel> _graph; Gtk::Label* _symbol_label; Gtk::Entry* _symbol_entry; @@ -93,4 +93,4 @@ private: } // namespace GUI } // namespace Ingen -#endif // INGEN_GUI_LOADSUBPATCHWINDOW_HPP +#endif // INGEN_GUI_LOADGRAPHWINDOW_HPP diff --git a/src/gui/LoadPluginWindow.cpp b/src/gui/LoadPluginWindow.cpp index f5f7a7d7..c3e5b580 100644 --- a/src/gui/LoadPluginWindow.cpp +++ b/src/gui/LoadPluginWindow.cpp @@ -23,13 +23,13 @@ #include "ingen/Interface.hpp" #include "ingen/client/ClientStore.hpp" -#include "ingen/client/PatchModel.hpp" +#include "ingen/client/GraphModel.hpp" #include "App.hpp" #include "LoadPluginWindow.hpp" -#include "PatchCanvas.hpp" -#include "PatchView.hpp" -#include "PatchWindow.hpp" +#include "GraphCanvas.hpp" +#include "GraphView.hpp" +#include "GraphWindow.hpp" #include "ingen_config.h" @@ -115,10 +115,10 @@ LoadPluginWindow::LoadPluginWindow(BaseObjectType* cobject, } void -LoadPluginWindow::present(SharedPtr<const PatchModel> patch, +LoadPluginWindow::present(SharedPtr<const GraphModel> graph, GraphObject::Properties data) { - set_patch(patch); + set_graph(graph); _initial_data = data; Gtk::Window::present(); } @@ -134,7 +134,7 @@ LoadPluginWindow::name_changed() 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))) + } else if (_app->store()->find(_graph->path().child(Raul::Symbol(sym))) != _app->store()->end()) { _add_button->property_sensitive() = false; } else { @@ -151,21 +151,21 @@ LoadPluginWindow::name_cleared(Gtk::EntryIconPosition pos, const GdkEventButton* } #endif // HAVE_NEW_GTKMM -/** Sets the patch controller for this window and initializes everything. +/** Sets the graph controller for this window and initializes everything. * * This function MUST be called before using the window in any way! */ void -LoadPluginWindow::set_patch(SharedPtr<const PatchModel> patch) +LoadPluginWindow::set_graph(SharedPtr<const GraphModel> graph) { - if (_patch) { - _patch = patch; + if (_graph) { + _graph = graph; plugin_selection_changed(); } else { - _patch = patch; + _graph = graph; } - /*if (patch->poly() <= 1) + /*if (graph->poly() <= 1) _polyphonic_checkbutton->property_sensitive() = false; else _polyphonic_checkbutton->property_sensitive() = true;*/ @@ -174,8 +174,8 @@ LoadPluginWindow::set_patch(SharedPtr<const PatchModel> patch) /** Populates the plugin list on the first show. * * This is done here instead of construction time as the list population is - * really expensive and bogs down creation of a patch. This is especially - * important when many patch notifications are sent at one time from the + * really expensive and bogs down creation of a graph. This is especially + * important when many graph notifications are sent at one time from the * engine. */ void @@ -237,8 +237,8 @@ LoadPluginWindow::set_row(Gtk::TreeModel::Row& row, case Plugin::Internal: row[_plugins_columns._col_type] = "Internal"; break; - case Plugin::Patch: - row[_plugins_columns._col_type] = "Patch"; + case Plugin::Graph: + row[_plugins_columns._col_type] = "Graph"; break; case Plugin::NIL: row[_plugins_columns._col_type] = "?"; @@ -292,7 +292,7 @@ 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_block_symbol()); + _graph->path(), p->default_block_symbol()); _name_entry->set_text(generate_module_name(p, _name_offset)); _name_entry->set_sensitive(true); } else { @@ -342,7 +342,7 @@ LoadPluginWindow::load_plugin(const Gtk::TreeModel::iterator& iter) dialog.run(); } else { - Raul::Path path = _patch->path().child(Raul::Symbol::symbolify(name)); + Raul::Path path = _graph->path().child(Raul::Symbol::symbolify(name)); Resource::Properties props = _initial_data; props.insert(make_pair(uris.rdf_type, uris.ingen_Block)); diff --git a/src/gui/LoadPluginWindow.hpp b/src/gui/LoadPluginWindow.hpp index e9b874a2..ba574f12 100644 --- a/src/gui/LoadPluginWindow.hpp +++ b/src/gui/LoadPluginWindow.hpp @@ -28,16 +28,16 @@ #include "raul/SharedPtr.hpp" -#include "ingen_config.h" #include "ingen/GraphObject.hpp" #include "ingen/client/ClientStore.hpp" +#include "ingen_config.h" #include "Window.hpp" namespace Ingen { namespace Client { -class PatchModel; +class GraphModel; class PluginModel; } @@ -55,12 +55,12 @@ public: LoadPluginWindow(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& xml); - void set_patch(SharedPtr<const Client::PatchModel> patch); + void set_graph(SharedPtr<const Client::GraphModel> graph); void set_plugins(SharedPtr<const Client::ClientStore::Plugins> plugins); void add_plugin(SharedPtr<const Client::PluginModel> plugin); - void present(SharedPtr<const Client::PatchModel> patch, + void present(SharedPtr<const Client::GraphModel> graph, GraphObject::Properties data); protected: @@ -128,7 +128,7 @@ private: GraphObject::Properties _initial_data; - SharedPtr<const Client::PatchModel> _patch; + SharedPtr<const Client::GraphModel> _graph; typedef std::map<Raul::URI, Gtk::TreeModel::iterator> Rows; Rows _rows; diff --git a/src/gui/MessagesWindow.hpp b/src/gui/MessagesWindow.hpp index ad3f92a1..8167e30a 100644 --- a/src/gui/MessagesWindow.hpp +++ b/src/gui/MessagesWindow.hpp @@ -31,7 +31,7 @@ namespace GUI { /** Messages Window. * * Loaded from XML as a derived object. - * This is shown when errors occur (e.g. during patch loading). + * This is shown when errors occur (e.g. during graph loading). * * \ingroup GUI */ diff --git a/src/gui/NewSubpatchWindow.cpp b/src/gui/NewSubgraphWindow.cpp index 1124afb3..0cc8da7a 100644 --- a/src/gui/NewSubpatchWindow.cpp +++ b/src/gui/NewSubgraphWindow.cpp @@ -18,30 +18,30 @@ #include "ingen/Interface.hpp" #include "ingen/client/ClientStore.hpp" -#include "ingen/client/PatchModel.hpp" +#include "ingen/client/GraphModel.hpp" #include "App.hpp" -#include "NewSubpatchWindow.hpp" -#include "PatchView.hpp" +#include "NewSubgraphWindow.hpp" +#include "GraphView.hpp" using namespace std; namespace Ingen { namespace GUI { -NewSubpatchWindow::NewSubpatchWindow(BaseObjectType* cobject, +NewSubgraphWindow::NewSubgraphWindow(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& xml) : Window(cobject) { - xml->get_widget("new_subpatch_name_entry", _name_entry); - xml->get_widget("new_subpatch_message_label", _message_label); - xml->get_widget("new_subpatch_polyphony_spinbutton", _poly_spinbutton); - xml->get_widget("new_subpatch_ok_button", _ok_button); - xml->get_widget("new_subpatch_cancel_button", _cancel_button); + xml->get_widget("new_subgraph_name_entry", _name_entry); + xml->get_widget("new_subgraph_message_label", _message_label); + xml->get_widget("new_subgraph_polyphony_spinbutton", _poly_spinbutton); + xml->get_widget("new_subgraph_ok_button", _ok_button); + xml->get_widget("new_subgraph_cancel_button", _cancel_button); - _name_entry->signal_changed().connect(sigc::mem_fun(this, &NewSubpatchWindow::name_changed)); - _ok_button->signal_clicked().connect(sigc::mem_fun(this, &NewSubpatchWindow::ok_clicked)); - _cancel_button->signal_clicked().connect(sigc::mem_fun(this, &NewSubpatchWindow::cancel_clicked)); + _name_entry->signal_changed().connect(sigc::mem_fun(this, &NewSubgraphWindow::name_changed)); + _ok_button->signal_clicked().connect(sigc::mem_fun(this, &NewSubgraphWindow::ok_clicked)); + _cancel_button->signal_clicked().connect(sigc::mem_fun(this, &NewSubgraphWindow::cancel_clicked)); _ok_button->property_sensitive() = false; @@ -49,35 +49,35 @@ NewSubpatchWindow::NewSubpatchWindow(BaseObjectType* cobject, } void -NewSubpatchWindow::present(SharedPtr<const Client::PatchModel> patch, +NewSubgraphWindow::present(SharedPtr<const Client::GraphModel> graph, GraphObject::Properties data) { - set_patch(patch); + set_graph(graph); _initial_data = data; Gtk::Window::present(); } -/** Sets the patch controller for this window and initializes everything. +/** Sets the graph controller for this window and initializes everything. * * This function MUST be called before using the window in any way! */ void -NewSubpatchWindow::set_patch(SharedPtr<const Client::PatchModel> patch) +NewSubgraphWindow::set_graph(SharedPtr<const Client::GraphModel> graph) { - _patch = patch; + _graph = graph; } /** Called every time the user types into the name input box. * Used to display warning messages, and enable/disable the OK button. */ void -NewSubpatchWindow::name_changed() +NewSubgraphWindow::name_changed() { string name = _name_entry->get_text(); if (!Raul::Symbol::is_valid(name)) { _message_label->set_text("Name contains invalid characters."); _ok_button->property_sensitive() = false; - } else if (_app->store()->find(_patch->path().child(Raul::Symbol(name))) + } else if (_app->store()->find(_graph->path().child(Raul::Symbol(name))) != _app->store()->end()) { _message_label->set_text("An object already exists with that name."); _ok_button->property_sensitive() = false; @@ -86,31 +86,30 @@ NewSubpatchWindow::name_changed() _ok_button->property_sensitive() = true; } } - void -NewSubpatchWindow::ok_clicked() +NewSubgraphWindow::ok_clicked() { const uint32_t poly = _poly_spinbutton->get_value_as_int(); - const Raul::Path path = _patch->path().child( + const Raul::Path path = _graph->path().child( Raul::Symbol::symbolify(_name_entry->get_text())); - // Create patch + // Create graph Resource::Properties props; - props.insert(make_pair(_app->uris().rdf_type, _app->uris().ingen_Patch)); + props.insert(make_pair(_app->uris().rdf_type, _app->uris().ingen_Graph)); props.insert(make_pair(_app->uris().ingen_polyphony, _app->forge().make(int32_t(poly)))); 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 (block perspective) properties props = _initial_data; - props.insert(make_pair(_app->uris().rdf_type, _app->uris().ingen_Patch)); + props.insert(make_pair(_app->uris().rdf_type, _app->uris().ingen_Graph)); _app->interface()->put(GraphObject::path_to_uri(path), _initial_data, Resource::EXTERNAL); hide(); } void -NewSubpatchWindow::cancel_clicked() +NewSubgraphWindow::cancel_clicked() { hide(); } diff --git a/src/gui/NewSubpatchWindow.hpp b/src/gui/NewSubgraphWindow.hpp index 20a27dc6..721a0916 100644 --- a/src/gui/NewSubpatchWindow.hpp +++ b/src/gui/NewSubgraphWindow.hpp @@ -14,8 +14,8 @@ along with Ingen. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef INGEN_GUI_NEWSUBPATCHWINDOW_HPP -#define INGEN_GUI_NEWSUBPATCHWINDOW_HPP +#ifndef INGEN_GUI_NEWSUBGRAPHWINDOW_HPP +#define INGEN_GUI_NEWSUBGRAPHWINDOW_HPP #include <gtkmm/builder.h> #include <gtkmm/button.h> @@ -31,25 +31,25 @@ namespace Ingen { -namespace Client { class PatchModel; } +namespace Client { class GraphModel; } namespace GUI { -/** 'New Subpatch' window. +/** 'New Subgraph' window. * * Loaded from XML as a derived object. * * \ingroup GUI */ -class NewSubpatchWindow : public Window +class NewSubgraphWindow : public Window { public: - NewSubpatchWindow(BaseObjectType* cobject, + NewSubgraphWindow(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& xml); - void set_patch(SharedPtr<const Client::PatchModel> patch); + void set_graph(SharedPtr<const Client::GraphModel> graph); - void present(SharedPtr<const Client::PatchModel> patch, + void present(SharedPtr<const Client::GraphModel> graph, GraphObject::Properties data); private: @@ -58,7 +58,7 @@ private: void cancel_clicked(); GraphObject::Properties _initial_data; - SharedPtr<const Client::PatchModel> _patch; + SharedPtr<const Client::GraphModel> _graph; Gtk::Entry* _name_entry; Gtk::Label* _message_label; @@ -70,4 +70,4 @@ private: } // namespace GUI } // namespace Ingen -#endif // INGEN_GUI_NEWSUBPATCHWINDOW_HPP +#endif // INGEN_GUI_NEWSUBGRAPHWINDOW_HPP diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp index bbd569fc..5be945ce 100644 --- a/src/gui/NodeModule.cpp +++ b/src/gui/NodeModule.cpp @@ -24,7 +24,7 @@ #include "ingen/Interface.hpp" #include "ingen/Log.hpp" #include "ingen/client/BlockModel.hpp" -#include "ingen/client/PatchModel.hpp" +#include "ingen/client/GraphModel.hpp" #include "ingen/client/PluginModel.hpp" #include "ingen/client/PluginUI.hpp" #include "raul/Atom.hpp" @@ -33,11 +33,11 @@ #include "Configuration.hpp" #include "NodeMenu.hpp" #include "NodeModule.hpp" -#include "PatchCanvas.hpp" -#include "PatchWindow.hpp" +#include "GraphCanvas.hpp" +#include "GraphWindow.hpp" #include "Port.hpp" #include "RenameWindow.hpp" -#include "SubpatchModule.hpp" +#include "SubgraphModule.hpp" #include "WidgetFactory.hpp" #include "WindowFactory.hpp" @@ -49,7 +49,7 @@ using namespace Client; namespace GUI { -NodeModule::NodeModule(PatchCanvas& canvas, +NodeModule::NodeModule(GraphCanvas& canvas, SharedPtr<const BlockModel> block) : Ganv::Module(canvas, block->path().symbol(), 0, 0, true) , _block(block) @@ -98,14 +98,14 @@ NodeModule::show_menu(GdkEventButton* ev) } NodeModule* -NodeModule::create(PatchCanvas& canvas, +NodeModule::create(GraphCanvas& canvas, SharedPtr<const BlockModel> block, bool human) { - SharedPtr<const PatchModel> patch = PtrCast<const PatchModel>(block); + SharedPtr<const GraphModel> graph = PtrCast<const GraphModel>(block); - NodeModule* ret = (patch) - ? new SubpatchModule(canvas, patch) + NodeModule* ret = (graph) + ? new SubgraphModule(canvas, graph) : new NodeModule(canvas, block); for (GraphObject::Properties::const_iterator m = block->properties().begin(); @@ -127,7 +127,7 @@ NodeModule::create(PatchCanvas& canvas, App& NodeModule::app() const { - return ((PatchCanvas*)canvas())->app(); + return ((GraphCanvas*)canvas())->app(); } void @@ -432,7 +432,7 @@ NodeModule::set_selected(gboolean b) Ganv::Module::set_selected(b); #if 0 if (b) { - PatchWindow* win = app().window_factory()->parent_patch_window(block()); + GraphWindow* win = app().window_factory()->parent_graph_window(block()); if (win) { std::string doc; bool html = false; diff --git a/src/gui/NodeModule.hpp b/src/gui/NodeModule.hpp index 73295d1a..2d63b047 100644 --- a/src/gui/NodeModule.hpp +++ b/src/gui/NodeModule.hpp @@ -33,11 +33,11 @@ namespace Ingen { namespace Client { namespace Ingen { namespace GUI { -class PatchCanvas; +class GraphCanvas; class Port; class NodeMenu; -/** A module in a patch. +/** A module in a graphn. * * This base class is extended for various types of modules. * @@ -47,7 +47,7 @@ class NodeModule : public Ganv::Module { public: static NodeModule* create( - PatchCanvas& canvas, + GraphCanvas& canvas, SharedPtr<const Client::BlockModel> block, bool human_names); @@ -66,7 +66,7 @@ public: SharedPtr<const Client::BlockModel> block() const { return _block; } protected: - NodeModule(PatchCanvas& canvas, SharedPtr<const Client::BlockModel> block); + NodeModule(GraphCanvas& canvas, SharedPtr<const Client::BlockModel> block); virtual bool on_double_click(GdkEventButton* ev); diff --git a/src/gui/ObjectMenu.hpp b/src/gui/ObjectMenu.hpp index 6cb20e70..c4648443 100644 --- a/src/gui/ObjectMenu.hpp +++ b/src/gui/ObjectMenu.hpp @@ -31,7 +31,7 @@ namespace GUI { class ObjectControlWindow; class ObjectPropertiesWindow; -class PatchCanvas; +class GraphCanvas; /** Menu for a Object. * diff --git a/src/gui/PatchTreeWindow.cpp b/src/gui/PatchTreeWindow.cpp deleted file mode 100644 index 00b96926..00000000 --- a/src/gui/PatchTreeWindow.cpp +++ /dev/null @@ -1,234 +0,0 @@ -/* - This file is part of Ingen. - Copyright 2007-2012 David Robillard <http://drobilla.net/> - - Ingen is free software: you can redistribute it and/or modify it under the - terms of the GNU Affero General Public License as published by the Free - Software Foundation, either version 3 of the License, or any later version. - - Ingen is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU Affero General Public License for details. - - You should have received a copy of the GNU Affero General Public License - along with Ingen. If not, see <http://www.gnu.org/licenses/>. -*/ - -#include "App.hpp" -#include "PatchTreeWindow.hpp" -#include "SubpatchModule.hpp" -#include "WindowFactory.hpp" -#include "ingen/Interface.hpp" -#include "ingen/Log.hpp" -#include "ingen/client/ClientStore.hpp" -#include "ingen/client/PatchModel.hpp" -#include "raul/Path.hpp" - -using namespace std; - -namespace Ingen { - -using namespace Client; - -namespace GUI { - -PatchTreeWindow::PatchTreeWindow(BaseObjectType* cobject, - const Glib::RefPtr<Gtk::Builder>& xml) - : Window(cobject) - , _app(NULL) - , _enable_signal(true) -{ - xml->get_widget_derived("patches_treeview", _patches_treeview); - - _patch_treestore = Gtk::TreeStore::create(_patch_tree_columns); - _patches_treeview->set_window(this); - _patches_treeview->set_model(_patch_treestore); - Gtk::TreeViewColumn* name_col = Gtk::manage(new Gtk::TreeViewColumn( - "Patch", _patch_tree_columns.name_col)); - Gtk::TreeViewColumn* enabled_col = Gtk::manage(new Gtk::TreeViewColumn( - "Run", _patch_tree_columns.enabled_col)); - name_col->set_resizable(true); - name_col->set_expand(true); - - _patches_treeview->append_column(*name_col); - _patches_treeview->append_column(*enabled_col); - Gtk::CellRendererToggle* enabled_renderer = dynamic_cast<Gtk::CellRendererToggle*>( - _patches_treeview->get_column_cell_renderer(1)); - enabled_renderer->property_activatable() = true; - - _patch_tree_selection = _patches_treeview->get_selection(); - - _patches_treeview->signal_row_activated().connect( - sigc::mem_fun(this, &PatchTreeWindow::event_patch_activated)); - enabled_renderer->signal_toggled().connect( - sigc::mem_fun(this, &PatchTreeWindow::event_patch_enabled_toggled)); - - _patches_treeview->columns_autosize(); -} - -void -PatchTreeWindow::init(App& app, ClientStore& store) -{ - _app = &app; - store.signal_new_object().connect( - sigc::mem_fun(this, &PatchTreeWindow::new_object)); -} - -void -PatchTreeWindow::new_object(SharedPtr<ObjectModel> object) -{ - SharedPtr<PatchModel> patch = PtrCast<PatchModel>(object); - if (patch) - add_patch(patch); -} - -void -PatchTreeWindow::add_patch(SharedPtr<PatchModel> pm) -{ - if (!pm->parent()) { - Gtk::TreeModel::iterator iter = _patch_treestore->append(); - Gtk::TreeModel::Row row = *iter; - if (pm->path().is_root()) { - row[_patch_tree_columns.name_col] = _app->interface()->uri(); - } else { - row[_patch_tree_columns.name_col] = pm->symbol().c_str(); - } - row[_patch_tree_columns.enabled_col] = pm->enabled(); - row[_patch_tree_columns.patch_model_col] = pm; - _patches_treeview->expand_row(_patch_treestore->get_path(iter), true); - } else { - Gtk::TreeModel::Children children = _patch_treestore->children(); - Gtk::TreeModel::iterator c = find_patch(children, pm->parent()); - - if (c != children.end()) { - Gtk::TreeModel::iterator iter = _patch_treestore->append(c->children()); - Gtk::TreeModel::Row row = *iter; - row[_patch_tree_columns.name_col] = pm->symbol().c_str(); - row[_patch_tree_columns.enabled_col] = pm->enabled(); - row[_patch_tree_columns.patch_model_col] = pm; - _patches_treeview->expand_row(_patch_treestore->get_path(iter), true); - } - } - - pm->signal_property().connect( - sigc::bind(sigc::mem_fun(this, &PatchTreeWindow::patch_property_changed), - pm)); - - pm->signal_moved().connect( - sigc::bind(sigc::mem_fun(this, &PatchTreeWindow::patch_moved), - pm)); - - pm->signal_destroyed().connect( - sigc::bind(sigc::mem_fun(this, &PatchTreeWindow::remove_patch), - pm)); -} - -void -PatchTreeWindow::remove_patch(SharedPtr<PatchModel> pm) -{ - Gtk::TreeModel::iterator i = find_patch(_patch_treestore->children(), pm); - if (i != _patch_treestore->children().end()) - _patch_treestore->erase(i); -} - -Gtk::TreeModel::iterator -PatchTreeWindow::find_patch( - Gtk::TreeModel::Children root, - SharedPtr<Client::ObjectModel> patch) -{ - for (Gtk::TreeModel::iterator c = root.begin(); c != root.end(); ++c) { - SharedPtr<PatchModel> pm = (*c)[_patch_tree_columns.patch_model_col]; - if (patch == pm) { - return c; - } else if ((*c)->children().size() > 0) { - Gtk::TreeModel::iterator ret = find_patch(c->children(), patch); - if (ret != c->children().end()) - return ret; - } - } - return root.end(); -} - -/** Show the context menu for the selected patch in the patches treeview. - */ -void -PatchTreeWindow::show_patch_menu(GdkEventButton* ev) -{ - Gtk::TreeModel::iterator active = _patch_tree_selection->get_selected(); - if (active) { - Gtk::TreeModel::Row row = *active; - SharedPtr<PatchModel> pm = row[_patch_tree_columns.patch_model_col]; - if (pm) { - _app->log().warn("TODO: patch menu from tree window"); - } - } -} - -void -PatchTreeWindow::event_patch_activated(const Gtk::TreeModel::Path& path, Gtk::TreeView::Column* col) -{ - Gtk::TreeModel::iterator active = _patch_treestore->get_iter(path); - Gtk::TreeModel::Row row = *active; - SharedPtr<PatchModel> pm = row[_patch_tree_columns.patch_model_col]; - - _app->window_factory()->present_patch(pm); -} - -void -PatchTreeWindow::event_patch_enabled_toggled(const Glib::ustring& path_str) -{ - Gtk::TreeModel::Path path(path_str); - Gtk::TreeModel::iterator active = _patch_treestore->get_iter(path); - Gtk::TreeModel::Row row = *active; - - SharedPtr<PatchModel> pm = row[_patch_tree_columns.patch_model_col]; - assert(pm); - - if (_enable_signal) - _app->interface()->set_property( - pm->uri(), - _app->uris().ingen_enabled, - _app->forge().make((bool)!pm->enabled())); -} - -void -PatchTreeWindow::patch_property_changed(const Raul::URI& key, - const Raul::Atom& value, - SharedPtr<PatchModel> patch) -{ - const URIs& uris = _app->uris(); - _enable_signal = false; - if (key == uris.ingen_enabled && value.type() == uris.forge.Bool) { - Gtk::TreeModel::iterator i = find_patch(_patch_treestore->children(), patch); - if (i != _patch_treestore->children().end()) { - Gtk::TreeModel::Row row = *i; - row[_patch_tree_columns.enabled_col] = value.get_bool(); - } else { - _app->log().error(Raul::fmt("Unable to find patch %1%\n") - % patch->path()); - } - } - _enable_signal = true; -} - -void -PatchTreeWindow::patch_moved(SharedPtr<PatchModel> patch) -{ - _enable_signal = false; - - Gtk::TreeModel::iterator i - = find_patch(_patch_treestore->children(), patch); - - if (i != _patch_treestore->children().end()) { - Gtk::TreeModel::Row row = *i; - row[_patch_tree_columns.name_col] = patch->symbol().c_str(); - } else { - _app->log().error(Raul::fmt("Unable to find patch %1%\n") - % patch->path()); - } - - _enable_signal = true; -} - -} // namespace GUI -} // namespace Ingen diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp index 88d81fcd..f747234a 100644 --- a/src/gui/Port.cpp +++ b/src/gui/Port.cpp @@ -20,12 +20,12 @@ #include "ganv/Module.hpp" #include "ingen/Interface.hpp" #include "ingen/Log.hpp" -#include "ingen/client/PatchModel.hpp" +#include "ingen/client/GraphModel.hpp" #include "ingen/client/PortModel.hpp" #include "App.hpp" #include "Configuration.hpp" -#include "PatchWindow.hpp" +#include "GraphWindow.hpp" #include "Port.hpp" #include "PortMenu.hpp" #include "WidgetFactory.hpp" @@ -156,7 +156,7 @@ Port::on_value_changed(GVariant* value) } if (_entered) { - PatchBox* box = get_patch_box(); + GraphBox* box = get_graph_box(); if (box) { box->show_port_status(model().get(), atom); } @@ -202,17 +202,17 @@ Port::build_enum_menu() bool Port::on_event(GdkEvent* ev) { - PatchBox* box = NULL; + GraphBox* box = NULL; switch (ev->type) { case GDK_ENTER_NOTIFY: _entered = true; - if ((box = get_patch_box())) { + if ((box = get_graph_box())) { box->object_entered(model().get()); } break; case GDK_LEAVE_NOTIFY: _entered = false; - if ((box = get_patch_box())) { + if ((box = get_graph_box())) { box->object_left(model().get()); } break; @@ -306,15 +306,15 @@ Port::disconnected_from(SharedPtr<PortModel> port) } } -PatchBox* -Port::get_patch_box() const +GraphBox* +Port::get_graph_box() const { - SharedPtr<const PatchModel> patch = PtrCast<const PatchModel>(model()->parent()); - if (!patch) { - patch = PtrCast<const PatchModel>(model()->parent()->parent()); + SharedPtr<const GraphModel> graph = PtrCast<const GraphModel>(model()->parent()); + if (!graph) { + graph = PtrCast<const GraphModel>(model()->parent()->parent()); } - return _app.window_factory()->patch_box(patch); + return _app.window_factory()->graph_box(graph); } void @@ -355,7 +355,7 @@ Port::set_selected(gboolean b) SharedPtr<const PortModel> pm = _port_model.lock(); if (pm && b) { SharedPtr<const BlockModel> block = PtrCast<BlockModel>(pm->parent()); - PatchWindow* win = _app.window_factory()->parent_patch_window(block); + GraphWindow* win = _app.window_factory()->parent_graph_window(block); if (win && block->plugin_model()) { const std::string& doc = block->plugin_model()->port_documentation( pm->index()); diff --git a/src/gui/Port.hpp b/src/gui/Port.hpp index 6552ba8d..2aab66eb 100644 --- a/src/gui/Port.hpp +++ b/src/gui/Port.hpp @@ -38,7 +38,7 @@ namespace Client { class PortModel; } namespace GUI { class App; -class PatchBox; +class GraphBox; /** A Port on an Module. * @@ -75,7 +75,7 @@ private: bool flip = false); Gtk::Menu* build_enum_menu(); - PatchBox* get_patch_box() const; + GraphBox* get_graph_box() const; void property_changed(const Raul::URI& key, const Raul::Atom& value); void moved(); diff --git a/src/gui/PortMenu.cpp b/src/gui/PortMenu.cpp index a23e3b84..3b51976f 100644 --- a/src/gui/PortMenu.cpp +++ b/src/gui/PortMenu.cpp @@ -17,7 +17,7 @@ #include <math.h> #include "ingen/Interface.hpp" -#include "ingen/client/PatchModel.hpp" +#include "ingen/client/GraphModel.hpp" #include "ingen/client/PortModel.hpp" #include "raul/SharedPtr.hpp" @@ -34,7 +34,7 @@ namespace GUI { PortMenu::PortMenu(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& xml) : ObjectMenu(cobject, xml) - , _is_patch_port(false) + , _is_graph_port(false) { xml->get_widget("object_menu", _port_menu); xml->get_widget("port_set_min_menuitem", _set_min_menuitem); @@ -44,12 +44,12 @@ PortMenu::PortMenu(BaseObjectType* cobject, } void -PortMenu::init(App& app, SharedPtr<const PortModel> port, bool is_patch_port) +PortMenu::init(App& app, SharedPtr<const PortModel> port, bool is_graph_port) { const URIs& uris = app.uris(); ObjectMenu::init(app, port); - _is_patch_port = is_patch_port; + _is_graph_port = is_graph_port; _set_min_menuitem->signal_activate().connect( sigc::mem_fun(this, &PortMenu::on_menu_set_min)); @@ -64,9 +64,9 @@ PortMenu::init(App& app, SharedPtr<const PortModel> port, bool is_patch_port) sigc::mem_fun(this, &PortMenu::on_menu_expose)); const bool is_control = app.can_control(port.get()) && port->is_numeric(); - const bool is_on_patch = PtrCast<PatchModel>(port->parent()); + const bool is_on_graph = PtrCast<GraphModel>(port->parent()); - if (!_is_patch_port) { + if (!_is_graph_port) { _polyphonic_menuitem->set_sensitive(false); _rename_menuitem->set_sensitive(false); _destroy_menuitem->set_sensitive(false); @@ -76,10 +76,10 @@ PortMenu::init(App& app, SharedPtr<const PortModel> port, bool is_patch_port) _polyphonic_menuitem->hide(); } - _reset_range_menuitem->set_visible(is_control && !is_on_patch); + _reset_range_menuitem->set_visible(is_control && !is_on_graph); _set_max_menuitem->set_visible(is_control); _set_min_menuitem->set_visible(is_control); - _expose_menuitem->set_visible(!is_on_patch); + _expose_menuitem->set_visible(!is_on_graph); _learn_menuitem->set_visible(is_control); _unlearn_menuitem->set_visible(is_control); @@ -89,7 +89,7 @@ PortMenu::init(App& app, SharedPtr<const PortModel> port, bool is_patch_port) void PortMenu::on_menu_disconnect() { - if (_is_patch_port) { + if (_is_graph_port) { _app->interface()->disconnect_all( _object->parent()->path(), _object->path()); } else { diff --git a/src/gui/PortMenu.hpp b/src/gui/PortMenu.hpp index 598afaa5..34f2c315 100644 --- a/src/gui/PortMenu.hpp +++ b/src/gui/PortMenu.hpp @@ -41,7 +41,7 @@ public: void init(App& app, SharedPtr<const Client::PortModel> port, - bool is_patch_port = false); + bool is_graph_port = false); private: void on_menu_disconnect(); @@ -56,7 +56,7 @@ private: Gtk::MenuItem* _reset_range_menuitem; Gtk::MenuItem* _expose_menuitem; - bool _is_patch_port; + bool _is_graph_port; }; } // namespace GUI diff --git a/src/gui/SubpatchModule.cpp b/src/gui/SubgraphModule.cpp index efd29805..4860098e 100644 --- a/src/gui/SubpatchModule.cpp +++ b/src/gui/SubgraphModule.cpp @@ -18,14 +18,14 @@ #include <utility> #include "ingen/Interface.hpp" -#include "ingen/client/PatchModel.hpp" +#include "ingen/client/GraphModel.hpp" #include "App.hpp" #include "NodeModule.hpp" -#include "PatchCanvas.hpp" -#include "PatchWindow.hpp" +#include "GraphCanvas.hpp" +#include "GraphWindow.hpp" #include "Port.hpp" -#include "SubpatchModule.hpp" +#include "SubgraphModule.hpp" #include "WindowFactory.hpp" using namespace std; @@ -36,31 +36,31 @@ using namespace Client; namespace GUI { -SubpatchModule::SubpatchModule(PatchCanvas& canvas, - SharedPtr<const PatchModel> patch) - : NodeModule(canvas, patch) - , _patch(patch) +SubgraphModule::SubgraphModule(GraphCanvas& canvas, + SharedPtr<const GraphModel> graph) + : NodeModule(canvas, graph) + , _graph(graph) { - assert(patch); + assert(graph); } bool -SubpatchModule::on_double_click(GdkEventButton* event) +SubgraphModule::on_double_click(GdkEventButton* event) { - assert(_patch); + assert(_graph); - SharedPtr<PatchModel> parent = PtrCast<PatchModel>(_patch->parent()); + SharedPtr<GraphModel> parent = PtrCast<GraphModel>(_graph->parent()); - PatchWindow* const preferred = ( (parent && (event->state & GDK_SHIFT_MASK)) + GraphWindow* const preferred = ( (parent && (event->state & GDK_SHIFT_MASK)) ? NULL - : app().window_factory()->patch_window(parent) ); + : app().window_factory()->graph_window(parent) ); - app().window_factory()->present_patch(_patch, preferred); + app().window_factory()->present_graph(_graph, preferred); return true; } void -SubpatchModule::store_location(double ax, double ay) +SubgraphModule::store_location(double ax, double ay) { const URIs& uris = app().uris(); @@ -82,27 +82,27 @@ SubpatchModule::store_location(double ax, double ay) } } -/** Browse to this patch in current (parent's) window +/** Browse to this graph in current (parent's) window * (unless an existing window is displaying it) */ void -SubpatchModule::browse_to_patch() +SubgraphModule::browse_to_graph() { - assert(_patch->parent()); + assert(_graph->parent()); - SharedPtr<PatchModel> parent = PtrCast<PatchModel>(_patch->parent()); + SharedPtr<GraphModel> parent = PtrCast<GraphModel>(_graph->parent()); - PatchWindow* const preferred = (parent) - ? app().window_factory()->patch_window(parent) + GraphWindow* const preferred = (parent) + ? app().window_factory()->graph_window(parent) : NULL; - app().window_factory()->present_patch(_patch, preferred); + app().window_factory()->present_graph(_graph, preferred); } void -SubpatchModule::menu_remove() +SubgraphModule::menu_remove() { - app().interface()->del(_patch->uri()); + app().interface()->del(_graph->uri()); } } // namespace GUI diff --git a/src/gui/SubpatchModule.hpp b/src/gui/SubgraphModule.hpp index 8d7dbecc..569e0fd8 100644 --- a/src/gui/SubpatchModule.hpp +++ b/src/gui/SubgraphModule.hpp @@ -14,51 +14,51 @@ along with Ingen. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef INGEN_GUI_SUBPATCHMODULE_HPP -#define INGEN_GUI_SUBPATCHMODULE_HPP +#ifndef INGEN_GUI_SUBGRAPHMODULE_HPP +#define INGEN_GUI_SUBGRAPHMODULE_HPP #include "raul/SharedPtr.hpp" #include "NodeModule.hpp" -#include "PatchPortModule.hpp" +#include "GraphPortModule.hpp" namespace Ingen { namespace Client { - class PatchModel; - class PatchWindow; + class GraphModel; + class GraphWindow; class PortModel; } } namespace Ingen { namespace GUI { -class PatchCanvas; +class GraphCanvas; -/** A module to represent a subpatch +/** A module to represent a subgraph * * \ingroup GUI */ -class SubpatchModule : public NodeModule +class SubgraphModule : public NodeModule { public: - SubpatchModule(PatchCanvas& canvas, - SharedPtr<const Client::PatchModel> controller); + SubgraphModule(GraphCanvas& canvas, + SharedPtr<const Client::GraphModel> controller); - virtual ~SubpatchModule() {} + virtual ~SubgraphModule() {} bool on_double_click(GdkEventButton* ev); void store_location(double x, double y); - void browse_to_patch(); + void browse_to_graph(); void menu_remove(); - SharedPtr<const Client::PatchModel> patch() const { return _patch; } + SharedPtr<const Client::GraphModel> graph() const { return _graph; } protected: - SharedPtr<const Client::PatchModel> _patch; + SharedPtr<const Client::GraphModel> _graph; }; } // namespace GUI } // namespace Ingen -#endif // INGEN_GUI_SUBPATCHMODULE_HPP +#endif // INGEN_GUI_SUBGRAPHMODULE_HPP diff --git a/src/gui/ThreadedLoader.cpp b/src/gui/ThreadedLoader.cpp index bc7aa19c..cec9a4c9 100644 --- a/src/gui/ThreadedLoader.cpp +++ b/src/gui/ThreadedLoader.cpp @@ -19,7 +19,7 @@ #include "ingen/Log.hpp" #include "ingen/Module.hpp" #include "ingen/World.hpp" -#include "ingen/client/PatchModel.hpp" +#include "ingen/client/GraphModel.hpp" #include "App.hpp" #include "ThreadedLoader.hpp" @@ -39,7 +39,7 @@ ThreadedLoader::ThreadedLoader(App& app, SharedPtr<Interface> engine) if (parser()) { start(); } else { - app.log().warn("Parser unavailable, patch loading disabled\n"); + app.log().warn("Parser unavailable, graph loading disabled\n"); } } @@ -74,7 +74,7 @@ ThreadedLoader::_run() } void -ThreadedLoader::load_patch(bool merge, +ThreadedLoader::load_graph(bool merge, const Glib::ustring& document_uri, optional<Raul::Path> engine_parent, optional<Raul::Symbol> engine_symbol, @@ -108,13 +108,13 @@ ThreadedLoader::load_patch(bool merge, } void -ThreadedLoader::save_patch(SharedPtr<const Client::PatchModel> model, +ThreadedLoader::save_graph(SharedPtr<const Client::GraphModel> model, const string& filename) { _mutex.lock(); _events.push_back(sigc::hide_return(sigc::bind( - sigc::mem_fun(this, &ThreadedLoader::save_patch_event), + sigc::mem_fun(this, &ThreadedLoader::save_graph_event), model, filename))); _mutex.unlock(); @@ -122,7 +122,7 @@ ThreadedLoader::save_patch(SharedPtr<const Client::PatchModel> model, } void -ThreadedLoader::save_patch_event(SharedPtr<const Client::PatchModel> model, +ThreadedLoader::save_graph_event(SharedPtr<const Client::GraphModel> model, const string& filename) { if (_app.serialiser()) { diff --git a/src/gui/ThreadedLoader.hpp b/src/gui/ThreadedLoader.hpp index 273c72f9..162e7cc7 100644 --- a/src/gui/ThreadedLoader.hpp +++ b/src/gui/ThreadedLoader.hpp @@ -33,11 +33,11 @@ namespace Ingen { namespace GUI { -/** Thread for loading patch files. +/** Thread for loading graph files. * * This is a seperate thread so it can send all the loading message without * blocking everything else, so the app can respond to the incoming events - * caused as a result of the patch loading, while the patch loads. + * caused as a result of the graph loading, while the graph loads. * * Implemented as a slave with a list of closures (events) which processes * all events in the (mutex protected) list each time it's whipped. @@ -52,19 +52,19 @@ public: ~ThreadedLoader(); - void load_patch(bool merge, + void load_graph(bool merge, const Glib::ustring& document_uri, boost::optional<Raul::Path> engine_parent, boost::optional<Raul::Symbol> engine_symbol, boost::optional<GraphObject::Properties> engine_data); - void save_patch(SharedPtr<const Client::PatchModel> model, + void save_graph(SharedPtr<const Client::GraphModel> model, const std::string& filename); SharedPtr<Serialisation::Parser> parser(); private: - void save_patch_event(SharedPtr<const Client::PatchModel> model, + void save_graph_event(SharedPtr<const Client::GraphModel> model, const std::string& filename); /** Returns nothing and takes no parameters (because they have all been bound) */ diff --git a/src/gui/WindowFactory.cpp b/src/gui/WindowFactory.cpp index 1f0e0310..884313fd 100644 --- a/src/gui/WindowFactory.cpp +++ b/src/gui/WindowFactory.cpp @@ -16,14 +16,14 @@ #include <string> -#include "ingen/client/PatchModel.hpp" +#include "ingen/client/GraphModel.hpp" #include "App.hpp" -#include "LoadPatchWindow.hpp" +#include "LoadGraphWindow.hpp" #include "LoadPluginWindow.hpp" -#include "NewSubpatchWindow.hpp" -#include "PatchView.hpp" -#include "PatchWindow.hpp" +#include "NewSubgraphWindow.hpp" +#include "GraphView.hpp" +#include "GraphWindow.hpp" #include "PropertiesWindow.hpp" #include "RenameWindow.hpp" #include "WidgetFactory.hpp" @@ -41,58 +41,58 @@ WindowFactory::WindowFactory(App& app) : _app(app) , _main_box(NULL) , _load_plugin_win(NULL) - , _load_patch_win(NULL) - , _new_subpatch_win(NULL) + , _load_graph_win(NULL) + , _new_subgraph_win(NULL) , _properties_win(NULL) { WidgetFactory::get_widget_derived("load_plugin_win", _load_plugin_win); - WidgetFactory::get_widget_derived("load_patch_win", _load_patch_win); - WidgetFactory::get_widget_derived("new_subpatch_win", _new_subpatch_win); + WidgetFactory::get_widget_derived("load_graph_win", _load_graph_win); + WidgetFactory::get_widget_derived("new_subgraph_win", _new_subgraph_win); WidgetFactory::get_widget_derived("properties_win", _properties_win); WidgetFactory::get_widget_derived("rename_win", _rename_win); _load_plugin_win->init_window(app); - _load_patch_win->init(app); - _new_subpatch_win->init_window(app); + _load_graph_win->init(app); + _new_subgraph_win->init_window(app); _properties_win->init_window(app); _rename_win->init_window(app); } WindowFactory::~WindowFactory() { - for (PatchWindowMap::iterator i = _patch_windows.begin(); - i != _patch_windows.end(); ++i) + for (GraphWindowMap::iterator i = _graph_windows.begin(); + i != _graph_windows.end(); ++i) delete i->second; } void WindowFactory::clear() { - for (PatchWindowMap::iterator i = _patch_windows.begin(); - i != _patch_windows.end(); ++i) + for (GraphWindowMap::iterator i = _graph_windows.begin(); + i != _graph_windows.end(); ++i) delete i->second; - _patch_windows.clear(); + _graph_windows.clear(); } -/** Returns the number of Patch windows currently visible. +/** Returns the number of Graph windows currently visible. */ size_t -WindowFactory::num_open_patch_windows() +WindowFactory::num_open_graph_windows() { size_t ret = 0; - for (PatchWindowMap::iterator i = _patch_windows.begin(); - i != _patch_windows.end(); ++i) + for (GraphWindowMap::iterator i = _graph_windows.begin(); + i != _graph_windows.end(); ++i) if (i->second->is_visible()) ++ret; return ret; } -PatchBox* -WindowFactory::patch_box(SharedPtr<const PatchModel> patch) +GraphBox* +WindowFactory::graph_box(SharedPtr<const GraphModel> graph) { - PatchWindow* window = patch_window(patch); + GraphWindow* window = graph_window(graph); if (window) { return window->box(); } else { @@ -100,87 +100,87 @@ WindowFactory::patch_box(SharedPtr<const PatchModel> patch) } } -PatchWindow* -WindowFactory::patch_window(SharedPtr<const PatchModel> patch) +GraphWindow* +WindowFactory::graph_window(SharedPtr<const GraphModel> graph) { - if (!patch) + if (!graph) return NULL; - PatchWindowMap::iterator w = _patch_windows.find(patch->path()); + GraphWindowMap::iterator w = _graph_windows.find(graph->path()); - return (w == _patch_windows.end()) ? NULL : w->second; + return (w == _graph_windows.end()) ? NULL : w->second; } -PatchWindow* -WindowFactory::parent_patch_window(SharedPtr<const BlockModel> block) +GraphWindow* +WindowFactory::parent_graph_window(SharedPtr<const BlockModel> block) { if (!block) return NULL; - return patch_window(PtrCast<PatchModel>(block->parent())); + return graph_window(PtrCast<GraphModel>(block->parent())); } -/** Present a PatchWindow for a Patch. +/** Present a GraphWindow for a Graph. * - * If @a preferred is not NULL, it will be set to display @a patch if the patch + * If @a preferred is not NULL, it will be set to display @a graph if the graph * does not already have a visible window, otherwise that window will be * presented and @a preferred left unmodified. */ void -WindowFactory::present_patch(SharedPtr<const PatchModel> patch, - PatchWindow* preferred, - SharedPtr<PatchView> view) +WindowFactory::present_graph(SharedPtr<const GraphModel> graph, + GraphWindow* preferred, + SharedPtr<GraphView> view) { - assert(!view || view->patch() == patch); + assert(!view || view->graph() == graph); - PatchWindowMap::iterator w = _patch_windows.find(patch->path()); + GraphWindowMap::iterator w = _graph_windows.find(graph->path()); - if (w != _patch_windows.end()) { + if (w != _graph_windows.end()) { (*w).second->present(); } else if (preferred) { - w = _patch_windows.find(preferred->patch()->path()); + w = _graph_windows.find(preferred->graph()->path()); assert((*w).second == preferred); - preferred->box()->set_patch(patch, view); - _patch_windows.erase(w); - _patch_windows[patch->path()] = preferred; + preferred->box()->set_graph(graph, view); + _graph_windows.erase(w); + _graph_windows[graph->path()] = preferred; preferred->present(); } else { - PatchWindow* win = new_patch_window(patch, view); + GraphWindow* win = new_graph_window(graph, view); win->present(); } } -PatchWindow* -WindowFactory::new_patch_window(SharedPtr<const PatchModel> patch, - SharedPtr<PatchView> view) +GraphWindow* +WindowFactory::new_graph_window(SharedPtr<const GraphModel> graph, + SharedPtr<GraphView> view) { - assert(!view || view->patch() == patch); + assert(!view || view->graph() == graph); - PatchWindow* win = NULL; - WidgetFactory::get_widget_derived("patch_win", win); + GraphWindow* win = NULL; + WidgetFactory::get_widget_derived("graph_win", win); win->init_window(_app); - win->box()->set_patch(patch, view); - _patch_windows[patch->path()] = win; + win->box()->set_graph(graph, view); + _graph_windows[graph->path()] = win; win->signal_delete_event().connect(sigc::bind<0>( - sigc::mem_fun(this, &WindowFactory::remove_patch_window), win)); + sigc::mem_fun(this, &WindowFactory::remove_graph_window), win)); return win; } bool -WindowFactory::remove_patch_window(PatchWindow* win, GdkEventAny* ignored) +WindowFactory::remove_graph_window(GraphWindow* win, GdkEventAny* ignored) { - if (_patch_windows.size() <= 1) + if (_graph_windows.size() <= 1) return !_app.quit(win); - PatchWindowMap::iterator w = _patch_windows.find(win->patch()->path()); + GraphWindowMap::iterator w = _graph_windows.find(win->graph()->path()); assert((*w).second == win); - _patch_windows.erase(w); + _graph_windows.erase(w); delete win; @@ -188,12 +188,12 @@ WindowFactory::remove_patch_window(PatchWindow* win, GdkEventAny* ignored) } void -WindowFactory::present_load_plugin(SharedPtr<const PatchModel> patch, +WindowFactory::present_load_plugin(SharedPtr<const GraphModel> graph, GraphObject::Properties data) { - PatchWindowMap::iterator w = _patch_windows.find(patch->path()); + GraphWindowMap::iterator w = _graph_windows.find(graph->path()); - if (w != _patch_windows.end()) + if (w != _graph_windows.end()) _load_plugin_win->set_transient_for(*w->second); _load_plugin_win->set_modal(false); @@ -204,54 +204,54 @@ WindowFactory::present_load_plugin(SharedPtr<const PatchModel> patch, _load_plugin_win->set_default_size(width - width / 8, height / 2); } _load_plugin_win->set_title( - string("Load Plugin - ") + patch->path() + " - Ingen"); - _load_plugin_win->present(patch, data); + string("Load Plugin - ") + graph->path() + " - Ingen"); + _load_plugin_win->present(graph, data); } void -WindowFactory::present_load_patch(SharedPtr<const PatchModel> patch, +WindowFactory::present_load_graph(SharedPtr<const GraphModel> graph, GraphObject::Properties data) { - PatchWindowMap::iterator w = _patch_windows.find(patch->path()); + GraphWindowMap::iterator w = _graph_windows.find(graph->path()); - if (w != _patch_windows.end()) - _load_patch_win->set_transient_for(*w->second); + if (w != _graph_windows.end()) + _load_graph_win->set_transient_for(*w->second); - _load_patch_win->present(patch, true, data); + _load_graph_win->present(graph, true, data); } void -WindowFactory::present_load_subpatch(SharedPtr<const PatchModel> patch, +WindowFactory::present_load_subgraph(SharedPtr<const GraphModel> graph, GraphObject::Properties data) { - PatchWindowMap::iterator w = _patch_windows.find(patch->path()); + GraphWindowMap::iterator w = _graph_windows.find(graph->path()); - if (w != _patch_windows.end()) - _load_patch_win->set_transient_for(*w->second); + if (w != _graph_windows.end()) + _load_graph_win->set_transient_for(*w->second); - _load_patch_win->present(patch, false, data); + _load_graph_win->present(graph, false, data); } void -WindowFactory::present_new_subpatch(SharedPtr<const PatchModel> patch, +WindowFactory::present_new_subgraph(SharedPtr<const GraphModel> graph, GraphObject::Properties data) { - PatchWindowMap::iterator w = _patch_windows.find(patch->path()); + GraphWindowMap::iterator w = _graph_windows.find(graph->path()); - if (w != _patch_windows.end()) - _new_subpatch_win->set_transient_for(*w->second); + if (w != _graph_windows.end()) + _new_subgraph_win->set_transient_for(*w->second); - _new_subpatch_win->present(patch, data); + _new_subgraph_win->present(graph, data); } void WindowFactory::present_rename(SharedPtr<const ObjectModel> object) { - PatchWindowMap::iterator w = _patch_windows.find(object->path()); - if (w == _patch_windows.end()) - w = _patch_windows.find(object->path().parent()); + GraphWindowMap::iterator w = _graph_windows.find(object->path()); + if (w == _graph_windows.end()) + w = _graph_windows.find(object->path().parent()); - if (w != _patch_windows.end()) + if (w != _graph_windows.end()) _rename_win->set_transient_for(*w->second); _rename_win->present(object); @@ -260,13 +260,13 @@ WindowFactory::present_rename(SharedPtr<const ObjectModel> object) void WindowFactory::present_properties(SharedPtr<const ObjectModel> object) { - PatchWindowMap::iterator w = _patch_windows.find(object->path()); - if (w == _patch_windows.end()) - w = _patch_windows.find(object->path().parent()); - if (w == _patch_windows.end()) - w = _patch_windows.find(object->path().parent().parent()); + GraphWindowMap::iterator w = _graph_windows.find(object->path()); + if (w == _graph_windows.end()) + w = _graph_windows.find(object->path().parent()); + if (w == _graph_windows.end()) + w = _graph_windows.find(object->path().parent().parent()); - if (w != _patch_windows.end()) + if (w != _graph_windows.end()) _properties_win->set_transient_for(*w->second); _properties_win->present(object); diff --git a/src/gui/WindowFactory.hpp b/src/gui/WindowFactory.hpp index 465bfa80..46c8b39a 100644 --- a/src/gui/WindowFactory.hpp +++ b/src/gui/WindowFactory.hpp @@ -27,19 +27,19 @@ namespace Ingen { namespace Client { class BlockModel; class ObjectModel; -class PatchModel; +class GraphModel; } namespace GUI { class App; -class LoadPatchWindow; +class GraphBox; +class GraphView; +class GraphWindow; +class LoadGraphWindow; class LoadPluginWindow; -class NewSubpatchWindow; +class NewSubgraphWindow; class PropertiesWindow; -class PatchBox; -class PatchView; -class PatchWindow; class RenameWindow; /** Manager/Factory for all windows. @@ -53,44 +53,44 @@ public: explicit WindowFactory(App& app); ~WindowFactory(); - size_t num_open_patch_windows(); + size_t num_open_graph_windows(); - PatchBox* patch_box(SharedPtr<const Client::PatchModel> patch); - PatchWindow* patch_window(SharedPtr<const Client::PatchModel> patch); - PatchWindow* parent_patch_window(SharedPtr<const Client::BlockModel> block); + GraphBox* graph_box(SharedPtr<const Client::GraphModel> graph); + GraphWindow* graph_window(SharedPtr<const Client::GraphModel> graph); + GraphWindow* parent_graph_window(SharedPtr<const Client::BlockModel> block); - void present_patch( - SharedPtr<const Client::PatchModel> model, - PatchWindow* preferred = NULL, - SharedPtr<PatchView> view = SharedPtr<PatchView>()); + void present_graph( + SharedPtr<const Client::GraphModel> model, + GraphWindow* preferred = NULL, + SharedPtr<GraphView> view = SharedPtr<GraphView>()); typedef GraphObject::Properties Properties; - void present_load_plugin(SharedPtr<const Client::PatchModel> patch, Properties data=Properties()); - void present_load_patch(SharedPtr<const Client::PatchModel> patch, Properties data=Properties()); - void present_load_subpatch(SharedPtr<const Client::PatchModel> patch, Properties data=Properties()); - void present_new_subpatch(SharedPtr<const Client::PatchModel> patch, Properties data=Properties()); + void present_load_plugin(SharedPtr<const Client::GraphModel> graph, Properties data=Properties()); + void present_load_graph(SharedPtr<const Client::GraphModel> graph, Properties data=Properties()); + void present_load_subgraph(SharedPtr<const Client::GraphModel> graph, Properties data=Properties()); + void present_new_subgraph(SharedPtr<const Client::GraphModel> graph, Properties data=Properties()); void present_rename(SharedPtr<const Client::ObjectModel> object); void present_properties(SharedPtr<const Client::ObjectModel> object); - bool remove_patch_window(PatchWindow* win, GdkEventAny* ignored = NULL); + bool remove_graph_window(GraphWindow* win, GdkEventAny* ignored = NULL); - void set_main_box(PatchBox* box) { _main_box = box; } + void set_main_box(GraphBox* box) { _main_box = box; } void clear(); private: - typedef std::map<Raul::Path, PatchWindow*> PatchWindowMap; + typedef std::map<Raul::Path, GraphWindow*> GraphWindowMap; - PatchWindow* new_patch_window(SharedPtr<const Client::PatchModel> patch, - SharedPtr<PatchView> view); + GraphWindow* new_graph_window(SharedPtr<const Client::GraphModel> graph, + SharedPtr<GraphView> view); App& _app; - PatchBox* _main_box; - PatchWindowMap _patch_windows; + GraphBox* _main_box; + GraphWindowMap _graph_windows; LoadPluginWindow* _load_plugin_win; - LoadPatchWindow* _load_patch_win; - NewSubpatchWindow* _new_subpatch_win; + LoadGraphWindow* _load_graph_win; + NewSubgraphWindow* _new_subgraph_win; PropertiesWindow* _properties_win; RenameWindow* _rename_win; }; diff --git a/src/gui/ingen_gui.ui b/src/gui/ingen_gui.ui index ed393082..3f939608 100644 --- a/src/gui/ingen_gui.ui +++ b/src/gui/ingen_gui.ui @@ -168,25 +168,25 @@ Contributors: </object> </child> <child> - <object class="GtkImageMenuItem" id="canvas_menu_load_patch"> - <property name="label">_Load Patch...</property> + <object class="GtkImageMenuItem" id="canvas_menu_load_graph"> + <property name="label">_Load Graph...</property> <property name="visible">True</property> <property name="can_focus">False</property> <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="use_stock">False</property> - <signal name="activate" handler="on_canvas_menu_load_patch_activate" swapped="no"/> + <signal name="activate" handler="on_canvas_menu_load_graph_activate" swapped="no"/> </object> </child> <child> - <object class="GtkImageMenuItem" id="canvas_menu_new_patch"> - <property name="label">_New Patch...</property> + <object class="GtkImageMenuItem" id="canvas_menu_new_graph"> + <property name="label">_New Graph...</property> <property name="visible">True</property> <property name="can_focus">False</property> <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="use_stock">False</property> - <signal name="activate" handler="on_canvas_menu_new_patch_activate" swapped="no"/> + <signal name="activate" handler="on_canvas_menu_new_graph_activate" swapped="no"/> </object> </child> </object> @@ -209,7 +209,7 @@ Contributors: <object class="GtkLabel" id="label90"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="label" translatable="yes"><b>Patch Search Path: </b></property> + <property name="label" translatable="yes"><b>Graph Search Path: </b></property> <property name="use_markup">True</property> </object> <packing> @@ -232,7 +232,7 @@ Contributors: <object class="GtkLabel" id="label91"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="label" translatable="yes"><i>Example: /foo/bar:/home/john/patches:/usr/share/om/patches</i></property> + <property name="label" translatable="yes"><i>Example: /foo/bar:/home/user/graphs</i></property> <property name="use_markup">True</property> </object> <packing> @@ -684,9 +684,9 @@ Contributors: <action-widget response="-6">connect_connect_button</action-widget> </action-widgets> </object> - <object class="GtkFileChooserDialog" id="load_patch_win"> + <object class="GtkFileChooserDialog" id="load_graph_win"> <property name="can_focus">False</property> - <property name="title" translatable="yes">Load Patch - Ingen</property> + <property name="title" translatable="yes">Load Graph - Ingen</property> <property name="window_position">center-on-parent</property> <property name="type_hint">dialog</property> <child internal-child="vbox"> @@ -699,7 +699,7 @@ Contributors: <property name="can_focus">False</property> <property name="layout_style">end</property> <child> - <object class="GtkButton" id="load_patch_cancel_button"> + <object class="GtkButton" id="load_graph_cancel_button"> <property name="label">gtk-cancel</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -715,7 +715,7 @@ Contributors: </packing> </child> <child> - <object class="GtkButton" id="load_patch_ok_button"> + <object class="GtkButton" id="load_graph_ok_button"> <property name="label">gtk-open</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -754,7 +754,7 @@ Contributors: <property name="column_spacing">12</property> <property name="row_spacing">12</property> <child> - <object class="GtkLabel" id="load_patch_poly_label"> + <object class="GtkLabel" id="load_graph_poly_label"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="xalign">0</property> @@ -769,7 +769,7 @@ Contributors: </packing> </child> <child> - <object class="GtkRadioButton" id="load_patch_poly_from_file_radio"> + <object class="GtkRadioButton" id="load_graph_poly_from_file_radio"> <property name="label" translatable="yes">Load from _File</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -778,7 +778,7 @@ Contributors: <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="draw_indicator">True</property> - <property name="group">load_patch_poly_voices_radio</property> + <property name="group">load_graph_poly_voices_radio</property> </object> <packing> <property name="left_attach">2</property> @@ -790,7 +790,7 @@ Contributors: </packing> </child> <child> - <object class="GtkLabel" id="load_patch_ports_label"> + <object class="GtkLabel" id="load_graph_ports_label"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="xalign">0</property> @@ -804,7 +804,7 @@ Contributors: </packing> </child> <child> - <object class="GtkRadioButton" id="load_patch_insert_ports_radio"> + <object class="GtkRadioButton" id="load_graph_insert_ports_radio"> <property name="label" translatable="yes">_Insert new ports</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -813,7 +813,7 @@ Contributors: <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="draw_indicator">True</property> - <property name="group">load_patch_merge_ports_radio</property> + <property name="group">load_graph_merge_ports_radio</property> </object> <packing> <property name="left_attach">2</property> @@ -824,7 +824,7 @@ Contributors: </packing> </child> <child> - <object class="GtkRadioButton" id="load_patch_merge_ports_radio"> + <object class="GtkRadioButton" id="load_graph_merge_ports_radio"> <property name="label" translatable="yes">_Merge with existing ports</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -849,7 +849,7 @@ Contributors: <property name="can_focus">False</property> <property name="spacing">6</property> <child> - <object class="GtkRadioButton" id="load_patch_poly_voices_radio"> + <object class="GtkRadioButton" id="load_graph_poly_voices_radio"> <property name="label" translatable="yes">_Voices:</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -867,7 +867,7 @@ Contributors: </packing> </child> <child> - <object class="GtkSpinButton" id="load_patch_poly_spinbutton"> + <object class="GtkSpinButton" id="load_graph_poly_spinbutton"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="invisible_char">●</property> @@ -890,14 +890,14 @@ Contributors: </packing> </child> <child> - <object class="GtkLabel" id="load_patch_symbol_label"> + <object class="GtkLabel" id="load_graph_symbol_label"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="xalign">0</property> <property name="label" translatable="yes">_Symbol: </property> <property name="use_markup">True</property> <property name="use_underline">True</property> - <property name="mnemonic_widget">load_patch_symbol_entry</property> + <property name="mnemonic_widget">load_graph_symbol_entry</property> </object> <packing> <property name="x_options">GTK_FILL</property> @@ -905,7 +905,7 @@ Contributors: </packing> </child> <child> - <object class="GtkEntry" id="load_patch_symbol_entry"> + <object class="GtkEntry" id="load_graph_symbol_entry"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="invisible_char">●</property> @@ -929,8 +929,8 @@ Contributors: </object> </child> <action-widgets> - <action-widget response="-6">load_patch_cancel_button</action-widget> - <action-widget response="-5">load_patch_ok_button</action-widget> + <action-widget response="-6">load_graph_cancel_button</action-widget> + <action-widget response="-5">load_graph_ok_button</action-widget> </action-widgets> </object> <object class="GtkWindow" id="load_plugin_win"> @@ -1236,11 +1236,11 @@ Contributors: </object> </child> </object> - <object class="GtkWindow" id="new_subpatch_win"> + <object class="GtkWindow" id="new_subgraph_win"> <property name="width_request">320</property> <property name="can_focus">False</property> <property name="border_width">8</property> - <property name="title" translatable="yes">Create Subpatch - Ingen</property> + <property name="title" translatable="yes">Create Subgraph - Ingen</property> <property name="resizable">False</property> <property name="window_position">center-on-parent</property> <property name="type_hint">dialog</property> @@ -1261,7 +1261,7 @@ Contributors: <property name="xalign">0</property> <property name="label" translatable="yes">_Symbol: </property> <property name="use_underline">True</property> - <property name="mnemonic_widget">new_subpatch_name_entry</property> + <property name="mnemonic_widget">new_subgraph_name_entry</property> </object> <packing> <property name="x_options">GTK_FILL</property> @@ -1276,7 +1276,7 @@ Contributors: <property name="xalign">0</property> <property name="label" translatable="yes">_Polyphony: </property> <property name="use_underline">True</property> - <property name="mnemonic_widget">new_subpatch_polyphony_spinbutton</property> + <property name="mnemonic_widget">new_subgraph_polyphony_spinbutton</property> </object> <packing> <property name="top_attach">1</property> @@ -1287,7 +1287,7 @@ Contributors: </packing> </child> <child> - <object class="GtkSpinButton" id="new_subpatch_polyphony_spinbutton"> + <object class="GtkSpinButton" id="new_subgraph_polyphony_spinbutton"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="invisible_char">●</property> @@ -1305,7 +1305,7 @@ Contributors: </packing> </child> <child> - <object class="GtkEntry" id="new_subpatch_name_entry"> + <object class="GtkEntry" id="new_subgraph_name_entry"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="invisible_char">●</property> @@ -1326,7 +1326,7 @@ Contributors: </packing> </child> <child> - <object class="GtkLabel" id="new_subpatch_message_label"> + <object class="GtkLabel" id="new_subgraph_message_label"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="wrap">True</property> @@ -1344,7 +1344,7 @@ Contributors: <property name="spacing">4</property> <property name="layout_style">end</property> <child> - <object class="GtkButton" id="new_subpatch_cancel_button"> + <object class="GtkButton" id="new_subgraph_cancel_button"> <property name="label">gtk-cancel</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -1359,7 +1359,7 @@ Contributors: </packing> </child> <child> - <object class="GtkButton" id="new_subpatch_ok_button"> + <object class="GtkButton" id="new_subgraph_ok_button"> <property name="label">gtk-ok</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -1516,12 +1516,12 @@ Contributors: </object> </child> </object> - <object class="GtkWindow" id="patch_tree_win"> + <object class="GtkWindow" id="graph_tree_win"> <property name="width_request">320</property> <property name="height_request">340</property> <property name="can_focus">False</property> <property name="border_width">8</property> - <property name="title" translatable="yes">Patches - Ingen</property> + <property name="title" translatable="yes">Graphs - Ingen</property> <child> <object class="GtkScrolledWindow" id="scrolledwindow8"> <property name="visible">True</property> @@ -1529,7 +1529,7 @@ Contributors: <property name="border_width">3</property> <property name="shadow_type">in</property> <child> - <object class="GtkTreeView" id="patches_treeview"> + <object class="GtkTreeView" id="graphs_treeview"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="rules_hint">True</property> @@ -1538,13 +1538,13 @@ Contributors: </object> </child> </object> - <object class="GtkWindow" id="patch_win"> + <object class="GtkWindow" id="graph_win"> <property name="can_focus">False</property> <property name="title" translatable="yes">Ingen</property> <property name="default_width">776</property> <property name="default_height">480</property> <child> - <object class="GtkVBox" id="patch_win_vbox"> + <object class="GtkVBox" id="graph_win_vbox"> <property name="visible">True</property> <property name="can_focus">False</property> <child> @@ -1552,17 +1552,17 @@ Contributors: <property name="visible">True</property> <property name="can_focus">False</property> <child> - <object class="GtkMenuItem" id="patch_file_menu"> + <object class="GtkMenuItem" id="graph_file_menu"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="use_action_appearance">False</property> <property name="label" translatable="yes">_File</property> <property name="use_underline">True</property> <child type="submenu"> - <object class="GtkMenu" id="patch_file_menu_menu"> + <object class="GtkMenu" id="graph_file_menu_menu"> <property name="can_focus">False</property> <child> - <object class="GtkImageMenuItem" id="patch_import_menuitem"> + <object class="GtkImageMenuItem" id="graph_import_menuitem"> <property name="label">_Import...</property> <property name="visible">True</property> <property name="can_focus">False</property> @@ -1570,7 +1570,7 @@ Contributors: <property name="use_underline">True</property> <property name="use_stock">False</property> <accelerator key="I" signal="activate" modifiers="GDK_CONTROL_MASK"/> - <signal name="activate" handler="on_patch_import_menuitem_activate" swapped="no"/> + <signal name="activate" handler="on_graph_import_menuitem_activate" swapped="no"/> </object> </child> <child> @@ -1580,7 +1580,7 @@ Contributors: </object> </child> <child> - <object class="GtkImageMenuItem" id="patch_save_menuitem"> + <object class="GtkImageMenuItem" id="graph_save_menuitem"> <property name="label">gtk-save</property> <property name="visible">True</property> <property name="can_focus">False</property> @@ -1588,11 +1588,11 @@ Contributors: <property name="use_underline">True</property> <property name="use_stock">True</property> <accelerator key="S" signal="activate" modifiers="GDK_CONTROL_MASK"/> - <signal name="activate" handler="on_file_save_patch_menuitem_activate" swapped="no"/> + <signal name="activate" handler="on_file_save_graph_menuitem_activate" swapped="no"/> </object> </child> <child> - <object class="GtkImageMenuItem" id="patch_save_as_menuitem"> + <object class="GtkImageMenuItem" id="graph_save_as_menuitem"> <property name="label">Save _As...</property> <property name="visible">True</property> <property name="can_focus">False</property> @@ -1600,11 +1600,11 @@ Contributors: <property name="use_underline">True</property> <property name="use_stock">False</property> <accelerator key="S" signal="activate" modifiers="GDK_SHIFT_MASK | GDK_CONTROL_MASK"/> - <signal name="activate" handler="on_patch_save_as_menuitem_activate" swapped="no"/> + <signal name="activate" handler="on_graph_save_as_menuitem_activate" swapped="no"/> </object> </child> <child> - <object class="GtkImageMenuItem" id="patch_draw_menuitem"> + <object class="GtkImageMenuItem" id="graph_draw_menuitem"> <property name="label">_Draw...</property> <property name="visible">True</property> <property name="can_focus">False</property> @@ -1612,7 +1612,7 @@ Contributors: <property name="use_underline">True</property> <property name="use_stock">False</property> <accelerator key="D" signal="activate" modifiers="GDK_CONTROL_MASK"/> - <signal name="activate" handler="on_patch_draw_menuitem_activate" swapped="no"/> + <signal name="activate" handler="on_graph_draw_menuitem_activate" swapped="no"/> </object> </child> <child> @@ -1622,14 +1622,14 @@ Contributors: </object> </child> <child> - <object class="GtkImageMenuItem" id="patch_close_menuitem"> + <object class="GtkImageMenuItem" id="graph_close_menuitem"> <property name="label">gtk-close</property> <property name="visible">True</property> <property name="can_focus">False</property> <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="use_stock">True</property> - <signal name="activate" handler="on_patch_file_close_menuitem_activate" swapped="no"/> + <signal name="activate" handler="on_graph_file_close_menuitem_activate" swapped="no"/> </object> </child> <child> @@ -1639,14 +1639,14 @@ Contributors: </object> </child> <child> - <object class="GtkImageMenuItem" id="patch_quit_menuitem"> + <object class="GtkImageMenuItem" id="graph_quit_menuitem"> <property name="label">gtk-quit</property> <property name="visible">True</property> <property name="can_focus">False</property> <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="use_stock">True</property> - <signal name="activate" handler="on_patch_file_quit_nokill_menuitem_activate" swapped="no"/> + <signal name="activate" handler="on_graph_file_quit_nokill_menuitem_activate" swapped="no"/> </object> </child> </object> @@ -1670,7 +1670,7 @@ Contributors: </object> </child> <child> - <object class="GtkImageMenuItem" id="patch_cut_menuitem"> + <object class="GtkImageMenuItem" id="graph_cut_menuitem"> <property name="label">gtk-cut</property> <property name="visible">True</property> <property name="sensitive">False</property> @@ -1678,11 +1678,11 @@ Contributors: <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="use_stock">True</property> - <signal name="activate" handler="on_patch_cut_menuitem_activate" swapped="no"/> + <signal name="activate" handler="on_graph_cut_menuitem_activate" swapped="no"/> </object> </child> <child> - <object class="GtkImageMenuItem" id="patch_copy_menuitem"> + <object class="GtkImageMenuItem" id="graph_copy_menuitem"> <property name="label">gtk-copy</property> <property name="visible">True</property> <property name="can_focus">False</property> @@ -1690,11 +1690,11 @@ Contributors: <property name="use_underline">True</property> <property name="use_stock">True</property> <accelerator key="C" signal="activate" modifiers="GDK_CONTROL_MASK"/> - <signal name="activate" handler="on_patch_copy_menuitem_activate" swapped="no"/> + <signal name="activate" handler="on_graph_copy_menuitem_activate" swapped="no"/> </object> </child> <child> - <object class="GtkImageMenuItem" id="patch_paste_menuitem"> + <object class="GtkImageMenuItem" id="graph_paste_menuitem"> <property name="label">gtk-paste</property> <property name="visible">True</property> <property name="sensitive">False</property> @@ -1703,11 +1703,11 @@ Contributors: <property name="use_underline">True</property> <property name="use_stock">True</property> <accelerator key="V" signal="activate" modifiers="GDK_CONTROL_MASK"/> - <signal name="activate" handler="on_patch_paste_menuitem_activate" swapped="no"/> + <signal name="activate" handler="on_graph_paste_menuitem_activate" swapped="no"/> </object> </child> <child> - <object class="GtkImageMenuItem" id="patch_delete_menuitem"> + <object class="GtkImageMenuItem" id="graph_delete_menuitem"> <property name="label">gtk-delete</property> <property name="visible">True</property> <property name="can_focus">False</property> @@ -1715,11 +1715,11 @@ Contributors: <property name="use_underline">True</property> <property name="use_stock">True</property> <accelerator key="Delete" signal="activate"/> - <signal name="activate" handler="on_patch_delete_menuitem_activate" swapped="no"/> + <signal name="activate" handler="on_graph_delete_menuitem_activate" swapped="no"/> </object> </child> <child> - <object class="GtkImageMenuItem" id="patch_select_all_menuitem"> + <object class="GtkImageMenuItem" id="graph_select_all_menuitem"> <property name="label">gtk-select-all</property> <property name="visible">True</property> <property name="can_focus">False</property> @@ -1727,7 +1727,7 @@ Contributors: <property name="use_underline">True</property> <property name="use_stock">True</property> <accelerator key="A" signal="activate" modifiers="GDK_CONTROL_MASK"/> - <signal name="activate" handler="on_patch_select_all_menuitem_activate" swapped="no"/> + <signal name="activate" handler="on_graph_select_all_menuitem_activate" swapped="no"/> </object> </child> <child> @@ -1737,7 +1737,7 @@ Contributors: </object> </child> <child> - <object class="GtkImageMenuItem" id="patch_arrange_menuitem"> + <object class="GtkImageMenuItem" id="graph_arrange_menuitem"> <property name="label">Arrange</property> <property name="visible">True</property> <property name="can_focus">False</property> @@ -1754,7 +1754,7 @@ Contributors: </object> </child> <child> - <object class="GtkImageMenuItem" id="patch_view_control_window_menuitem"> + <object class="GtkImageMenuItem" id="graph_view_control_window_menuitem"> <property name="label">C_ontrols...</property> <property name="visible">True</property> <property name="can_focus">False</property> @@ -1762,11 +1762,11 @@ Contributors: <property name="use_underline">True</property> <property name="use_stock">False</property> <accelerator key="O" signal="activate" modifiers="GDK_CONTROL_MASK"/> - <signal name="activate" handler="on_patch_view_control_window_menuitem_activate" swapped="no"/> + <signal name="activate" handler="on_graph_view_control_window_menuitem_activate" swapped="no"/> </object> </child> <child> - <object class="GtkImageMenuItem" id="patch_properties_menuitem"> + <object class="GtkImageMenuItem" id="graph_properties_menuitem"> <property name="label">gtk-properties</property> <property name="visible">True</property> <property name="can_focus">False</property> @@ -1774,7 +1774,7 @@ Contributors: <property name="use_underline">True</property> <property name="use_stock">True</property> <accelerator key="P" signal="activate" modifiers="GDK_CONTROL_MASK"/> - <signal name="activate" handler="on_patch_properties_menuitem_activate" swapped="no"/> + <signal name="activate" handler="on_graph_properties_menuitem_activate" swapped="no"/> </object> </child> </object> @@ -1782,17 +1782,17 @@ Contributors: </object> </child> <child> - <object class="GtkMenuItem" id="patch_patch_menu"> + <object class="GtkMenuItem" id="graph_graph_menu"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="use_action_appearance">False</property> <property name="label" translatable="yes">_View</property> <property name="use_underline">True</property> <child type="submenu"> - <object class="GtkMenu" id="patch_patch_menu_menu"> + <object class="GtkMenu" id="graph_graph_menu_menu"> <property name="can_focus">False</property> <child> - <object class="GtkCheckMenuItem" id="patch_human_names_menuitem"> + <object class="GtkCheckMenuItem" id="graph_human_names_menuitem"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="use_action_appearance">False</property> @@ -1803,7 +1803,7 @@ Contributors: </object> </child> <child> - <object class="GtkCheckMenuItem" id="patch_show_port_names_menuitem"> + <object class="GtkCheckMenuItem" id="graph_show_port_names_menuitem"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="use_action_appearance">False</property> @@ -1814,7 +1814,7 @@ Contributors: </object> </child> <child> - <object class="GtkCheckMenuItem" id="patch_status_bar_menuitem"> + <object class="GtkCheckMenuItem" id="graph_status_bar_menuitem"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="use_action_appearance">False</property> @@ -1831,7 +1831,7 @@ Contributors: </object> </child> <child> - <object class="GtkImageMenuItem" id="patch_zoom_in_menuitem"> + <object class="GtkImageMenuItem" id="graph_zoom_in_menuitem"> <property name="label">gtk-zoom-in</property> <property name="visible">True</property> <property name="can_focus">False</property> @@ -1842,7 +1842,7 @@ Contributors: </object> </child> <child> - <object class="GtkImageMenuItem" id="patch_zoom_out_menuitem"> + <object class="GtkImageMenuItem" id="graph_zoom_out_menuitem"> <property name="label">gtk-zoom-out</property> <property name="visible">True</property> <property name="can_focus">False</property> @@ -1853,7 +1853,7 @@ Contributors: </object> </child> <child> - <object class="GtkImageMenuItem" id="patch_zoom_normal_menuitem"> + <object class="GtkImageMenuItem" id="graph_zoom_normal_menuitem"> <property name="label">gtk-zoom-100</property> <property name="visible">True</property> <property name="can_focus">False</property> @@ -1870,7 +1870,7 @@ Contributors: </object> </child> <child> - <object class="GtkImageMenuItem" id="patch_fullscreen_menuitem"> + <object class="GtkImageMenuItem" id="graph_fullscreen_menuitem"> <property name="label">gtk-fullscreen</property> <property name="visible">True</property> <property name="can_focus">False</property> @@ -1878,7 +1878,7 @@ Contributors: <property name="use_underline">True</property> <property name="use_stock">True</property> <accelerator key="F11" signal="activate"/> - <signal name="activate" handler="patch_fullscreen_menuitem" swapped="no"/> + <signal name="activate" handler="graph_fullscreen_menuitem" swapped="no"/> </object> </child> </object> @@ -1897,7 +1897,7 @@ Contributors: <object class="GtkMenu" id="view1_menu"> <property name="can_focus">False</property> <child> - <object class="GtkImageMenuItem" id="patch_view_engine_window_menuitem"> + <object class="GtkImageMenuItem" id="graph_view_engine_window_menuitem"> <property name="label">_Engine</property> <property name="visible">True</property> <property name="can_focus">False</property> @@ -1905,23 +1905,23 @@ Contributors: <property name="use_underline">True</property> <property name="use_stock">False</property> <accelerator key="E" signal="activate" modifiers="GDK_CONTROL_MASK"/> - <signal name="activate" handler="on_patch_view_engine_window_menuitem_activate" swapped="no"/> + <signal name="activate" handler="on_graph_view_engine_window_menuitem_activate" swapped="no"/> </object> </child> <child> - <object class="GtkImageMenuItem" id="patch_view_patch_tree_window_menuitem"> - <property name="label">_Patch Tree</property> + <object class="GtkImageMenuItem" id="graph_view_graph_tree_window_menuitem"> + <property name="label">_Graph Tree</property> <property name="visible">True</property> <property name="can_focus">False</property> <property name="use_action_appearance">False</property> <property name="use_underline">True</property> <property name="use_stock">False</property> <accelerator key="T" signal="activate" modifiers="GDK_CONTROL_MASK"/> - <signal name="activate" handler="on_patch_view_tree_window_menuitem_activate" swapped="no"/> + <signal name="activate" handler="on_graph_view_tree_window_menuitem_activate" swapped="no"/> </object> </child> <child> - <object class="GtkImageMenuItem" id="patch_view_messages_window_menuitem"> + <object class="GtkImageMenuItem" id="graph_view_messages_window_menuitem"> <property name="label">_Messages</property> <property name="visible">True</property> <property name="can_focus">False</property> @@ -1929,7 +1929,7 @@ Contributors: <property name="use_underline">True</property> <property name="use_stock">False</property> <accelerator key="M" signal="activate" modifiers="GDK_CONTROL_MASK"/> - <signal name="activate" handler="on_patch_view_messages_window_menuitem_activate" swapped="no"/> + <signal name="activate" handler="on_graph_view_messages_window_menuitem_activate" swapped="no"/> </object> </child> </object> @@ -1964,7 +1964,7 @@ Contributors: </object> </child> <child> - <object class="GtkImageMenuItem" id="patch_help_about_menuitem"> + <object class="GtkImageMenuItem" id="graph_help_about_menuitem"> <property name="label">gtk-about</property> <property name="visible">True</property> <property name="can_focus">False</property> @@ -1986,11 +1986,11 @@ Contributors: </packing> </child> <child> - <object class="GtkHPaned" id="patch_documentation_paned"> + <object class="GtkHPaned" id="graph_documentation_paned"> <property name="visible">True</property> <property name="can_focus">False</property> <child> - <object class="GtkAlignment" id="patch_win_alignment"> + <object class="GtkAlignment" id="graph_win_alignment"> <property name="visible">True</property> <property name="can_focus">False</property> <child> @@ -2003,7 +2003,7 @@ Contributors: </packing> </child> <child> - <object class="GtkScrolledWindow" id="patch_documentation_scrolledwindow"> + <object class="GtkScrolledWindow" id="graph_documentation_scrolledwindow"> <property name="can_focus">False</property> <property name="shadow_type">in</property> <child> @@ -2023,7 +2023,7 @@ Contributors: </packing> </child> <child> - <object class="GtkStatusbar" id="patch_win_status_bar"> + <object class="GtkStatusbar" id="graph_win_status_bar"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="spacing">2</property> @@ -2610,7 +2610,7 @@ Contributors: </object> </child> <child> - <object class="GtkVBox" id="patch_view_box"> + <object class="GtkVBox" id="graph_view_box"> <property name="visible">True</property> <property name="can_focus">False</property> <child> @@ -2624,7 +2624,7 @@ Contributors: <property name="toolbar_style">icons</property> <property name="icon_size">1</property> <child> - <object class="GtkToolItem" id="patch_view_breadcrumb_container"> + <object class="GtkToolItem" id="graph_view_breadcrumb_container"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="use_action_appearance">False</property> @@ -2644,14 +2644,14 @@ Contributors: </packing> </child> <child> - <object class="GtkToolbar" id="patch_view_toolbar"> + <object class="GtkToolbar" id="graph_view_toolbar"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="toolbar_style">icons</property> <property name="show_arrow">False</property> <property name="icon_size">1</property> <child> - <object class="GtkToggleToolButton" id="patch_view_process_but"> + <object class="GtkToggleToolButton" id="graph_view_process_but"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="use_action_appearance">False</property> @@ -2688,7 +2688,7 @@ Contributors: <property name="can_focus">False</property> <property name="use_action_appearance">False</property> <child> - <object class="GtkSpinButton" id="patch_view_poly_spin"> + <object class="GtkSpinButton" id="graph_view_poly_spin"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="climb_rate">1</property> @@ -2710,7 +2710,7 @@ Contributors: </packing> </child> <child> - <object class="GtkToolButton" id="patch_view_save_but"> + <object class="GtkToolButton" id="graph_view_save_but"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="use_action_appearance">False</property> @@ -2731,7 +2731,7 @@ Contributors: </packing> </child> <child> - <object class="GtkToolButton" id="patch_view_refresh_but"> + <object class="GtkToolButton" id="graph_view_refresh_but"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="use_action_appearance">False</property> @@ -2743,7 +2743,7 @@ Contributors: </packing> </child> <child> - <object class="GtkToolButton" id="patch_view_zoom_normal_but"> + <object class="GtkToolButton" id="graph_view_zoom_normal_but"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="use_action_appearance">False</property> @@ -2756,7 +2756,7 @@ Contributors: </packing> </child> <child> - <object class="GtkToolButton" id="patch_view_zoom_full_but"> + <object class="GtkToolButton" id="graph_view_zoom_full_but"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="use_action_appearance">False</property> @@ -2783,7 +2783,7 @@ Contributors: </packing> </child> <child> - <object class="GtkScrolledWindow" id="patch_view_scrolledwindow"> + <object class="GtkScrolledWindow" id="graph_view_scrolledwindow"> <property name="visible">True</property> <property name="can_default">True</property> <property name="has_default">True</property> diff --git a/src/gui/ingen_gui_lv2.cpp b/src/gui/ingen_gui_lv2.cpp index 937ecd38..d66405fb 100644 --- a/src/gui/ingen_gui_lv2.cpp +++ b/src/gui/ingen_gui_lv2.cpp @@ -19,15 +19,15 @@ #include "ingen/AtomWriter.hpp" #include "ingen/World.hpp" #include "ingen/client/ClientStore.hpp" -#include "ingen/client/PatchModel.hpp" +#include "ingen/client/GraphModel.hpp" #include "ingen/client/SigClientInterface.hpp" #include "ingen/runtime_paths.hpp" #include "lv2/lv2plug.in/ns/extensions/ui/ui.h" #include "App.hpp" -#include "PatchBox.hpp" +#include "GraphBox.hpp" -#define INGEN_LV2_UI_URI "http://drobilla.net/ns/ingen#PatchUIGtk2" +#define INGEN_LV2_UI_URI "http://drobilla.net/ns/ingen#GraphUIGtk2" /** A sink that writes atoms to a port via the UI extension. */ struct IngenLV2AtomSink : public Ingen::AtomSink { @@ -68,7 +68,7 @@ struct IngenLV2UI { Ingen::World* world; IngenLV2AtomSink* sink; SharedPtr<Ingen::GUI::App> app; - SharedPtr<Ingen::GUI::PatchBox> view; + SharedPtr<Ingen::GUI::GraphBox> view; SharedPtr<Ingen::Interface> engine; SharedPtr<Ingen::AtomReader> reader; SharedPtr<Ingen::Client::SigClientInterface> client; @@ -135,20 +135,20 @@ instantiate(const LV2UI_Descriptor* descriptor, // Request plugins ui->world->interface()->get(Raul::URI("ingen:plugins")); - // Create empty root patch model + // Create empty root graph model Ingen::Resource::Properties props; props.insert(std::make_pair(ui->app->uris().rdf_type, - ui->app->uris().ingen_Patch)); + ui->app->uris().ingen_Graph)); ui->app->store()->put(Ingen::GraphObject::root_uri(), props); - // Create a PatchBox for the root and set as the UI widget - SharedPtr<const Ingen::Client::PatchModel> root = PtrCast<const Ingen::Client::PatchModel>( + // Create a GraphBox for the root and set as the UI widget + SharedPtr<const Ingen::Client::GraphModel> root = PtrCast<const Ingen::Client::GraphModel>( ui->app->store()->object(Raul::Path("/"))); - ui->view = Ingen::GUI::PatchBox::create(*ui->app, root); + ui->view = Ingen::GUI::GraphBox::create(*ui->app, root); ui->view->unparent(); *widget = ui->view->gobj(); - // Request the actual root patch + // Request the actual root graph ui->world->interface()->get(Ingen::GraphObject::root_uri()); return ui; diff --git a/src/gui/wscript b/src/gui/wscript index 7702bd4f..7d022b27 100644 --- a/src/gui/wscript +++ b/src/gui/wscript @@ -32,25 +32,25 @@ def build(bld): Configuration.cpp ConnectWindow.cpp Edge.cpp - LoadPatchWindow.cpp + GraphBox.cpp + GraphCanvas.cpp + GraphPortModule.cpp + GraphTreeWindow.cpp + GraphView.cpp + GraphWindow.cpp + LoadGraphWindow.cpp LoadPluginWindow.cpp MessagesWindow.cpp - NewSubpatchWindow.cpp + NewSubgraphWindow.cpp NodeMenu.cpp NodeModule.cpp ObjectMenu.cpp - PatchBox.cpp - PatchCanvas.cpp - PatchPortModule.cpp - PatchTreeWindow.cpp - PatchView.cpp - PatchWindow.cpp Port.cpp PortMenu.cpp PortPropertiesWindow.cpp PropertiesWindow.cpp RenameWindow.cpp - SubpatchModule.cpp + SubgraphModule.cpp ThreadedLoader.cpp WidgetFactory.cpp Window.cpp diff --git a/src/ingen/main.cpp b/src/ingen/main.cpp index 44f042a4..a0b0dbbe 100644 --- a/src/ingen/main.cpp +++ b/src/ingen/main.cpp @@ -151,7 +151,7 @@ main(int argc, char** argv) world->engine()->activate(); } - // Load a patch + // Load a graph if (conf.option("load").is_valid() || !conf.files().empty()) { boost::optional<Raul::Path> parent; boost::optional<Raul::Symbol> symbol; diff --git a/src/serialisation/Parser.cpp b/src/serialisation/Parser.cpp index 900aba02..9a5c52ed 100644 --- a/src/serialisation/Parser.cpp +++ b/src/serialisation/Parser.cpp @@ -179,7 +179,7 @@ parse( boost::optional<Resource::Properties> data = boost::optional<Resource::Properties>()); static boost::optional<Raul::Path> -parse_patch( +parse_graph( World* world, Interface* target, Sord::Model& model, @@ -212,7 +212,7 @@ parse_edges( Interface* target, Sord::Model& model, const Sord::Node& subject, - const Raul::Path& patch); + const Raul::Path& graph); static boost::optional<Raul::Path> parse_block(Ingen::World* world, @@ -263,10 +263,10 @@ parse_block(Ingen::World* world, serd_env_free(env); Sord::URI sub_node(*world->rdf_world(), sub_file); - parse_patch(world, target, sub_model, sub_node, + parse_graph(world, target, sub_model, sub_node, path.parent(), Raul::Symbol(path.symbol())); - parse_patch(world, target, model, subject, + parse_graph(world, target, model, subject, path.parent(), Raul::Symbol(path.symbol())); } else { Resource::Properties props = get_properties(world, model, subject); @@ -278,7 +278,7 @@ parse_block(Ingen::World* world, } static boost::optional<Raul::Path> -parse_patch(Ingen::World* world, +parse_graph(Ingen::World* world, Ingen::Interface* target, Sord::Model& model, const Sord::Node& subject_node, @@ -292,7 +292,7 @@ parse_patch(Ingen::World* world, const Sord::URI ingen_polyphony(*world->rdf_world(), uris.ingen_polyphony); const Sord::URI lv2_port(*world->rdf_world(), LV2_CORE__port); - const Sord::Node& patch = subject_node; + const Sord::Node& graph = subject_node; const Sord::Node nil; const Glib::ustring base_uri = model.base_uri().to_string(); @@ -304,25 +304,25 @@ parse_patch(Ingen::World* world, const std::string basename = get_basename(base_uri); } - string patch_path_str = relative_uri(base_uri, subject_node.to_string(), true); + string graph_path_str = relative_uri(base_uri, subject_node.to_string(), true); if (parent && a_symbol) - patch_path_str = parent->child(*a_symbol); + graph_path_str = parent->child(*a_symbol); - if (!Raul::Path::is_valid(patch_path_str)) { - world->log().error(Raul::fmt("Patch %1% has invalid path\n") - % patch_path_str); + if (!Raul::Path::is_valid(graph_path_str)) { + world->log().error(Raul::fmt("Graph %1% has invalid path\n") + % graph_path_str); return boost::optional<Raul::Path>(); } - // Create patch - Raul::Path patch_path(patch_path_str); + // Create graph + Raul::Path graph_path(graph_path_str); Resource::Properties props = get_properties(world, model, subject_node); - target->put(GraphObject::path_to_uri(patch_path), props); + target->put(GraphObject::path_to_uri(graph_path), props); - // For each block in this patch + // For each block in this graph for (Sord::Iter n = model.find(subject_node, ingen_block, nil); !n.end(); ++n) { Sord::Node node = n.get_object(); - const Raul::Path block_path = patch_path.child( + const Raul::Path block_path = graph_path.child( Raul::Symbol(get_basename(node.to_string()))); // Parse and create block @@ -348,16 +348,16 @@ parse_patch(Ingen::World* world, } } - // For each port on this patch + // For each port on this graph typedef std::map<uint32_t, PortRecord> PortRecords; PortRecords ports; - for (Sord::Iter p = model.find(patch, lv2_port, nil); !p.end(); ++p) { + for (Sord::Iter p = model.find(graph, lv2_port, nil); !p.end(); ++p) { Sord::Node port = p.get_object(); // Get all properties uint32_t index = 0; boost::optional<PortRecord> port_record = get_port( - world, model, port, patch_path, index); + world, model, port, graph_path, index); if (!port_record) { world->log().error(Raul::fmt("Invalid port %1%\n") % port); return boost::optional<Raul::Path>(); @@ -373,9 +373,9 @@ parse_patch(Ingen::World* world, i->second.second); } - parse_edges(world, target, model, subject_node, patch_path); + parse_edges(world, target, model, subject_node, graph_path); - return patch_path; + return graph_path; } static bool @@ -479,7 +479,7 @@ parse(Ingen::World* world, { URIs& uris = world->uris(); - const Sord::URI patch_class (*world->rdf_world(), uris.ingen_Patch); + const Sord::URI graph_class (*world->rdf_world(), uris.ingen_Graph); const Sord::URI block_class (*world->rdf_world(), uris.ingen_Block); const Sord::URI edge_class (*world->rdf_world(), uris.ingen_Edge); const Sord::URI internal_class(*world->rdf_world(), uris.ingen_Internal); @@ -489,9 +489,9 @@ parse(Ingen::World* world, const Sord::URI rdf_type (*world->rdf_world(), uris.rdf_type); const Sord::Node nil; - // Parse explicit subject patch + // Parse explicit subject graph if (subject.is_valid()) { - return parse_patch(world, target, model, subject, parent, symbol, data); + return parse_graph(world, target, model, subject, parent, symbol, data); } // Get all subjects and their types (?subject a ?type) @@ -519,8 +519,8 @@ parse(Ingen::World* world, boost::optional<Raul::Path> ret; const Raul::Path path( relative_uri( model.base_uri().to_string(), s.to_string(), true)); - if (types.find(patch_class) != types.end()) { - ret = parse_patch(world, target, model, s, parent, symbol, data); + if (types.find(graph_class) != types.end()) { + ret = parse_graph(world, target, model, s, parent, symbol, data); } else if (types.find(block_class) != types.end()) { ret = parse_block(world, target, model, s, path, data); } else if (types.find(in_port_class) != types.end() || @@ -539,7 +539,7 @@ parse(Ingen::World* world, return boost::optional<Raul::Path>(); } -/** Parse a patch from RDF into a Interface (engine or client). +/** Parse a graph from RDF into a Interface (engine or client). * @return whether or not load was successful. */ bool @@ -551,7 +551,7 @@ Parser::parse_file(Ingen::World* world, boost::optional<GraphObject::Properties> data) { if (Glib::file_test(path, Glib::FILE_TEST_IS_DIR)) { - // This is a bundle, append "/name.ttl" to get patch file path + // This is a bundle, append "/name.ttl" to get graph file path path = Glib::build_filename(path, get_basename(path) + ".ttl"); } @@ -572,7 +572,7 @@ Parser::parse_file(Ingen::World* world, SerdNode base_node = serd_node_from_string(SERD_URI, uri_c_str); SerdEnv* env = serd_env_new(&base_node); - // Load patch file into model + // Load graph file into model Sord::Model model(*world->rdf_world(), uri, SORD_SPO|SORD_PSO, false); model.load_file(env, SERD_TURTLE, uri); diff --git a/src/serialisation/Serialiser.cpp b/src/serialisation/Serialiser.cpp index a9d49fe3..e1b1548d 100644 --- a/src/serialisation/Serialiser.cpp +++ b/src/serialisation/Serialiser.cpp @@ -66,7 +66,7 @@ struct Serialiser::Impl { void start_to_filename(const std::string& filename); - void serialise_patch(SharedPtr<const GraphObject> p, + void serialise_graph(SharedPtr<const GraphObject> p, const Sord::Node& id); void serialise_block(SharedPtr<const GraphObject> n, @@ -80,14 +80,14 @@ struct Serialiser::Impl { void serialise_properties(Sord::Node id, const Resource::Properties& props); - void write_bundle(SharedPtr<const GraphObject> patch, + void write_bundle(SharedPtr<const GraphObject> graph, const std::string& uri); Sord::Node path_rdf_node(const Raul::Path& path); void write_manifest(const std::string& bundle_path, - SharedPtr<const GraphObject> patch, - const std::string& patch_symbol); + SharedPtr<const GraphObject> graph, + const std::string& graph_symbol); void serialise_edge(const Sord::Node& parent, SharedPtr<const Edge> c) @@ -124,8 +124,8 @@ Serialiser::to_file(SharedPtr<const GraphObject> object, void Serialiser::Impl::write_manifest(const std::string& bundle_path, - SharedPtr<const GraphObject> patch, - const std::string& patch_symbol) + SharedPtr<const GraphObject> graph, + const std::string& graph_symbol) { const string manifest_path(Glib::build_filename(bundle_path, "manifest.ttl")); const string binary_path(Glib::Module::build_path("", "ingen_lv2")); @@ -135,12 +135,12 @@ Serialiser::Impl::write_manifest(const std::string& bundle_path, Sord::World& world = _model->world(); const URIs& uris = _world.uris(); - const string filename(patch_symbol + ".ttl"); + const string filename(graph_symbol + ".ttl"); const Sord::URI subject(world, filename, _base_uri); _model->add_statement(subject, Sord::URI(world, uris.rdf_type), - Sord::URI(world, uris.ingen_Patch)); + Sord::URI(world, uris.ingen_Graph)); _model->add_statement(subject, Sord::URI(world, uris.rdf_type), Sord::URI(world, uris.lv2_Plugin)); @@ -158,14 +158,14 @@ Serialiser::Impl::write_manifest(const std::string& bundle_path, } void -Serialiser::write_bundle(SharedPtr<const GraphObject> patch, +Serialiser::write_bundle(SharedPtr<const GraphObject> graph, const std::string& path) { - me->write_bundle(patch, path); + me->write_bundle(graph, path); } void -Serialiser::Impl::write_bundle(SharedPtr<const GraphObject> patch, +Serialiser::Impl::write_bundle(SharedPtr<const GraphObject> graph, const std::string& a_path) { std::string path = Glib::filename_from_uri(a_path); @@ -186,12 +186,12 @@ Serialiser::Impl::write_bundle(SharedPtr<const GraphObject> patch, start_to_filename(root_file); const Raul::Path old_root_path = _root_path; - _root_path = patch->path(); - serialise_patch(patch, Sord::URI(_model->world(), root_file, _base_uri)); + _root_path = graph->path(); + serialise_graph(graph, Sord::URI(_model->world(), root_file, _base_uri)); _root_path = old_root_path; finish(); - write_manifest(path, patch, symbol); + write_manifest(path, graph, symbol); } string @@ -284,8 +284,8 @@ Serialiser::serialise(SharedPtr<const GraphObject> object) throw (std::logic_err if (!me->_model) throw std::logic_error("serialise called without serialisation in progress"); - if (object->graph_type() == GraphObject::PATCH) { - me->serialise_patch(object, me->path_rdf_node(object->path())); + if (object->graph_type() == GraphObject::GRAPH) { + me->serialise_graph(object, me->path_rdf_node(object->path())); } else if (object->graph_type() == GraphObject::BLOCK) { const Sord::URI plugin_id(me->_model->world(), object->plugin()->uri()); me->serialise_block(object, plugin_id, me->path_rdf_node(object->path())); @@ -300,122 +300,122 @@ Serialiser::serialise(SharedPtr<const GraphObject> object) throw (std::logic_err } void -Serialiser::Impl::serialise_patch(SharedPtr<const GraphObject> patch, - const Sord::Node& patch_id) +Serialiser::Impl::serialise_graph(SharedPtr<const GraphObject> graph, + const Sord::Node& graph_id) { Sord::World& world = _model->world(); const URIs& uris = _world.uris(); - _model->add_statement(patch_id, + _model->add_statement(graph_id, Sord::URI(world, uris.rdf_type), - Sord::URI(world, uris.ingen_Patch)); + Sord::URI(world, uris.ingen_Graph)); - _model->add_statement(patch_id, + _model->add_statement(graph_id, Sord::URI(world, uris.rdf_type), Sord::URI(world, uris.lv2_Plugin)); - _model->add_statement(patch_id, + _model->add_statement(graph_id, Sord::URI(world, uris.lv2_extensionData), Sord::URI(world, LV2_STATE__interface)); - _model->add_statement(patch_id, + _model->add_statement(graph_id, Sord::URI(world, LV2_UI__ui), - Sord::URI(world, "http://drobilla.net/ns/ingen#PatchUIGtk2")); + Sord::URI(world, "http://drobilla.net/ns/ingen#GraphUIGtk2")); // Always write a symbol (required by Ingen) Raul::Symbol symbol("_"); - GraphObject::Properties::const_iterator s = patch->properties().find(uris.lv2_symbol); - if (s == patch->properties().end() + GraphObject::Properties::const_iterator s = graph->properties().find(uris.lv2_symbol); + if (s == graph->properties().end() || !s->second.type() == _world.forge().String || !Raul::Symbol::is_valid(s->second.get_string())) { const std::string base = Glib::path_get_basename( _model->base_uri().to_c_string()); symbol = Raul::Symbol::symbolify(base.substr(0, base.find('.'))); _model->add_statement( - patch_id, + graph_id, Sord::URI(world, uris.lv2_symbol), Sord::Literal(world, symbol.c_str())); } else { symbol = Raul::Symbol::symbolify(s->second.get_string()); } - // If the patch has no doap:name (required by LV2), use the symbol - if (patch->properties().find(uris.doap_name) == patch->properties().end()) - _model->add_statement(patch_id, + // If the graph has no doap:name (required by LV2), use the symbol + if (graph->properties().find(uris.doap_name) == graph->properties().end()) + _model->add_statement(graph_id, Sord::URI(world, uris.doap_name), Sord::Literal(world, symbol.c_str())); - const GraphObject::Properties props = patch->properties(Resource::INTERNAL); - serialise_properties(patch_id, props); + const GraphObject::Properties props = graph->properties(Resource::INTERNAL); + serialise_properties(graph_id, props); - const Store::const_range kids = _world.store()->children_range(patch); + const Store::const_range kids = _world.store()->children_range(graph); for (Store::const_iterator n = kids.first; n != kids.second; ++n) { - if (n->first.parent() != patch->path()) + if (n->first.parent() != graph->path()) continue; - if (n->second->graph_type() == GraphObject::PATCH) { - SharedPtr<GraphObject> subpatch = n->second; + if (n->second->graph_type() == GraphObject::GRAPH) { + SharedPtr<GraphObject> subgraph = n->second; SerdURI base_uri; serd_uri_parse((const uint8_t*)_base_uri.c_str(), &base_uri); - const string sub_bundle_path = subpatch->path().substr(1) + ".ingen"; + const string sub_bundle_path = subgraph->path().substr(1) + ".ingen"; - SerdURI subpatch_uri; - SerdNode subpatch_node = serd_node_new_uri_from_string( + SerdURI subgraph_uri; + SerdNode subgraph_node = serd_node_new_uri_from_string( (const uint8_t*)sub_bundle_path.c_str(), &base_uri, - &subpatch_uri); + &subgraph_uri); - const Sord::URI subpatch_id(world, (const char*)subpatch_node.buf); + const Sord::URI subgraph_id(world, (const char*)subgraph_node.buf); // Save our state std::string my_base_uri = _base_uri; Sord::Model* my_model = _model; // Write child bundle within this bundle - write_bundle(subpatch, subpatch_id.to_string()); + write_bundle(subgraph, subgraph_id.to_string()); // Restore our state _base_uri = my_base_uri; _model = my_model; - // Serialise reference to patch block - const Sord::Node block_id(path_rdf_node(subpatch->path())); - _model->add_statement(patch_id, + // Serialise reference to graph block + const Sord::Node block_id(path_rdf_node(subgraph->path())); + _model->add_statement(graph_id, Sord::URI(world, uris.ingen_block), block_id); - serialise_block(subpatch, subpatch_id, block_id); + serialise_block(subgraph, subgraph_id, block_id); } else if (n->second->graph_type() == GraphObject::BLOCK) { SharedPtr<const GraphObject> block = n->second; const Sord::URI class_id(world, block->plugin()->uri()); const Sord::Node block_id(path_rdf_node(n->second->path())); - _model->add_statement(patch_id, + _model->add_statement(graph_id, Sord::URI(world, uris.ingen_block), block_id); serialise_block(block, class_id, block_id); } } - for (uint32_t i = 0; i < patch->num_ports(); ++i) { - GraphObject* p = patch->port(i); + for (uint32_t i = 0; i < graph->num_ports(); ++i) { + GraphObject* p = graph->port(i); const Sord::Node port_id = path_rdf_node(p->path()); - // Ensure lv2:name always exists so Patch is a valid LV2 plugin + // Ensure lv2:name always exists so Graph is a valid LV2 plugin if (p->properties().find(uris.lv2_name) == p->properties().end()) p->set_property(uris.lv2_name, _world.forge().alloc(p->symbol().c_str())); - _model->add_statement(patch_id, + _model->add_statement(graph_id, Sord::URI(world, LV2_CORE__port), port_id); serialise_port(p, Resource::INTERNAL, port_id); } - for (GraphObject::Edges::const_iterator c = patch->edges().begin(); - c != patch->edges().end(); ++c) { - serialise_edge(patch_id, c->second); + for (GraphObject::Edges::const_iterator c = graph->edges().begin(); + c != graph->edges().end(); ++c) { + serialise_edge(graph_id, c->second); } } diff --git a/src/server/BlockImpl.cpp b/src/server/BlockImpl.cpp index 7d99ca28..2ccb0e2f 100644 --- a/src/server/BlockImpl.cpp +++ b/src/server/BlockImpl.cpp @@ -22,7 +22,7 @@ #include "Buffer.hpp" #include "Engine.hpp" #include "BlockImpl.hpp" -#include "PatchImpl.hpp" +#include "GraphImpl.hpp" #include "PluginImpl.hpp" #include "PortImpl.hpp" #include "ProcessContext.hpp" @@ -36,7 +36,7 @@ namespace Server { BlockImpl::BlockImpl(PluginImpl* plugin, const Raul::Symbol& symbol, bool polyphonic, - PatchImpl* parent, + GraphImpl* parent, SampleRate srate) : GraphObjectImpl(plugin->uris(), parent, symbol) , _plugin(plugin) @@ -58,7 +58,7 @@ BlockImpl::~BlockImpl() } if (is_linked()) { - parent_patch()->remove_block(*this); + parent_graph()->remove_block(*this); } delete _ports; diff --git a/src/server/BlockImpl.hpp b/src/server/BlockImpl.hpp index fd2af927..12318d60 100644 --- a/src/server/BlockImpl.hpp +++ b/src/server/BlockImpl.hpp @@ -43,12 +43,12 @@ namespace Server { class Buffer; class BufferFactory; class Context; -class PatchImpl; +class GraphImpl; class PluginImpl; class PortImpl; class ProcessContext; -/** A Block in a Patch (which is also a Block). +/** A Block in a Graph (which is also a Block). * * This is what is often called a "Module" in modular synthesizers. A Block is * a unit with input/output ports, a process() method, and some other things. @@ -56,13 +56,13 @@ class ProcessContext; * \ingroup engine */ class BlockImpl : public GraphObjectImpl - , public boost::intrusive::slist_base_hook<> // In PatchImpl + , public boost::intrusive::slist_base_hook<> // In GraphImpl { public: BlockImpl(PluginImpl* plugin, const Raul::Symbol& symbol, bool poly, - PatchImpl* parent, + GraphImpl* parent, SampleRate rate); virtual ~BlockImpl(); @@ -72,7 +72,7 @@ public: /** Activate this Block. * * This function must be called in a non-realtime thread before it is - * inserted in to a patch. Any non-realtime actions that need to be + * inserted in to a graph. Any non-realtime actions that need to be * done before the Block is ready for use should be done here. */ virtual void activate(BufferFactory& bufs); @@ -80,7 +80,7 @@ public: /** Deactivate this Block. * * This function must be called in a non-realtime thread after the - * block has been removed from its patch (i.e. processing is finished). + * block has been removed from its graph (i.e. processing is finished). */ virtual void deactivate(); @@ -130,12 +130,12 @@ public: ProcessContext& context, Raul::Maid& maid, uint32_t poly); /** Information about the Plugin this Block is an instance of. - * Not the best name - not all blocks come from plugins (e.g. Patch) + * Not the best name - not all blocks come from plugins (e.g. Graph) */ virtual PluginImpl* plugin_impl() const { return _plugin; } /** Information about the Plugin this Block is an instance of. - * Not the best name - not all blocks come from plugins (ie Patch) + * Not the best name - not all blocks come from plugins (ie Graph) */ virtual const Plugin* plugin() const; @@ -146,8 +146,8 @@ public: LV2_URID type, uint32_t size); - /** The Patch this Block belongs to. */ - inline PatchImpl* parent_patch() const { return (PatchImpl*)_parent; } + /** The Graph this Block belongs to. */ + inline GraphImpl* parent_graph() const { return (GraphImpl*)_parent; } Context::ID context() const { return _context; } uint32_t num_ports() const { return _ports ? _ports->size() : 0; } diff --git a/src/server/Broadcaster.hpp b/src/server/Broadcaster.hpp index 0bc7576a..3af4e5b7 100644 --- a/src/server/Broadcaster.hpp +++ b/src/server/Broadcaster.hpp @@ -89,9 +89,9 @@ public: BROADCAST(disconnect, tail, head); } - void disconnect_all(const Raul::Path& parent_patch_path, + void disconnect_all(const Raul::Path& graph, const Raul::Path& path) { - BROADCAST(disconnect_all, parent_patch_path, path); + BROADCAST(disconnect_all, graph, path); } void set_property(const Raul::URI& subject, diff --git a/src/server/CompiledPatch.hpp b/src/server/CompiledGraph.hpp index 15d1137a..024aa919 100644 --- a/src/server/CompiledPatch.hpp +++ b/src/server/CompiledGraph.hpp @@ -14,8 +14,8 @@ along with Ingen. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef INGEN_ENGINE_COMPILEDPATCH_HPP -#define INGEN_ENGINE_COMPILEDPATCH_HPP +#ifndef INGEN_ENGINE_COMPILEDGRAPH_HPP +#define INGEN_ENGINE_COMPILEDGRAPH_HPP #include <vector> #include <list> @@ -54,7 +54,7 @@ private: std::vector<BlockImpl*> _dependants; ///< Blocks this one's output ports are connected to }; -/** A patch ``compiled'' into a flat structure with the correct order so +/** A graph ``compiled'' into a flat structure with the correct order so * the audio thread(s) can execute it without threading problems (since * the preprocessor thread modifies the graph). * @@ -62,7 +62,7 @@ private: * The parallel processing algorithm guarantees no block will be executed * before its providers, using this order as well as semaphores. */ -class CompiledPatch : public std::vector<CompiledBlock> +class CompiledGraph : public std::vector<CompiledBlock> , public Raul::Disposable , public Raul::Noncopyable { @@ -71,4 +71,4 @@ class CompiledPatch : public std::vector<CompiledBlock> } // namespace Server } // namespace Ingen -#endif // INGEN_ENGINE_COMPILEDPATCH_HPP +#endif // INGEN_ENGINE_COMPILEDGRAPH_HPP diff --git a/src/server/ControlBindings.cpp b/src/server/ControlBindings.cpp index de6818ff..e8f595fa 100644 --- a/src/server/ControlBindings.cpp +++ b/src/server/ControlBindings.cpp @@ -429,7 +429,7 @@ ControlBindings::pre_process(ProcessContext& context, Buffer* buffer) void ControlBindings::post_process(ProcessContext& context, Buffer* buffer) { - // TODO: merge buffer's existing contents (anything send to it in the patch) + // TODO: merge buffer's existing contents (anything send to it in the graph) buffer->copy(context, _feedback.get()); } diff --git a/src/server/DirectDriver.hpp b/src/server/DirectDriver.hpp index 76cd3cbc..5fde93d9 100644 --- a/src/server/DirectDriver.hpp +++ b/src/server/DirectDriver.hpp @@ -38,7 +38,7 @@ public: virtual void deactivate() {} - virtual EnginePort* create_port(DuplexPort* patch_port) { + virtual EnginePort* create_port(DuplexPort* graph_port) { return NULL; } diff --git a/src/server/Driver.hpp b/src/server/Driver.hpp index e038b2bc..e5c62623 100644 --- a/src/server/Driver.hpp +++ b/src/server/Driver.hpp @@ -34,7 +34,7 @@ class EnginePort; /** Engine driver base class. * - * A Driver is, from the perspective of GraphObjects (blocks, patches, ports) + * A Driver is, from the perspective of GraphObjects (blocks, graphs, ports) * an interface for managing system ports. An implementation of Driver * basically needs to manage EnginePorts, and handle writing/reading data * to/from them. @@ -54,12 +54,12 @@ public: /** Create a port ready to be inserted with add_input (non realtime). * May return NULL if the Driver can not create the port for some reason. */ - virtual EnginePort* create_port(DuplexPort* patch_port) = 0; + virtual EnginePort* create_port(DuplexPort* graph_port) = 0; /** Find a system port by path. */ virtual EnginePort* get_port(const Raul::Path& path) = 0; - /** Add a system visible port (e.g. a port on the root patch). */ + /** Add a system visible port (e.g. a port on the root graph). */ virtual void add_port(ProcessContext& context, EnginePort* port) = 0; /** Remove a system visible port. diff --git a/src/server/DuplexPort.cpp b/src/server/DuplexPort.cpp index 43197844..34c9b590 100644 --- a/src/server/DuplexPort.cpp +++ b/src/server/DuplexPort.cpp @@ -18,8 +18,8 @@ #include "Buffer.hpp" #include "DuplexPort.hpp" +#include "GraphImpl.hpp" #include "OutputPort.hpp" -#include "PatchImpl.hpp" using namespace std; @@ -49,7 +49,7 @@ DuplexPort::DuplexPort(BufferFactory& bufs, DuplexPort::~DuplexPort() { if (is_linked()) { - parent_patch()->remove_port(*this); + parent_graph()->remove_port(*this); } } @@ -69,34 +69,34 @@ DuplexPort::get_buffers(BufferFactory& bufs, uint32_t DuplexPort::max_tail_poly(Context& context) const { - return parent_patch()->internal_poly_process(); + return parent_graph()->internal_poly_process(); } -/** Prepare for the execution of parent patch */ +/** Prepare for the execution of parent graph */ void DuplexPort::pre_process(Context& context) { if (_is_output) { - /* This is a patch output, which is an input from the internal + /* This is a graph output, which is an input from the internal perspective. Prepare buffers for write so plugins can deliver to them */ for (uint32_t v = 0; v < _poly; ++v) { _buffers->at(v)->prepare_write(context); } } else { - /* This is a a patch input, which is an output from the internal + /* This is a a graph input, which is an output from the internal perspective. Do whatever a normal block's input port does to prepare input for reading. */ InputPort::pre_process(context); } } -/** Finalize after the execution of parent patch (deliver outputs) */ +/** Finalize after the execution of parent graph (deliver outputs) */ void DuplexPort::post_process(Context& context) { if (_is_output) { - /* This is a patch output, which is an input from the internal + /* This is a graph output, which is an input from the internal perspective. Mix down input delivered by plugins so output (external perspective) is ready. */ InputPort::pre_process(context); diff --git a/src/server/DuplexPort.hpp b/src/server/DuplexPort.hpp index 25d389c5..55ba8fa0 100644 --- a/src/server/DuplexPort.hpp +++ b/src/server/DuplexPort.hpp @@ -28,18 +28,18 @@ namespace Server { class BlockImpl; -/** A duplex Port (both an InputPort and an OutputPort on a Patch) +/** A duplex Port (both an InputPort and an OutputPort on a Graph) * - * This is used for Patch ports, since they need to appear as both an input and + * This is used for Graph ports, since they need to appear as both an input and * an output port based on context. There are no actual duplex ports in Ingen, - * a Port is either an Input or Output. This class only exists to allow Patch - * outputs to appear as inputs from within that Patch, and vice versa. + * a Port is either an Input or Output. This class only exists to allow Graph + * outputs to appear as inputs from within that Graph, and vice versa. * * \ingroup engine */ class DuplexPort : public InputPort , public OutputPort - , public boost::intrusive::slist_base_hook<> // In PatchImpl + , public boost::intrusive::slist_base_hook<> // In GraphImpl { public: DuplexPort(BufferFactory& bufs, diff --git a/src/server/Engine.cpp b/src/server/Engine.cpp index eada608a..7c053884 100644 --- a/src/server/Engine.cpp +++ b/src/server/Engine.cpp @@ -34,7 +34,7 @@ #include "Engine.hpp" #include "Event.hpp" #include "EventWriter.hpp" -#include "PatchImpl.hpp" +#include "GraphImpl.hpp" #include "PostProcessor.hpp" #include "PreProcessor.hpp" #include "ProcessContext.hpp" @@ -59,7 +59,7 @@ Engine::Engine(Ingen::World* world) , _pre_processor(new PreProcessor()) , _post_processor(new PostProcessor(*this)) , _event_writer(new EventWriter(*this)) - , _root_patch(NULL) + , _root_graph(NULL) , _worker(new Worker(world->log(), event_queue_size())) , _process_context(*this) , _quit_flag(false) @@ -185,20 +185,20 @@ Engine::activate() const Ingen::URIs& uris = world()->uris(); Forge& forge = world()->forge(); - // Create root patch - if (!_root_patch) { - _root_patch = new PatchImpl( + // Create root graph + if (!_root_graph) { + _root_graph = new GraphImpl( *this, Raul::Symbol("root"), 1, NULL, _driver->sample_rate(), 1); - _root_patch->set_property( + _root_graph->set_property( uris.rdf_type, - Resource::Property(uris.ingen_Patch, Resource::INTERNAL)); - _root_patch->set_property( + Resource::Property(uris.ingen_Graph, Resource::INTERNAL)); + _root_graph->set_property( uris.ingen_polyphony, Resource::Property(_world->forge().make(int32_t(1)), Resource::INTERNAL)); - _root_patch->activate(*_buffer_factory); - _world->store()->add(_root_patch); - _root_patch->compiled_patch(_root_patch->compile()); + _root_graph->activate(*_buffer_factory); + _world->store()->add(_root_graph); + _root_graph->compiled_graph(_root_graph->compile()); ProcessContext context(*this); @@ -249,7 +249,7 @@ Engine::activate() } _driver->activate(); - _root_patch->enable(); + _root_graph->enable(); ThreadManager::single_threaded = false; @@ -265,8 +265,8 @@ Engine::deactivate() _driver->deactivate(); } - if (_root_patch) { - _root_patch->deactivate(); + if (_root_graph) { + _root_graph->deactivate(); } ThreadManager::single_threaded = true; @@ -279,7 +279,7 @@ Engine::run(uint32_t sample_count) // Apply control bindings to input control_bindings()->pre_process( - _process_context, _root_patch->port_impl(0)->buffer(0).get()); + _process_context, _root_graph->port_impl(0)->buffer(0).get()); post_processor()->set_end_time(_process_context.end()); @@ -287,14 +287,14 @@ Engine::run(uint32_t sample_count) // (Aiming for jitter-free 1 block event latency, ideally) const unsigned n_processed_events = process_events(); - // Run root patch - if (_root_patch) { - _root_patch->process(_process_context); + // Run root graph + if (_root_graph) { + _root_graph->process(_process_context); } // Emit control binding feedback control_bindings()->post_process( - _process_context, _root_patch->port_impl(1)->buffer(0).get()); + _process_context, _root_graph->port_impl(1)->buffer(0).get()); return n_processed_events; } diff --git a/src/server/Engine.hpp b/src/server/Engine.hpp index 66930938..2d49bde0 100644 --- a/src/server/Engine.hpp +++ b/src/server/Engine.hpp @@ -34,17 +34,17 @@ class World; namespace Server { +class BlockFactory; class Broadcaster; class BufferFactory; class ControlBindings; class Driver; class Event; class EventWriter; -class BlockFactory; +class GraphImpl; class PostProcessor; class PreProcessor; class ProcessContext; -class PatchImpl; class Worker; /** @@ -98,7 +98,7 @@ public: ControlBindings* control_bindings() const { return _control_bindings; } Driver* driver() const { return _driver.get(); } Log& log() const { return _world->log(); } - PatchImpl* root_patch() const { return _root_patch; } + GraphImpl* root_graph() const { return _root_graph; } PostProcessor* post_processor() const { return _post_processor; } Raul::Maid* maid() const { return _maid; } Worker* worker() const { return _worker; } @@ -121,7 +121,7 @@ private: PreProcessor* _pre_processor; PostProcessor* _post_processor; EventWriter* _event_writer; - PatchImpl* _root_patch; + GraphImpl* _root_graph; Worker* _worker; ProcessContext _process_context; diff --git a/src/server/EnginePort.hpp b/src/server/EnginePort.hpp index 3bda2998..7154920b 100644 --- a/src/server/EnginePort.hpp +++ b/src/server/EnginePort.hpp @@ -37,7 +37,7 @@ class EnginePort : public Raul::Noncopyable { public: explicit EnginePort(DuplexPort* port) - : _patch_port(port) + : _graph_port(port) , _buffer(NULL) , _handle(NULL) {} @@ -47,11 +47,11 @@ public: void* buffer() const { return _buffer; } void* handle() const { return _handle; } - DuplexPort* patch_port() const { return _patch_port; } - bool is_input() const { return _patch_port->is_input(); } + DuplexPort* graph_port() const { return _graph_port; } + bool is_input() const { return _graph_port->is_input(); } protected: - DuplexPort* _patch_port; + DuplexPort* _graph_port; void* _buffer; void* _handle; }; diff --git a/src/server/EventWriter.cpp b/src/server/EventWriter.cpp index b4f95294..2b1b1bf6 100644 --- a/src/server/EventWriter.cpp +++ b/src/server/EventWriter.cpp @@ -103,12 +103,12 @@ EventWriter::disconnect(const Raul::Path& src, } void -EventWriter::disconnect_all(const Raul::Path& patch_path, +EventWriter::disconnect_all(const Raul::Path& graph, const Raul::Path& path) { _engine.enqueue_event( new Events::DisconnectAll(_engine, _respondee, _request_id, now(), - patch_path, path)); + graph, path)); } void diff --git a/src/server/EventWriter.hpp b/src/server/EventWriter.hpp index 67b3b83b..5c44c5b6 100644 --- a/src/server/EventWriter.hpp +++ b/src/server/EventWriter.hpp @@ -79,7 +79,7 @@ public: virtual void del(const Raul::URI& uri); - virtual void disconnect_all(const Raul::Path& parent_patch_path, + virtual void disconnect_all(const Raul::Path& graph, const Raul::Path& path); virtual void get(const Raul::URI& uri); diff --git a/src/server/PatchImpl.cpp b/src/server/GraphImpl.cpp index ae16c634..81c69b46 100644 --- a/src/server/PatchImpl.cpp +++ b/src/server/GraphImpl.cpp @@ -25,8 +25,8 @@ #include "DuplexPort.hpp" #include "EdgeImpl.hpp" #include "Engine.hpp" -#include "PatchImpl.hpp" -#include "PatchPlugin.hpp" +#include "GraphImpl.hpp" +#include "GraphPlugin.hpp" #include "PortImpl.hpp" #include "ThreadManager.hpp" @@ -35,35 +35,35 @@ using namespace std; namespace Ingen { namespace Server { -PatchImpl::PatchImpl(Engine& engine, +GraphImpl::GraphImpl(Engine& engine, const Raul::Symbol& symbol, uint32_t poly, - PatchImpl* parent, + GraphImpl* parent, SampleRate srate, uint32_t internal_poly) - : BlockImpl(new PatchPlugin(engine.world()->uris(), - engine.world()->uris().ingen_Patch, - Raul::Symbol("patch"), - "Ingen Patch"), + : BlockImpl(new GraphPlugin(engine.world()->uris(), + engine.world()->uris().ingen_Graph, + Raul::Symbol("graph"), + "Ingen Graph"), symbol, poly, parent, srate) , _engine(engine) , _poly_pre(internal_poly) , _poly_process(internal_poly) - , _compiled_patch(NULL) + , _compiled_graph(NULL) , _process(false) { assert(internal_poly >= 1); assert(internal_poly <= 128); } -PatchImpl::~PatchImpl() +GraphImpl::~GraphImpl() { - delete _compiled_patch; + delete _compiled_graph; delete _plugin; } void -PatchImpl::activate(BufferFactory& bufs) +GraphImpl::activate(BufferFactory& bufs) { BlockImpl::activate(bufs); @@ -75,7 +75,7 @@ PatchImpl::activate(BufferFactory& bufs) } void -PatchImpl::deactivate() +GraphImpl::deactivate() { if (_activated) { BlockImpl::deactivate(); @@ -89,7 +89,7 @@ PatchImpl::deactivate() } void -PatchImpl::disable(ProcessContext& context) +GraphImpl::disable(ProcessContext& context) { _process = false; for (Ports::iterator i = _outputs.begin(); i != _outputs.end(); ++i) { @@ -98,11 +98,11 @@ PatchImpl::disable(ProcessContext& context) } bool -PatchImpl::prepare_internal_poly(BufferFactory& bufs, uint32_t poly) +GraphImpl::prepare_internal_poly(BufferFactory& bufs, uint32_t poly) { ThreadManager::assert_thread(THREAD_PRE_PROCESS); - // TODO: Subpatch dynamic polyphony (i.e. changing port polyphony) + // TODO: Subgraph dynamic polyphony (i.e. changing port polyphony) for (Blocks::iterator i = _blocks.begin(); i != _blocks.end(); ++i) { i->prepare_poly(bufs, poly); @@ -113,12 +113,12 @@ PatchImpl::prepare_internal_poly(BufferFactory& bufs, uint32_t poly) } bool -PatchImpl::apply_internal_poly(ProcessContext& context, +GraphImpl::apply_internal_poly(ProcessContext& context, BufferFactory& bufs, Raul::Maid& maid, uint32_t poly) { - // TODO: Subpatch dynamic polyphony (i.e. changing port polyphony) + // TODO: Subgraph dynamic polyphony (i.e. changing port polyphony) for (Blocks::iterator i = _blocks.begin(); i != _blocks.end(); ++i) { i->apply_poly(context, maid, poly); @@ -133,7 +133,7 @@ PatchImpl::apply_internal_poly(ProcessContext& context, } } - const bool polyphonic = parent_patch() && (poly == parent_patch()->internal_poly_process()); + const bool polyphonic = parent_graph() && (poly == parent_graph()->internal_poly_process()); for (Ports::iterator i = _outputs.begin(); i != _outputs.end(); ++i) i->setup_buffers(bufs, polyphonic ? poly : 1, true); @@ -141,22 +141,22 @@ PatchImpl::apply_internal_poly(ProcessContext& context, return true; } -/** Run the patch for the specified number of frames. +/** Run the graph for the specified number of frames. * - * Calls all Blocks in (roughly, if parallel) the order _compiled_patch specifies. + * Calls all Blocks in (roughly, if parallel) the order _compiled_graph specifies. */ void -PatchImpl::process(ProcessContext& context) +GraphImpl::process(ProcessContext& context) { if (!_process) return; BlockImpl::pre_process(context); - if (_compiled_patch && _compiled_patch->size() > 0) { + if (_compiled_graph && _compiled_graph->size() > 0) { // Run all blocks - for (size_t i = 0; i < _compiled_patch->size(); ++i) { - (*_compiled_patch)[i].block()->process(context); + for (size_t i = 0; i < _compiled_graph->size(); ++i) { + (*_compiled_graph)[i].block()->process(context); } } @@ -164,24 +164,24 @@ PatchImpl::process(ProcessContext& context) } void -PatchImpl::set_buffer_size(Context& context, +GraphImpl::set_buffer_size(Context& context, BufferFactory& bufs, LV2_URID type, uint32_t size) { BlockImpl::set_buffer_size(context, bufs, type, size); - for (size_t i = 0; i < _compiled_patch->size(); ++i) - (*_compiled_patch)[i].block()->set_buffer_size(context, bufs, type, size); + for (size_t i = 0; i < _compiled_graph->size(); ++i) + (*_compiled_graph)[i].block()->set_buffer_size(context, bufs, type, size); } -// Patch specific stuff +// Graph specific stuff /** Add a block. * Preprocessing thread only. */ void -PatchImpl::add_block(BlockImpl& block) +GraphImpl::add_block(BlockImpl& block) { ThreadManager::assert_thread(THREAD_PRE_PROCESS); _blocks.push_front(block); @@ -191,13 +191,13 @@ PatchImpl::add_block(BlockImpl& block) * Preprocessing thread only. */ void -PatchImpl::remove_block(BlockImpl& block) +GraphImpl::remove_block(BlockImpl& block) { _blocks.erase(_blocks.iterator_to(block)); } void -PatchImpl::add_edge(SharedPtr<EdgeImpl> c) +GraphImpl::add_edge(SharedPtr<EdgeImpl> c) { ThreadManager::assert_thread(THREAD_PRE_PROCESS); _edges.insert(make_pair(make_pair(c->tail(), c->head()), c)); @@ -207,7 +207,7 @@ PatchImpl::add_edge(SharedPtr<EdgeImpl> c) * Preprocessing thread only. */ SharedPtr<EdgeImpl> -PatchImpl::remove_edge(const PortImpl* tail, const PortImpl* dst_port) +GraphImpl::remove_edge(const PortImpl* tail, const PortImpl* dst_port) { ThreadManager::assert_thread(THREAD_PRE_PROCESS); Edges::iterator i = _edges.find(make_pair(tail, dst_port)); @@ -221,7 +221,7 @@ PatchImpl::remove_edge(const PortImpl* tail, const PortImpl* dst_port) } bool -PatchImpl::has_edge(const PortImpl* tail, const PortImpl* dst_port) const +GraphImpl::has_edge(const PortImpl* tail, const PortImpl* dst_port) const { ThreadManager::assert_thread(THREAD_PRE_PROCESS); Edges::const_iterator i = _edges.find(make_pair(tail, dst_port)); @@ -229,7 +229,7 @@ PatchImpl::has_edge(const PortImpl* tail, const PortImpl* dst_port) const } uint32_t -PatchImpl::num_ports_non_rt() const +GraphImpl::num_ports_non_rt() const { ThreadManager::assert_not_thread(THREAD_PROCESS); return _inputs.size() + _outputs.size(); @@ -238,7 +238,7 @@ PatchImpl::num_ports_non_rt() const /** Create a port. Not realtime safe. */ DuplexPort* -PatchImpl::create_port(BufferFactory& bufs, +GraphImpl::create_port(BufferFactory& bufs, const Raul::Symbol& symbol, PortType type, LV2_URID buffer_type, @@ -268,7 +268,7 @@ PatchImpl::create_port(BufferFactory& bufs, * Realtime safe. Preprocessing thread only. */ void -PatchImpl::remove_port(DuplexPort& port) +GraphImpl::remove_port(DuplexPort& port) { ThreadManager::assert_thread(THREAD_PRE_PROCESS); @@ -287,7 +287,7 @@ PatchImpl::remove_port(DuplexPort& port) * Realtime safe. Preprocessing thread only. */ void -PatchImpl::clear_ports() +GraphImpl::clear_ports() { ThreadManager::assert_thread(THREAD_PRE_PROCESS); @@ -296,7 +296,7 @@ PatchImpl::clear_ports() } Raul::Array<PortImpl*>* -PatchImpl::build_ports_array() +GraphImpl::build_ports_array() { ThreadManager::assert_thread(THREAD_PRE_PROCESS); @@ -317,7 +317,7 @@ PatchImpl::build_ports_array() } static inline void -compile_recursive(BlockImpl* n, CompiledPatch* output) +compile_recursive(BlockImpl* n, CompiledGraph* output) { if (n == NULL || n->traversed()) return; @@ -333,9 +333,9 @@ compile_recursive(BlockImpl* n, CompiledPatch* output) output->push_back(CompiledBlock(n, n->providers().size(), n->dependants())); } -/** Find the process order for this Patch. +/** Find the process order for this Graph. * - * The process order is a flat list that the patch will execute in order + * The process order is a flat list that the graph will execute in order * when its run() method is called. Return value is a newly allocated list * which the caller is reponsible to delete. Note that this function does * NOT actually set the process order, it is returned so it can be inserted @@ -343,12 +343,12 @@ compile_recursive(BlockImpl* n, CompiledPatch* output) * * Not realtime safe. */ -CompiledPatch* -PatchImpl::compile() +CompiledGraph* +GraphImpl::compile() { ThreadManager::assert_thread(THREAD_PRE_PROCESS); - CompiledPatch* const compiled_patch = new CompiledPatch(); + CompiledGraph* const compiled_graph = new CompiledGraph(); for (Blocks::iterator i = _blocks.begin(); i != _blocks.end(); ++i) { i->traversed(false); @@ -357,24 +357,24 @@ PatchImpl::compile() for (Blocks::iterator i = _blocks.begin(); i != _blocks.end(); ++i) { // Either a sink or connected to our output ports: if (!i->traversed() && i->dependants().empty()) { - compile_recursive(&*i, compiled_patch); + compile_recursive(&*i, compiled_graph); } } // Traverse any blocks we didn't hit yet for (Blocks::iterator i = _blocks.begin(); i != _blocks.end(); ++i) { if (!i->traversed()) { - compile_recursive(&*i, compiled_patch); + compile_recursive(&*i, compiled_graph); } } - if (compiled_patch->size() != _blocks.size()) { - _engine.log().error(Raul::fmt("Failed to compile patch %1%\n") % _path); - delete compiled_patch; + if (compiled_graph->size() != _blocks.size()) { + _engine.log().error(Raul::fmt("Failed to compile graph %1%\n") % _path); + delete compiled_graph; return NULL; } - return compiled_patch; + return compiled_graph; } } // namespace Server diff --git a/src/server/PatchImpl.hpp b/src/server/GraphImpl.hpp index fa212b1a..1eb0945e 100644 --- a/src/server/PatchImpl.hpp +++ b/src/server/GraphImpl.hpp @@ -14,13 +14,13 @@ along with Ingen. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef INGEN_ENGINE_PATCHIMPL_HPP -#define INGEN_ENGINE_PATCHIMPL_HPP +#ifndef INGEN_ENGINE_GRAPHIMPL_HPP +#define INGEN_ENGINE_GRAPHIMPL_HPP #include <cstdlib> #include "BlockImpl.hpp" -#include "CompiledPatch.hpp" +#include "CompiledGraph.hpp" #include "DuplexPort.hpp" #include "PluginImpl.hpp" #include "PortType.hpp" @@ -32,33 +32,33 @@ class Edge; namespace Server { -class CompiledPatch; -class EdgeImpl; +class CompiledGraph; class Context; +class EdgeImpl; class Engine; class ProcessContext; /** A group of blocks in a graph, possibly polyphonic. * * Note that this is also a Block, just one which contains Blocks. - * Therefore infinite subpatching is possible, of polyphonic - * patches of polyphonic blocks etc. etc. + * Therefore infinite subgraphing is possible, of polyphonic + * graphes of polyphonic blocks etc. etc. * * \ingroup engine */ -class PatchImpl : public BlockImpl +class GraphImpl : public BlockImpl { public: - PatchImpl(Engine& engine, + GraphImpl(Engine& engine, const Raul::Symbol& symbol, uint32_t poly, - PatchImpl* parent, + GraphImpl* parent, SampleRate srate, uint32_t local_poly); - virtual ~PatchImpl(); + virtual ~GraphImpl(); - virtual GraphType graph_type() const { return PATCH; } + virtual GraphType graph_type() const { return GRAPH; } void activate(BufferFactory& bufs); void deactivate(); @@ -91,7 +91,7 @@ public: Raul::Maid& maid, uint32_t poly); - // Patch specific stuff not inherited from Block + // Graph specific stuff not inherited from Block typedef boost::intrusive::slist< BlockImpl, boost::intrusive::constant_time_size<true> > Blocks; @@ -135,16 +135,16 @@ public: bool has_edge(const PortImpl* tail, const PortImpl* head) const; - CompiledPatch* compiled_patch() { return _compiled_patch; } - void compiled_patch(CompiledPatch* cp) { _compiled_patch = cp; } + CompiledGraph* compiled_graph() { return _compiled_graph; } + void compiled_graph(CompiledGraph* cp) { _compiled_graph = cp; } Raul::Array<PortImpl*>* external_ports() { return _ports; } void external_ports(Raul::Array<PortImpl*>* pa) { _ports = pa; } - CompiledPatch* compile(); + CompiledGraph* compile(); Raul::Array<PortImpl*>* build_ports_array(); - /** Whether to run this patch's DSP bits in the audio thread */ + /** Whether to run this graph's DSP bits in the audio thread */ bool enabled() const { return _process; } void enable() { _process = true; } void disable(ProcessContext& context); @@ -158,7 +158,7 @@ private: Engine& _engine; uint32_t _poly_pre; ///< Pre-process thread only uint32_t _poly_process; ///< Process thread only - CompiledPatch* _compiled_patch; ///< Process thread only + CompiledGraph* _compiled_graph; ///< Process thread only Ports _inputs; ///< Pre-process thread only Ports _outputs; ///< Pre-process thread only Blocks _blocks; ///< Pre-process thread only @@ -168,4 +168,4 @@ private: } // namespace Server } // namespace Ingen -#endif // INGEN_ENGINE_PATCHIMPL_HPP +#endif // INGEN_ENGINE_GRAPHIMPL_HPP diff --git a/src/server/GraphObjectImpl.cpp b/src/server/GraphObjectImpl.cpp index d5608b0f..2df7943f 100644 --- a/src/server/GraphObjectImpl.cpp +++ b/src/server/GraphObjectImpl.cpp @@ -14,8 +14,8 @@ along with Ingen. If not, see <http://www.gnu.org/licenses/>. */ +#include "GraphImpl.hpp" #include "GraphObjectImpl.hpp" -#include "PatchImpl.hpp" #include "ThreadManager.hpp" using namespace std; @@ -42,10 +42,10 @@ GraphObjectImpl::get_property(const Raul::URI& key) const return (i != properties().end()) ? i->second : null_atom; } -PatchImpl* -GraphObjectImpl::parent_patch() const +GraphImpl* +GraphObjectImpl::parent_graph() const { - return dynamic_cast<PatchImpl*>((BlockImpl*)_parent); + return dynamic_cast<GraphImpl*>((BlockImpl*)_parent); } } // namespace Server diff --git a/src/server/GraphObjectImpl.hpp b/src/server/GraphObjectImpl.hpp index 5388981f..07a59727 100644 --- a/src/server/GraphObjectImpl.hpp +++ b/src/server/GraphObjectImpl.hpp @@ -35,12 +35,12 @@ namespace Shared { class URIs; } namespace Server { -class PatchImpl; +class BufferFactory; class Context; +class GraphImpl; class ProcessContext; -class BufferFactory; -/** An object on the audio graph (a Patch, Block, or Port). +/** An object on the audio graph (a Graph, Block, or Port). * * Each of these is a Raul::Deletable and so can be deleted in a realtime safe * way from anywhere, and they all have a map of variable for clients to store @@ -70,8 +70,8 @@ public: const Raul::Atom& get_property(const Raul::URI& key) const; - /** The Patch this object is a child of. */ - virtual PatchImpl* parent_patch() const; + /** The Graph this object is a child of. */ + virtual GraphImpl* parent_graph() const; const Raul::Path& path() const { return _path; } diff --git a/src/server/PatchPlugin.hpp b/src/server/GraphPlugin.hpp index 1fd9069f..3b1e9bfa 100644 --- a/src/server/PatchPlugin.hpp +++ b/src/server/GraphPlugin.hpp @@ -14,8 +14,8 @@ along with Ingen. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef INGEN_ENGINE_PATCHPLUGIN_HPP -#define INGEN_ENGINE_PATCHPLUGIN_HPP +#ifndef INGEN_ENGINE_GRAPHPLUGIN_HPP +#define INGEN_ENGINE_GRAPHPLUGIN_HPP #include <string> #include "PluginImpl.hpp" @@ -25,31 +25,31 @@ namespace Server { class BlockImpl; -/** Implementation of a Patch plugin. +/** Implementation of a Graph plugin. * - * Patches don't actually work like this yet... + * Graphs don't actually work like this yet... */ -class PatchPlugin : public PluginImpl +class GraphPlugin : public PluginImpl { public: - PatchPlugin(URIs& uris, + GraphPlugin(URIs& uris, const Raul::URI& uri, const Raul::Symbol& symbol, const std::string& name) - : PluginImpl(uris, Plugin::Patch, uri) + : PluginImpl(uris, Plugin::Graph, uri) {} BlockImpl* instantiate(BufferFactory& bufs, const Raul::Symbol& symbol, bool polyphonic, - PatchImpl* parent, + GraphImpl* parent, Engine& engine) { return NULL; } - const Raul::Symbol symbol() const { return Raul::Symbol("patch"); } - const std::string name() const { return "Ingen Patch"; } + const Raul::Symbol symbol() const { return Raul::Symbol("graph"); } + const std::string name() const { return "Ingen Graph"; } private: const std::string _symbol; @@ -59,5 +59,5 @@ private: } // namespace Server } // namespace Ingen -#endif // INGEN_ENGINE_PATCHPLUGIN_HPP +#endif // INGEN_ENGINE_GRAPHPLUGIN_HPP diff --git a/src/server/InputPort.cpp b/src/server/InputPort.cpp index fff29f30..e2f97896 100644 --- a/src/server/InputPort.cpp +++ b/src/server/InputPort.cpp @@ -25,9 +25,9 @@ #include "BufferFactory.hpp" #include "EdgeImpl.hpp" #include "Engine.hpp" +#include "GraphImpl.hpp" #include "InputPort.hpp" #include "OutputPort.hpp" -#include "PatchImpl.hpp" #include "ProcessContext.hpp" #include "mix.hpp" @@ -50,7 +50,7 @@ InputPort::InputPort(BufferFactory& bufs, { const Ingen::URIs& uris = bufs.uris(); - if (parent->graph_type() != GraphObject::PATCH) { + if (parent->graph_type() != GraphObject::GRAPH) { add_property(uris.rdf_type, uris.lv2_InputPort); } @@ -159,7 +159,7 @@ InputPort::remove_edge(ProcessContext& context, const OutputPort* tail) uint32_t InputPort::max_tail_poly(Context& context) const { - return parent_block()->parent_patch()->internal_poly_process(); + return parent_block()->parent_graph()->internal_poly_process(); } static void diff --git a/src/server/InputPort.hpp b/src/server/InputPort.hpp index 40650415..7a4c7669 100644 --- a/src/server/InputPort.hpp +++ b/src/server/InputPort.hpp @@ -36,7 +36,7 @@ class BlockImpl; class OutputPort; class ProcessContext; -/** An input port on a Block or Patch. +/** An input port on a Block or Graph. * * All ports have a Buffer, but the actual contents (data) of that buffer may be * set directly to the incoming edge's buffer if there's only one inbound diff --git a/src/server/InternalPlugin.cpp b/src/server/InternalPlugin.cpp index 0e15fd9d..39e32580 100644 --- a/src/server/InternalPlugin.cpp +++ b/src/server/InternalPlugin.cpp @@ -46,7 +46,7 @@ BlockImpl* InternalPlugin::instantiate(BufferFactory& bufs, const Raul::Symbol& symbol, bool polyphonic, - PatchImpl* parent, + GraphImpl* parent, Engine& engine) { assert(_type == Internal); diff --git a/src/server/InternalPlugin.hpp b/src/server/InternalPlugin.hpp index 29753c69..5bd842dd 100644 --- a/src/server/InternalPlugin.hpp +++ b/src/server/InternalPlugin.hpp @@ -44,7 +44,7 @@ public: BlockImpl* instantiate(BufferFactory& bufs, const Raul::Symbol& symbol, bool polyphonic, - PatchImpl* parent, + GraphImpl* parent, Engine& engine); const Raul::Symbol symbol() const { return _symbol; } diff --git a/src/server/JackDriver.cpp b/src/server/JackDriver.cpp index b950c350..5f1ba1d3 100644 --- a/src/server/JackDriver.cpp +++ b/src/server/JackDriver.cpp @@ -35,8 +35,8 @@ #include "Buffer.hpp" #include "DuplexPort.hpp" #include "Engine.hpp" +#include "GraphImpl.hpp" #include "JackDriver.hpp" -#include "PatchImpl.hpp" #include "PortImpl.hpp" #include "ThreadManager.hpp" #include "util.hpp" @@ -182,7 +182,7 @@ EnginePort* JackDriver::get_port(const Raul::Path& path) { for (Ports::iterator i = _ports.begin(); i != _ports.end(); ++i) { - if (i->patch_port()->path() == path) { + if (i->graph_port()->path() == path) { return &*i; } } @@ -207,10 +207,10 @@ JackDriver::register_port(EnginePort& port) { jack_port_t* jack_port = jack_port_register( _client, - port.patch_port()->path().substr(1).c_str(), - (port.patch_port()->is_a(PortType::AUDIO) + port.graph_port()->path().substr(1).c_str(), + (port.graph_port()->is_a(PortType::AUDIO) ? JACK_DEFAULT_AUDIO_TYPE : JACK_DEFAULT_MIDI_TYPE), - (port.patch_port()->is_input() + (port.graph_port()->is_input() ? JackPortIsInput : JackPortIsOutput), 0); @@ -241,16 +241,16 @@ JackDriver::rename_port(const Raul::Path& old_path, } EnginePort* -JackDriver::create_port(DuplexPort* patch_port) +JackDriver::create_port(DuplexPort* graph_port) { - if (patch_port && - (patch_port->is_a(PortType::AUDIO) || - (patch_port->is_a(PortType::ATOM) && - patch_port->buffer_type() == _engine.world()->uris().atom_Sequence))) { - EnginePort* eport = new EnginePort(patch_port); + if (graph_port && + (graph_port->is_a(PortType::AUDIO) || + (graph_port->is_a(PortType::ATOM) && + graph_port->buffer_type() == _engine.world()->uris().atom_Sequence))) { + EnginePort* eport = new EnginePort(graph_port); register_port(*eport); - patch_port->setup_buffers(*_engine.buffer_factory(), - patch_port->poly(), + graph_port->setup_buffers(*_engine.buffer_factory(), + graph_port->poly(), false); return eport; } else { @@ -263,33 +263,33 @@ JackDriver::pre_process_port(ProcessContext& context, EnginePort* port) { const SampleCount nframes = context.nframes(); jack_port_t* jack_port = (jack_port_t*)port->handle(); - PortImpl* patch_port = port->patch_port(); + PortImpl* graph_port = port->graph_port(); void* buffer = jack_port_get_buffer(jack_port, nframes); port->set_buffer(buffer); - if (!patch_port->is_input()) { - patch_port->buffer(0)->clear(); + if (!graph_port->is_input()) { + graph_port->buffer(0)->clear(); return; } - if (patch_port->is_a(PortType::AUDIO)) { - Buffer* patch_buf = patch_port->buffer(0).get(); - memcpy(patch_buf->samples(), buffer, nframes * sizeof(float)); + if (graph_port->is_a(PortType::AUDIO)) { + Buffer* graph_buf = graph_port->buffer(0).get(); + memcpy(graph_buf->samples(), buffer, nframes * sizeof(float)); - } else if (patch_port->buffer_type() == patch_port->bufs().uris().atom_Sequence) { - Buffer* patch_buf = (Buffer*)patch_port->buffer(0).get(); + } else if (graph_port->buffer_type() == graph_port->bufs().uris().atom_Sequence) { + Buffer* graph_buf = (Buffer*)graph_port->buffer(0).get(); const jack_nframes_t event_count = jack_midi_get_event_count(buffer); - patch_buf->prepare_write(context); + graph_buf->prepare_write(context); - // Copy events from Jack port buffer into patch port buffer + // Copy events from Jack port buffer into graph port buffer for (jack_nframes_t i = 0; i < event_count; ++i) { jack_midi_event_t ev; jack_midi_event_get(&ev, buffer, i); - if (!patch_buf->append_event( + if (!graph_buf->append_event( ev.time, ev.size, _midi_event_type, ev.buffer)) { _engine.log().warn("Failed to write to MIDI buffer, events lost!\n"); } @@ -302,10 +302,10 @@ JackDriver::post_process_port(ProcessContext& context, EnginePort* port) { const SampleCount nframes = context.nframes(); jack_port_t* jack_port = (jack_port_t*)port->handle(); - PortImpl* patch_port = port->patch_port(); + PortImpl* graph_port = port->graph_port(); void* buffer = port->buffer(); - if (patch_port->is_input()) { + if (graph_port->is_input()) { return; } @@ -315,16 +315,16 @@ JackDriver::post_process_port(ProcessContext& context, EnginePort* port) port->set_buffer(buffer); } - patch_port->post_process(context); - Buffer* const patch_buf = patch_port->buffer(0).get(); - if (patch_port->is_a(PortType::AUDIO)) { - memcpy(buffer, patch_buf->samples(), nframes * sizeof(Sample)); - } else if (patch_port->buffer_type() == patch_port->bufs().uris().atom_Sequence) { + graph_port->post_process(context); + Buffer* const graph_buf = graph_port->buffer(0).get(); + if (graph_port->is_a(PortType::AUDIO)) { + memcpy(buffer, graph_buf->samples(), nframes * sizeof(Sample)); + } else if (graph_port->buffer_type() == graph_port->bufs().uris().atom_Sequence) { jack_midi_clear_buffer(buffer); - LV2_Atom_Sequence* seq = (LV2_Atom_Sequence*)patch_buf->atom(); + LV2_Atom_Sequence* seq = (LV2_Atom_Sequence*)graph_buf->atom(); LV2_ATOM_SEQUENCE_FOREACH(seq, ev) { const uint8_t* buf = (const uint8_t*)LV2_ATOM_BODY(&ev->body); - if (ev->body.type == patch_port->bufs().uris().midi_MidiEvent) { + if (ev->body.type == graph_port->bufs().uris().midi_MidiEvent) { jack_midi_event_write(buffer, ev->time.frames, buf, ev->body.size); } } @@ -388,9 +388,9 @@ JackDriver::_shutdown_cb() int JackDriver::_block_length_cb(jack_nframes_t nframes) { - if (_engine.root_patch()) { + if (_engine.root_graph()) { _block_length = nframes; - _engine.root_patch()->set_buffer_size( + _engine.root_graph()->set_buffer_size( _engine.process_context(), *_engine.buffer_factory(), PortType::AUDIO, _engine.buffer_factory()->audio_buffer_size(nframes)); } @@ -409,7 +409,7 @@ JackDriver::_session_cb(jack_session_event_t* event) SharedPtr<Serialisation::Serialiser> serialiser = _engine.world()->serialiser(); if (serialiser) { - SharedPtr<GraphObject> root(_engine.root_patch(), NullDeleter<GraphObject>); + SharedPtr<GraphObject> root(_engine.root_graph(), NullDeleter<GraphObject>); serialiser->write_bundle(root, string("file://") + event->session_dir); } diff --git a/src/server/JackDriver.hpp b/src/server/JackDriver.hpp index c9bda939..8ea84fd6 100644 --- a/src/server/JackDriver.hpp +++ b/src/server/JackDriver.hpp @@ -38,16 +38,16 @@ namespace Raul { class Path; } namespace Ingen { namespace Server { -class Engine; -class PatchImpl; -class PortImpl; class DuplexPort; +class Engine; +class GraphImpl; class JackDriver; +class PortImpl; /** The Jack Driver. * * The process callback here drives the entire audio thread by "pulling" - * events from queues, processing them, running the patches, and passing + * events from queues, processing them, running the graphes, and passing * events along to the PostProcessor. * * \ingroup engine @@ -67,7 +67,7 @@ public: void enable(); void disable(); - EnginePort* create_port(DuplexPort* patch_port); + EnginePort* create_port(DuplexPort* graph_port); EnginePort* get_port(const Raul::Path& path); void rename_port(const Raul::Path& old_path, const Raul::Path& new_path); diff --git a/src/server/LV2Block.cpp b/src/server/LV2Block.cpp index d26f7417..e121f270 100644 --- a/src/server/LV2Block.cpp +++ b/src/server/LV2Block.cpp @@ -32,11 +32,11 @@ #include "Buffer.hpp" #include "Driver.hpp" #include "Engine.hpp" +#include "GraphImpl.hpp" #include "InputPort.hpp" #include "LV2Block.hpp" #include "LV2Plugin.hpp" #include "OutputPort.hpp" -#include "PatchImpl.hpp" #include "ProcessContext.hpp" using namespace std; @@ -52,7 +52,7 @@ namespace Server { LV2Block::LV2Block(LV2Plugin* plugin, const Raul::Symbol& symbol, bool polyphonic, - PatchImpl* parent, + GraphImpl* parent, SampleRate srate) : BlockImpl(plugin, symbol, polyphonic, parent, srate) , _lv2_plugin(plugin) @@ -78,7 +78,7 @@ LV2Block::make_instance(URIs& uris, _lv2_plugin->lilv_plugin(), rate, _features->array()); if (!inst) { - parent_patch()->engine().log().error( + parent_graph()->engine().log().error( Raul::fmt("Failed to instantiate <%1%>\n") % _lv2_plugin->uri().c_str()); return SharedPtr<LilvInstance>(); @@ -119,7 +119,7 @@ LV2Block::make_instance(URIs& uris, } else if (type == _uris.lv2_CVPort) { port->set_type(PortType::CV, 0); } else { - parent_patch()->engine().log().error( + parent_graph()->engine().log().error( Raul::fmt("%1% auto-morphed to unknown type %2%\n") % port->path().c_str() % type); return SharedPtr<LilvInstance>(); @@ -304,7 +304,7 @@ LV2Block::instantiate(BufferFactory& bufs) } if (port_type == PortType::UNKNOWN || direction == UNKNOWN) { - parent_patch()->engine().log().error( + parent_graph()->engine().log().error( Raul::fmt("<%1%> port %2% has unknown type or direction\n") % _lv2_plugin->uri().c_str() % port_sym.c_str()); ret = false; @@ -422,7 +422,7 @@ LV2Block::work(uint32_t size, const void* data) if (_worker_iface) { LV2_Handle inst = lilv_instance_get_handle(instance(0)); if (_worker_iface->work(inst, work_respond, this, size, data)) { - parent_patch()->engine().log().error( + parent_graph()->engine().log().error( Raul::fmt("Error calling %1% work method\n") % _path); } } diff --git a/src/server/LV2Block.hpp b/src/server/LV2Block.hpp index 3746b201..2e45d350 100644 --- a/src/server/LV2Block.hpp +++ b/src/server/LV2Block.hpp @@ -39,10 +39,10 @@ class LV2Block : public BlockImpl { public: LV2Block(LV2Plugin* plugin, - const Raul::Symbol& symbol, - bool polyphonic, - PatchImpl* parent, - SampleRate srate); + const Raul::Symbol& symbol, + bool polyphonic, + GraphImpl* parent, + SampleRate srate); ~LV2Block(); diff --git a/src/server/LV2Plugin.cpp b/src/server/LV2Plugin.cpp index 0febfc7d..cc0aee4c 100644 --- a/src/server/LV2Plugin.cpp +++ b/src/server/LV2Plugin.cpp @@ -60,7 +60,7 @@ BlockImpl* LV2Plugin::instantiate(BufferFactory& bufs, const Raul::Symbol& symbol, bool polyphonic, - PatchImpl* parent, + GraphImpl* parent, Engine& engine) { LV2Block* b = new LV2Block( diff --git a/src/server/LV2Plugin.hpp b/src/server/LV2Plugin.hpp index ed26b4ae..bec1b588 100644 --- a/src/server/LV2Plugin.hpp +++ b/src/server/LV2Plugin.hpp @@ -29,7 +29,7 @@ namespace Ingen { namespace Server { -class PatchImpl; +class GraphImpl; class BlockImpl; /** Implementation of an LV2 plugin (loaded shared library). @@ -42,7 +42,7 @@ public: BlockImpl* instantiate(BufferFactory& bufs, const Raul::Symbol& symbol, bool polyphonic, - PatchImpl* parent, + GraphImpl* parent, Engine& engine); const Raul::Symbol symbol() const; diff --git a/src/server/OutputPort.cpp b/src/server/OutputPort.cpp index 1fa53451..48f7eb22 100644 --- a/src/server/OutputPort.cpp +++ b/src/server/OutputPort.cpp @@ -38,7 +38,7 @@ OutputPort::OutputPort(BufferFactory& bufs, size_t buffer_size) : PortImpl(bufs, parent, symbol, index, poly, type, buffer_type, value, buffer_size) { - if (parent->graph_type() != GraphObject::PATCH) { + if (parent->graph_type() != GraphObject::GRAPH) { add_property(bufs.uris().rdf_type, bufs.uris().lv2_OutputPort); } diff --git a/src/server/PluginImpl.hpp b/src/server/PluginImpl.hpp index 624b3f6d..342225ef 100644 --- a/src/server/PluginImpl.hpp +++ b/src/server/PluginImpl.hpp @@ -35,7 +35,7 @@ namespace Server { class BlockImpl; class BufferFactory; class Engine; -class PatchImpl; +class GraphImpl; /** Implementation of a plugin (internal code, or a loaded shared library). * @@ -55,8 +55,8 @@ public: virtual BlockImpl* instantiate(BufferFactory& bufs, const Raul::Symbol& symbol, bool polyphonic, - PatchImpl* parent, - Engine& engine) = 0; + GraphImpl* parent, + Engine& engine) = 0; virtual const Raul::Symbol symbol() const = 0; diff --git a/src/server/Worker.cpp b/src/server/Worker.cpp index 6a39cba8..9fbc4825 100644 --- a/src/server/Worker.cpp +++ b/src/server/Worker.cpp @@ -20,8 +20,8 @@ #include "Driver.hpp" #include "Engine.hpp" +#include "GraphImpl.hpp" #include "LV2Block.hpp" -#include "PatchImpl.hpp" #include "Worker.hpp" namespace Ingen { @@ -40,7 +40,7 @@ schedule(LV2_Worker_Schedule_Handle handle, const void* data) { LV2Block* block = (LV2Block*)handle; - Engine& engine = block->parent_patch()->engine(); + Engine& engine = block->parent_graph()->engine(); Worker* worker = engine.worker(); return worker->request(block, size, data); @@ -51,7 +51,7 @@ Worker::request(LV2Block* block, uint32_t size, const void* data) { - Engine& engine = block->parent_patch()->engine(); + Engine& engine = block->parent_graph()->engine(); if (_requests.write_space() < sizeof(MessageHeader) + size) { engine.log().error("Work request ring overflow\n"); return LV2_WORKER_ERR_NO_SPACE; diff --git a/src/server/events.hpp b/src/server/events.hpp index 95f3d35f..24ac8593 100644 --- a/src/server/events.hpp +++ b/src/server/events.hpp @@ -19,7 +19,7 @@ #include "events/Connect.hpp" #include "events/CreateBlock.hpp" -#include "events/CreatePatch.hpp" +#include "events/CreateGraph.hpp" #include "events/CreatePort.hpp" #include "events/Delete.hpp" #include "events/Delta.hpp" diff --git a/src/server/events/Connect.cpp b/src/server/events/Connect.cpp index db8e044f..eeaa1904 100644 --- a/src/server/events/Connect.cpp +++ b/src/server/events/Connect.cpp @@ -24,9 +24,9 @@ #include "Connect.hpp" #include "EdgeImpl.hpp" #include "Engine.hpp" +#include "GraphImpl.hpp" #include "InputPort.hpp" #include "OutputPort.hpp" -#include "PatchImpl.hpp" #include "PortImpl.hpp" #include "types.hpp" @@ -43,9 +43,9 @@ Connect::Connect(Engine& engine, : Event(engine, client, id, timestamp) , _tail_path(tail_path) , _head_path(head_path) - , _patch(NULL) + , _graph(NULL) , _head(NULL) - , _compiled_patch(NULL) + , _compiled_graph(NULL) , _buffers(NULL) {} @@ -86,23 +86,23 @@ Connect::pre_process() return Event::pre_process_done(TYPE_MISMATCH, _head_path); } - if (tail_block->parent_patch() != head_block->parent_patch()) { - // Edge to a patch port from inside the patch + if (tail_block->parent_graph() != head_block->parent_graph()) { + // Edge to a graph port from inside the graph assert(tail_block->parent() == head_block || head_block->parent() == tail_block); if (tail_block->parent() == head_block) { - _patch = dynamic_cast<PatchImpl*>(head_block); + _graph = dynamic_cast<GraphImpl*>(head_block); } else { - _patch = dynamic_cast<PatchImpl*>(tail_block); + _graph = dynamic_cast<GraphImpl*>(tail_block); } - } else if (tail_block == head_block && dynamic_cast<PatchImpl*>(tail_block)) { - // Edge from a patch input to a patch output (pass through) - _patch = dynamic_cast<PatchImpl*>(tail_block); + } else if (tail_block == head_block && dynamic_cast<GraphImpl*>(tail_block)) { + // Edge from a graph input to a graph output (pass through) + _graph = dynamic_cast<GraphImpl*>(tail_block); } else { // Normal edge between blocks with the same parent - _patch = tail_block->parent_patch(); + _graph = tail_block->parent_graph(); } - if (_patch->has_edge(tail_output, _head)) { + if (_graph->has_edge(tail_output, _head)) { return Event::pre_process_done(EXISTS, _head_path); } @@ -113,8 +113,8 @@ Connect::pre_process() { Glib::RWLock::ReaderLock wlock(_engine.store()->lock()); - /* Need to be careful about patch port edges here and adding a - block's parent as a dependant/provider, or adding a patch as its own + /* Need to be careful about graph port edges here and adding a + block's parent as a dependant/provider, or adding a graph as its own provider... */ if (tail_block != head_block && tail_block->parent() == head_block->parent()) { @@ -122,7 +122,7 @@ Connect::pre_process() tail_block->dependants().push_back(head_block); } - _patch->add_edge(_edge); + _graph->add_edge(_edge); _head->increment_num_edges(); } @@ -132,8 +132,8 @@ Connect::pre_process() _head->poly(), false); - if (_patch->enabled()) { - _compiled_patch = _patch->compile(); + if (_graph->enabled()) { + _compiled_graph = _graph->compile(); } return Event::pre_process_done(SUCCESS); @@ -146,8 +146,8 @@ Connect::execute(ProcessContext& context) _head->add_edge(context, _edge.get()); _engine.maid()->dispose(_head->set_buffers(context, _buffers)); _head->connect_buffers(); - _engine.maid()->dispose(_patch->compiled_patch()); - _patch->compiled_patch(_compiled_patch); + _engine.maid()->dispose(_graph->compiled_graph()); + _graph->compiled_graph(_compiled_graph); } } diff --git a/src/server/events/Connect.hpp b/src/server/events/Connect.hpp index 8d75d2da..445ee80e 100644 --- a/src/server/events/Connect.hpp +++ b/src/server/events/Connect.hpp @@ -30,11 +30,11 @@ template <typename T> class Array; namespace Ingen { namespace Server { -class CompiledPatch; +class CompiledGraph; class EdgeImpl; class InputPort; class OutputPort; -class PatchImpl; +class GraphImpl; namespace Events { @@ -59,9 +59,9 @@ public: private: const Raul::Path _tail_path; const Raul::Path _head_path; - PatchImpl* _patch; + GraphImpl* _graph; InputPort* _head; - CompiledPatch* _compiled_patch; + CompiledGraph* _compiled_graph; SharedPtr<EdgeImpl> _edge; Raul::Array<BufferRef>* _buffers; }; diff --git a/src/server/events/CreateBlock.cpp b/src/server/events/CreateBlock.cpp index 73ff7ba2..bc234b97 100644 --- a/src/server/events/CreateBlock.cpp +++ b/src/server/events/CreateBlock.cpp @@ -24,7 +24,7 @@ #include "Broadcaster.hpp" #include "CreateBlock.hpp" #include "Engine.hpp" -#include "PatchImpl.hpp" +#include "GraphImpl.hpp" #include "PluginImpl.hpp" #include "PortImpl.hpp" @@ -41,9 +41,9 @@ CreateBlock::CreateBlock(Engine& engine, : Event(engine, client, id, timestamp) , _path(path) , _properties(properties) - , _patch(NULL) + , _graph(NULL) , _block(NULL) - , _compiled_patch(NULL) + , _compiled_graph(NULL) {} bool @@ -69,8 +69,8 @@ CreateBlock::pre_process() return Event::pre_process_done(EXISTS, _path); } - _patch = dynamic_cast<PatchImpl*>(_engine.store()->get(_path.parent())); - if (!_patch) { + _graph = dynamic_cast<GraphImpl*>(_engine.store()->get(_path.parent())); + if (!_graph) { return Event::pre_process_done(PARENT_NOT_FOUND, _path.parent()); } @@ -89,7 +89,7 @@ CreateBlock::pre_process() if (!(_block = plugin->instantiate(*_engine.buffer_factory(), Raul::Symbol(_path.symbol()), polyphonic, - _patch, + _graph, _engine))) { return Event::pre_process_done(CREATION_FAILED, _path); } @@ -97,15 +97,15 @@ CreateBlock::pre_process() _block->properties().insert(_properties.begin(), _properties.end()); _block->activate(*_engine.buffer_factory()); - // Add block to the store and the patch's pre-processor only block list - _patch->add_block(*_block); + // Add block to the store and the graph's pre-processor only block list + _graph->add_block(*_block); _engine.store()->add(_block); - /* Compile patch with new block added for insertion in audio thread + /* Compile graph with new block added for insertion in audio thread TODO: Since the block is not connected at this point, a full compilation could be avoided and the block simply appended. */ - if (_patch->enabled()) { - _compiled_patch = _patch->compile(); + if (_graph->enabled()) { + _compiled_graph = _graph->compile(); } _update.push_back(make_pair(_block->uri(), _block->properties())); @@ -124,8 +124,8 @@ void CreateBlock::execute(ProcessContext& context) { if (_block) { - _engine.maid()->dispose(_patch->compiled_patch()); - _patch->compiled_patch(_compiled_patch); + _engine.maid()->dispose(_graph->compiled_graph()); + _graph->compiled_graph(_compiled_graph); } } diff --git a/src/server/events/CreateBlock.hpp b/src/server/events/CreateBlock.hpp index ea3c4b5c..da444b1f 100644 --- a/src/server/events/CreateBlock.hpp +++ b/src/server/events/CreateBlock.hpp @@ -28,12 +28,12 @@ namespace Ingen { namespace Server { class BlockImpl; -class CompiledPatch; -class PatchImpl; +class CompiledGraph; +class GraphImpl; namespace Events { -/** An event to load a Block and insert it into a Patch. +/** An event to load a Block and insert it into a Graph. * * \ingroup engine */ @@ -58,9 +58,9 @@ private: Raul::Path _path; Resource::Properties _properties; Update _update; - PatchImpl* _patch; + GraphImpl* _graph; BlockImpl* _block; - CompiledPatch* _compiled_patch; + CompiledGraph* _compiled_graph; }; } // namespace Events diff --git a/src/server/events/CreatePatch.cpp b/src/server/events/CreateGraph.cpp index e9adc547..bfe08043 100644 --- a/src/server/events/CreatePatch.cpp +++ b/src/server/events/CreateGraph.cpp @@ -19,17 +19,17 @@ #include "raul/Maid.hpp" #include "raul/Path.hpp" -#include "events/CreatePatch.hpp" #include "Broadcaster.hpp" #include "Driver.hpp" #include "Engine.hpp" -#include "PatchImpl.hpp" +#include "GraphImpl.hpp" +#include "events/CreateGraph.hpp" namespace Ingen { namespace Server { namespace Events { -CreatePatch::CreatePatch(Engine& engine, +CreateGraph::CreateGraph(Engine& engine, SharedPtr<Interface> client, int32_t id, SampleCount timestamp, @@ -38,20 +38,20 @@ CreatePatch::CreatePatch(Engine& engine, : Event(engine, client, id, timestamp) , _path(path) , _properties(properties) - , _patch(NULL) + , _graph(NULL) , _parent(NULL) - , _compiled_patch(NULL) + , _compiled_graph(NULL) { } bool -CreatePatch::pre_process() +CreateGraph::pre_process() { if (_path.is_root() || _engine.store()->get(_path)) { return Event::pre_process_done(EXISTS, _path); } - _parent = dynamic_cast<PatchImpl*>(_engine.store()->get(_path.parent())); + _parent = dynamic_cast<GraphImpl*>(_engine.store()->get(_path.parent())); if (!_parent) { return Event::pre_process_done(PARENT_NOT_FOUND, _path.parent()); } @@ -76,42 +76,42 @@ CreatePatch::pre_process() } const Raul::Symbol symbol((_path.is_root()) ? "root" : _path.symbol()); - _patch = new PatchImpl(_engine, symbol, ext_poly, _parent, + _graph = new GraphImpl(_engine, symbol, ext_poly, _parent, _engine.driver()->sample_rate(), int_poly); - _patch->properties().insert(_properties.begin(), _properties.end()); - _patch->add_property(uris.rdf_type, uris.ingen_Patch); - _patch->add_property(uris.rdf_type, + _graph->properties().insert(_properties.begin(), _properties.end()); + _graph->add_property(uris.rdf_type, uris.ingen_Graph); + _graph->add_property(uris.rdf_type, Resource::Property(uris.ingen_Block, Resource::EXTERNAL)); - _parent->add_block(*_patch); + _parent->add_block(*_graph); if (_parent->enabled()) { - _patch->enable(); - _compiled_patch = _parent->compile(); + _graph->enable(); + _compiled_graph = _parent->compile(); } - _patch->activate(*_engine.buffer_factory()); + _graph->activate(*_engine.buffer_factory()); // Insert into Store - _engine.store()->add(_patch); + _engine.store()->add(_graph); - _update = _patch->properties(); + _update = _graph->properties(); return Event::pre_process_done(SUCCESS); } void -CreatePatch::execute(ProcessContext& context) +CreateGraph::execute(ProcessContext& context) { - if (_patch) { + if (_graph) { assert(_parent); assert(!_path.is_root()); - _engine.maid()->dispose(_parent->compiled_patch()); - _parent->compiled_patch(_compiled_patch); + _engine.maid()->dispose(_parent->compiled_graph()); + _parent->compiled_graph(_compiled_graph); } } void -CreatePatch::post_process() +CreateGraph::post_process() { if (!respond()) { _engine.broadcaster()->put(GraphObject::path_to_uri(_path), _update); diff --git a/src/server/events/CreatePatch.hpp b/src/server/events/CreateGraph.hpp index be19d54e..0f6a95dd 100644 --- a/src/server/events/CreatePatch.hpp +++ b/src/server/events/CreateGraph.hpp @@ -14,8 +14,8 @@ along with Ingen. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef INGEN_EVENTS_CREATEPATCH_HPP -#define INGEN_EVENTS_CREATEPATCH_HPP +#ifndef INGEN_EVENTS_CREATEGRAPH_HPP +#define INGEN_EVENTS_CREATEGRAPH_HPP #include "Event.hpp" #include "ingen/Resource.hpp" @@ -23,19 +23,19 @@ namespace Ingen { namespace Server { -class PatchImpl; -class CompiledPatch; +class GraphImpl; +class CompiledGraph; namespace Events { -/** Creates a new Patch. +/** Creates a new Graph. * * \ingroup engine */ -class CreatePatch : public Event +class CreateGraph : public Event { public: - CreatePatch(Engine& engine, + CreateGraph(Engine& engine, SharedPtr<Interface> client, int32_t id, SampleCount timestamp, @@ -50,13 +50,13 @@ private: const Raul::Path _path; Resource::Properties _properties; Resource::Properties _update; - PatchImpl* _patch; - PatchImpl* _parent; - CompiledPatch* _compiled_patch; + GraphImpl* _graph; + GraphImpl* _parent; + CompiledGraph* _compiled_graph; }; } // namespace Events } // namespace Server } // namespace Ingen -#endif // INGEN_EVENTS_CREATEPATCH_HPP +#endif // INGEN_EVENTS_CREATEGRAPH_HPP diff --git a/src/server/events/CreatePort.cpp b/src/server/events/CreatePort.cpp index 49ceed95..a32faaee 100644 --- a/src/server/events/CreatePort.cpp +++ b/src/server/events/CreatePort.cpp @@ -29,7 +29,7 @@ #include "Driver.hpp" #include "DuplexPort.hpp" #include "Engine.hpp" -#include "PatchImpl.hpp" +#include "GraphImpl.hpp" #include "PortImpl.hpp" namespace Ingen { @@ -47,8 +47,8 @@ CreatePort::CreatePort(Engine& engine, , _path(path) , _port_type(PortType::UNKNOWN) , _buf_type(0) - , _patch(NULL) - , _patch_port(NULL) + , _graph(NULL) + , _graph_port(NULL) , _ports_array(NULL) , _old_ports_array(NULL) , _engine_port(NULL) @@ -102,7 +102,7 @@ CreatePort::pre_process() return Event::pre_process_done(PARENT_NOT_FOUND, _path.parent()); } - if (!(_patch = dynamic_cast<PatchImpl*>(parent))) { + if (!(_graph = dynamic_cast<GraphImpl*>(parent))) { return Event::pre_process_done(INVALID_PARENT_PATH, _path.parent()); } @@ -110,7 +110,7 @@ CreatePort::pre_process() const BufferFactory& buffer_factory = *_engine.buffer_factory(); const uint32_t buf_size = buffer_factory.default_size(_buf_type); - const int32_t old_n_ports = _patch->num_ports_non_rt(); + const int32_t old_n_ports = _graph->num_ports_non_rt(); typedef Resource::Properties::const_iterator PropIter; @@ -130,34 +130,34 @@ CreatePort::pre_process() poly_i->second.type() == uris.forge.Bool && poly_i->second.get_bool()); - if (!(_patch_port = _patch->create_port( + if (!(_graph_port = _graph->create_port( *_engine.buffer_factory(), Raul::Symbol(_path.symbol()), _port_type, _buf_type, buf_size, _is_output, polyphonic))) { return Event::pre_process_done(CREATION_FAILED, _path); } - _patch_port->properties().insert(_properties.begin(), _properties.end()); + _graph_port->properties().insert(_properties.begin(), _properties.end()); - _engine.store()->add(_patch_port); + _engine.store()->add(_graph_port); if (_is_output) { - _patch->add_output(*_patch_port); + _graph->add_output(*_graph_port); } else { - _patch->add_input(*_patch_port); + _graph->add_input(*_graph_port); } - if (!_patch->parent()) { + if (!_graph->parent()) { _engine_port = _engine.driver()->create_port( - dynamic_cast<DuplexPort*>(_patch_port)); + dynamic_cast<DuplexPort*>(_graph_port)); } _ports_array = new Raul::Array<PortImpl*>(old_n_ports + 1, NULL); - _update = _patch_port->properties(); + _update = _graph_port->properties(); - assert(_patch_port->index() == (uint32_t)index_i->second.get_int32()); - assert(_patch->num_ports_non_rt() == (uint32_t)old_n_ports + 1); - assert(_patch_port->index() == (uint32_t)old_n_ports); - assert(_ports_array->size() == _patch->num_ports_non_rt()); - assert(_patch_port->index() < _ports_array->size()); + assert(_graph_port->index() == (uint32_t)index_i->second.get_int32()); + assert(_graph->num_ports_non_rt() == (uint32_t)old_n_ports + 1); + assert(_graph_port->index() == (uint32_t)old_n_ports); + assert(_ports_array->size() == _graph->num_ports_non_rt()); + assert(_graph_port->index() < _ports_array->size()); return Event::pre_process_done(SUCCESS); } @@ -165,15 +165,15 @@ void CreatePort::execute(ProcessContext& context) { if (!_status) { - _old_ports_array = _patch->external_ports(); + _old_ports_array = _graph->external_ports(); if (_old_ports_array) { for (uint32_t i = 0; i < _old_ports_array->size(); ++i) { (*_ports_array)[i] = (*_old_ports_array)[i]; } } - assert(!(*_ports_array)[_patch_port->index()]); - (*_ports_array)[_patch_port->index()] = _patch_port; - _patch->external_ports(_ports_array); + assert(!(*_ports_array)[_graph_port->index()]); + (*_ports_array)[_graph_port->index()] = _graph_port; + _graph->external_ports(_ports_array); if (_engine_port) { _engine.driver()->add_port(context, _engine_port); diff --git a/src/server/events/CreatePort.hpp b/src/server/events/CreatePort.hpp index c8e4c695..d35b58af 100644 --- a/src/server/events/CreatePort.hpp +++ b/src/server/events/CreatePort.hpp @@ -30,12 +30,12 @@ namespace Server { class DuplexPort; class EnginePort; -class PatchImpl; +class GraphImpl; class PortImpl; namespace Events { -/** An event to add a Port to a Patch. +/** An event to add a Port to a Graph. * * \ingroup engine */ @@ -58,9 +58,9 @@ private: Raul::Path _path; PortType _port_type; LV2_URID _buf_type; - PatchImpl* _patch; - DuplexPort* _patch_port; - Raul::Array<PortImpl*>* _ports_array; ///< New external port array for Patch + GraphImpl* _graph; + DuplexPort* _graph_port; + Raul::Array<PortImpl*>* _ports_array; ///< New external port array for Graph Raul::Array<PortImpl*>* _old_ports_array; EnginePort* _engine_port; ///< Driver port if on the root Resource::Properties _properties; diff --git a/src/server/events/Delete.cpp b/src/server/events/Delete.cpp index dbda331c..a6207ba1 100644 --- a/src/server/events/Delete.cpp +++ b/src/server/events/Delete.cpp @@ -26,7 +26,7 @@ #include "Driver.hpp" #include "Engine.hpp" #include "EnginePort.hpp" -#include "PatchImpl.hpp" +#include "GraphImpl.hpp" #include "PluginImpl.hpp" #include "PortImpl.hpp" @@ -43,7 +43,7 @@ Delete::Delete(Engine& engine, , _uri(uri) , _engine_port(NULL) , _ports_array(NULL) - , _compiled_patch(NULL) + , _compiled_graph(NULL) , _disconnect_event(NULL) , _lock(engine.store()->lock(), Glib::NOT_LOCK) { @@ -81,7 +81,7 @@ Delete::pre_process() return Event::pre_process_done(NOT_DELETABLE, _path); } - PatchImpl* parent = _block ? _block->parent_patch() : _port->parent_patch(); + GraphImpl* parent = _block ? _block->parent_graph() : _port->parent_graph(); if (!parent) { return Event::pre_process_done(INTERNAL_ERROR, _path); } @@ -94,7 +94,7 @@ Delete::pre_process() _disconnect_event->pre_process(); if (parent->enabled()) { - _compiled_patch = parent->compile(); + _compiled_graph = parent->compile(); } } else if (_port) { parent->remove_port(*_port); @@ -102,7 +102,7 @@ Delete::pre_process() _disconnect_event->pre_process(); if (parent->enabled()) { - _compiled_patch = parent->compile(); + _compiled_graph = parent->compile(); _ports_array = parent->build_ports_array(); assert(_ports_array->size() == parent->num_ports_non_rt()); } @@ -122,7 +122,7 @@ Delete::execute(ProcessContext& context) _disconnect_event->execute(context); } - PatchImpl* parent = _block ? _block->parent_patch() : _port->parent_patch(); + GraphImpl* parent = _block ? _block->parent_graph() : _port->parent_graph(); if (_port) { _engine.maid()->dispose(parent->external_ports()); parent->external_ports(_ports_array); @@ -133,8 +133,8 @@ Delete::execute(ProcessContext& context) } if (parent) { - _engine.maid()->dispose(parent->compiled_patch()); - parent->compiled_patch(_compiled_patch); + _engine.maid()->dispose(parent->compiled_graph()); + parent->compiled_graph(_compiled_graph); } } diff --git a/src/server/events/Delete.hpp b/src/server/events/Delete.hpp index c14c5567..74046f82 100644 --- a/src/server/events/Delete.hpp +++ b/src/server/events/Delete.hpp @@ -20,7 +20,7 @@ #include "ingen/Store.hpp" #include "Event.hpp" -#include "PatchImpl.hpp" +#include "GraphImpl.hpp" #include "ControlBindings.hpp" namespace Raul { @@ -31,7 +31,7 @@ namespace Ingen { namespace Server { class BlockImpl; -class CompiledPatch; +class CompiledGraph; class DuplexPort; class EnginePort; class PortImpl; @@ -75,8 +75,8 @@ private: SharedPtr<BlockImpl> _block; ///< Non-NULL iff a block SharedPtr<DuplexPort> _port; ///< Non-NULL iff a port EnginePort* _engine_port; - Raul::Array<PortImpl*>* _ports_array; ///< New (external) ports for Patch - CompiledPatch* _compiled_patch; ///< Patch's new process order + Raul::Array<PortImpl*>* _ports_array; ///< New (external) ports for Graph + CompiledGraph* _compiled_graph; ///< Graph's new process order DisconnectAll* _disconnect_event; SharedPtr<ControlBindings::Bindings> _removed_bindings; diff --git a/src/server/events/Delta.cpp b/src/server/events/Delta.cpp index 3b31cedb..06bd150c 100644 --- a/src/server/events/Delta.cpp +++ b/src/server/events/Delta.cpp @@ -25,11 +25,11 @@ #include "Broadcaster.hpp" #include "ControlBindings.hpp" #include "CreateBlock.hpp" -#include "CreatePatch.hpp" +#include "CreateGraph.hpp" #include "CreatePort.hpp" #include "Delta.hpp" #include "Engine.hpp" -#include "PatchImpl.hpp" +#include "GraphImpl.hpp" #include "PluginImpl.hpp" #include "PortImpl.hpp" #include "PortType.hpp" @@ -59,8 +59,8 @@ Delta::Delta(Engine& engine, , _properties(properties) , _remove(remove) , _object(NULL) - , _patch(NULL) - , _compiled_patch(NULL) + , _graph(NULL) + , _compiled_graph(NULL) , _context(context) , _create(create) { @@ -122,11 +122,11 @@ Delta::pre_process() if (is_graph_object && !_object) { Raul::Path path(GraphObject::uri_to_path(_subject)); - bool is_patch = false, is_block = false, is_port = false, is_output = false; - Ingen::Resource::type(uris, _properties, is_patch, is_block, is_port, is_output); + bool is_graph = false, is_block = false, is_port = false, is_output = false; + Ingen::Resource::type(uris, _properties, is_graph, is_block, is_port, is_output); - if (is_patch) { - _create_event = new CreatePatch( + if (is_graph) { + _create_event = new CreateGraph( _engine, _request_client, _request_id, _time, path, _properties); } else if (is_block) { _create_event = new CreateBlock( @@ -194,13 +194,13 @@ Delta::pre_process() _status = BAD_OBJECT_TYPE; } } - } else if ((_patch = dynamic_cast<PatchImpl*>(_object))) { + } else if ((_graph = dynamic_cast<GraphImpl*>(_object))) { if (key == uris.ingen_enabled) { if (value.type() == uris.forge.Bool) { op = ENABLE; // FIXME: defer this until all other metadata has been processed - if (value.get_bool() && !_patch->enabled()) - _compiled_patch = _patch->compile(); + if (value.get_bool() && !_graph->enabled()) + _compiled_graph = _graph->compile(); } else { _status = BAD_VALUE_TYPE; } @@ -210,7 +210,7 @@ Delta::pre_process() _status = INVALID_POLY; } else { op = POLYPHONY; - _patch->prepare_internal_poly( + _graph->prepare_internal_poly( *_engine.buffer_factory(), value.get_int32()); } } else { @@ -218,7 +218,7 @@ Delta::pre_process() } } } else if (key == uris.ingen_polyphonic) { - PatchImpl* parent = dynamic_cast<PatchImpl*>(obj->parent()); + GraphImpl* parent = dynamic_cast<GraphImpl*>(obj->parent()); if (parent) { if (value.type() == uris.forge.Bool) { op = POLYPHONIC; @@ -286,17 +286,17 @@ Delta::execute(ProcessContext& context) break; case ENABLE: if (value.get_bool()) { - if (_compiled_patch) { - _engine.maid()->dispose(_patch->compiled_patch()); - _patch->compiled_patch(_compiled_patch); + if (_compiled_graph) { + _engine.maid()->dispose(_graph->compiled_graph()); + _graph->compiled_graph(_compiled_graph); } - _patch->enable(); + _graph->enable(); } else { - _patch->disable(context); + _graph->disable(context); } break; case POLYPHONIC: { - PatchImpl* parent = reinterpret_cast<PatchImpl*>(object->parent()); + GraphImpl* parent = reinterpret_cast<GraphImpl*>(object->parent()); if (value.get_bool()) { object->apply_poly( context, *_engine.maid(), parent->internal_poly_process()); @@ -305,7 +305,7 @@ Delta::execute(ProcessContext& context) } } break; case POLYPHONY: - if (!_patch->apply_internal_poly(context, + if (!_graph->apply_internal_poly(context, *_engine.buffer_factory(), *_engine.maid(), value.get_int32())) { diff --git a/src/server/events/Delta.hpp b/src/server/events/Delta.hpp index 6bb6508a..c3a28fbb 100644 --- a/src/server/events/Delta.hpp +++ b/src/server/events/Delta.hpp @@ -30,9 +30,9 @@ class Resource; namespace Server { -class CompiledPatch; +class CompiledGraph; class Engine; -class PatchImpl; +class GraphImpl; class ProcessContext; namespace Events { @@ -105,8 +105,8 @@ private: Resource::Properties _properties; Resource::Properties _remove; Ingen::Resource* _object; - PatchImpl* _patch; - CompiledPatch* _compiled_patch; + GraphImpl* _graph; + CompiledGraph* _compiled_graph; Resource::Graph _context; ControlBindings::Key _binding; bool _create; diff --git a/src/server/events/Disconnect.cpp b/src/server/events/Disconnect.cpp index 9cf2974a..914e3375 100644 --- a/src/server/events/Disconnect.cpp +++ b/src/server/events/Disconnect.cpp @@ -27,9 +27,9 @@ #include "DuplexPort.hpp" #include "EdgeImpl.hpp" #include "Engine.hpp" +#include "GraphImpl.hpp" #include "InputPort.hpp" #include "OutputPort.hpp" -#include "PatchImpl.hpp" #include "PortImpl.hpp" #include "ProcessContext.hpp" #include "ThreadManager.hpp" @@ -48,21 +48,21 @@ Disconnect::Disconnect(Engine& engine, : Event(engine, client, id, timestamp) , _tail_path(tail_path) , _head_path(head_path) - , _patch(NULL) + , _graph(NULL) , _impl(NULL) - , _compiled_patch(NULL) + , _compiled_graph(NULL) { } Disconnect::Impl::Impl(Engine& e, - PatchImpl* patch, + GraphImpl* graph, OutputPort* s, InputPort* d) : _engine(e) , _src_output_port(s) , _dst_input_port(d) - , _patch(patch) - , _edge(patch->remove_edge(_src_output_port, _dst_input_port)) + , _graph(graph) + , _edge(graph->remove_edge(_src_output_port, _dst_input_port)) , _buffers(NULL) { ThreadManager::assert_thread(THREAD_PRE_PROCESS); @@ -133,25 +133,25 @@ Disconnect::pre_process() BlockImpl* const src_block = tail->parent_block(); BlockImpl* const dst_block = head->parent_block(); - if (src_block->parent_patch() != dst_block->parent_patch()) { - // Edge to a patch port from inside the patch + if (src_block->parent_graph() != dst_block->parent_graph()) { + // Edge to a graph port from inside the graph assert(src_block->parent() == dst_block || dst_block->parent() == src_block); if (src_block->parent() == dst_block) { - _patch = dynamic_cast<PatchImpl*>(dst_block); + _graph = dynamic_cast<GraphImpl*>(dst_block); } else { - _patch = dynamic_cast<PatchImpl*>(src_block); + _graph = dynamic_cast<GraphImpl*>(src_block); } - } else if (src_block == dst_block && dynamic_cast<PatchImpl*>(src_block)) { - // Edge from a patch input to a patch output (pass through) - _patch = dynamic_cast<PatchImpl*>(src_block); + } else if (src_block == dst_block && dynamic_cast<GraphImpl*>(src_block)) { + // Edge from a graph input to a graph output (pass through) + _graph = dynamic_cast<GraphImpl*>(src_block); } else { // Normal edge between blocks with the same parent - _patch = src_block->parent_patch(); + _graph = src_block->parent_graph(); } - assert(_patch); + assert(_graph); - if (!_patch->has_edge(tail, head)) { + if (!_graph->has_edge(tail, head)) { return Event::pre_process_done(NOT_FOUND, _head_path); } @@ -160,12 +160,12 @@ Disconnect::pre_process() } _impl = new Impl(_engine, - _patch, + _graph, dynamic_cast<OutputPort*>(tail), dynamic_cast<InputPort*>(head)); - if (_patch->enabled()) - _compiled_patch = _patch->compile(); + if (_graph->enabled()) + _compiled_graph = _graph->compile(); return Event::pre_process_done(SUCCESS); } @@ -207,8 +207,8 @@ Disconnect::execute(ProcessContext& context) return; } - _engine.maid()->dispose(_patch->compiled_patch()); - _patch->compiled_patch(_compiled_patch); + _engine.maid()->dispose(_graph->compiled_graph()); + _graph->compiled_graph(_compiled_graph); } } diff --git a/src/server/events/Disconnect.hpp b/src/server/events/Disconnect.hpp index b008025a..feb1d17f 100644 --- a/src/server/events/Disconnect.hpp +++ b/src/server/events/Disconnect.hpp @@ -18,10 +18,11 @@ #define INGEN_EVENTS_DISCONNECT_HPP #include "raul/Path.hpp" + +#include "BufferFactory.hpp" #include "Event.hpp" +#include "GraphImpl.hpp" #include "types.hpp" -#include "PatchImpl.hpp" -#include "BufferFactory.hpp" namespace Raul { template <typename T> class Array; @@ -30,7 +31,7 @@ template <typename T> class Array; namespace Ingen { namespace Server { -class CompiledPatch; +class CompiledGraph; class InputPort; class OutputPort; class PortImpl; @@ -58,7 +59,7 @@ public: class Impl { public: Impl(Engine& e, - PatchImpl* patch, + GraphImpl* graph, OutputPort* s, InputPort* d); @@ -70,7 +71,7 @@ public: Engine& _engine; OutputPort* _src_output_port; InputPort* _dst_input_port; - PatchImpl* _patch; + GraphImpl* _graph; SharedPtr<EdgeImpl> _edge; Raul::Array<BufferRef>* _buffers; }; @@ -78,9 +79,9 @@ public: private: const Raul::Path _tail_path; const Raul::Path _head_path; - PatchImpl* _patch; + GraphImpl* _graph; Impl* _impl; - CompiledPatch* _compiled_patch; + CompiledGraph* _compiled_graph; }; } // namespace Events diff --git a/src/server/events/DisconnectAll.cpp b/src/server/events/DisconnectAll.cpp index 4169622d..dbff2ab3 100644 --- a/src/server/events/DisconnectAll.cpp +++ b/src/server/events/DisconnectAll.cpp @@ -28,9 +28,9 @@ #include "Broadcaster.hpp" #include "EdgeImpl.hpp" #include "Engine.hpp" +#include "GraphImpl.hpp" #include "InputPort.hpp" #include "OutputPort.hpp" -#include "PatchImpl.hpp" #include "PortImpl.hpp" #include "events/Disconnect.hpp" #include "events/DisconnectAll.hpp" @@ -52,7 +52,7 @@ DisconnectAll::DisconnectAll(Engine& engine, , _parent(NULL) , _block(NULL) , _port(NULL) - , _compiled_patch(NULL) + , _compiled_graph(NULL) , _deleting(false) { } @@ -60,7 +60,7 @@ DisconnectAll::DisconnectAll(Engine& engine, /** Internal version for use by other events. */ DisconnectAll::DisconnectAll(Engine& engine, - PatchImpl* parent, + GraphImpl* parent, GraphObject* object) : Event(engine) , _parent_path(parent->path()) @@ -68,7 +68,7 @@ DisconnectAll::DisconnectAll(Engine& engine, , _parent(parent) , _block(dynamic_cast<BlockImpl*>(object)) , _port(dynamic_cast<PortImpl*>(object)) - , _compiled_patch(NULL) + , _compiled_graph(NULL) , _deleting(true) { } @@ -87,7 +87,7 @@ DisconnectAll::pre_process() if (!_deleting) { lock.acquire(); - _parent = dynamic_cast<PatchImpl*>(_engine.store()->get(_parent_path)); + _parent = dynamic_cast<GraphImpl*>(_engine.store()->get(_parent_path)); if (!_parent) { return Event::pre_process_done(PARENT_NOT_FOUND, _parent_path); } @@ -98,8 +98,8 @@ DisconnectAll::pre_process() return Event::pre_process_done(NOT_FOUND, _path); } - if (object->parent_patch() != _parent - && object->parent()->parent_patch() != _parent) { + if (object->parent_graph() != _parent + && object->parent()->parent_graph() != _parent) { return Event::pre_process_done(INVALID_PARENT_PATH, _parent_path); } @@ -138,7 +138,7 @@ DisconnectAll::pre_process() } if (!_deleting && _parent->enabled()) - _compiled_patch = _parent->compile(); + _compiled_graph = _parent->compile(); return Event::pre_process_done(SUCCESS); } @@ -153,8 +153,8 @@ DisconnectAll::execute(ProcessContext& context) } } - _engine.maid()->dispose(_parent->compiled_patch()); - _parent->compiled_patch(_compiled_patch); + _engine.maid()->dispose(_parent->compiled_graph()); + _parent->compiled_graph(_compiled_graph); } void diff --git a/src/server/events/DisconnectAll.hpp b/src/server/events/DisconnectAll.hpp index 68ba8ebe..8a785722 100644 --- a/src/server/events/DisconnectAll.hpp +++ b/src/server/events/DisconnectAll.hpp @@ -28,8 +28,8 @@ namespace Ingen { namespace Server { class BlockImpl; -class CompiledPatch; -class PatchImpl; +class CompiledGraph; +class GraphImpl; class PortImpl; namespace Events { @@ -51,7 +51,7 @@ public: const Raul::Path& object); DisconnectAll(Engine& engine, - PatchImpl* parent, + GraphImpl* parent, GraphObject* object); ~DisconnectAll(); @@ -65,11 +65,11 @@ private: Raul::Path _parent_path; Raul::Path _path; - PatchImpl* _parent; + GraphImpl* _parent; BlockImpl* _block; PortImpl* _port; Impls _impls; - CompiledPatch* _compiled_patch; + CompiledGraph* _compiled_graph; bool _deleting; }; diff --git a/src/server/events/Get.cpp b/src/server/events/Get.cpp index 24b4daae..c452328e 100644 --- a/src/server/events/Get.cpp +++ b/src/server/events/Get.cpp @@ -26,7 +26,7 @@ #include "Driver.hpp" #include "Engine.hpp" #include "Get.hpp" -#include "PatchImpl.hpp" +#include "GraphImpl.hpp" #include "PluginImpl.hpp" #include "PortImpl.hpp" @@ -35,7 +35,7 @@ namespace Server { namespace Events { static void -send_patch(Interface* client, const PatchImpl* patch); +send_graph(Interface* client, const GraphImpl* graph); Get::Get(Engine& engine, SharedPtr<Interface> client, @@ -87,8 +87,8 @@ static void send_block(Interface* client, const BlockImpl* block) { PluginImpl* const plugin = block->plugin_impl(); - if (plugin->type() == Plugin::Patch) { - send_patch(client, (const PatchImpl*)block); + if (plugin->type() == Plugin::Graph) { + send_graph(client, (const GraphImpl*)block); } else { client->put(block->uri(), block->properties()); for (size_t j = 0; j < block->num_ports(); ++j) { @@ -98,30 +98,30 @@ send_block(Interface* client, const BlockImpl* block) } static void -send_patch(Interface* client, const PatchImpl* patch) +send_graph(Interface* client, const GraphImpl* graph) { - client->put(patch->uri(), - patch->properties(Resource::INTERNAL), + client->put(graph->uri(), + graph->properties(Resource::INTERNAL), Resource::INTERNAL); - client->put(patch->uri(), - patch->properties(Resource::EXTERNAL), + client->put(graph->uri(), + graph->properties(Resource::EXTERNAL), Resource::EXTERNAL); // Send blocks - for (PatchImpl::Blocks::const_iterator j = patch->blocks().begin(); - j != patch->blocks().end(); ++j) { + for (GraphImpl::Blocks::const_iterator j = graph->blocks().begin(); + j != graph->blocks().end(); ++j) { send_block(client, &*j); } // Send ports - for (uint32_t i = 0; i < patch->num_ports_non_rt(); ++i) { - send_port(client, patch->port_impl(i)); + for (uint32_t i = 0; i < graph->num_ports_non_rt(); ++i) { + send_port(client, graph->port_impl(i)); } // Send edges - for (PatchImpl::Edges::const_iterator j = patch->edges().begin(); - j != patch->edges().end(); ++j) { + for (GraphImpl::Edges::const_iterator j = graph->edges().begin(); + j != graph->edges().end(); ++j) { client->connect(j->second->tail_path(), j->second->head_path()); } } @@ -142,10 +142,10 @@ Get::post_process() } else if (_object) { _request_client->bundle_begin(); const BlockImpl* block = NULL; - const PatchImpl* patch = NULL; + const GraphImpl* graph = NULL; const PortImpl* port = NULL; - if ((patch = dynamic_cast<const PatchImpl*>(_object))) { - send_patch(_request_client.get(), patch); + if ((graph = dynamic_cast<const GraphImpl*>(_object))) { + send_graph(_request_client.get(), graph); } else if ((block = dynamic_cast<const BlockImpl*>(_object))) { send_block(_request_client.get(), block); } else if ((port = dynamic_cast<const PortImpl*>(_object))) { diff --git a/src/server/events/Move.cpp b/src/server/events/Move.cpp index d5b4d116..58f47e13 100644 --- a/src/server/events/Move.cpp +++ b/src/server/events/Move.cpp @@ -24,7 +24,7 @@ #include "Driver.hpp" #include "Engine.hpp" #include "EnginePort.hpp" -#include "PatchImpl.hpp" +#include "GraphImpl.hpp" #include "events/Move.hpp" namespace Ingen { diff --git a/src/server/events/Move.hpp b/src/server/events/Move.hpp index 6c38347f..6e30cba6 100644 --- a/src/server/events/Move.hpp +++ b/src/server/events/Move.hpp @@ -25,7 +25,7 @@ namespace Ingen { namespace Server { -class PatchImpl; +class GraphImpl; class PortImpl; namespace Events { @@ -62,7 +62,7 @@ public: private: const Raul::Path _old_path; const Raul::Path _new_path; - PatchImpl* _parent_patch; + GraphImpl* _parent_graph; }; } // namespace Events diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp index 5158e441..26f239da 100644 --- a/src/server/ingen_lv2.cpp +++ b/src/server/ingen_lv2.cpp @@ -49,7 +49,7 @@ #include "Engine.hpp" #include "EnginePort.hpp" #include "EventWriter.hpp" -#include "PatchImpl.hpp" +#include "GraphImpl.hpp" #include "PostProcessor.hpp" #include "ProcessContext.hpp" #include "ThreadManager.hpp" @@ -58,9 +58,9 @@ #define NS_RDF "http://www.w3.org/1999/02/22-rdf-syntax-ns#" #define NS_RDFS "http://www.w3.org/2000/01/rdf-schema#" -/** Record of a patch in this bundle. */ -struct LV2Patch { - LV2Patch(const std::string& u, const std::string& f); +/** Record of a graph in this bundle. */ +struct LV2Graph { + LV2Graph(const std::string& u, const std::string& f); const std::string uri; const std::string filename; @@ -72,9 +72,9 @@ class Lib { public: explicit Lib(const char* bundle_path); - typedef std::vector< SharedPtr<const LV2Patch> > Patches; + typedef std::vector< SharedPtr<const LV2Graph> > Graphes; - Patches patches; + Graphes graphes; }; namespace Ingen { @@ -101,7 +101,7 @@ public: *this) , _from_ui(block_length * sizeof(float)) // FIXME: size , _to_ui(block_length * sizeof(float)) // FIXME: size - , _root_patch(NULL) + , _root_graph(NULL) , _notify_capacity(0) , _block_length(block_length) , _sample_rate(sample_rate) @@ -111,28 +111,28 @@ public: {} void pre_process_port(ProcessContext& context, EnginePort* port) { - PortImpl* patch_port = port->patch_port(); + PortImpl* graph_port = port->graph_port(); void* buffer = port->buffer(); - if (!patch_port->is_input() || !buffer) { + if (!graph_port->is_input() || !buffer) { return; } - Buffer* const patch_buf = patch_port->buffer(0).get(); - if (patch_port->is_a(PortType::AUDIO) || - patch_port->is_a(PortType::CV)) { - memcpy(patch_buf->samples(), + Buffer* const graph_buf = graph_port->buffer(0).get(); + if (graph_port->is_a(PortType::AUDIO) || + graph_port->is_a(PortType::CV)) { + memcpy(graph_buf->samples(), buffer, context.nframes() * sizeof(float)); - } else if (patch_port->is_a(PortType::CONTROL)) { - patch_buf->samples()[0] = ((float*)buffer)[0]; + } else if (graph_port->is_a(PortType::CONTROL)) { + graph_buf->samples()[0] = ((float*)buffer)[0]; } else { LV2_Atom_Sequence* seq = (LV2_Atom_Sequence*)buffer; bool enqueued = false; - URIs& uris = patch_port->bufs().uris(); - patch_buf->prepare_write(context); + URIs& uris = graph_port->bufs().uris(); + graph_buf->prepare_write(context); LV2_ATOM_SEQUENCE_FOREACH(seq, ev) { - if (!patch_buf->append_event( + if (!graph_buf->append_event( ev->time.frames, ev->body.size, ev->body.type, (const uint8_t*)LV2_ATOM_BODY(&ev->body))) { _engine.log().warn("Failed to write to buffer, event lost!\n"); @@ -151,27 +151,27 @@ public: } void post_process_port(ProcessContext& context, EnginePort* port) { - PortImpl* patch_port = port->patch_port(); + PortImpl* graph_port = port->graph_port(); void* buffer = port->buffer(); - if (patch_port->is_input() || !buffer) { + if (graph_port->is_input() || !buffer) { return; } - Buffer* patch_buf = patch_port->buffer(0).get(); - if (patch_port->is_a(PortType::AUDIO) || - patch_port->is_a(PortType::CV)) { + Buffer* graph_buf = graph_port->buffer(0).get(); + if (graph_port->is_a(PortType::AUDIO) || + graph_port->is_a(PortType::CV)) { memcpy(buffer, - patch_buf->samples(), + graph_buf->samples(), context.nframes() * sizeof(float)); - } else if (patch_port->is_a(PortType::CONTROL)) { - ((float*)buffer)[0] = patch_buf->samples()[0]; - } else if (patch_port->index() != 1) { + } else if (graph_port->is_a(PortType::CONTROL)) { + ((float*)buffer)[0] = graph_buf->samples()[0]; + } else if (graph_port->index() != 1) { /* Copy Sequence output to LV2 buffer, except notify output which is written by flush_to_ui() (TODO: merge) */ memcpy(buffer, - patch_buf->atom(), - sizeof(LV2_Atom) + patch_buf->atom()->size); + graph_buf->atom(), + sizeof(LV2_Atom) + graph_buf->atom()->size); } } @@ -204,12 +204,12 @@ public: _main_sem.post(); } - virtual void set_root_patch(PatchImpl* patch) { _root_patch = patch; } - virtual PatchImpl* root_patch() { return _root_patch; } + virtual void set_root_graph(GraphImpl* graph) { _root_graph = graph; } + virtual GraphImpl* root_graph() { return _root_graph; } virtual EnginePort* get_port(const Raul::Path& path) { for (Ports::iterator i = _ports.begin(); i != _ports.end(); ++i) { - if ((*i)->patch_port()->path() == path) { + if ((*i)->graph_port()->path() == path) { return *i; } } @@ -221,7 +221,7 @@ public: * It is only called on initial load. */ virtual void add_port(ProcessContext& context, EnginePort* port) { - const uint32_t index = port->patch_port()->index(); + const uint32_t index = port->graph_port()->index(); if (_ports.size() <= index) { _ports.resize(index + 1); } @@ -241,8 +241,8 @@ public: virtual void rename_port(const Raul::Path& old_path, const Raul::Path& new_path) {} - virtual EnginePort* create_port(DuplexPort* patch_port) { - return new EnginePort(patch_port); + virtual EnginePort* create_port(DuplexPort* graph_port) { + return new EnginePort(graph_port); } /** Called in run thread for events received at control input port. */ @@ -359,7 +359,7 @@ private: AtomWriter _writer; Raul::RingBuffer _from_ui; Raul::RingBuffer _to_ui; - PatchImpl* _root_patch; + GraphImpl* _root_graph; uint32_t _notify_capacity; SampleCount _block_length; SampleCount _sample_rate; @@ -422,13 +422,13 @@ struct IngenPlugin { char** argv; }; -static Lib::Patches -find_patches(const Glib::ustring& manifest_uri) +static Lib::Graphes +find_graphes(const Glib::ustring& manifest_uri) { Sord::World world; const Sord::URI base(world, manifest_uri); const Sord::Node nil; - const Sord::URI ingen_Patch (world, NS_INGEN "Patch"); + const Sord::URI ingen_Graph (world, NS_INGEN "Graph"); const Sord::URI rdf_type (world, NS_RDF "type"); const Sord::URI rdfs_seeAlso(world, NS_RDFS "seeAlso"); @@ -436,22 +436,22 @@ find_patches(const Glib::ustring& manifest_uri) Sord::Model model(world, manifest_uri); model.load_file(env, SERD_TURTLE, manifest_uri); - Lib::Patches patches; - for (Sord::Iter i = model.find(nil, rdf_type, ingen_Patch); !i.end(); ++i) { - const Sord::Node patch = i.get_subject(); - Sord::Iter f = model.find(patch, rdfs_seeAlso, nil); - const std::string patch_uri = patch.to_c_string(); + Lib::Graphes graphes; + for (Sord::Iter i = model.find(nil, rdf_type, ingen_Graph); !i.end(); ++i) { + const Sord::Node graph = i.get_subject(); + Sord::Iter f = model.find(graph, rdfs_seeAlso, nil); + const std::string graph_uri = graph.to_c_string(); if (!f.end()) { const uint8_t* file_uri = f.get_object().to_u_string(); uint8_t* file_path = serd_file_uri_parse(file_uri, NULL); - patches.push_back(boost::shared_ptr<const LV2Patch>( - new LV2Patch(patch_uri, (const char*)file_path))); + graphes.push_back(boost::shared_ptr<const LV2Graph>( + new LV2Graph(graph_uri, (const char*)file_path))); free(file_path); } } serd_env_free(env); - return patches; + return graphes; } static LV2_Handle @@ -482,19 +482,19 @@ ingen_instantiate(const LV2_Descriptor* descriptor, } set_bundle_path(bundle_path); - Lib::Patches patches = find_patches( + Lib::Graphes graphes = find_graphes( Glib::filename_to_uri(Ingen::bundle_file_path("manifest.ttl"))); - const LV2Patch* patch = NULL; - for (Lib::Patches::iterator i = patches.begin(); i != patches.end(); ++i) { + const LV2Graph* graph = NULL; + for (Lib::Graphes::iterator i = graphes.begin(); i != graphes.end(); ++i) { if ((*i)->uri == descriptor->URI) { - patch = (*i).get(); + graph = (*i).get(); break; } } - if (!patch) { - const std::string msg((Raul::fmt("Could not find patch %1%\n") + if (!graph) { + const std::string msg((Raul::fmt("Could not find graph %1%\n") % descriptor->URI).str()); if (log) { log->vprintf(log->handle, @@ -560,14 +560,14 @@ ingen_instantiate(const LV2_Descriptor* descriptor, plugin->world->parser()->parse_file(plugin->world, plugin->world->interface().get(), - patch->filename); + graph->filename); while (engine->pending_events()) { engine->process_events(); engine->post_processor()->process(); } - /* Register client after loading patch so the to-ui ring does not overflow. + /* Register client after loading graph so the to-ui ring does not overflow. Since we are not yet rolling, it won't be drained, causing a deadlock. */ SharedPtr<Interface> client(&driver->writer(), NullDeleter<Interface>); interface->set_respondee(client); @@ -586,7 +586,7 @@ ingen_connect_port(LV2_Handle instance, uint32_t port, void* data) LV2Driver* driver = (LV2Driver*)engine->driver(); if (port < driver->ports().size()) { driver->ports().at(port)->set_buffer(data); - assert(driver->ports().at(port)->patch_port()->index() == port); + assert(driver->ports().at(port)->graph_port()->index() == port); assert(driver->ports().at(port)->buffer() == data); } else { engine->log().error(Raul::fmt("Connect to non-existent port %1%\n") @@ -668,7 +668,7 @@ ingen_save(LV2_Handle instance, LV2_URID atom_Path = plugin->map->map(plugin->map->handle, LV2_ATOM__Path); - char* real_path = make_path->path(make_path->handle, "patch.ttl"); + char* real_path = make_path->path(make_path->handle, "graph.ttl"); char* state_path = map_path->abstract_path(map_path->handle, real_path); Ingen::Store::iterator root = plugin->world->store()->find(Raul::Path("/")); @@ -736,7 +736,7 @@ ingen_extension_data(const char* uri) return NULL; } -LV2Patch::LV2Patch(const std::string& u, const std::string& f) +LV2Graph::LV2Graph(const std::string& u, const std::string& f) : uri(u) , filename(f) { @@ -753,7 +753,7 @@ LV2Patch::LV2Patch(const std::string& u, const std::string& f) Lib::Lib(const char* bundle_path) { Ingen::set_bundle_path(bundle_path); - patches = find_patches( + graphes = find_graphes( Glib::filename_to_uri(Ingen::bundle_file_path("manifest.ttl"))); } @@ -768,7 +768,7 @@ static const LV2_Descriptor* lib_get_plugin(LV2_Lib_Handle handle, uint32_t index) { Lib* lib = (Lib*)handle; - return index < lib->patches.size() ? &lib->patches[index]->descriptor : NULL; + return index < lib->graphes.size() ? &lib->graphes[index]->descriptor : NULL; } /** LV2 plugin library entry point */ diff --git a/src/server/internals/Controller.cpp b/src/server/internals/Controller.cpp index 0e8d125e..f38545d3 100644 --- a/src/server/internals/Controller.cpp +++ b/src/server/internals/Controller.cpp @@ -45,7 +45,7 @@ ControllerNode::ControllerNode(InternalPlugin* plugin, BufferFactory& bufs, const Raul::Symbol& symbol, bool polyphonic, - PatchImpl* parent, + GraphImpl* parent, SampleRate srate) : BlockImpl(plugin, symbol, false, parent, srate) , _learning(false) diff --git a/src/server/internals/Controller.hpp b/src/server/internals/Controller.hpp index 23401826..6cb78397 100644 --- a/src/server/internals/Controller.hpp +++ b/src/server/internals/Controller.hpp @@ -42,7 +42,7 @@ public: BufferFactory& bufs, const Raul::Symbol& symbol, bool polyphonic, - PatchImpl* parent, + GraphImpl* parent, SampleRate srate); void process(ProcessContext& context); diff --git a/src/server/internals/Delay.cpp b/src/server/internals/Delay.cpp index 1e7ed5a5..c528a068 100644 --- a/src/server/internals/Delay.cpp +++ b/src/server/internals/Delay.cpp @@ -25,10 +25,10 @@ #include "Buffer.hpp" #include "Driver.hpp" #include "Engine.hpp" +#include "GraphImpl.hpp" #include "InputPort.hpp" #include "InternalPlugin.hpp" #include "OutputPort.hpp" -#include "PatchImpl.hpp" #include "ProcessContext.hpp" #include "internals/Delay.hpp" #include "util.hpp" @@ -53,7 +53,7 @@ DelayNode::DelayNode(InternalPlugin* plugin, BufferFactory& bufs, const Raul::Symbol& symbol, bool polyphonic, - PatchImpl* parent, + GraphImpl* parent, SampleRate srate) : BlockImpl(plugin, symbol, polyphonic, parent, srate) , _buffer(0) diff --git a/src/server/internals/Delay.hpp b/src/server/internals/Delay.hpp index 8f4b758b..0dc5fb21 100644 --- a/src/server/internals/Delay.hpp +++ b/src/server/internals/Delay.hpp @@ -39,7 +39,7 @@ public: BufferFactory& bufs, const Raul::Symbol& symbol, bool polyphonic, - PatchImpl* parent, + GraphImpl* parent, SampleRate srate); ~DelayNode(); diff --git a/src/server/internals/Note.cpp b/src/server/internals/Note.cpp index 00ab0835..a373d4de 100644 --- a/src/server/internals/Note.cpp +++ b/src/server/internals/Note.cpp @@ -24,10 +24,10 @@ #include "Buffer.hpp" #include "Driver.hpp" +#include "GraphImpl.hpp" #include "InputPort.hpp" #include "InternalPlugin.hpp" #include "OutputPort.hpp" -#include "PatchImpl.hpp" #include "ProcessContext.hpp" #include "ingen_config.h" #include "internals/Note.hpp" @@ -50,7 +50,7 @@ NoteNode::NoteNode(InternalPlugin* plugin, BufferFactory& bufs, const Raul::Symbol& symbol, bool polyphonic, - PatchImpl* parent, + GraphImpl* parent, SampleRate srate) : BlockImpl(plugin, symbol, polyphonic, parent, srate) , _voices(new Raul::Array<Voice>(_polyphony)) diff --git a/src/server/internals/Note.hpp b/src/server/internals/Note.hpp index 290908e8..dbdc59e7 100644 --- a/src/server/internals/Note.hpp +++ b/src/server/internals/Note.hpp @@ -42,7 +42,7 @@ public: BufferFactory& bufs, const Raul::Symbol& symbol, bool polyphonic, - PatchImpl* parent, + GraphImpl* parent, SampleRate srate); ~NoteNode(); diff --git a/src/server/internals/Trigger.cpp b/src/server/internals/Trigger.cpp index 31943425..2c353636 100644 --- a/src/server/internals/Trigger.cpp +++ b/src/server/internals/Trigger.cpp @@ -45,7 +45,7 @@ TriggerNode::TriggerNode(InternalPlugin* plugin, BufferFactory& bufs, const Raul::Symbol& symbol, bool polyphonic, - PatchImpl* parent, + GraphImpl* parent, SampleRate srate) : BlockImpl(plugin, symbol, false, parent, srate) , _learning(false) diff --git a/src/server/internals/Trigger.hpp b/src/server/internals/Trigger.hpp index 750cd287..b9ae4849 100644 --- a/src/server/internals/Trigger.hpp +++ b/src/server/internals/Trigger.hpp @@ -45,7 +45,7 @@ public: BufferFactory& bufs, const Raul::Symbol& symbol, bool polyphonic, - PatchImpl* parent, + GraphImpl* parent, SampleRate srate); void process(ProcessContext& context); diff --git a/src/server/wscript b/src/server/wscript index 9664545a..b6ec6e98 100644 --- a/src/server/wscript +++ b/src/server/wscript @@ -14,6 +14,7 @@ def build(bld): EdgeImpl.cpp Engine.cpp EventWriter.cpp + GraphImpl.cpp GraphObjectImpl.cpp InputPort.cpp InternalPlugin.cpp @@ -21,14 +22,13 @@ def build(bld): LV2Info.cpp LV2Plugin.cpp OutputPort.cpp - PatchImpl.cpp PortImpl.cpp PostProcessor.cpp PreProcessor.cpp Worker.cpp events/Connect.cpp events/CreateBlock.cpp - events/CreatePatch.cpp + events/CreateGraph.cpp events/CreatePort.cpp events/Delete.cpp events/Delta.cpp |