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/gui | |
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/gui')
-rw-r--r-- | src/gui/App.cpp | 16 | ||||
-rw-r--r-- | src/gui/App.hpp | 12 | ||||
-rw-r--r-- | src/gui/BreadCrumbs.cpp | 16 | ||||
-rw-r--r-- | src/gui/BreadCrumbs.hpp | 32 | ||||
-rw-r--r-- | src/gui/Configuration.hpp | 8 | ||||
-rw-r--r-- | src/gui/ConnectWindow.cpp | 10 | ||||
-rw-r--r-- | src/gui/Edge.hpp | 2 | ||||
-rw-r--r-- | src/gui/GraphBox.cpp (renamed from src/gui/PatchBox.cpp) | 306 | ||||
-rw-r--r-- | src/gui/GraphBox.hpp (renamed from src/gui/PatchBox.hpp) | 58 | ||||
-rw-r--r-- | src/gui/GraphCanvas.cpp (renamed from src/gui/PatchCanvas.cpp) | 220 | ||||
-rw-r--r-- | src/gui/GraphCanvas.hpp (renamed from src/gui/PatchCanvas.hpp) | 32 | ||||
-rw-r--r-- | src/gui/GraphPortModule.cpp (renamed from src/gui/PatchPortModule.cpp) | 38 | ||||
-rw-r--r-- | src/gui/GraphPortModule.hpp (renamed from src/gui/PatchPortModule.hpp) | 18 | ||||
-rw-r--r-- | src/gui/GraphTreeWindow.cpp | 234 | ||||
-rw-r--r-- | src/gui/GraphTreeWindow.hpp (renamed from src/gui/PatchTreeWindow.hpp) | 69 | ||||
-rw-r--r-- | src/gui/GraphView.cpp (renamed from src/gui/PatchView.cpp) | 94 | ||||
-rw-r--r-- | src/gui/GraphView.hpp (renamed from src/gui/PatchView.hpp) | 36 | ||||
-rw-r--r-- | src/gui/GraphWindow.cpp (renamed from src/gui/PatchWindow.cpp) | 20 | ||||
-rw-r--r-- | src/gui/GraphWindow.hpp (renamed from src/gui/PatchWindow.hpp) | 24 | ||||
-rw-r--r-- | src/gui/LoadGraphWindow.cpp (renamed from src/gui/LoadPatchWindow.cpp) | 96 | ||||
-rw-r--r-- | src/gui/LoadGraphWindow.hpp (renamed from src/gui/LoadPatchWindow.hpp) | 20 | ||||
-rw-r--r-- | src/gui/LoadPluginWindow.cpp | 38 | ||||
-rw-r--r-- | src/gui/LoadPluginWindow.hpp | 10 | ||||
-rw-r--r-- | src/gui/MessagesWindow.hpp | 2 | ||||
-rw-r--r-- | src/gui/NewSubgraphWindow.cpp (renamed from src/gui/NewSubpatchWindow.cpp) | 51 | ||||
-rw-r--r-- | src/gui/NewSubgraphWindow.hpp (renamed from src/gui/NewSubpatchWindow.hpp) | 20 | ||||
-rw-r--r-- | src/gui/NodeModule.cpp | 22 | ||||
-rw-r--r-- | src/gui/NodeModule.hpp | 8 | ||||
-rw-r--r-- | src/gui/ObjectMenu.hpp | 2 | ||||
-rw-r--r-- | src/gui/PatchTreeWindow.cpp | 234 | ||||
-rw-r--r-- | src/gui/Port.cpp | 26 | ||||
-rw-r--r-- | src/gui/Port.hpp | 4 | ||||
-rw-r--r-- | src/gui/PortMenu.cpp | 18 | ||||
-rw-r--r-- | src/gui/PortMenu.hpp | 4 | ||||
-rw-r--r-- | src/gui/SubgraphModule.cpp (renamed from src/gui/SubpatchModule.cpp) | 50 | ||||
-rw-r--r-- | src/gui/SubgraphModule.hpp (renamed from src/gui/SubpatchModule.hpp) | 30 | ||||
-rw-r--r-- | src/gui/ThreadedLoader.cpp | 12 | ||||
-rw-r--r-- | src/gui/ThreadedLoader.hpp | 10 | ||||
-rw-r--r-- | src/gui/WindowFactory.cpp | 174 | ||||
-rw-r--r-- | src/gui/WindowFactory.hpp | 54 | ||||
-rw-r--r-- | src/gui/ingen_gui.ui | 202 | ||||
-rw-r--r-- | src/gui/ingen_gui_lv2.cpp | 20 | ||||
-rw-r--r-- | src/gui/wscript | 18 |
43 files changed, 1186 insertions, 1184 deletions
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 |