From bb1c49dfa484db080938cff6f8f70167c9026a1c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 24 Jul 2007 19:26:47 +0000 Subject: Consistently rename all C++ files .cpp/.hpp. Fix (some) inclusion guard names to not clash with other libs. git-svn-id: http://svn.drobilla.net/lad/ingen@613 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/gui/App.cpp | 40 ++++---- src/libs/gui/App.h | 143 ----------------------------- src/libs/gui/App.hpp | 143 +++++++++++++++++++++++++++++ src/libs/gui/BreadCrumb.h | 81 ---------------- src/libs/gui/BreadCrumb.hpp | 81 ++++++++++++++++ src/libs/gui/BreadCrumbBox.cpp | 4 +- src/libs/gui/BreadCrumbBox.h | 70 -------------- src/libs/gui/BreadCrumbBox.hpp | 70 ++++++++++++++ src/libs/gui/ConfigWindow.cpp | 4 +- src/libs/gui/ConfigWindow.h | 65 ------------- src/libs/gui/ConfigWindow.hpp | 65 +++++++++++++ src/libs/gui/Configuration.cpp | 12 +-- src/libs/gui/Configuration.h | 80 ---------------- src/libs/gui/Configuration.hpp | 80 ++++++++++++++++ src/libs/gui/ConnectWindow.cpp | 32 +++---- src/libs/gui/ConnectWindow.h | 92 ------------------- src/libs/gui/ConnectWindow.hpp | 92 +++++++++++++++++++ src/libs/gui/Connection.h | 60 ------------ src/libs/gui/Connection.hpp | 60 ++++++++++++ src/libs/gui/ControlGroups.cpp | 18 ++-- src/libs/gui/ControlGroups.h | 163 --------------------------------- src/libs/gui/ControlGroups.hpp | 163 +++++++++++++++++++++++++++++++++ src/libs/gui/ControlPanel.cpp | 18 ++-- src/libs/gui/ControlPanel.h | 94 ------------------- src/libs/gui/ControlPanel.hpp | 94 +++++++++++++++++++ src/libs/gui/DSSIController.cpp | 10 +- src/libs/gui/DSSIController.h | 77 ---------------- src/libs/gui/DSSIController.hpp | 77 ++++++++++++++++ src/libs/gui/DSSIModule.cpp | 4 +- src/libs/gui/DSSIModule.h | 46 ---------- src/libs/gui/DSSIModule.hpp | 46 ++++++++++ src/libs/gui/GladeFactory.cpp | 2 +- src/libs/gui/GladeFactory.h | 51 ----------- src/libs/gui/GladeFactory.hpp | 51 +++++++++++ src/libs/gui/LashController.cpp | 8 +- src/libs/gui/LashController.h | 56 ----------- src/libs/gui/LashController.hpp | 56 +++++++++++ src/libs/gui/LoadPatchWindow.cpp | 12 +-- src/libs/gui/LoadPatchWindow.h | 81 ---------------- src/libs/gui/LoadPatchWindow.hpp | 81 ++++++++++++++++ src/libs/gui/LoadPluginWindow.cpp | 18 ++-- src/libs/gui/LoadPluginWindow.h | 151 ------------------------------ src/libs/gui/LoadPluginWindow.hpp | 151 ++++++++++++++++++++++++++++++ src/libs/gui/LoadRemotePatchWindow.cpp | 14 +-- src/libs/gui/LoadRemotePatchWindow.h | 93 ------------------- src/libs/gui/LoadRemotePatchWindow.hpp | 93 +++++++++++++++++++ src/libs/gui/LoadSubpatchWindow.cpp | 16 ++-- src/libs/gui/LoadSubpatchWindow.h | 79 ---------------- src/libs/gui/LoadSubpatchWindow.hpp | 79 ++++++++++++++++ src/libs/gui/MessagesWindow.cpp | 2 +- src/libs/gui/MessagesWindow.h | 58 ------------ src/libs/gui/MessagesWindow.hpp | 58 ++++++++++++ src/libs/gui/NewSubpatchWindow.cpp | 12 +-- src/libs/gui/NewSubpatchWindow.h | 67 -------------- src/libs/gui/NewSubpatchWindow.hpp | 67 ++++++++++++++ src/libs/gui/NodeControlWindow.cpp | 16 ++-- src/libs/gui/NodeControlWindow.h | 76 --------------- src/libs/gui/NodeControlWindow.hpp | 76 +++++++++++++++ src/libs/gui/NodeMenu.cpp | 10 +- src/libs/gui/NodeMenu.h | 78 ---------------- src/libs/gui/NodeMenu.hpp | 78 ++++++++++++++++ src/libs/gui/NodeModule.cpp | 28 +++--- src/libs/gui/NodeModule.h | 90 ------------------ src/libs/gui/NodeModule.hpp | 90 ++++++++++++++++++ src/libs/gui/NodePropertiesWindow.cpp | 6 +- src/libs/gui/NodePropertiesWindow.h | 58 ------------ src/libs/gui/NodePropertiesWindow.hpp | 58 ++++++++++++ src/libs/gui/PatchCanvas.cpp | 43 ++++----- src/libs/gui/PatchCanvas.h | 131 -------------------------- src/libs/gui/PatchCanvas.hpp | 131 ++++++++++++++++++++++++++ src/libs/gui/PatchPortModule.cpp | 20 ++-- src/libs/gui/PatchPortModule.h | 79 ---------------- src/libs/gui/PatchPortModule.hpp | 79 ++++++++++++++++ src/libs/gui/PatchPropertiesWindow.cpp | 4 +- src/libs/gui/PatchPropertiesWindow.h | 64 ------------- src/libs/gui/PatchPropertiesWindow.hpp | 64 +++++++++++++ src/libs/gui/PatchTreeWindow.cpp | 18 ++-- src/libs/gui/PatchTreeWindow.h | 112 ---------------------- src/libs/gui/PatchTreeWindow.hpp | 112 ++++++++++++++++++++++ src/libs/gui/PatchView.cpp | 24 ++--- src/libs/gui/PatchView.h | 102 --------------------- src/libs/gui/PatchView.hpp | 102 +++++++++++++++++++++ src/libs/gui/PatchWindow.cpp | 40 ++++---- src/libs/gui/PatchWindow.h | 150 ------------------------------ src/libs/gui/PatchWindow.hpp | 150 ++++++++++++++++++++++++++++++ src/libs/gui/Port.cpp | 14 +-- src/libs/gui/Port.h | 57 ------------ src/libs/gui/Port.hpp | 57 ++++++++++++ src/libs/gui/PortPropertiesWindow.cpp | 12 +-- src/libs/gui/PortPropertiesWindow.h | 70 -------------- src/libs/gui/PortPropertiesWindow.hpp | 70 ++++++++++++++ src/libs/gui/RenameWindow.cpp | 10 +- src/libs/gui/RenameWindow.h | 60 ------------ src/libs/gui/RenameWindow.hpp | 60 ++++++++++++ src/libs/gui/SubpatchModule.cpp | 20 ++-- src/libs/gui/SubpatchModule.h | 71 -------------- src/libs/gui/SubpatchModule.hpp | 71 ++++++++++++++ src/libs/gui/ThreadedLoader.cpp | 8 +- src/libs/gui/ThreadedLoader.h | 98 -------------------- src/libs/gui/ThreadedLoader.hpp | 98 ++++++++++++++++++++ src/libs/gui/UploadPatchWindow.cpp | 16 ++-- src/libs/gui/UploadPatchWindow.h | 105 --------------------- src/libs/gui/UploadPatchWindow.hpp | 105 +++++++++++++++++++++ src/libs/gui/WindowFactory.cpp | 28 +++--- src/libs/gui/WindowFactory.h | 105 --------------------- src/libs/gui/WindowFactory.hpp | 105 +++++++++++++++++++++ src/libs/gui/gui.cpp | 8 +- src/libs/gui/gui.h | 45 --------- src/libs/gui/gui.hpp | 45 +++++++++ 109 files changed, 3434 insertions(+), 3433 deletions(-) delete mode 100644 src/libs/gui/App.h create mode 100644 src/libs/gui/App.hpp delete mode 100644 src/libs/gui/BreadCrumb.h create mode 100644 src/libs/gui/BreadCrumb.hpp delete mode 100644 src/libs/gui/BreadCrumbBox.h create mode 100644 src/libs/gui/BreadCrumbBox.hpp delete mode 100644 src/libs/gui/ConfigWindow.h create mode 100644 src/libs/gui/ConfigWindow.hpp delete mode 100644 src/libs/gui/Configuration.h create mode 100644 src/libs/gui/Configuration.hpp delete mode 100644 src/libs/gui/ConnectWindow.h create mode 100644 src/libs/gui/ConnectWindow.hpp delete mode 100644 src/libs/gui/Connection.h create mode 100644 src/libs/gui/Connection.hpp delete mode 100644 src/libs/gui/ControlGroups.h create mode 100644 src/libs/gui/ControlGroups.hpp delete mode 100644 src/libs/gui/ControlPanel.h create mode 100644 src/libs/gui/ControlPanel.hpp delete mode 100644 src/libs/gui/DSSIController.h create mode 100644 src/libs/gui/DSSIController.hpp delete mode 100644 src/libs/gui/DSSIModule.h create mode 100644 src/libs/gui/DSSIModule.hpp delete mode 100644 src/libs/gui/GladeFactory.h create mode 100644 src/libs/gui/GladeFactory.hpp delete mode 100644 src/libs/gui/LashController.h create mode 100644 src/libs/gui/LashController.hpp delete mode 100644 src/libs/gui/LoadPatchWindow.h create mode 100644 src/libs/gui/LoadPatchWindow.hpp delete mode 100644 src/libs/gui/LoadPluginWindow.h create mode 100644 src/libs/gui/LoadPluginWindow.hpp delete mode 100644 src/libs/gui/LoadRemotePatchWindow.h create mode 100644 src/libs/gui/LoadRemotePatchWindow.hpp delete mode 100644 src/libs/gui/LoadSubpatchWindow.h create mode 100644 src/libs/gui/LoadSubpatchWindow.hpp delete mode 100644 src/libs/gui/MessagesWindow.h create mode 100644 src/libs/gui/MessagesWindow.hpp delete mode 100644 src/libs/gui/NewSubpatchWindow.h create mode 100644 src/libs/gui/NewSubpatchWindow.hpp delete mode 100644 src/libs/gui/NodeControlWindow.h create mode 100644 src/libs/gui/NodeControlWindow.hpp delete mode 100644 src/libs/gui/NodeMenu.h create mode 100644 src/libs/gui/NodeMenu.hpp delete mode 100644 src/libs/gui/NodeModule.h create mode 100644 src/libs/gui/NodeModule.hpp delete mode 100644 src/libs/gui/NodePropertiesWindow.h create mode 100644 src/libs/gui/NodePropertiesWindow.hpp delete mode 100644 src/libs/gui/PatchCanvas.h create mode 100644 src/libs/gui/PatchCanvas.hpp delete mode 100644 src/libs/gui/PatchPortModule.h create mode 100644 src/libs/gui/PatchPortModule.hpp delete mode 100644 src/libs/gui/PatchPropertiesWindow.h create mode 100644 src/libs/gui/PatchPropertiesWindow.hpp delete mode 100644 src/libs/gui/PatchTreeWindow.h create mode 100644 src/libs/gui/PatchTreeWindow.hpp delete mode 100644 src/libs/gui/PatchView.h create mode 100644 src/libs/gui/PatchView.hpp delete mode 100644 src/libs/gui/PatchWindow.h create mode 100644 src/libs/gui/PatchWindow.hpp delete mode 100644 src/libs/gui/Port.h create mode 100644 src/libs/gui/Port.hpp delete mode 100644 src/libs/gui/PortPropertiesWindow.h create mode 100644 src/libs/gui/PortPropertiesWindow.hpp delete mode 100644 src/libs/gui/RenameWindow.h create mode 100644 src/libs/gui/RenameWindow.hpp delete mode 100644 src/libs/gui/SubpatchModule.h create mode 100644 src/libs/gui/SubpatchModule.hpp delete mode 100644 src/libs/gui/ThreadedLoader.h create mode 100644 src/libs/gui/ThreadedLoader.hpp delete mode 100644 src/libs/gui/UploadPatchWindow.h create mode 100644 src/libs/gui/UploadPatchWindow.hpp delete mode 100644 src/libs/gui/WindowFactory.h create mode 100644 src/libs/gui/WindowFactory.hpp delete mode 100644 src/libs/gui/gui.h create mode 100644 src/libs/gui/gui.hpp (limited to 'src/libs/gui') diff --git a/src/libs/gui/App.cpp b/src/libs/gui/App.cpp index 7b815db2..acebf04e 100644 --- a/src/libs/gui/App.cpp +++ b/src/libs/gui/App.cpp @@ -16,33 +16,33 @@ */ #include "../../../config/config.h" -#include "App.h" +#include "App.hpp" #include #include #include #include #include #include -#include -#include "interface/EngineInterface.h" -#include "client/ObjectModel.h" -#include "client/PatchModel.h" -#include "client/Store.h" -#include "NodeModule.h" -#include "ControlPanel.h" -#include "SubpatchModule.h" -#include "LoadPluginWindow.h" -#include "PatchWindow.h" -#include "MessagesWindow.h" -#include "ConfigWindow.h" -#include "GladeFactory.h" -#include "PatchTreeWindow.h" -#include "Configuration.h" -#include "ConnectWindow.h" -#include "ThreadedLoader.h" -#include "WindowFactory.h" +#include +#include "interface/EngineInterface.hpp" +#include "client/ObjectModel.hpp" +#include "client/PatchModel.hpp" +#include "client/Store.hpp" +#include "NodeModule.hpp" +#include "ControlPanel.hpp" +#include "SubpatchModule.hpp" +#include "LoadPluginWindow.hpp" +#include "PatchWindow.hpp" +#include "MessagesWindow.hpp" +#include "ConfigWindow.hpp" +#include "GladeFactory.hpp" +#include "PatchTreeWindow.hpp" +#include "Configuration.hpp" +#include "ConnectWindow.hpp" +#include "ThreadedLoader.hpp" +#include "WindowFactory.hpp" /*#ifdef HAVE_LASH -#include "LashController.h" +#include "LashController.hpp" #endif*/ using std::cerr; using std::cout; using std::endl; using std::string; diff --git a/src/libs/gui/App.h b/src/libs/gui/App.h deleted file mode 100644 index 9173a786..00000000 --- a/src/libs/gui/App.h +++ /dev/null @@ -1,143 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef APP_H -#define APP_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -using std::string; using std::map; using std::list; -using std::cerr; using std::endl; - -namespace Ingen { - class Engine; - namespace Shared { - class EngineInterface; - } - namespace Client { - class PatchModel; - class PluginModel; - class Store; - class SigClientInterface; - } -} -using namespace Ingen::Client; -using Ingen::Shared::EngineInterface; - -/** \defgroup GUI GTK GUI - */ - -namespace Ingen { -namespace GUI { - -class MessagesWindow; -class ConfigWindow; -class PatchCanvas; -class PatchTreeView; -class PatchTreeWindow; -class ConnectWindow; -class Configuration; -class ThreadedLoader; -class WindowFactory; - - -/** Singleton master class most everything is contained within. - * - * This is a horrible god-object, but it's shrinking in size as things are - * moved out. Hopefully it will go away entirely some day.. - * - * \ingroup GUI - */ -class App -{ -public: - ~App(); - - void error_message(const string& msg); - - void attach(const SharedPtr& engine, - const SharedPtr& client); - - void detach(); - - void quit(); - - ConnectWindow* connect_window() const { return _connect_window; } - Gtk::Dialog* about_dialog() const { return _about_dialog; } - ConfigWindow* configuration_dialog() const { return _config_window; } - MessagesWindow* messages_dialog() const { return _messages_window; } - PatchTreeWindow* patch_tree() const { return _patch_tree_window; } - Configuration* configuration() const { return _configuration; } - WindowFactory* window_factory() const { return _window_factory; } - - Raul::RDF::World* rdf_world() { return &_rdf_world; } - - const SharedPtr& engine() const { return _engine; } - const SharedPtr& client() const { return _client; } - const SharedPtr& store() const { return _store; } - const SharedPtr& loader() const { return _loader; } - - static inline App& instance() { assert(_instance); return *_instance; } - - static void run(int argc, char** argv, - SharedPtr engine, - SharedPtr interface); - -protected: - App(); - static App* _instance; - - static void instantiate(int argc, char** argv); - - SharedPtr _engine; - SharedPtr _client; - SharedPtr _store; - SharedPtr _loader; - - Configuration* _configuration; - - ConnectWindow* _connect_window; - MessagesWindow* _messages_window; - PatchTreeWindow* _patch_tree_window; - ConfigWindow* _config_window; - Gtk::Dialog* _about_dialog; - WindowFactory* _window_factory; - - Raul::RDF::World _rdf_world; - - /** Used to avoid feedback loops with (eg) process checkbutton - * FIXME: Maybe this should be globally implemented at the Controller level, - * disable all command sending while handling events to avoid feedback - * issues with widget event callbacks? This same pattern is duplicated - * too much... */ - bool _enable_signal; -}; - - -} // namespace GUI -} // namespace Ingen - -#endif // APP_H - diff --git a/src/libs/gui/App.hpp b/src/libs/gui/App.hpp new file mode 100644 index 00000000..97bbb661 --- /dev/null +++ b/src/libs/gui/App.hpp @@ -0,0 +1,143 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef APP_H +#define APP_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +using std::string; using std::map; using std::list; +using std::cerr; using std::endl; + +namespace Ingen { + class Engine; + namespace Shared { + class EngineInterface; + } + namespace Client { + class PatchModel; + class PluginModel; + class Store; + class SigClientInterface; + } +} +using namespace Ingen::Client; +using Ingen::Shared::EngineInterface; + +/** \defgroup GUI GTK GUI + */ + +namespace Ingen { +namespace GUI { + +class MessagesWindow; +class ConfigWindow; +class PatchCanvas; +class PatchTreeView; +class PatchTreeWindow; +class ConnectWindow; +class Configuration; +class ThreadedLoader; +class WindowFactory; + + +/** Singleton master class most everything is contained within. + * + * This is a horrible god-object, but it's shrinking in size as things are + * moved out. Hopefully it will go away entirely some day.. + * + * \ingroup GUI + */ +class App +{ +public: + ~App(); + + void error_message(const string& msg); + + void attach(const SharedPtr& engine, + const SharedPtr& client); + + void detach(); + + void quit(); + + ConnectWindow* connect_window() const { return _connect_window; } + Gtk::Dialog* about_dialog() const { return _about_dialog; } + ConfigWindow* configuration_dialog() const { return _config_window; } + MessagesWindow* messages_dialog() const { return _messages_window; } + PatchTreeWindow* patch_tree() const { return _patch_tree_window; } + Configuration* configuration() const { return _configuration; } + WindowFactory* window_factory() const { return _window_factory; } + + Raul::RDF::World* rdf_world() { return &_rdf_world; } + + const SharedPtr& engine() const { return _engine; } + const SharedPtr& client() const { return _client; } + const SharedPtr& store() const { return _store; } + const SharedPtr& loader() const { return _loader; } + + static inline App& instance() { assert(_instance); return *_instance; } + + static void run(int argc, char** argv, + SharedPtr engine, + SharedPtr interface); + +protected: + App(); + static App* _instance; + + static void instantiate(int argc, char** argv); + + SharedPtr _engine; + SharedPtr _client; + SharedPtr _store; + SharedPtr _loader; + + Configuration* _configuration; + + ConnectWindow* _connect_window; + MessagesWindow* _messages_window; + PatchTreeWindow* _patch_tree_window; + ConfigWindow* _config_window; + Gtk::Dialog* _about_dialog; + WindowFactory* _window_factory; + + Raul::RDF::World _rdf_world; + + /** Used to avoid feedback loops with (eg) process checkbutton + * FIXME: Maybe this should be globally implemented at the Controller level, + * disable all command sending while handling events to avoid feedback + * issues with widget event callbacks? This same pattern is duplicated + * too much... */ + bool _enable_signal; +}; + + +} // namespace GUI +} // namespace Ingen + +#endif // APP_H + diff --git a/src/libs/gui/BreadCrumb.h b/src/libs/gui/BreadCrumb.h deleted file mode 100644 index 96464b50..00000000 --- a/src/libs/gui/BreadCrumb.h +++ /dev/null @@ -1,81 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef BREADCRUMB_H -#define BREADCRUMB_H - -#include -#include -#include -#include "PatchView.h" - -namespace Ingen { -namespace GUI { - - -/** Breadcrumb button in a PatchWindow. - * - * 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 - * number of visible breadcrumbs (which is the perfect cache for GUI - * responsiveness balanced with mem consumption). - * - * \ingroup GUI - */ -class BreadCrumb : public Gtk::ToggleButton -{ -public: - BreadCrumb(const Path& path, SharedPtr view = SharedPtr()) - : _path(path) - , _view(view) - { - assert( !view || view->patch()->path() == path); - set_border_width(0); - set_path(path); - show_all(); - } - - void set_view(SharedPtr view) { - assert( !view || view->patch()->path() == _path); - _view = view; - } - - const Path& path() const { return _path; } - SharedPtr view() const { return _view; } - - void set_path(const Path& path) - { - remove(); - const string text = (path == "/") ? "/" : path.name(); - Gtk::Label* lab = manage(new Gtk::Label(text)); - lab->set_padding(0, 0); - lab->show(); - add(*lab); - - if (_view && _view->patch()->path() != path) - _view.reset(); - } - -private: - Path _path; - SharedPtr _view; -}; - -} // namespace GUI -} // namespace Ingen - -#endif // BREADCRUMB_H diff --git a/src/libs/gui/BreadCrumb.hpp b/src/libs/gui/BreadCrumb.hpp new file mode 100644 index 00000000..7f4f9f89 --- /dev/null +++ b/src/libs/gui/BreadCrumb.hpp @@ -0,0 +1,81 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef BREADCRUMB_H +#define BREADCRUMB_H + +#include +#include +#include +#include "PatchView.hpp" + +namespace Ingen { +namespace GUI { + + +/** Breadcrumb button in a PatchWindow. + * + * 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 + * number of visible breadcrumbs (which is the perfect cache for GUI + * responsiveness balanced with mem consumption). + * + * \ingroup GUI + */ +class BreadCrumb : public Gtk::ToggleButton +{ +public: + BreadCrumb(const Path& path, SharedPtr view = SharedPtr()) + : _path(path) + , _view(view) + { + assert( !view || view->patch()->path() == path); + set_border_width(0); + set_path(path); + show_all(); + } + + void set_view(SharedPtr view) { + assert( !view || view->patch()->path() == _path); + _view = view; + } + + const Path& path() const { return _path; } + SharedPtr view() const { return _view; } + + void set_path(const Path& path) + { + remove(); + const string text = (path == "/") ? "/" : path.name(); + Gtk::Label* lab = manage(new Gtk::Label(text)); + lab->set_padding(0, 0); + lab->show(); + add(*lab); + + if (_view && _view->patch()->path() != path) + _view.reset(); + } + +private: + Path _path; + SharedPtr _view; +}; + +} // namespace GUI +} // namespace Ingen + +#endif // BREADCRUMB_H diff --git a/src/libs/gui/BreadCrumbBox.cpp b/src/libs/gui/BreadCrumbBox.cpp index 79a0bf69..d8ff4519 100644 --- a/src/libs/gui/BreadCrumbBox.cpp +++ b/src/libs/gui/BreadCrumbBox.cpp @@ -15,8 +15,8 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "BreadCrumbBox.h" -#include "BreadCrumb.h" +#include "BreadCrumbBox.hpp" +#include "BreadCrumb.hpp" namespace Ingen { namespace GUI { diff --git a/src/libs/gui/BreadCrumbBox.h b/src/libs/gui/BreadCrumbBox.h deleted file mode 100644 index 8b806f5a..00000000 --- a/src/libs/gui/BreadCrumbBox.h +++ /dev/null @@ -1,70 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef BREADCRUMBBOX_H -#define BREADCRUMBBOX_H - -#include -#include -#include -#include -#include -#include -#include "PatchView.h" - -namespace Ingen { -namespace GUI { - -class BreadCrumb; - - -/** Collection of breadcrumb buttons forming a path. - * - * This doubles as a cache for PatchViews. - * - * \ingroup GUI - */ -class BreadCrumbBox : public Gtk::HBox -{ -public: - BreadCrumbBox(); - - SharedPtr view(const Path& path); - - void build(Path path, SharedPtr view); - - sigc::signal > signal_patch_selected; - -private: - BreadCrumb* create_crumb(const Path& path, - SharedPtr view = SharedPtr()); - - void breadcrumb_clicked(BreadCrumb* crumb); - - void object_removed(const Path& path); - void object_renamed(const Path& old_path, const Path& new_path); - - Path _active_path; - Path _full_path; - bool _enable_signal; - std::list _breadcrumbs; -}; - -} // namespace GUI -} // namespace Ingen - -#endif // BREADCRUMBBOX_H diff --git a/src/libs/gui/BreadCrumbBox.hpp b/src/libs/gui/BreadCrumbBox.hpp new file mode 100644 index 00000000..5e90806b --- /dev/null +++ b/src/libs/gui/BreadCrumbBox.hpp @@ -0,0 +1,70 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef BREADCRUMBBOX_H +#define BREADCRUMBBOX_H + +#include +#include +#include +#include +#include +#include +#include "PatchView.hpp" + +namespace Ingen { +namespace GUI { + +class BreadCrumb; + + +/** Collection of breadcrumb buttons forming a path. + * + * This doubles as a cache for PatchViews. + * + * \ingroup GUI + */ +class BreadCrumbBox : public Gtk::HBox +{ +public: + BreadCrumbBox(); + + SharedPtr view(const Path& path); + + void build(Path path, SharedPtr view); + + sigc::signal > signal_patch_selected; + +private: + BreadCrumb* create_crumb(const Path& path, + SharedPtr view = SharedPtr()); + + void breadcrumb_clicked(BreadCrumb* crumb); + + void object_removed(const Path& path); + void object_renamed(const Path& old_path, const Path& new_path); + + Path _active_path; + Path _full_path; + bool _enable_signal; + std::list _breadcrumbs; +}; + +} // namespace GUI +} // namespace Ingen + +#endif // BREADCRUMBBOX_H diff --git a/src/libs/gui/ConfigWindow.cpp b/src/libs/gui/ConfigWindow.cpp index c8b29f1a..3fb44626 100644 --- a/src/libs/gui/ConfigWindow.cpp +++ b/src/libs/gui/ConfigWindow.cpp @@ -19,8 +19,8 @@ #include #include #include -#include "client/NodeModel.h" -#include "ConfigWindow.h" +#include "client/NodeModel.hpp" +#include "ConfigWindow.hpp" using namespace std; diff --git a/src/libs/gui/ConfigWindow.h b/src/libs/gui/ConfigWindow.h deleted file mode 100644 index d1a2cff6..00000000 --- a/src/libs/gui/ConfigWindow.h +++ /dev/null @@ -1,65 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef CONFIGWINDOW_H -#define CONFIGWINDOW_H - -#include -#include -#include -#include -#include "client/PluginModel.h" -#include "Configuration.h" - -using std::list; -using Ingen::Client::PluginModel; - -namespace Ingen { -namespace GUI { - - -/** 'Configuration' window. - * - * Loaded by glade as a derived object. - * - * \ingroup GUI - */ -class ConfigWindow : public Gtk::Window -{ -public: - ConfigWindow(BaseObjectType* cobject, const Glib::RefPtr& xml); - - void configuration(Configuration* sm); - -private: - void save_clicked(); - void cancel_clicked(); - void ok_clicked(); - - Configuration* _configuration; - - Gtk::Entry* _path_entry; - Gtk::Button* _save_button; - Gtk::Button* _cancel_button; - Gtk::Button* _ok_button; -}; - - -} // namespace GUI -} // namespace Ingen - -#endif // CONFIGWINDOW_H diff --git a/src/libs/gui/ConfigWindow.hpp b/src/libs/gui/ConfigWindow.hpp new file mode 100644 index 00000000..dce40218 --- /dev/null +++ b/src/libs/gui/ConfigWindow.hpp @@ -0,0 +1,65 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef CONFIGWINDOW_H +#define CONFIGWINDOW_H + +#include +#include +#include +#include +#include "client/PluginModel.hpp" +#include "Configuration.hpp" + +using std::list; +using Ingen::Client::PluginModel; + +namespace Ingen { +namespace GUI { + + +/** 'Configuration' window. + * + * Loaded by glade as a derived object. + * + * \ingroup GUI + */ +class ConfigWindow : public Gtk::Window +{ +public: + ConfigWindow(BaseObjectType* cobject, const Glib::RefPtr& xml); + + void configuration(Configuration* sm); + +private: + void save_clicked(); + void cancel_clicked(); + void ok_clicked(); + + Configuration* _configuration; + + Gtk::Entry* _path_entry; + Gtk::Button* _save_button; + Gtk::Button* _cancel_button; + Gtk::Button* _ok_button; +}; + + +} // namespace GUI +} // namespace Ingen + +#endif // CONFIGWINDOW_H diff --git a/src/libs/gui/Configuration.cpp b/src/libs/gui/Configuration.cpp index 72ea5cb5..afeba77e 100644 --- a/src/libs/gui/Configuration.cpp +++ b/src/libs/gui/Configuration.cpp @@ -15,17 +15,17 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "Configuration.h" +#include "Configuration.hpp" #include #include #include #include #include -#include "client/PortModel.h" -#include "client/PluginModel.h" -#include "client/PatchModel.h" -#include "serialisation/Loader.h" -#include "App.h" +#include "client/PortModel.hpp" +#include "client/PluginModel.hpp" +#include "client/PatchModel.hpp" +#include "serialisation/Loader.hpp" +#include "App.hpp" using std::cerr; using std::cout; using std::endl; using std::map; using std::string; diff --git a/src/libs/gui/Configuration.h b/src/libs/gui/Configuration.h deleted file mode 100644 index 9f7cbb08..00000000 --- a/src/libs/gui/Configuration.h +++ /dev/null @@ -1,80 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef CONFIG_H -#define CONFIG_H - -#include - -namespace Ingen { namespace Client { class PortModel; } } -using Ingen::Client::PortModel; -using std::string; - -struct Coord { double x; double y; }; - -namespace Ingen { -namespace GUI { - -class Controller; - - -/** Singleton state manager for the entire app. - * - * Stores settings like color preferences, search paths, etc. - * (ie any user-defined preferences to be stoed in the rc file). - * - * \ingroup GUI - */ -class Configuration -{ -public: - Configuration(); - ~Configuration(); - - void load_settings(string filename = ""); - void save_settings(string filename = ""); - - void apply_settings(); - - string patch_path() { return _patch_path; } - void patch_path(const string& path) { _patch_path = path; } - - const string& patch_folder() { return _patch_folder; } - void set_patch_folder(const string& f) { _patch_folder = f; } - - uint32_t get_port_color(const PortModel* pi); - -private: - /** Search path for patch files. Colon delimited, as usual. */ - string _patch_path; - - /** Most recent patch folder shown in open dialog */ - string _patch_folder; - - uint32_t _audio_port_color; - uint32_t _control_port_color; - uint32_t _midi_port_color; - uint32_t _osc_port_color; -}; - - -} // namespace GUI -} // namespace Ingen - -#endif // CONFIG_H - - diff --git a/src/libs/gui/Configuration.hpp b/src/libs/gui/Configuration.hpp new file mode 100644 index 00000000..9f7cbb08 --- /dev/null +++ b/src/libs/gui/Configuration.hpp @@ -0,0 +1,80 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef CONFIG_H +#define CONFIG_H + +#include + +namespace Ingen { namespace Client { class PortModel; } } +using Ingen::Client::PortModel; +using std::string; + +struct Coord { double x; double y; }; + +namespace Ingen { +namespace GUI { + +class Controller; + + +/** Singleton state manager for the entire app. + * + * Stores settings like color preferences, search paths, etc. + * (ie any user-defined preferences to be stoed in the rc file). + * + * \ingroup GUI + */ +class Configuration +{ +public: + Configuration(); + ~Configuration(); + + void load_settings(string filename = ""); + void save_settings(string filename = ""); + + void apply_settings(); + + string patch_path() { return _patch_path; } + void patch_path(const string& path) { _patch_path = path; } + + const string& patch_folder() { return _patch_folder; } + void set_patch_folder(const string& f) { _patch_folder = f; } + + uint32_t get_port_color(const PortModel* pi); + +private: + /** Search path for patch files. Colon delimited, as usual. */ + string _patch_path; + + /** Most recent patch folder shown in open dialog */ + string _patch_folder; + + uint32_t _audio_port_color; + uint32_t _control_port_color; + uint32_t _midi_port_color; + uint32_t _osc_port_color; +}; + + +} // namespace GUI +} // namespace Ingen + +#endif // CONFIG_H + + diff --git a/src/libs/gui/ConnectWindow.cpp b/src/libs/gui/ConnectWindow.cpp index ae787c99..f643b059 100644 --- a/src/libs/gui/ConnectWindow.cpp +++ b/src/libs/gui/ConnectWindow.cpp @@ -21,23 +21,23 @@ #include #include #include -#include +#include #include "../../../../config/config.h" -#include "interface/ClientKey.h" -#include "interface/EngineInterface.h" -#include "engine/tuning.h" -#include "engine/Engine.h" -#include "engine/DirectResponder.h" -#include "engine/QueuedEngineInterface.h" -#include "client/OSCClientReceiver.h" -#include "client/OSCEngineSender.h" -#include "client/ThreadedSigClientInterface.h" -#include "client/Store.h" -#include "client/PatchModel.h" -#include "module/Module.h" -#include "App.h" -#include "WindowFactory.h" -#include "ConnectWindow.h" +#include "interface/ClientKey.hpp" +#include "interface/EngineInterface.hpp" +#include "engine/tuning.hpp" +#include "engine/Engine.hpp" +#include "engine/DirectResponder.hpp" +#include "engine/QueuedEngineInterface.hpp" +#include "client/OSCClientReceiver.hpp" +#include "client/OSCEngineSender.hpp" +#include "client/ThreadedSigClientInterface.hpp" +#include "client/Store.hpp" +#include "client/PatchModel.hpp" +#include "module/Module.hpp" +#include "App.hpp" +#include "WindowFactory.hpp" +#include "ConnectWindow.hpp" using Ingen::QueuedEngineInterface; using Ingen::Client::ThreadedSigClientInterface; diff --git a/src/libs/gui/ConnectWindow.h b/src/libs/gui/ConnectWindow.h deleted file mode 100644 index a52bbea2..00000000 --- a/src/libs/gui/ConnectWindow.h +++ /dev/null @@ -1,92 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef CONNECT_WINDOW_H -#define CONNECT_WINDOW_H - -#include -#include -#include -#include -#include "client/ThreadedSigClientInterface.h" -using Ingen::Client::SigClientInterface; - -namespace Ingen { class Engine; class QueuedEngineInterface; } - -namespace Ingen { -namespace GUI { - -class App; -class Controller; - - -/** The initially visible "Connect to engine" window. - * - * This handles actually connecting to the engine and making sure everything - * is ready before really launching the app (eg wait for the root patch). - * - * \ingroup GUI - */ -class ConnectWindow : public Gtk::Dialog -{ -public: - ConnectWindow(BaseObjectType* cobject, const Glib::RefPtr& xml); - - void set_connected_to(SharedPtr e=SharedPtr()); - void start(SharedPtr engine, SharedPtr interface); - void response_received(int32_t id, bool, string) { if ((id) == _ping_id) _attached = true; } - -private: - enum Mode { CONNECT_REMOTE, LAUNCH_REMOTE, INTERNAL }; - - void server_toggled(); - void launch_toggled(); - void internal_toggled(); - - void disconnect(); - void connect(); - void quit(); - - bool gtk_callback(); - - Mode _mode; - int32_t _ping_id; - bool _attached; - - int _connect_stage; - - SharedPtr _engine_module; - Ingen::Engine* (*_new_engine)(); - - Gtk::Image* _icon; - Gtk::ProgressBar* _progress_bar; - Gtk::Label* _progress_label; - Gtk::Entry* _url_entry; - Gtk::RadioButton* _server_radio; - Gtk::SpinButton* _port_spinbutton; - Gtk::RadioButton* _launch_radio; - Gtk::RadioButton* _internal_radio; - Gtk::Button* _disconnect_button; - Gtk::Button* _connect_button; - Gtk::Button* _quit_button; -}; - - -} // namespace GUI -} // namespace Ingen - -#endif // CONNECT_WINDOW_H diff --git a/src/libs/gui/ConnectWindow.hpp b/src/libs/gui/ConnectWindow.hpp new file mode 100644 index 00000000..5a0e67ad --- /dev/null +++ b/src/libs/gui/ConnectWindow.hpp @@ -0,0 +1,92 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef CONNECT_WINDOW_H +#define CONNECT_WINDOW_H + +#include +#include +#include +#include +#include "client/ThreadedSigClientInterface.hpp" +using Ingen::Client::SigClientInterface; + +namespace Ingen { class Engine; class QueuedEngineInterface; } + +namespace Ingen { +namespace GUI { + +class App; +class Controller; + + +/** The initially visible "Connect to engine" window. + * + * This handles actually connecting to the engine and making sure everything + * is ready before really launching the app (eg wait for the root patch). + * + * \ingroup GUI + */ +class ConnectWindow : public Gtk::Dialog +{ +public: + ConnectWindow(BaseObjectType* cobject, const Glib::RefPtr& xml); + + void set_connected_to(SharedPtr e=SharedPtr()); + void start(SharedPtr engine, SharedPtr interface); + void response_received(int32_t id, bool, string) { if ((id) == _ping_id) _attached = true; } + +private: + enum Mode { CONNECT_REMOTE, LAUNCH_REMOTE, INTERNAL }; + + void server_toggled(); + void launch_toggled(); + void internal_toggled(); + + void disconnect(); + void connect(); + void quit(); + + bool gtk_callback(); + + Mode _mode; + int32_t _ping_id; + bool _attached; + + int _connect_stage; + + SharedPtr _engine_module; + Ingen::Engine* (*_new_engine)(); + + Gtk::Image* _icon; + Gtk::ProgressBar* _progress_bar; + Gtk::Label* _progress_label; + Gtk::Entry* _url_entry; + Gtk::RadioButton* _server_radio; + Gtk::SpinButton* _port_spinbutton; + Gtk::RadioButton* _launch_radio; + Gtk::RadioButton* _internal_radio; + Gtk::Button* _disconnect_button; + Gtk::Button* _connect_button; + Gtk::Button* _quit_button; +}; + + +} // namespace GUI +} // namespace Ingen + +#endif // CONNECT_WINDOW_H diff --git a/src/libs/gui/Connection.h b/src/libs/gui/Connection.h deleted file mode 100644 index 75c988ac..00000000 --- a/src/libs/gui/Connection.h +++ /dev/null @@ -1,60 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef CONNECTION_H -#define CONNECTION_H - -#include -#include -#include -#include -#include "client/ConnectionModel.h" -using Ingen::Client::ConnectionModel; - -namespace Ingen { -namespace GUI { - - -/** A Connection in a Patch. - * - * \ingroup GUI - */ -class Connection : public FlowCanvas::Connection -{ -public: - Connection(boost::shared_ptr canvas, - boost::shared_ptr model, - boost::shared_ptr src, - boost::shared_ptr dst, - uint32_t color) - : FlowCanvas::Connection(canvas, src, dst, color) - , _connection_model(model) - {} - - virtual ~Connection() {} - - SharedPtr model() const { return _connection_model; } - -private: - SharedPtr _connection_model; -}; - - -} // namespace GUI -} // namespace Ingen - -#endif // CONNECTION_H diff --git a/src/libs/gui/Connection.hpp b/src/libs/gui/Connection.hpp new file mode 100644 index 00000000..b6ad070c --- /dev/null +++ b/src/libs/gui/Connection.hpp @@ -0,0 +1,60 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef CONNECTION_H +#define CONNECTION_H + +#include +#include +#include +#include +#include "client/ConnectionModel.hpp" +using Ingen::Client::ConnectionModel; + +namespace Ingen { +namespace GUI { + + +/** A Connection in a Patch. + * + * \ingroup GUI + */ +class Connection : public FlowCanvas::Connection +{ +public: + Connection(boost::shared_ptr canvas, + boost::shared_ptr model, + boost::shared_ptr src, + boost::shared_ptr dst, + uint32_t color) + : FlowCanvas::Connection(canvas, src, dst, color) + , _connection_model(model) + {} + + virtual ~Connection() {} + + SharedPtr model() const { return _connection_model; } + +private: + SharedPtr _connection_model; +}; + + +} // namespace GUI +} // namespace Ingen + +#endif // CONNECTION_H diff --git a/src/libs/gui/ControlGroups.cpp b/src/libs/gui/ControlGroups.cpp index 5098c3f8..d410f201 100644 --- a/src/libs/gui/ControlGroups.cpp +++ b/src/libs/gui/ControlGroups.cpp @@ -18,15 +18,15 @@ #include #include #include -#include "interface/EngineInterface.h" -#include "client/PluginModel.h" -#include "client/NodeModel.h" -#include "client/PortModel.h" -#include "ControlGroups.h" -#include "ControlPanel.h" -#include "PortPropertiesWindow.h" -#include "GladeFactory.h" -#include "App.h" +#include "interface/EngineInterface.hpp" +#include "client/PluginModel.hpp" +#include "client/NodeModel.hpp" +#include "client/PortModel.hpp" +#include "ControlGroups.hpp" +#include "ControlPanel.hpp" +#include "PortPropertiesWindow.hpp" +#include "GladeFactory.hpp" +#include "App.hpp" using namespace std; using namespace Ingen::Client; diff --git a/src/libs/gui/ControlGroups.h b/src/libs/gui/ControlGroups.h deleted file mode 100644 index 4c5c6f11..00000000 --- a/src/libs/gui/ControlGroups.h +++ /dev/null @@ -1,163 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef CONTROLGROUPS_H -#define CONTROLGROUPS_H - -#include -#include -#include -#include -#include "client/PortModel.h" -#include - -namespace Ingen { namespace Client { class PortModel; } } -using namespace Ingen::Client; - -namespace Ingen { -namespace GUI { - -class ControlPanel; -class PortPropertiesWindow; - - -/** A group of controls (for a single Port) in a NodeControlWindow. - * - * \ingroup GUI - */ -class ControlGroup : public Gtk::VBox -{ -public: - ControlGroup(BaseObjectType* cobject, const Glib::RefPtr& glade_xml); - virtual ~ControlGroup(); - - void init(ControlPanel* panel, SharedPtr pm); - - inline const SharedPtr port_model() const { return _port_model; } - -protected: - friend class PortPropertiesWindow; - - virtual void set_value(float value) = 0; - virtual void set_range(float min, float max) {} - - ControlPanel* _control_panel; - SharedPtr _port_model; - sigc::connection _control_connection; - bool _enable_signal; -}; - - -/** A slider for a continuous control. - * - * \ingroup GUI - */ -class SliderControlGroup : public ControlGroup -{ -public: - SliderControlGroup(BaseObjectType* cobject, const Glib::RefPtr& glade_xml); - void init(ControlPanel* panel, SharedPtr pm); - - void enable(); - void disable(); - - void set_min(float val); - void set_max(float val); - -private: - void set_name(const string& name); - - bool clicked(GdkEventButton* ev); - - void set_value(float value); - void set_range(float min, float max); - - void update_range(); - void update_value_from_slider(); - void update_value_from_spinner(); - - void menu_properties(); - - bool slider_pressed(GdkEvent* ev); - - bool _enabled; - - Gtk::Label* _name_label; - Gtk::SpinButton* _value_spinner; - Gtk::HScale* _slider; - - Gtk::Menu* _menu; - Gtk::MenuItem* _menu_properties; -}; - - -#if 0 - -/** A spinbutton for integer controls. - * - * \ingroup GUI - */ -class IntegerControlGroup : public ControlGroup -{ -public: - IntegerControlGroup(ControlPanel* panel, SharedPtr pm); - - void enable(); - void disable(); - -private: - void set_name(const string& name); - void set_value(float val); - - void update_value(); - - bool _enable_signal; - Gtk::Alignment _alignment; - Gtk::Label _name_label; - Gtk::SpinButton _spinner; -}; - - -/** A radio button for toggle controls. - * - * \ingroup GUI - */ -class ToggleControlGroup : public ControlGroup -{ -public: - ToggleControlGroup(ControlPanel* panel, SharedPtr pm); - - void enable(); - void disable(); - -private: - void set_name(const string& name); - void set_value(float val); - - void update_value(); - - bool _enable_signal; - Gtk::Alignment _alignment; - Gtk::Label _name_label; - Gtk::CheckButton _checkbutton; -}; -#endif - -} // namespace GUI -} // namespace Ingen - -#endif // CONTROLGROUPS_H diff --git a/src/libs/gui/ControlGroups.hpp b/src/libs/gui/ControlGroups.hpp new file mode 100644 index 00000000..232b1b56 --- /dev/null +++ b/src/libs/gui/ControlGroups.hpp @@ -0,0 +1,163 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef CONTROLGROUPS_H +#define CONTROLGROUPS_H + +#include +#include +#include +#include +#include "client/PortModel.hpp" +#include + +namespace Ingen { namespace Client { class PortModel; } } +using namespace Ingen::Client; + +namespace Ingen { +namespace GUI { + +class ControlPanel; +class PortPropertiesWindow; + + +/** A group of controls (for a single Port) in a NodeControlWindow. + * + * \ingroup GUI + */ +class ControlGroup : public Gtk::VBox +{ +public: + ControlGroup(BaseObjectType* cobject, const Glib::RefPtr& glade_xml); + virtual ~ControlGroup(); + + void init(ControlPanel* panel, SharedPtr pm); + + inline const SharedPtr port_model() const { return _port_model; } + +protected: + friend class PortPropertiesWindow; + + virtual void set_value(float value) = 0; + virtual void set_range(float min, float max) {} + + ControlPanel* _control_panel; + SharedPtr _port_model; + sigc::connection _control_connection; + bool _enable_signal; +}; + + +/** A slider for a continuous control. + * + * \ingroup GUI + */ +class SliderControlGroup : public ControlGroup +{ +public: + SliderControlGroup(BaseObjectType* cobject, const Glib::RefPtr& glade_xml); + void init(ControlPanel* panel, SharedPtr pm); + + void enable(); + void disable(); + + void set_min(float val); + void set_max(float val); + +private: + void set_name(const string& name); + + bool clicked(GdkEventButton* ev); + + void set_value(float value); + void set_range(float min, float max); + + void update_range(); + void update_value_from_slider(); + void update_value_from_spinner(); + + void menu_properties(); + + bool slider_pressed(GdkEvent* ev); + + bool _enabled; + + Gtk::Label* _name_label; + Gtk::SpinButton* _value_spinner; + Gtk::HScale* _slider; + + Gtk::Menu* _menu; + Gtk::MenuItem* _menu_properties; +}; + + +#if 0 + +/** A spinbutton for integer controls. + * + * \ingroup GUI + */ +class IntegerControlGroup : public ControlGroup +{ +public: + IntegerControlGroup(ControlPanel* panel, SharedPtr pm); + + void enable(); + void disable(); + +private: + void set_name(const string& name); + void set_value(float val); + + void update_value(); + + bool _enable_signal; + Gtk::Alignment _alignment; + Gtk::Label _name_label; + Gtk::SpinButton _spinner; +}; + + +/** A radio button for toggle controls. + * + * \ingroup GUI + */ +class ToggleControlGroup : public ControlGroup +{ +public: + ToggleControlGroup(ControlPanel* panel, SharedPtr pm); + + void enable(); + void disable(); + +private: + void set_name(const string& name); + void set_value(float val); + + void update_value(); + + bool _enable_signal; + Gtk::Alignment _alignment; + Gtk::Label _name_label; + Gtk::CheckButton _checkbutton; +}; +#endif + +} // namespace GUI +} // namespace Ingen + +#endif // CONTROLGROUPS_H diff --git a/src/libs/gui/ControlPanel.cpp b/src/libs/gui/ControlPanel.cpp index 70ab273e..0fb3dfb8 100644 --- a/src/libs/gui/ControlPanel.cpp +++ b/src/libs/gui/ControlPanel.cpp @@ -15,15 +15,15 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "interface/EngineInterface.h" -#include "client/PatchModel.h" -#include "client/NodeModel.h" -#include "client/PortModel.h" -#include "client/PluginModel.h" -#include "App.h" -#include "ControlPanel.h" -#include "ControlGroups.h" -#include "GladeFactory.h" +#include "interface/EngineInterface.hpp" +#include "client/PatchModel.hpp" +#include "client/NodeModel.hpp" +#include "client/PortModel.hpp" +#include "client/PluginModel.hpp" +#include "App.hpp" +#include "ControlPanel.hpp" +#include "ControlGroups.hpp" +#include "GladeFactory.hpp" namespace Ingen { namespace GUI { diff --git a/src/libs/gui/ControlPanel.h b/src/libs/gui/ControlPanel.h deleted file mode 100644 index 230b9b65..00000000 --- a/src/libs/gui/ControlPanel.h +++ /dev/null @@ -1,94 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef CONTROLPANEL_H -#define CONTROLPANEL_H - -#include -#include -#include -#include // for pair<> -#include -#include -#include -#include -#include -#include "ControlGroups.h" - - -using std::vector; using std::string; using std::pair; -using std::cerr; using std::cout; using std::endl; - -namespace Ingen { namespace Client { - class PortModel; - class NodeModel; -} } -using namespace Ingen::Client; - -namespace Ingen { -namespace GUI { - - -/** A group of controls for a node (or patch). - * - * Used by both NodeControlWindow and the main window (for patch controls). - * - * \ingroup GUI - */ -class ControlPanel : public Gtk::HBox { -public: - ControlPanel(BaseObjectType* cobject, const Glib::RefPtr& glade_xml); - virtual ~ControlPanel(); - - void init(SharedPtr node, size_t poly); - - ControlGroup* find_port(const Path& path) const; - - void add_port(SharedPtr port); - void remove_port(const Path& path); - - void enable_port(const Path& path); - void disable_port(const Path& path); - - size_t num_controls() const { return _controls.size(); } - pair ideal_size() const { return _ideal_size; } - - // Callback for ControlGroup - void value_changed(SharedPtr port_path, float val); - -private: - void all_voices_selected(); - void specific_voice_selected(); - void voice_selected(); - - bool _callback_enabled; - - pair _ideal_size; - - vector _controls; - Gtk::VBox* _control_box; - Gtk::Box* _voice_control_box; - Gtk::RadioButton* _all_voices_radio; - Gtk::RadioButton* _specific_voice_radio; - Gtk::SpinButton* _voice_spinbutton; -}; - - -} // namespace GUI -} // namespace Ingen - -#endif // CONTROLPANEL_H diff --git a/src/libs/gui/ControlPanel.hpp b/src/libs/gui/ControlPanel.hpp new file mode 100644 index 00000000..70ae4e95 --- /dev/null +++ b/src/libs/gui/ControlPanel.hpp @@ -0,0 +1,94 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef CONTROLPANEL_H +#define CONTROLPANEL_H + +#include +#include +#include +#include // for pair<> +#include +#include +#include +#include +#include +#include "ControlGroups.hpp" + + +using std::vector; using std::string; using std::pair; +using std::cerr; using std::cout; using std::endl; + +namespace Ingen { namespace Client { + class PortModel; + class NodeModel; +} } +using namespace Ingen::Client; + +namespace Ingen { +namespace GUI { + + +/** A group of controls for a node (or patch). + * + * Used by both NodeControlWindow and the main window (for patch controls). + * + * \ingroup GUI + */ +class ControlPanel : public Gtk::HBox { +public: + ControlPanel(BaseObjectType* cobject, const Glib::RefPtr& glade_xml); + virtual ~ControlPanel(); + + void init(SharedPtr node, size_t poly); + + ControlGroup* find_port(const Path& path) const; + + void add_port(SharedPtr port); + void remove_port(const Path& path); + + void enable_port(const Path& path); + void disable_port(const Path& path); + + size_t num_controls() const { return _controls.size(); } + pair ideal_size() const { return _ideal_size; } + + // Callback for ControlGroup + void value_changed(SharedPtr port_path, float val); + +private: + void all_voices_selected(); + void specific_voice_selected(); + void voice_selected(); + + bool _callback_enabled; + + pair _ideal_size; + + vector _controls; + Gtk::VBox* _control_box; + Gtk::Box* _voice_control_box; + Gtk::RadioButton* _all_voices_radio; + Gtk::RadioButton* _specific_voice_radio; + Gtk::SpinButton* _voice_spinbutton; +}; + + +} // namespace GUI +} // namespace Ingen + +#endif // CONTROLPANEL_H diff --git a/src/libs/gui/DSSIController.cpp b/src/libs/gui/DSSIController.cpp index f245d61f..b5537f82 100644 --- a/src/libs/gui/DSSIController.cpp +++ b/src/libs/gui/DSSIController.cpp @@ -15,16 +15,16 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "DSSIController.h" +#include "DSSIController.hpp" #include #include #include #include #include -#include "interface/EngineInterface.h" -#include "client/NodeModel.h" -#include "App.h" -#include "DSSIModule.h" +#include "interface/EngineInterface.hpp" +#include "client/NodeModel.hpp" +#include "App.hpp" +#include "DSSIModule.hpp" namespace Ingen { namespace GUI { diff --git a/src/libs/gui/DSSIController.h b/src/libs/gui/DSSIController.h deleted file mode 100644 index fdb0c1c0..00000000 --- a/src/libs/gui/DSSIController.h +++ /dev/null @@ -1,77 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef DSSICONTROLLER_H -#define DSSICONTROLLER_H - -#include -#include -#include -#include "client/NodeModel.h" - -using std::string; -using namespace Ingen::Client; - -namespace Ingen { namespace Client { - class MetadataModel; - class NodeModel; - class PortModel; -} } - -namespace Ingen { -namespace GUI { - -class NodeControlWindow; -class NodePropertiesWindow; - -/* Controller for a DSSI node. - * - * FIXME: legacy cruft. move this code to the appropriate places and nuke - * this class. - * - * \ingroup GUI - */ -class DSSIController -{ -public: - DSSIController(SharedPtr model); - - virtual ~DSSIController() {} - - void show_gui(); - bool attempt_to_show_gui(); - void program_add(int bank, int program, const string& name); - void program_remove(int bank, int program); - - void send_program_change(int bank, int program); - - void show_menu(GdkEventButton* event); - -private: - void update_program_menu(); - - Gtk::Menu _program_menu; - Glib::RefPtr _program_menu_item; - - bool _banks_dirty; -}; - - -} // namespace GUI -} // namespace Ingen - -#endif // DSSICONTROLLER_H diff --git a/src/libs/gui/DSSIController.hpp b/src/libs/gui/DSSIController.hpp new file mode 100644 index 00000000..0d7073ea --- /dev/null +++ b/src/libs/gui/DSSIController.hpp @@ -0,0 +1,77 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef DSSICONTROLLER_H +#define DSSICONTROLLER_H + +#include +#include +#include +#include "client/NodeModel.hpp" + +using std::string; +using namespace Ingen::Client; + +namespace Ingen { namespace Client { + class MetadataModel; + class NodeModel; + class PortModel; +} } + +namespace Ingen { +namespace GUI { + +class NodeControlWindow; +class NodePropertiesWindow; + +/* Controller for a DSSI node. + * + * FIXME: legacy cruft. move this code to the appropriate places and nuke + * this class. + * + * \ingroup GUI + */ +class DSSIController +{ +public: + DSSIController(SharedPtr model); + + virtual ~DSSIController() {} + + void show_gui(); + bool attempt_to_show_gui(); + void program_add(int bank, int program, const string& name); + void program_remove(int bank, int program); + + void send_program_change(int bank, int program); + + void show_menu(GdkEventButton* event); + +private: + void update_program_menu(); + + Gtk::Menu _program_menu; + Glib::RefPtr _program_menu_item; + + bool _banks_dirty; +}; + + +} // namespace GUI +} // namespace Ingen + +#endif // DSSICONTROLLER_H diff --git a/src/libs/gui/DSSIModule.cpp b/src/libs/gui/DSSIModule.cpp index 57cbd03f..84058100 100644 --- a/src/libs/gui/DSSIModule.cpp +++ b/src/libs/gui/DSSIModule.cpp @@ -15,8 +15,8 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "DSSIModule.h" -#include "DSSIController.h" +#include "DSSIModule.hpp" +#include "DSSIController.hpp" namespace Ingen { namespace GUI { diff --git a/src/libs/gui/DSSIModule.h b/src/libs/gui/DSSIModule.h deleted file mode 100644 index 1c041900..00000000 --- a/src/libs/gui/DSSIModule.h +++ /dev/null @@ -1,46 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef DSSIMODULE_H -#define DSSIMODULE_H - -#include "NodeModule.h" - -namespace Ingen { -namespace GUI { - -class DSSIController; - -/* Module for a DSSI node. - * - * \ingroup GUI - */ -class DSSIModule : public NodeModule -{ -public: - DSSIModule(boost::shared_ptr canvas, SharedPtr node); - virtual ~DSSIModule() {} - - void on_double_click(GdkEventButton* ev); -}; - - -} // namespace GUI -} // namespace Ingen - -#endif // DSSIMODULE_H - diff --git a/src/libs/gui/DSSIModule.hpp b/src/libs/gui/DSSIModule.hpp new file mode 100644 index 00000000..76824bdc --- /dev/null +++ b/src/libs/gui/DSSIModule.hpp @@ -0,0 +1,46 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef DSSIMODULE_H +#define DSSIMODULE_H + +#include "NodeModule.hpp" + +namespace Ingen { +namespace GUI { + +class DSSIController; + +/* Module for a DSSI node. + * + * \ingroup GUI + */ +class DSSIModule : public NodeModule +{ +public: + DSSIModule(boost::shared_ptr canvas, SharedPtr node); + virtual ~DSSIModule() {} + + void on_double_click(GdkEventButton* ev); +}; + + +} // namespace GUI +} // namespace Ingen + +#endif // DSSIMODULE_H + diff --git a/src/libs/gui/GladeFactory.cpp b/src/libs/gui/GladeFactory.cpp index 8b1f1e1f..de23a0b7 100644 --- a/src/libs/gui/GladeFactory.cpp +++ b/src/libs/gui/GladeFactory.cpp @@ -15,7 +15,7 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "GladeFactory.h" +#include "GladeFactory.hpp" #include #include using std::cout; using std::cerr; using std::endl; diff --git a/src/libs/gui/GladeFactory.h b/src/libs/gui/GladeFactory.h deleted file mode 100644 index 0a2e88fc..00000000 --- a/src/libs/gui/GladeFactory.h +++ /dev/null @@ -1,51 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef GLADEFACTORY_H -#define GLADEFACTORY_H - -#include -#include - -using std::string; - -namespace Ingen { -namespace GUI { - - -/** Creates glade references, so various objects can create widgets. - * Purely static. - * - * \ingroup GUI - */ -class GladeFactory { -public: - static Glib::RefPtr - new_glade_reference(const string& toplevel_widget = ""); - -private: - GladeFactory() {} - - static void find_glade_file(); - static Glib::ustring glade_filename; -}; - - -} // namespace GUI -} // namespace Ingen - -#endif // GLADEFACTORY_H diff --git a/src/libs/gui/GladeFactory.hpp b/src/libs/gui/GladeFactory.hpp new file mode 100644 index 00000000..0a2e88fc --- /dev/null +++ b/src/libs/gui/GladeFactory.hpp @@ -0,0 +1,51 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef GLADEFACTORY_H +#define GLADEFACTORY_H + +#include +#include + +using std::string; + +namespace Ingen { +namespace GUI { + + +/** Creates glade references, so various objects can create widgets. + * Purely static. + * + * \ingroup GUI + */ +class GladeFactory { +public: + static Glib::RefPtr + new_glade_reference(const string& toplevel_widget = ""); + +private: + GladeFactory() {} + + static void find_glade_file(); + static Glib::ustring glade_filename; +}; + + +} // namespace GUI +} // namespace Ingen + +#endif // GLADEFACTORY_H diff --git a/src/libs/gui/LashController.cpp b/src/libs/gui/LashController.cpp index b62ec818..8f288766 100644 --- a/src/libs/gui/LashController.cpp +++ b/src/libs/gui/LashController.cpp @@ -15,15 +15,15 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "LashController.h" -#include "config.h" +#include "LashController.hpp" +#include "../../../../config/config.hpp" #include #include #include #include #include -#include "App.h" -#include "PatchModel.h" +#include "App.hpp" +#include "PatchModel.hpp" using std::cerr; using std::cout; using std::endl; using std::string; diff --git a/src/libs/gui/LashController.h b/src/libs/gui/LashController.h deleted file mode 100644 index f47eb5e9..00000000 --- a/src/libs/gui/LashController.h +++ /dev/null @@ -1,56 +0,0 @@ -/* This file is part of IngenGtk. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef LASHCONTROLLER_H -#define LASHCONTROLLER_H - -#include -#include -using std::string; - -namespace Ingen { -namespace GUI { - -class App; - -/* Old and unused LASH controller. - * - * \ingroup GUI - */ -class LashController -{ -public: - LashController(lash_args_t* args); - ~LashController(); - - bool enabled() { return lash_enabled(_client); } - void process_events(); - -private: - void save(const string& dir); - - lash_client_t* _client; - - void handle_event(lash_event_t* conf); - void handle_config(lash_config_t* conf); -}; - - -} // namespace GUI -} // namespace Ingen - -#endif // LASHCONTROLLER_H diff --git a/src/libs/gui/LashController.hpp b/src/libs/gui/LashController.hpp new file mode 100644 index 00000000..f47eb5e9 --- /dev/null +++ b/src/libs/gui/LashController.hpp @@ -0,0 +1,56 @@ +/* This file is part of IngenGtk. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef LASHCONTROLLER_H +#define LASHCONTROLLER_H + +#include +#include +using std::string; + +namespace Ingen { +namespace GUI { + +class App; + +/* Old and unused LASH controller. + * + * \ingroup GUI + */ +class LashController +{ +public: + LashController(lash_args_t* args); + ~LashController(); + + bool enabled() { return lash_enabled(_client); } + void process_events(); + +private: + void save(const string& dir); + + lash_client_t* _client; + + void handle_event(lash_event_t* conf); + void handle_config(lash_config_t* conf); +}; + + +} // namespace GUI +} // namespace Ingen + +#endif // LASHCONTROLLER_H diff --git a/src/libs/gui/LoadPatchWindow.cpp b/src/libs/gui/LoadPatchWindow.cpp index faaa519a..d849c256 100644 --- a/src/libs/gui/LoadPatchWindow.cpp +++ b/src/libs/gui/LoadPatchWindow.cpp @@ -15,15 +15,15 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "LoadPatchWindow.h" +#include "LoadPatchWindow.hpp" #include #include #include -#include "interface/EngineInterface.h" -#include "client/PatchModel.h" -#include "App.h" -#include "Configuration.h" -#include "ThreadedLoader.h" +#include "interface/EngineInterface.hpp" +#include "client/PatchModel.hpp" +#include "App.hpp" +#include "Configuration.hpp" +#include "ThreadedLoader.hpp" using namespace Ingen::Serialisation; using boost::optional; diff --git a/src/libs/gui/LoadPatchWindow.h b/src/libs/gui/LoadPatchWindow.h deleted file mode 100644 index 47f0bc8f..00000000 --- a/src/libs/gui/LoadPatchWindow.h +++ /dev/null @@ -1,81 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef LOADPATCHWINDOW_H -#define LOADPATCHWINDOW_H - -#include -#include -#include -#include "client/PluginModel.h" -#include "client/PatchModel.h" -using Ingen::Client::PatchModel; -using Ingen::Client::MetadataMap; - -namespace Ingen { -namespace GUI { - - -/** 'Load Patch' window. - * - * Loaded by glade as a derived object. Used for both "Import" and "Load" - * (e.g. Replace, clear-then-import) operations (the radio button state - * should be changed with the provided methods before presenting). - * - * This is not for loading subpatches. See @a LoadSubpatchWindow for that. - * - * \ingroup GUI - */ -class LoadPatchWindow : public Gtk::FileChooserDialog -{ -public: - LoadPatchWindow(BaseObjectType* cobject, const Glib::RefPtr& xml); - - void set_patch(SharedPtr patch); - - void set_replace() { _replace = true; } - void set_merge() { _replace = false; } - - void present(SharedPtr patch, MetadataMap data); - -protected: - void on_show(); - -private: - void poly_from_file_selected(); - void poly_from_user_selected(); - void ok_clicked(); - void cancel_clicked(); - - MetadataMap _initial_data; - - SharedPtr _patch; - bool _replace; - - Gtk::RadioButton* _poly_from_current_radio; - Gtk::RadioButton* _poly_from_file_radio; - Gtk::RadioButton* _poly_from_user_radio; - Gtk::SpinButton* _poly_spinbutton; - Gtk::Button* _ok_button; - Gtk::Button* _cancel_button; -}; - - -} // namespace GUI -} // namespace Ingen - -#endif // LOADPATCHWINDOW_H diff --git a/src/libs/gui/LoadPatchWindow.hpp b/src/libs/gui/LoadPatchWindow.hpp new file mode 100644 index 00000000..3524ce16 --- /dev/null +++ b/src/libs/gui/LoadPatchWindow.hpp @@ -0,0 +1,81 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef LOADPATCHWINDOW_H +#define LOADPATCHWINDOW_H + +#include +#include +#include +#include "client/PluginModel.hpp" +#include "client/PatchModel.hpp" +using Ingen::Client::PatchModel; +using Ingen::Client::MetadataMap; + +namespace Ingen { +namespace GUI { + + +/** 'Load Patch' window. + * + * Loaded by glade as a derived object. Used for both "Import" and "Load" + * (e.g. Replace, clear-then-import) operations (the radio button state + * should be changed with the provided methods before presenting). + * + * This is not for loading subpatches. See @a LoadSubpatchWindow for that. + * + * \ingroup GUI + */ +class LoadPatchWindow : public Gtk::FileChooserDialog +{ +public: + LoadPatchWindow(BaseObjectType* cobject, const Glib::RefPtr& xml); + + void set_patch(SharedPtr patch); + + void set_replace() { _replace = true; } + void set_merge() { _replace = false; } + + void present(SharedPtr patch, MetadataMap data); + +protected: + void on_show(); + +private: + void poly_from_file_selected(); + void poly_from_user_selected(); + void ok_clicked(); + void cancel_clicked(); + + MetadataMap _initial_data; + + SharedPtr _patch; + bool _replace; + + Gtk::RadioButton* _poly_from_current_radio; + Gtk::RadioButton* _poly_from_file_radio; + Gtk::RadioButton* _poly_from_user_radio; + Gtk::SpinButton* _poly_spinbutton; + Gtk::Button* _ok_button; + Gtk::Button* _cancel_button; +}; + + +} // namespace GUI +} // namespace Ingen + +#endif // LOADPATCHWINDOW_H diff --git a/src/libs/gui/LoadPluginWindow.cpp b/src/libs/gui/LoadPluginWindow.cpp index a4b24e5f..cc7c7e71 100644 --- a/src/libs/gui/LoadPluginWindow.cpp +++ b/src/libs/gui/LoadPluginWindow.cpp @@ -19,15 +19,15 @@ #include #include #include -#include "interface/EngineInterface.h" -#include "client/NodeModel.h" -#include "client/PatchModel.h" -#include "client/Store.h" -#include "App.h" -#include "LoadPluginWindow.h" -#include "PatchWindow.h" -#include "PatchView.h" -#include "PatchCanvas.h" +#include "interface/EngineInterface.hpp" +#include "client/NodeModel.hpp" +#include "client/PatchModel.hpp" +#include "client/Store.hpp" +#include "App.hpp" +#include "LoadPluginWindow.hpp" +#include "PatchWindow.hpp" +#include "PatchView.hpp" +#include "PatchCanvas.hpp" using std::cout; using std::cerr; using std::endl; diff --git a/src/libs/gui/LoadPluginWindow.h b/src/libs/gui/LoadPluginWindow.h deleted file mode 100644 index 1b39d314..00000000 --- a/src/libs/gui/LoadPluginWindow.h +++ /dev/null @@ -1,151 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - - -#ifndef LOADPLUGINWINDOW_H -#define LOADPLUGINWINDOW_H - -#include -#include -#include -#include -#include -#include "client/PatchModel.h" -#include "client/PluginModel.h" -using Ingen::Client::PluginModel; -using Ingen::Client::PatchModel; -using Ingen::Client::MetadataMap; - -namespace Ingen { -namespace GUI { - - -// Gtkmm _really_ needs to add some helper to abstract away this stupid nonsense - -/** Columns for the plugin list in the load plugin window. - * - * \ingroup GUI - */ -class ModelColumns : public Gtk::TreeModel::ColumnRecord -{ -public: - ModelColumns() { - add(_col_name); - add(_col_type); - add(_col_uri); - add(_col_label); - //add(_col_library); - //add(_col_label); - add(_col_plugin_model); - } - - Gtk::TreeModelColumn _col_name; - Gtk::TreeModelColumn _col_type; - Gtk::TreeModelColumn _col_uri; - - // Not displayed: - Gtk::TreeModelColumn _col_label; - Gtk::TreeModelColumn > _col_plugin_model; -}; - - -/** Column for the criteria combo box in the load plugin window. - * - * \ingroup GUI - */ -class CriteriaColumns : public Gtk::TreeModel::ColumnRecord -{ -public: - enum Criteria { NAME, TYPE, URI, }; - - CriteriaColumns() { add(_col_label); add(_col_criteria); } - - Gtk::TreeModelColumn _col_label; - Gtk::TreeModelColumn _col_criteria; -}; - - -/** 'Load Plugin' window. - * - * Loaded by glade as a derived object. - * - * \ingroup GUI - */ -class LoadPluginWindow : public Gtk::Window -{ -public: - LoadPluginWindow(BaseObjectType* cobject, const Glib::RefPtr& xml); - - void set_patch(SharedPtr patch); - void set_plugin_list(const std::map >& m); - - void add_plugin(SharedPtr plugin); - bool has_shown() const { return _has_shown; } - - void present(SharedPtr patch, MetadataMap data); - -protected: - void on_show(); - bool on_key_press_event(GdkEventKey* event); - -private: - void add_clicked(); - //void close_clicked(); - //void ok_clicked(); - void filter_changed(); - void clear_clicked(); - void name_changed(); - - int plugin_compare(const Gtk::TreeModel::iterator& a, - const Gtk::TreeModel::iterator& b); - - void plugin_activated(const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* col); - void plugin_selection_changed(); - string generate_module_name(int offset = 0); - - MetadataMap _initial_data; - - SharedPtr _patch; - - bool _has_shown; // plugin list only populated on show to speed patch window creation - - Glib::RefPtr _plugins_liststore; - ModelColumns _plugins_columns; - - Glib::RefPtr _criteria_liststore; - CriteriaColumns _criteria_columns; - - Glib::RefPtr _selection; - - int _plugin_name_offset; // see comments for generate_plugin_name - - Gtk::TreeView* _plugins_treeview; - Gtk::CheckButton* _polyphonic_checkbutton; - Gtk::Entry* _node_name_entry; - Gtk::Button* _clear_button; - Gtk::Button* _add_button; - //Gtk::Button* _close_button; - //Gtk::Button* _ok_button; - Gtk::ComboBox* _filter_combo; - Gtk::Entry* _search_entry; -}; - - -} // namespace GUI -} // namespace Ingen - -#endif // LOADPLUGINWINDOW_H diff --git a/src/libs/gui/LoadPluginWindow.hpp b/src/libs/gui/LoadPluginWindow.hpp new file mode 100644 index 00000000..ce8a331b --- /dev/null +++ b/src/libs/gui/LoadPluginWindow.hpp @@ -0,0 +1,151 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + +#ifndef LOADPLUGINWINDOW_H +#define LOADPLUGINWINDOW_H + +#include +#include +#include +#include +#include +#include "client/PatchModel.hpp" +#include "client/PluginModel.hpp" +using Ingen::Client::PluginModel; +using Ingen::Client::PatchModel; +using Ingen::Client::MetadataMap; + +namespace Ingen { +namespace GUI { + + +// Gtkmm _really_ needs to add some helper to abstract away this stupid nonsense + +/** Columns for the plugin list in the load plugin window. + * + * \ingroup GUI + */ +class ModelColumns : public Gtk::TreeModel::ColumnRecord +{ +public: + ModelColumns() { + add(_col_name); + add(_col_type); + add(_col_uri); + add(_col_label); + //add(_col_library); + //add(_col_label); + add(_col_plugin_model); + } + + Gtk::TreeModelColumn _col_name; + Gtk::TreeModelColumn _col_type; + Gtk::TreeModelColumn _col_uri; + + // Not displayed: + Gtk::TreeModelColumn _col_label; + Gtk::TreeModelColumn > _col_plugin_model; +}; + + +/** Column for the criteria combo box in the load plugin window. + * + * \ingroup GUI + */ +class CriteriaColumns : public Gtk::TreeModel::ColumnRecord +{ +public: + enum Criteria { NAME, TYPE, URI, }; + + CriteriaColumns() { add(_col_label); add(_col_criteria); } + + Gtk::TreeModelColumn _col_label; + Gtk::TreeModelColumn _col_criteria; +}; + + +/** 'Load Plugin' window. + * + * Loaded by glade as a derived object. + * + * \ingroup GUI + */ +class LoadPluginWindow : public Gtk::Window +{ +public: + LoadPluginWindow(BaseObjectType* cobject, const Glib::RefPtr& xml); + + void set_patch(SharedPtr patch); + void set_plugin_list(const std::map >& m); + + void add_plugin(SharedPtr plugin); + bool has_shown() const { return _has_shown; } + + void present(SharedPtr patch, MetadataMap data); + +protected: + void on_show(); + bool on_key_press_event(GdkEventKey* event); + +private: + void add_clicked(); + //void close_clicked(); + //void ok_clicked(); + void filter_changed(); + void clear_clicked(); + void name_changed(); + + int plugin_compare(const Gtk::TreeModel::iterator& a, + const Gtk::TreeModel::iterator& b); + + void plugin_activated(const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* col); + void plugin_selection_changed(); + string generate_module_name(int offset = 0); + + MetadataMap _initial_data; + + SharedPtr _patch; + + bool _has_shown; // plugin list only populated on show to speed patch window creation + + Glib::RefPtr _plugins_liststore; + ModelColumns _plugins_columns; + + Glib::RefPtr _criteria_liststore; + CriteriaColumns _criteria_columns; + + Glib::RefPtr _selection; + + int _plugin_name_offset; // see comments for generate_plugin_name + + Gtk::TreeView* _plugins_treeview; + Gtk::CheckButton* _polyphonic_checkbutton; + Gtk::Entry* _node_name_entry; + Gtk::Button* _clear_button; + Gtk::Button* _add_button; + //Gtk::Button* _close_button; + //Gtk::Button* _ok_button; + Gtk::ComboBox* _filter_combo; + Gtk::Entry* _search_entry; +}; + + +} // namespace GUI +} // namespace Ingen + +#endif // LOADPLUGINWINDOW_H diff --git a/src/libs/gui/LoadRemotePatchWindow.cpp b/src/libs/gui/LoadRemotePatchWindow.cpp index 534a6949..096f6d61 100644 --- a/src/libs/gui/LoadRemotePatchWindow.cpp +++ b/src/libs/gui/LoadRemotePatchWindow.cpp @@ -15,16 +15,16 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "LoadRemotePatchWindow.h" +#include "LoadRemotePatchWindow.hpp" #include #include #include -#include -#include "interface/EngineInterface.h" -#include "client/PatchModel.h" -#include "App.h" -#include "Configuration.h" -#include "ThreadedLoader.h" +#include +#include "interface/EngineInterface.hpp" +#include "client/PatchModel.hpp" +#include "App.hpp" +#include "Configuration.hpp" +#include "ThreadedLoader.hpp" using boost::optional; using namespace Raul; diff --git a/src/libs/gui/LoadRemotePatchWindow.h b/src/libs/gui/LoadRemotePatchWindow.h deleted file mode 100644 index bbb3d93e..00000000 --- a/src/libs/gui/LoadRemotePatchWindow.h +++ /dev/null @@ -1,93 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef LOADREMOTEPATCHWINDOW_H -#define LOADREMOTEPATCHWINDOW_H - -#include -#include -#include -#include "client/PatchModel.h" -#include "client/PluginModel.h" -using Ingen::Client::PatchModel; -using Ingen::Client::MetadataMap; - -namespace Ingen { -namespace GUI { - - -/** Columns for the remote patch list. - * - * \ingroup GUI - */ -class PatchColumns : public Gtk::TreeModel::ColumnRecord -{ -public: - PatchColumns() { - add(_col_name); - add(_col_uri); - } - - Gtk::TreeModelColumn _col_name; - Gtk::TreeModelColumn _col_uri; -}; - - - -/* Load remote patch ("import location") dialog. - * - * \ingroup GUI - */ -class LoadRemotePatchWindow : public Gtk::Dialog -{ -public: - LoadRemotePatchWindow(BaseObjectType* cobject, const Glib::RefPtr& xml); - - void set_patch(SharedPtr patch); - - void set_replace() { _replace = true; } - void set_merge() { _replace = false; } - - void present(SharedPtr patch, MetadataMap data); - -private: - void patch_activated(const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* col); - void patch_selected(); - void uri_changed(); - void open_clicked(); - void cancel_clicked(); - - MetadataMap _initial_data; - - SharedPtr _patch; - bool _replace; - - Glib::RefPtr _selection; - Glib::RefPtr _liststore; - PatchColumns _columns; - - Gtk::TreeView* _treeview; - Gtk::Entry* _uri_entry; - Gtk::Button* _open_button; - Gtk::Button* _cancel_button; -}; - - -} // namespace GUI -} // namespace Ingen - -#endif // LOADREMOTEPATCHWINDOW_H diff --git a/src/libs/gui/LoadRemotePatchWindow.hpp b/src/libs/gui/LoadRemotePatchWindow.hpp new file mode 100644 index 00000000..2afef975 --- /dev/null +++ b/src/libs/gui/LoadRemotePatchWindow.hpp @@ -0,0 +1,93 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef LOADREMOTEPATCHWINDOW_H +#define LOADREMOTEPATCHWINDOW_H + +#include +#include +#include +#include "client/PatchModel.hpp" +#include "client/PluginModel.hpp" +using Ingen::Client::PatchModel; +using Ingen::Client::MetadataMap; + +namespace Ingen { +namespace GUI { + + +/** Columns for the remote patch list. + * + * \ingroup GUI + */ +class PatchColumns : public Gtk::TreeModel::ColumnRecord +{ +public: + PatchColumns() { + add(_col_name); + add(_col_uri); + } + + Gtk::TreeModelColumn _col_name; + Gtk::TreeModelColumn _col_uri; +}; + + + +/* Load remote patch ("import location") dialog. + * + * \ingroup GUI + */ +class LoadRemotePatchWindow : public Gtk::Dialog +{ +public: + LoadRemotePatchWindow(BaseObjectType* cobject, const Glib::RefPtr& xml); + + void set_patch(SharedPtr patch); + + void set_replace() { _replace = true; } + void set_merge() { _replace = false; } + + void present(SharedPtr patch, MetadataMap data); + +private: + void patch_activated(const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* col); + void patch_selected(); + void uri_changed(); + void open_clicked(); + void cancel_clicked(); + + MetadataMap _initial_data; + + SharedPtr _patch; + bool _replace; + + Glib::RefPtr _selection; + Glib::RefPtr _liststore; + PatchColumns _columns; + + Gtk::TreeView* _treeview; + Gtk::Entry* _uri_entry; + Gtk::Button* _open_button; + Gtk::Button* _cancel_button; +}; + + +} // namespace GUI +} // namespace Ingen + +#endif // LOADREMOTEPATCHWINDOW_H diff --git a/src/libs/gui/LoadSubpatchWindow.cpp b/src/libs/gui/LoadSubpatchWindow.cpp index 57fa9adc..a2591b86 100644 --- a/src/libs/gui/LoadSubpatchWindow.cpp +++ b/src/libs/gui/LoadSubpatchWindow.cpp @@ -19,14 +19,14 @@ #include #include #include -#include "interface/EngineInterface.h" -#include "client/NodeModel.h" -#include "client/PatchModel.h" -#include "App.h" -#include "LoadSubpatchWindow.h" -#include "PatchView.h" -#include "Configuration.h" -#include "ThreadedLoader.h" +#include "interface/EngineInterface.hpp" +#include "client/NodeModel.hpp" +#include "client/PatchModel.hpp" +#include "App.hpp" +#include "LoadSubpatchWindow.hpp" +#include "PatchView.hpp" +#include "Configuration.hpp" +#include "ThreadedLoader.hpp" using boost::optional; namespace Ingen { diff --git a/src/libs/gui/LoadSubpatchWindow.h b/src/libs/gui/LoadSubpatchWindow.h deleted file mode 100644 index 08a6f7db..00000000 --- a/src/libs/gui/LoadSubpatchWindow.h +++ /dev/null @@ -1,79 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef LOADSUBPATCHWINDOW_H -#define LOADSUBPATCHWINDOW_H - -#include -#include -#include -#include "client/PatchModel.h" -#include "client/PluginModel.h" -using Ingen::Client::PatchModel; -using Ingen::Client::MetadataMap; - -namespace Ingen { -namespace GUI { - - -/** 'Add Subpatch' window. - * - * Loaded by glade as a derived object. - * - * \ingroup GUI - */ -class LoadSubpatchWindow : public Gtk::FileChooserDialog -{ -public: - LoadSubpatchWindow(BaseObjectType* cobject, const Glib::RefPtr& xml); - - void set_patch(SharedPtr patch); - - void present(SharedPtr patch, MetadataMap data); - -protected: - void on_show(); - -private: - void disable_name_entry(); - void enable_name_entry(); - void disable_poly_spinner(); - void enable_poly_spinner(); - - void ok_clicked(); - void cancel_clicked(); - - MetadataMap _initial_data; - - SharedPtr _patch; - - Gtk::RadioButton* _name_from_file_radio; - Gtk::RadioButton* _name_from_user_radio; - Gtk::Entry* _name_entry; - Gtk::RadioButton* _poly_from_file_radio; - Gtk::RadioButton* _poly_from_parent_radio; - Gtk::RadioButton* _poly_from_user_radio; - Gtk::SpinButton* _poly_spinbutton; - Gtk::Button* _ok_button; - Gtk::Button* _cancel_button; -}; - - -} // namespace GUI -} // namespace Ingen - -#endif // LOADSUBPATCHWINDOW_H diff --git a/src/libs/gui/LoadSubpatchWindow.hpp b/src/libs/gui/LoadSubpatchWindow.hpp new file mode 100644 index 00000000..01047a3e --- /dev/null +++ b/src/libs/gui/LoadSubpatchWindow.hpp @@ -0,0 +1,79 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef LOADSUBPATCHWINDOW_H +#define LOADSUBPATCHWINDOW_H + +#include +#include +#include +#include "client/PatchModel.hpp" +#include "client/PluginModel.hpp" +using Ingen::Client::PatchModel; +using Ingen::Client::MetadataMap; + +namespace Ingen { +namespace GUI { + + +/** 'Add Subpatch' window. + * + * Loaded by glade as a derived object. + * + * \ingroup GUI + */ +class LoadSubpatchWindow : public Gtk::FileChooserDialog +{ +public: + LoadSubpatchWindow(BaseObjectType* cobject, const Glib::RefPtr& xml); + + void set_patch(SharedPtr patch); + + void present(SharedPtr patch, MetadataMap data); + +protected: + void on_show(); + +private: + void disable_name_entry(); + void enable_name_entry(); + void disable_poly_spinner(); + void enable_poly_spinner(); + + void ok_clicked(); + void cancel_clicked(); + + MetadataMap _initial_data; + + SharedPtr _patch; + + Gtk::RadioButton* _name_from_file_radio; + Gtk::RadioButton* _name_from_user_radio; + Gtk::Entry* _name_entry; + Gtk::RadioButton* _poly_from_file_radio; + Gtk::RadioButton* _poly_from_parent_radio; + Gtk::RadioButton* _poly_from_user_radio; + Gtk::SpinButton* _poly_spinbutton; + Gtk::Button* _ok_button; + Gtk::Button* _cancel_button; +}; + + +} // namespace GUI +} // namespace Ingen + +#endif // LOADSUBPATCHWINDOW_H diff --git a/src/libs/gui/MessagesWindow.cpp b/src/libs/gui/MessagesWindow.cpp index b8a83c20..3da810f6 100644 --- a/src/libs/gui/MessagesWindow.cpp +++ b/src/libs/gui/MessagesWindow.cpp @@ -15,7 +15,7 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "MessagesWindow.h" +#include "MessagesWindow.hpp" #include namespace Ingen { diff --git a/src/libs/gui/MessagesWindow.h b/src/libs/gui/MessagesWindow.h deleted file mode 100644 index dea0fdd4..00000000 --- a/src/libs/gui/MessagesWindow.h +++ /dev/null @@ -1,58 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef MESSAGESWINDOW_H -#define MESSAGESWINDOW_H - -#include -#include -#include -using std::string; - - -namespace Ingen { -namespace GUI { - - -/** Messages Window. - * - * Loaded by libglade as a derived object. - * This is shown when errors occur (ie during patch loading). - * - * \ingroup GUI - */ -class MessagesWindow : public Gtk::Window -{ -public: - MessagesWindow(BaseObjectType* cobject, const Glib::RefPtr& refGlade); - - void post(const string& str); - -private: - void clear_clicked(); - void close_clicked(); - - Gtk::TextView* _textview; - Gtk::Button* _clear_button; - Gtk::Button* _close_button; -}; - - -} // namespace GUI -} // namespace Ingen - -#endif // MESSAGESWINDOW_H diff --git a/src/libs/gui/MessagesWindow.hpp b/src/libs/gui/MessagesWindow.hpp new file mode 100644 index 00000000..dea0fdd4 --- /dev/null +++ b/src/libs/gui/MessagesWindow.hpp @@ -0,0 +1,58 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef MESSAGESWINDOW_H +#define MESSAGESWINDOW_H + +#include +#include +#include +using std::string; + + +namespace Ingen { +namespace GUI { + + +/** Messages Window. + * + * Loaded by libglade as a derived object. + * This is shown when errors occur (ie during patch loading). + * + * \ingroup GUI + */ +class MessagesWindow : public Gtk::Window +{ +public: + MessagesWindow(BaseObjectType* cobject, const Glib::RefPtr& refGlade); + + void post(const string& str); + +private: + void clear_clicked(); + void close_clicked(); + + Gtk::TextView* _textview; + Gtk::Button* _clear_button; + Gtk::Button* _close_button; +}; + + +} // namespace GUI +} // namespace Ingen + +#endif // MESSAGESWINDOW_H diff --git a/src/libs/gui/NewSubpatchWindow.cpp b/src/libs/gui/NewSubpatchWindow.cpp index f0bc7caa..8b66b6c2 100644 --- a/src/libs/gui/NewSubpatchWindow.cpp +++ b/src/libs/gui/NewSubpatchWindow.cpp @@ -15,12 +15,12 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "App.h" -#include "interface/EngineInterface.h" -#include "client/NodeModel.h" -#include "client/PatchModel.h" -#include "NewSubpatchWindow.h" -#include "PatchView.h" +#include "App.hpp" +#include "interface/EngineInterface.hpp" +#include "client/NodeModel.hpp" +#include "client/PatchModel.hpp" +#include "NewSubpatchWindow.hpp" +#include "PatchView.hpp" namespace Ingen { namespace GUI { diff --git a/src/libs/gui/NewSubpatchWindow.h b/src/libs/gui/NewSubpatchWindow.h deleted file mode 100644 index e70b7f91..00000000 --- a/src/libs/gui/NewSubpatchWindow.h +++ /dev/null @@ -1,67 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef NEWSUBPATCHWINDOW_H -#define NEWSUBPATCHWINDOW_H - -#include -#include -#include -#include "client/PatchModel.h" -#include "client/PluginModel.h" -using Ingen::Client::PatchModel; -using Ingen::Client::MetadataMap; - -namespace Ingen { -namespace GUI { - - -/** 'New Subpatch' window. - * - * Loaded by glade as a derived object. - * - * \ingroup GUI - */ -class NewSubpatchWindow : public Gtk::Window -{ -public: - NewSubpatchWindow(BaseObjectType* cobject, const Glib::RefPtr& xml); - - void set_patch(SharedPtr patch); - - void present(SharedPtr patch, MetadataMap data); - -private: - void name_changed(); - void ok_clicked(); - void cancel_clicked(); - - MetadataMap _initial_data; - SharedPtr _patch; - - Gtk::Entry* _name_entry; - Gtk::Label* _message_label; - Gtk::SpinButton* _poly_spinbutton; - Gtk::Button* _ok_button; - Gtk::Button* _cancel_button; -}; - - -} // namespace GUI -} // namespace Ingen - -#endif // NEWSUBPATCHWINDOW_H diff --git a/src/libs/gui/NewSubpatchWindow.hpp b/src/libs/gui/NewSubpatchWindow.hpp new file mode 100644 index 00000000..d6ce65d7 --- /dev/null +++ b/src/libs/gui/NewSubpatchWindow.hpp @@ -0,0 +1,67 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef NEWSUBPATCHWINDOW_H +#define NEWSUBPATCHWINDOW_H + +#include +#include +#include +#include "client/PatchModel.hpp" +#include "client/PluginModel.hpp" +using Ingen::Client::PatchModel; +using Ingen::Client::MetadataMap; + +namespace Ingen { +namespace GUI { + + +/** 'New Subpatch' window. + * + * Loaded by glade as a derived object. + * + * \ingroup GUI + */ +class NewSubpatchWindow : public Gtk::Window +{ +public: + NewSubpatchWindow(BaseObjectType* cobject, const Glib::RefPtr& xml); + + void set_patch(SharedPtr patch); + + void present(SharedPtr patch, MetadataMap data); + +private: + void name_changed(); + void ok_clicked(); + void cancel_clicked(); + + MetadataMap _initial_data; + SharedPtr _patch; + + Gtk::Entry* _name_entry; + Gtk::Label* _message_label; + Gtk::SpinButton* _poly_spinbutton; + Gtk::Button* _ok_button; + Gtk::Button* _cancel_button; +}; + + +} // namespace GUI +} // namespace Ingen + +#endif // NEWSUBPATCHWINDOW_H diff --git a/src/libs/gui/NodeControlWindow.cpp b/src/libs/gui/NodeControlWindow.cpp index 26108833..e5f25a1e 100644 --- a/src/libs/gui/NodeControlWindow.cpp +++ b/src/libs/gui/NodeControlWindow.cpp @@ -17,14 +17,14 @@ #include #include -#include "interface/EngineInterface.h" -#include "client/NodeModel.h" -#include "App.h" -#include "NodeControlWindow.h" -#include "GladeFactory.h" -#include "ControlGroups.h" -#include "ControlPanel.h" -#include "PatchWindow.h" +#include "interface/EngineInterface.hpp" +#include "client/NodeModel.hpp" +#include "App.hpp" +#include "NodeControlWindow.hpp" +#include "GladeFactory.hpp" +#include "ControlGroups.hpp" +#include "ControlPanel.hpp" +#include "PatchWindow.hpp" using namespace std; diff --git a/src/libs/gui/NodeControlWindow.h b/src/libs/gui/NodeControlWindow.h deleted file mode 100644 index bd6f9fc9..00000000 --- a/src/libs/gui/NodeControlWindow.h +++ /dev/null @@ -1,76 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef NODECONTROLWINDOW_H -#define NODECONTROLWINDOW_H - -#include -#include -#include -#include -#include -#include -using std::string; using std::vector; - -namespace Ingen { namespace Client { - class NodeModel; -} } -using Ingen::Client::NodeModel; - -namespace Ingen { -namespace GUI { - -class ControlGroup; -class ControlPanel; - - -/** Window with controls (sliders) for all control-rate ports on a Node. - * - * \ingroup GUI - */ -class NodeControlWindow : public Gtk::Window -{ -public: - NodeControlWindow(SharedPtr node, size_t poly); - NodeControlWindow(SharedPtr node, ControlPanel* panel); - virtual ~NodeControlWindow(); - - SharedPtr node() { return _node; } - - ControlPanel* control_panel() const { return _control_panel; } - - void resize(); - -protected: - void on_show(); - void on_hide(); - -private: - SharedPtr _node; - ControlPanel* _control_panel; - bool _callback_enabled; - - bool _position_stored; - int _x; - int _y; -}; - - -} // namespace GUI -} // namespace Ingen - -#endif // NODECONTROLWINDOW_H diff --git a/src/libs/gui/NodeControlWindow.hpp b/src/libs/gui/NodeControlWindow.hpp new file mode 100644 index 00000000..b639474a --- /dev/null +++ b/src/libs/gui/NodeControlWindow.hpp @@ -0,0 +1,76 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef NODECONTROLWINDOW_H +#define NODECONTROLWINDOW_H + +#include +#include +#include +#include +#include +#include +using std::string; using std::vector; + +namespace Ingen { namespace Client { + class NodeModel; +} } +using Ingen::Client::NodeModel; + +namespace Ingen { +namespace GUI { + +class ControlGroup; +class ControlPanel; + + +/** Window with controls (sliders) for all control-rate ports on a Node. + * + * \ingroup GUI + */ +class NodeControlWindow : public Gtk::Window +{ +public: + NodeControlWindow(SharedPtr node, size_t poly); + NodeControlWindow(SharedPtr node, ControlPanel* panel); + virtual ~NodeControlWindow(); + + SharedPtr node() { return _node; } + + ControlPanel* control_panel() const { return _control_panel; } + + void resize(); + +protected: + void on_show(); + void on_hide(); + +private: + SharedPtr _node; + ControlPanel* _control_panel; + bool _callback_enabled; + + bool _position_stored; + int _x; + int _y; +}; + + +} // namespace GUI +} // namespace Ingen + +#endif // NODECONTROLWINDOW_H diff --git a/src/libs/gui/NodeMenu.cpp b/src/libs/gui/NodeMenu.cpp index cf71989c..f65eb512 100644 --- a/src/libs/gui/NodeMenu.cpp +++ b/src/libs/gui/NodeMenu.cpp @@ -17,11 +17,11 @@ #include #include -#include "interface/EngineInterface.h" -#include "client/NodeModel.h" -#include "App.h" -#include "NodeMenu.h" -#include "WindowFactory.h" +#include "interface/EngineInterface.hpp" +#include "client/NodeModel.hpp" +#include "App.hpp" +#include "NodeMenu.hpp" +#include "WindowFactory.hpp" using std::cerr; using std::endl; diff --git a/src/libs/gui/NodeMenu.h b/src/libs/gui/NodeMenu.h deleted file mode 100644 index 65044608..00000000 --- a/src/libs/gui/NodeMenu.h +++ /dev/null @@ -1,78 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef NODEMENU_H -#define NODEMENU_H - -#include -#include -#include -#include -#include "client/NodeModel.h" -using Ingen::Client::NodeModel; - -using std::string; - -namespace Ingen { -namespace GUI { - -class Controller; -class NodeControlWindow; -class NodePropertiesWindow; -class PatchCanvas; - -/** Controller for a Node. - * - * \ingroup GUI - */ -class NodeMenu : public Gtk::Menu -{ -public: - NodeMenu(SharedPtr node); - - void set_path(const Path& new_path); - - virtual void program_add(int bank, int program, const string& name) {} - virtual void program_remove(int bank, int program) {} - - bool has_control_inputs(); - - //virtual void show_menu(GdkEventButton* event) - //{ _menu.popup(event->button, event->time); } - -protected: - - virtual void enable_controls_menuitem(); - virtual void disable_controls_menuitem(); - - //virtual void add_port(SharedPtr pm); - - void on_menu_destroy(); - void on_menu_clone(); - void on_menu_learn(); - void on_menu_disconnect_all(); - - //Gtk::Menu _menu; - SharedPtr _node; - Glib::RefPtr _controls_menuitem; -}; - - -} // namespace GUI -} // namespace Ingen - -#endif // NODEMENU_H diff --git a/src/libs/gui/NodeMenu.hpp b/src/libs/gui/NodeMenu.hpp new file mode 100644 index 00000000..0290d861 --- /dev/null +++ b/src/libs/gui/NodeMenu.hpp @@ -0,0 +1,78 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef NODEMENU_H +#define NODEMENU_H + +#include +#include +#include +#include +#include "client/NodeModel.hpp" +using Ingen::Client::NodeModel; + +using std::string; + +namespace Ingen { +namespace GUI { + +class Controller; +class NodeControlWindow; +class NodePropertiesWindow; +class PatchCanvas; + +/** Controller for a Node. + * + * \ingroup GUI + */ +class NodeMenu : public Gtk::Menu +{ +public: + NodeMenu(SharedPtr node); + + void set_path(const Path& new_path); + + virtual void program_add(int bank, int program, const string& name) {} + virtual void program_remove(int bank, int program) {} + + bool has_control_inputs(); + + //virtual void show_menu(GdkEventButton* event) + //{ _menu.popup(event->button, event->time); } + +protected: + + virtual void enable_controls_menuitem(); + virtual void disable_controls_menuitem(); + + //virtual void add_port(SharedPtr pm); + + void on_menu_destroy(); + void on_menu_clone(); + void on_menu_learn(); + void on_menu_disconnect_all(); + + //Gtk::Menu _menu; + SharedPtr _node; + Glib::RefPtr _controls_menuitem; +}; + + +} // namespace GUI +} // namespace Ingen + +#endif // NODEMENU_H diff --git a/src/libs/gui/NodeModule.cpp b/src/libs/gui/NodeModule.cpp index 61c937a8..b7126dd7 100644 --- a/src/libs/gui/NodeModule.cpp +++ b/src/libs/gui/NodeModule.cpp @@ -16,20 +16,20 @@ */ #include -#include -#include "interface/EngineInterface.h" -#include "client/PatchModel.h" -#include "client/NodeModel.h" -#include "App.h" -#include "NodeModule.h" -#include "PatchCanvas.h" -#include "Port.h" -#include "GladeFactory.h" -#include "RenameWindow.h" -#include "PatchWindow.h" -#include "WindowFactory.h" -#include "SubpatchModule.h" -#include "NodeControlWindow.h" +#include +#include "interface/EngineInterface.hpp" +#include "client/PatchModel.hpp" +#include "client/NodeModel.hpp" +#include "App.hpp" +#include "NodeModule.hpp" +#include "PatchCanvas.hpp" +#include "Port.hpp" +#include "GladeFactory.hpp" +#include "RenameWindow.hpp" +#include "PatchWindow.hpp" +#include "WindowFactory.hpp" +#include "SubpatchModule.hpp" +#include "NodeControlWindow.hpp" namespace Ingen { namespace GUI { diff --git a/src/libs/gui/NodeModule.h b/src/libs/gui/NodeModule.h deleted file mode 100644 index 66a46503..00000000 --- a/src/libs/gui/NodeModule.h +++ /dev/null @@ -1,90 +0,0 @@ -/* This file is part of In* Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef NODEMODULE_H -#define NODEMODULE_H - -#include -#include -#include -#include -#include "Port.h" -#include "NodeMenu.h" -using std::string; - -class Atom; - -namespace Ingen { namespace Client { - class PortModel; - class NodeModel; - class ControlModel; -} } -using namespace Ingen::Client; - -namespace Ingen { -namespace GUI { - -class PatchCanvas; -class Port; - - -/** A module in a patch. - * - * This base class is extended for various types of modules - SubpatchModule, - * DSSIModule, etc. - * - * \ingroup GUI - */ -class NodeModule : public FlowCanvas::Module -{ -public: - static boost::shared_ptr create (boost::shared_ptr canvas, SharedPtr node); - - virtual ~NodeModule(); - - boost::shared_ptr port(const string& port_name) { - return boost::dynamic_pointer_cast( - Module::get_port(port_name)); - } - - virtual void store_location(); - - void on_click(GdkEventButton* event); - - void show_control_window(); - - SharedPtr node() const { return _node; } - -protected: - NodeModule(boost::shared_ptr canvas, SharedPtr node); - - virtual void on_double_click(GdkEventButton* ev) { show_control_window(); } - virtual void on_middle_click(GdkEventButton* ev) { show_control_window(); } - - void metadata_update(const string& key, const Atom& value); - - void add_port(SharedPtr port, bool resize=true); - void remove_port(SharedPtr port); - - SharedPtr _node; - NodeMenu _menu; -}; - - -} // namespace GUI -} // namespace Ingen - -#endif // NODEMODULE_H diff --git a/src/libs/gui/NodeModule.hpp b/src/libs/gui/NodeModule.hpp new file mode 100644 index 00000000..b68d1143 --- /dev/null +++ b/src/libs/gui/NodeModule.hpp @@ -0,0 +1,90 @@ +/* This file is part of In* Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef NODEMODULE_H +#define NODEMODULE_H + +#include +#include +#include +#include +#include "Port.hpp" +#include "NodeMenu.hpp" +using std::string; + +class Atom; + +namespace Ingen { namespace Client { + class PortModel; + class NodeModel; + class ControlModel; +} } +using namespace Ingen::Client; + +namespace Ingen { +namespace GUI { + +class PatchCanvas; +class Port; + + +/** A module in a patch. + * + * This base class is extended for various types of modules - SubpatchModule, + * DSSIModule, etc. + * + * \ingroup GUI + */ +class NodeModule : public FlowCanvas::Module +{ +public: + static boost::shared_ptr create (boost::shared_ptr canvas, SharedPtr node); + + virtual ~NodeModule(); + + boost::shared_ptr port(const string& port_name) { + return boost::dynamic_pointer_cast( + Module::get_port(port_name)); + } + + virtual void store_location(); + + void on_click(GdkEventButton* event); + + void show_control_window(); + + SharedPtr node() const { return _node; } + +protected: + NodeModule(boost::shared_ptr canvas, SharedPtr node); + + virtual void on_double_click(GdkEventButton* ev) { show_control_window(); } + virtual void on_middle_click(GdkEventButton* ev) { show_control_window(); } + + void metadata_update(const string& key, const Atom& value); + + void add_port(SharedPtr port, bool resize=true); + void remove_port(SharedPtr port); + + SharedPtr _node; + NodeMenu _menu; +}; + + +} // namespace GUI +} // namespace Ingen + +#endif // NODEMODULE_H diff --git a/src/libs/gui/NodePropertiesWindow.cpp b/src/libs/gui/NodePropertiesWindow.cpp index 0cd59e80..a6fb46ee 100644 --- a/src/libs/gui/NodePropertiesWindow.cpp +++ b/src/libs/gui/NodePropertiesWindow.cpp @@ -17,9 +17,9 @@ #include #include -#include "client/NodeModel.h" -#include "client/PluginModel.h" -#include "NodePropertiesWindow.h" +#include "client/NodeModel.hpp" +#include "client/PluginModel.hpp" +#include "NodePropertiesWindow.hpp" namespace Ingen { namespace GUI { diff --git a/src/libs/gui/NodePropertiesWindow.h b/src/libs/gui/NodePropertiesWindow.h deleted file mode 100644 index 057de4ec..00000000 --- a/src/libs/gui/NodePropertiesWindow.h +++ /dev/null @@ -1,58 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef NODEPROPERTIESWINDOW_H -#define NODEPROPERTIESWINDOW_H - -#include -#include -#include -#include "client/NodeModel.h" -using namespace Ingen::Client; - -namespace Ingen { -namespace GUI { - - -/** Node properties window. - * - * Loaded by libglade as a derived object. - * - * \ingroup GUI - */ -class NodePropertiesWindow : public Gtk::Window -{ -public: - NodePropertiesWindow(BaseObjectType* cobject, const Glib::RefPtr& refGlade); - - void present(SharedPtr node_model) { set_node(node_model); Gtk::Window::present(); } - void set_node(SharedPtr node_model); - -private: - - SharedPtr _node_model; - Gtk::Label* _node_path_label; - Gtk::CheckButton* _node_polyphonic_toggle; - Gtk::Label* _plugin_type_label; - Gtk::Label* _plugin_uri_label; - Gtk::Label* _plugin_name_label; -}; - -} // namespace GUI -} // namespace Ingen - -#endif // NODEPROPERTIESWINDOW_H diff --git a/src/libs/gui/NodePropertiesWindow.hpp b/src/libs/gui/NodePropertiesWindow.hpp new file mode 100644 index 00000000..248c8b42 --- /dev/null +++ b/src/libs/gui/NodePropertiesWindow.hpp @@ -0,0 +1,58 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef NODEPROPERTIESWINDOW_H +#define NODEPROPERTIESWINDOW_H + +#include +#include +#include +#include "client/NodeModel.hpp" +using namespace Ingen::Client; + +namespace Ingen { +namespace GUI { + + +/** Node properties window. + * + * Loaded by libglade as a derived object. + * + * \ingroup GUI + */ +class NodePropertiesWindow : public Gtk::Window +{ +public: + NodePropertiesWindow(BaseObjectType* cobject, const Glib::RefPtr& refGlade); + + void present(SharedPtr node_model) { set_node(node_model); Gtk::Window::present(); } + void set_node(SharedPtr node_model); + +private: + + SharedPtr _node_model; + Gtk::Label* _node_path_label; + Gtk::CheckButton* _node_polyphonic_toggle; + Gtk::Label* _plugin_type_label; + Gtk::Label* _plugin_uri_label; + Gtk::Label* _plugin_name_label; +}; + +} // namespace GUI +} // namespace Ingen + +#endif // NODEPROPERTIESWINDOW_H diff --git a/src/libs/gui/PatchCanvas.cpp b/src/libs/gui/PatchCanvas.cpp index d08b7b86..ba7a58ce 100644 --- a/src/libs/gui/PatchCanvas.cpp +++ b/src/libs/gui/PatchCanvas.cpp @@ -15,28 +15,29 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "../../../../config/config.h" + #include -#include -#include "interface/EngineInterface.h" -#include "client/PluginModel.h" -#include "client/PatchModel.h" -#include "client/NodeModel.h" -#include "client/Store.h" -#include "client/Serializer.h" -#include "App.h" -#include "PatchCanvas.h" -#include "PatchWindow.h" -#include "PatchPortModule.h" -#include "LoadPluginWindow.h" -#include "LoadSubpatchWindow.h" -#include "NewSubpatchWindow.h" -#include "Port.h" -#include "Connection.h" -#include "NodeModule.h" -#include "SubpatchModule.h" -#include "GladeFactory.h" -#include "WindowFactory.h" -#include "config.h" +#include +#include "interface/EngineInterface.hpp" +#include "client/PluginModel.hpp" +#include "client/PatchModel.hpp" +#include "client/NodeModel.hpp" +#include "client/Store.hpp" +#include "client/Serializer.hpp" +#include "App.hpp" +#include "PatchCanvas.hpp" +#include "PatchWindow.hpp" +#include "PatchPortModule.hpp" +#include "LoadPluginWindow.hpp" +#include "LoadSubpatchWindow.hpp" +#include "NewSubpatchWindow.hpp" +#include "Port.hpp" +#include "Connection.hpp" +#include "NodeModule.hpp" +#include "SubpatchModule.hpp" +#include "GladeFactory.hpp" +#include "WindowFactory.hpp" using Ingen::Client::Store; using Ingen::Client::Serializer; using Ingen::Client::PluginModel; diff --git a/src/libs/gui/PatchCanvas.h b/src/libs/gui/PatchCanvas.h deleted file mode 100644 index 1cf9f410..00000000 --- a/src/libs/gui/PatchCanvas.h +++ /dev/null @@ -1,131 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef PATCHCANVAS_H -#define PATCHCANVAS_H - -#include -#include -#include -#include -#include -#include -#include -#include "client/ConnectionModel.h" -#include "client/PatchModel.h" -#include "NodeModule.h" - -using std::string; -using namespace FlowCanvas; - -using FlowCanvas::Port; -using Ingen::Client::ConnectionModel; -using Ingen::Client::PatchModel; -using Ingen::Client::NodeModel; -using Ingen::Client::PortModel; -using Ingen::Client::MetadataMap; - -namespace Ingen { -namespace GUI { - -class NodeModule; - - -/** Patch canvas widget. - * - * \ingroup GUI - */ -class PatchCanvas : public FlowCanvas::Canvas -{ -public: - PatchCanvas(SharedPtr patch, int width, int height); - - virtual ~PatchCanvas() {} - - /*boost::shared_ptr find_module(const string& name) { - return boost::dynamic_pointer_cast( - Canvas::get_item(name)); - }*/ - - void build(); - void arrange(); - - void add_node(SharedPtr nm); - void remove_node(SharedPtr nm); - void add_port(SharedPtr pm); - void remove_port(SharedPtr pm); - void connection(SharedPtr cm); - void disconnection(SharedPtr cm); - - void get_new_module_location(double& x, double& y); - - void destroy_selection(); - void copy_selection(); - - void show_menu(GdkEvent* event) - { _menu->popup(event->button.button, event->button.time); } - -private: - string generate_port_name(const string& base); - void menu_add_port(const string& name, const string& type, bool is_output); - void menu_load_plugin(); - void menu_new_patch(); - void menu_load_patch(); - void load_plugin(SharedPtr plugin); - void build_plugin_menu(); - size_t build_plugin_class_menu(Gtk::Menu* menu, - SLV2PluginClass plugin_class, SLV2PluginClasses classes); - - MetadataMap get_initial_data(); - - bool canvas_event(GdkEvent* event); - - SharedPtr get_port_view(SharedPtr port); - - void connect(boost::shared_ptr src, - boost::shared_ptr dst); - - void disconnect(boost::shared_ptr src, - boost::shared_ptr dst); - - SharedPtr _patch; - - typedef std::map, SharedPtr > Views; - Views _views; - - int _last_click_x; - int _last_click_y; - - Gtk::Menu* _menu; - Gtk::MenuItem* _menu_add_audio_input; - Gtk::MenuItem* _menu_add_audio_output; - Gtk::MenuItem* _menu_add_control_input; - Gtk::MenuItem* _menu_add_control_output; - Gtk::MenuItem* _menu_add_midi_input; - Gtk::MenuItem* _menu_add_midi_output; - Gtk::MenuItem* _menu_add_osc_input; - Gtk::MenuItem* _menu_add_osc_output; - Gtk::MenuItem* _menu_load_plugin; - Gtk::MenuItem* _menu_load_patch; - Gtk::MenuItem* _menu_new_patch; -}; - - -} // namespace GUI -} // namespace Ingen - -#endif // PATCHCANVAS_H diff --git a/src/libs/gui/PatchCanvas.hpp b/src/libs/gui/PatchCanvas.hpp new file mode 100644 index 00000000..06126334 --- /dev/null +++ b/src/libs/gui/PatchCanvas.hpp @@ -0,0 +1,131 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef PATCHCANVAS_H +#define PATCHCANVAS_H + +#include +#include +#include +#include +#include +#include +#include +#include "client/ConnectionModel.hpp" +#include "client/PatchModel.hpp" +#include "NodeModule.hpp" + +using std::string; +using namespace FlowCanvas; + +using FlowCanvas::Port; +using Ingen::Client::ConnectionModel; +using Ingen::Client::PatchModel; +using Ingen::Client::NodeModel; +using Ingen::Client::PortModel; +using Ingen::Client::MetadataMap; + +namespace Ingen { +namespace GUI { + +class NodeModule; + + +/** Patch canvas widget. + * + * \ingroup GUI + */ +class PatchCanvas : public FlowCanvas::Canvas +{ +public: + PatchCanvas(SharedPtr patch, int width, int height); + + virtual ~PatchCanvas() {} + + /*boost::shared_ptr find_module(const string& name) { + return boost::dynamic_pointer_cast( + Canvas::get_item(name)); + }*/ + + void build(); + void arrange(); + + void add_node(SharedPtr nm); + void remove_node(SharedPtr nm); + void add_port(SharedPtr pm); + void remove_port(SharedPtr pm); + void connection(SharedPtr cm); + void disconnection(SharedPtr cm); + + void get_new_module_location(double& x, double& y); + + void destroy_selection(); + void copy_selection(); + + void show_menu(GdkEvent* event) + { _menu->popup(event->button.button, event->button.time); } + +private: + string generate_port_name(const string& base); + void menu_add_port(const string& name, const string& type, bool is_output); + void menu_load_plugin(); + void menu_new_patch(); + void menu_load_patch(); + void load_plugin(SharedPtr plugin); + void build_plugin_menu(); + size_t build_plugin_class_menu(Gtk::Menu* menu, + SLV2PluginClass plugin_class, SLV2PluginClasses classes); + + MetadataMap get_initial_data(); + + bool canvas_event(GdkEvent* event); + + SharedPtr get_port_view(SharedPtr port); + + void connect(boost::shared_ptr src, + boost::shared_ptr dst); + + void disconnect(boost::shared_ptr src, + boost::shared_ptr dst); + + SharedPtr _patch; + + typedef std::map, SharedPtr > Views; + Views _views; + + int _last_click_x; + int _last_click_y; + + Gtk::Menu* _menu; + Gtk::MenuItem* _menu_add_audio_input; + Gtk::MenuItem* _menu_add_audio_output; + Gtk::MenuItem* _menu_add_control_input; + Gtk::MenuItem* _menu_add_control_output; + Gtk::MenuItem* _menu_add_midi_input; + Gtk::MenuItem* _menu_add_midi_output; + Gtk::MenuItem* _menu_add_osc_input; + Gtk::MenuItem* _menu_add_osc_output; + Gtk::MenuItem* _menu_load_plugin; + Gtk::MenuItem* _menu_load_patch; + Gtk::MenuItem* _menu_new_patch; +}; + + +} // namespace GUI +} // namespace Ingen + +#endif // PATCHCANVAS_H diff --git a/src/libs/gui/PatchPortModule.cpp b/src/libs/gui/PatchPortModule.cpp index 6f309324..1d566741 100644 --- a/src/libs/gui/PatchPortModule.cpp +++ b/src/libs/gui/PatchPortModule.cpp @@ -15,17 +15,17 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "PatchPortModule.h" +#include "PatchPortModule.hpp" #include -#include "interface/EngineInterface.h" -#include "client/PatchModel.h" -#include "client/NodeModel.h" -#include "App.h" -#include "PatchCanvas.h" -#include "Port.h" -#include "GladeFactory.h" -#include "RenameWindow.h" -#include "PatchWindow.h" +#include "interface/EngineInterface.hpp" +#include "client/PatchModel.hpp" +#include "client/NodeModel.hpp" +#include "App.hpp" +#include "PatchCanvas.hpp" +#include "Port.hpp" +#include "GladeFactory.hpp" +#include "RenameWindow.hpp" +#include "PatchWindow.hpp" namespace Ingen { namespace GUI { diff --git a/src/libs/gui/PatchPortModule.h b/src/libs/gui/PatchPortModule.h deleted file mode 100644 index 81bc7b53..00000000 --- a/src/libs/gui/PatchPortModule.h +++ /dev/null @@ -1,79 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef PATCHPORTMODULE_H -#define PATCHPORTMODULE_H - -#include -#include -#include -#include -#include -#include "Port.h" -using std::string; - -namespace Ingen { namespace Client { - class PortModel; - class NodeModel; - class ControlModel; -} } -using namespace Ingen::Client; - -namespace Ingen { -namespace GUI { - -class PatchCanvas; -class Port; - - -/** A "module" to represent a patch's port on it's own canvas. - * - * Translation: This is the nameless single port pseudo module thingy. - * - * \ingroup GUI - */ -class PatchPortModule : public FlowCanvas::Module -{ -public: - static boost::shared_ptr create(boost::shared_ptr canvas, - SharedPtr port); - - virtual ~PatchPortModule() {} - - virtual void store_location(); - - //void on_right_click(GdkEventButton* event) { _port->show_menu(event); } - - SharedPtr port() const { return _port; } - -protected: - PatchPortModule(boost::shared_ptr canvas, SharedPtr port); - - //virtual void on_double_click(GdkEventButton* ev) { show_control_window(); } - //virtual void on_middle_click(GdkEventButton* ev) { show_control_window(); } - - void metadata_update(const string& key, const Raul::Atom& value); - - SharedPtr _port; - boost::shared_ptr _patch_port; ///< Port on this 'anonymous' module -}; - - -} // namespace GUI -} // namespace Ingen - -#endif // PATCHPORTMODULE_H diff --git a/src/libs/gui/PatchPortModule.hpp b/src/libs/gui/PatchPortModule.hpp new file mode 100644 index 00000000..ceac4954 --- /dev/null +++ b/src/libs/gui/PatchPortModule.hpp @@ -0,0 +1,79 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef PATCHPORTMODULE_H +#define PATCHPORTMODULE_H + +#include +#include +#include +#include +#include +#include "Port.hpp" +using std::string; + +namespace Ingen { namespace Client { + class PortModel; + class NodeModel; + class ControlModel; +} } +using namespace Ingen::Client; + +namespace Ingen { +namespace GUI { + +class PatchCanvas; +class Port; + + +/** A "module" to represent a patch's port on it's own canvas. + * + * Translation: This is the nameless single port pseudo module thingy. + * + * \ingroup GUI + */ +class PatchPortModule : public FlowCanvas::Module +{ +public: + static boost::shared_ptr create(boost::shared_ptr canvas, + SharedPtr port); + + virtual ~PatchPortModule() {} + + virtual void store_location(); + + //void on_right_click(GdkEventButton* event) { _port->show_menu(event); } + + SharedPtr port() const { return _port; } + +protected: + PatchPortModule(boost::shared_ptr canvas, SharedPtr port); + + //virtual void on_double_click(GdkEventButton* ev) { show_control_window(); } + //virtual void on_middle_click(GdkEventButton* ev) { show_control_window(); } + + void metadata_update(const string& key, const Raul::Atom& value); + + SharedPtr _port; + boost::shared_ptr _patch_port; ///< Port on this 'anonymous' module +}; + + +} // namespace GUI +} // namespace Ingen + +#endif // PATCHPORTMODULE_H diff --git a/src/libs/gui/PatchPropertiesWindow.cpp b/src/libs/gui/PatchPropertiesWindow.cpp index 1e310f0b..eb5120c4 100644 --- a/src/libs/gui/PatchPropertiesWindow.cpp +++ b/src/libs/gui/PatchPropertiesWindow.cpp @@ -16,8 +16,8 @@ */ #include -#include "client/PatchModel.h" -#include "PatchPropertiesWindow.h" +#include "client/PatchModel.hpp" +#include "PatchPropertiesWindow.hpp" namespace Ingen { namespace GUI { diff --git a/src/libs/gui/PatchPropertiesWindow.h b/src/libs/gui/PatchPropertiesWindow.h deleted file mode 100644 index 0640a198..00000000 --- a/src/libs/gui/PatchPropertiesWindow.h +++ /dev/null @@ -1,64 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef PATCHPROPERTIESWINDOW_H -#define PATCHPROPERTIESWINDOW_H - -#include -#include -#include -#include -using std::string; - -namespace Ingen { namespace Client { class PatchModel; } } -using Ingen::Client::PatchModel; - -namespace Ingen { -namespace GUI { - - -/** Patch Properties Window. - * - * Loaded by libglade as a derived object. - * - * \ingroup GUI - */ -class PatchPropertiesWindow : public Gtk::Window -{ -public: - PatchPropertiesWindow(BaseObjectType* cobject, const Glib::RefPtr& refGlade); - - void present(SharedPtr patch_model) { set_patch(patch_model); Gtk::Window::present(); } - void set_patch(SharedPtr patch_model); - - void cancel_clicked(); - void ok_clicked(); - -private: - SharedPtr _patch_model; - - Gtk::Entry* _author_entry; - Gtk::TextView* _textview; - Gtk::Button* _cancel_button; - Gtk::Button* _ok_button; -}; - - -} // namespace GUI -} // namespace Ingen - -#endif // PATCHPROPERTIESWINDOW_H diff --git a/src/libs/gui/PatchPropertiesWindow.hpp b/src/libs/gui/PatchPropertiesWindow.hpp new file mode 100644 index 00000000..0f60b147 --- /dev/null +++ b/src/libs/gui/PatchPropertiesWindow.hpp @@ -0,0 +1,64 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef PATCHPROPERTIESWINDOW_H +#define PATCHPROPERTIESWINDOW_H + +#include +#include +#include +#include +using std::string; + +namespace Ingen { namespace Client { class PatchModel; } } +using Ingen::Client::PatchModel; + +namespace Ingen { +namespace GUI { + + +/** Patch Properties Window. + * + * Loaded by libglade as a derived object. + * + * \ingroup GUI + */ +class PatchPropertiesWindow : public Gtk::Window +{ +public: + PatchPropertiesWindow(BaseObjectType* cobject, const Glib::RefPtr& refGlade); + + void present(SharedPtr patch_model) { set_patch(patch_model); Gtk::Window::present(); } + void set_patch(SharedPtr patch_model); + + void cancel_clicked(); + void ok_clicked(); + +private: + SharedPtr _patch_model; + + Gtk::Entry* _author_entry; + Gtk::TextView* _textview; + Gtk::Button* _cancel_button; + Gtk::Button* _ok_button; +}; + + +} // namespace GUI +} // namespace Ingen + +#endif // PATCHPROPERTIESWINDOW_H diff --git a/src/libs/gui/PatchTreeWindow.cpp b/src/libs/gui/PatchTreeWindow.cpp index b77508c1..bdd293ac 100644 --- a/src/libs/gui/PatchTreeWindow.cpp +++ b/src/libs/gui/PatchTreeWindow.cpp @@ -15,15 +15,15 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include "interface/EngineInterface.h" -#include "client/OSCEngineSender.h" -#include "client/Store.h" -#include "client/PatchModel.h" -#include "App.h" -#include "PatchTreeWindow.h" -#include "SubpatchModule.h" -#include "WindowFactory.h" +#include +#include "interface/EngineInterface.hpp" +#include "client/OSCEngineSender.hpp" +#include "client/Store.hpp" +#include "client/PatchModel.hpp" +#include "App.hpp" +#include "PatchTreeWindow.hpp" +#include "SubpatchModule.hpp" +#include "WindowFactory.hpp" namespace Ingen { namespace GUI { diff --git a/src/libs/gui/PatchTreeWindow.h b/src/libs/gui/PatchTreeWindow.h deleted file mode 100644 index 9868d363..00000000 --- a/src/libs/gui/PatchTreeWindow.h +++ /dev/null @@ -1,112 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef PATCHTREEWINDOW_H -#define PATCHTREEWINDOW_H - -#include -#include -#include - -namespace Ingen { namespace Client { - class Store; -} } -using Ingen::Client::Store; - -namespace Ingen { -namespace GUI { - -class PatchWindow; -class PatchTreeView; - - -/** Window with a TreeView of all loaded patches. - * - * \ingroup GUI - */ -class PatchTreeWindow : public Gtk::Window -{ -public: - PatchTreeWindow(BaseObjectType* cobject, const Glib::RefPtr& refGlade); - - void init(Store& store); - - void new_object(SharedPtr object); - - void patch_enabled(const Path& path); - void patch_disabled(const Path& path); - void patch_renamed(const Path& old_path, const Path& new_path); - - void add_patch(SharedPtr pm); - void remove_patch(const Path& path); - void show_patch_menu(GdkEventButton* ev); - -protected: - //void event_patch_selected(); - void event_patch_activated(const Gtk::TreeModel::Path& path, Gtk::TreeView::Column* col); - void event_patch_enabled_toggled(const Glib::ustring& path_str); - - Gtk::TreeModel::iterator find_patch(Gtk::TreeModel::Children root, const Path& path); - - PatchTreeView* _patches_treeview; - - struct PatchTreeModelColumns : public Gtk::TreeModel::ColumnRecord - { - PatchTreeModelColumns() - { add(name_col); add(enabled_col); add(patch_model_col); } - - Gtk::TreeModelColumn name_col; - Gtk::TreeModelColumn enabled_col; - Gtk::TreeModelColumn > patch_model_col; - }; - - bool _enable_signal; - PatchTreeModelColumns _patch_tree_columns; - Glib::RefPtr _patch_treestore; - Glib::RefPtr _patch_tree_selection; -}; - - -/** Derived TreeView class to support context menus for patches */ -class PatchTreeView : public Gtk::TreeView -{ -public: - PatchTreeView(BaseObjectType* cobject, const Glib::RefPtr& xml) - : Gtk::TreeView(cobject) - {} - - void set_window(PatchTreeWindow* 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); - - return ret; - } - -private: - PatchTreeWindow* _window; - -}; // struct PatchTreeView - - -} // namespace GUI -} // namespace Ingen - -#endif // PATCHTREEWINDOW_H diff --git a/src/libs/gui/PatchTreeWindow.hpp b/src/libs/gui/PatchTreeWindow.hpp new file mode 100644 index 00000000..534f4607 --- /dev/null +++ b/src/libs/gui/PatchTreeWindow.hpp @@ -0,0 +1,112 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef PATCHTREEWINDOW_H +#define PATCHTREEWINDOW_H + +#include +#include +#include + +namespace Ingen { namespace Client { + class Store; +} } +using Ingen::Client::Store; + +namespace Ingen { +namespace GUI { + +class PatchWindow; +class PatchTreeView; + + +/** Window with a TreeView of all loaded patches. + * + * \ingroup GUI + */ +class PatchTreeWindow : public Gtk::Window +{ +public: + PatchTreeWindow(BaseObjectType* cobject, const Glib::RefPtr& refGlade); + + void init(Store& store); + + void new_object(SharedPtr object); + + void patch_enabled(const Path& path); + void patch_disabled(const Path& path); + void patch_renamed(const Path& old_path, const Path& new_path); + + void add_patch(SharedPtr pm); + void remove_patch(const Path& path); + void show_patch_menu(GdkEventButton* ev); + +protected: + //void event_patch_selected(); + void event_patch_activated(const Gtk::TreeModel::Path& path, Gtk::TreeView::Column* col); + void event_patch_enabled_toggled(const Glib::ustring& path_str); + + Gtk::TreeModel::iterator find_patch(Gtk::TreeModel::Children root, const Path& path); + + PatchTreeView* _patches_treeview; + + struct PatchTreeModelColumns : public Gtk::TreeModel::ColumnRecord + { + PatchTreeModelColumns() + { add(name_col); add(enabled_col); add(patch_model_col); } + + Gtk::TreeModelColumn name_col; + Gtk::TreeModelColumn enabled_col; + Gtk::TreeModelColumn > patch_model_col; + }; + + bool _enable_signal; + PatchTreeModelColumns _patch_tree_columns; + Glib::RefPtr _patch_treestore; + Glib::RefPtr _patch_tree_selection; +}; + + +/** Derived TreeView class to support context menus for patches */ +class PatchTreeView : public Gtk::TreeView +{ +public: + PatchTreeView(BaseObjectType* cobject, const Glib::RefPtr& xml) + : Gtk::TreeView(cobject) + {} + + void set_window(PatchTreeWindow* 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); + + return ret; + } + +private: + PatchTreeWindow* _window; + +}; // struct PatchTreeView + + +} // namespace GUI +} // namespace Ingen + +#endif // PATCHTREEWINDOW_H diff --git a/src/libs/gui/PatchView.cpp b/src/libs/gui/PatchView.cpp index fa0d01a0..0246b98c 100644 --- a/src/libs/gui/PatchView.cpp +++ b/src/libs/gui/PatchView.cpp @@ -18,18 +18,18 @@ #include #include #include -#include "interface/EngineInterface.h" -#include "client/PatchModel.h" -#include "App.h" -#include "PatchView.h" -#include "PatchCanvas.h" -#include "LoadPluginWindow.h" -#include "NewSubpatchWindow.h" -#include "LoadSubpatchWindow.h" -#include "NodeControlWindow.h" -#include "PatchPropertiesWindow.h" -#include "PatchTreeWindow.h" -#include "GladeFactory.h" +#include "interface/EngineInterface.hpp" +#include "client/PatchModel.hpp" +#include "App.hpp" +#include "PatchView.hpp" +#include "PatchCanvas.hpp" +#include "LoadPluginWindow.hpp" +#include "NewSubpatchWindow.hpp" +#include "LoadSubpatchWindow.hpp" +#include "NodeControlWindow.hpp" +#include "PatchPropertiesWindow.hpp" +#include "PatchTreeWindow.hpp" +#include "GladeFactory.hpp" namespace Ingen { namespace GUI { diff --git a/src/libs/gui/PatchView.h b/src/libs/gui/PatchView.h deleted file mode 100644 index 72d773fa..00000000 --- a/src/libs/gui/PatchView.h +++ /dev/null @@ -1,102 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef PATCHVIEW_H -#define PATCHVIEW_H - -#include -#include -#include -#include -#include -#include "client/PatchModel.h" - -using std::string; - -namespace Ingen { namespace Client { - class PortModel; - class ControlModel; - class MetadataModel; -} } -using namespace Ingen::Client; - - -namespace Ingen { -namespace GUI { - -class PatchCanvas; -class LoadPluginWindow; -class NewSubpatchWindow; -class LoadSubpatchWindow; -class NewSubpatchWindow; -class NodeControlWindow; -class PatchDescriptionWindow; -class SubpatchModule; -class OmPort; - - -/** The patch specific contents of a PatchWindow (ie the canvas and whatever else). - * - * \ingroup GUI - */ -class PatchView : public Gtk::Box -{ -public: - PatchView(BaseObjectType* cobject, const Glib::RefPtr& glade_xml); - ~PatchView(); - - SharedPtr canvas() const { return _canvas; } - SharedPtr patch() const { return _patch; } - Gtk::Viewport* breadcrumb_container() const { return _breadcrumb_container; } - - static SharedPtr create(SharedPtr patch); - -private: - void set_patch(SharedPtr patch); - - void process_toggled(); - void clear_clicked(); - void refresh_clicked(); - - void enable(); - void disable(); - - void zoom_full(); - - SharedPtr _patch; - SharedPtr _canvas; - - Gtk::ScrolledWindow* _canvas_scrolledwindow; - - Gtk::ToggleToolButton* _process_but; - Gtk::SpinButton* _poly_spin; - Gtk::ToolButton* _clear_but; - Gtk::ToolButton* _destroy_but; - Gtk::ToolButton* _refresh_but; - Gtk::ToolButton* _save_but; - Gtk::ToolButton* _zoom_normal_but; - Gtk::ToolButton* _zoom_full_but; - Gtk::Viewport* _breadcrumb_container; - - bool _enable_signal; -}; - - -} // namespace GUI -} // namespace Ingen - -#endif // PATCHVIEW_H diff --git a/src/libs/gui/PatchView.hpp b/src/libs/gui/PatchView.hpp new file mode 100644 index 00000000..c3d0fc8a --- /dev/null +++ b/src/libs/gui/PatchView.hpp @@ -0,0 +1,102 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef PATCHVIEW_H +#define PATCHVIEW_H + +#include +#include +#include +#include +#include +#include "client/PatchModel.hpp" + +using std::string; + +namespace Ingen { namespace Client { + class PortModel; + class ControlModel; + class MetadataModel; +} } +using namespace Ingen::Client; + + +namespace Ingen { +namespace GUI { + +class PatchCanvas; +class LoadPluginWindow; +class NewSubpatchWindow; +class LoadSubpatchWindow; +class NewSubpatchWindow; +class NodeControlWindow; +class PatchDescriptionWindow; +class SubpatchModule; +class OmPort; + + +/** The patch specific contents of a PatchWindow (ie the canvas and whatever else). + * + * \ingroup GUI + */ +class PatchView : public Gtk::Box +{ +public: + PatchView(BaseObjectType* cobject, const Glib::RefPtr& glade_xml); + ~PatchView(); + + SharedPtr canvas() const { return _canvas; } + SharedPtr patch() const { return _patch; } + Gtk::Viewport* breadcrumb_container() const { return _breadcrumb_container; } + + static SharedPtr create(SharedPtr patch); + +private: + void set_patch(SharedPtr patch); + + void process_toggled(); + void clear_clicked(); + void refresh_clicked(); + + void enable(); + void disable(); + + void zoom_full(); + + SharedPtr _patch; + SharedPtr _canvas; + + Gtk::ScrolledWindow* _canvas_scrolledwindow; + + Gtk::ToggleToolButton* _process_but; + Gtk::SpinButton* _poly_spin; + Gtk::ToolButton* _clear_but; + Gtk::ToolButton* _destroy_but; + Gtk::ToolButton* _refresh_but; + Gtk::ToolButton* _save_but; + Gtk::ToolButton* _zoom_normal_but; + Gtk::ToolButton* _zoom_full_but; + Gtk::Viewport* _breadcrumb_container; + + bool _enable_signal; +}; + + +} // namespace GUI +} // namespace Ingen + +#endif // PATCHVIEW_H diff --git a/src/libs/gui/PatchWindow.cpp b/src/libs/gui/PatchWindow.cpp index 048416df..b0b87c5e 100644 --- a/src/libs/gui/PatchWindow.cpp +++ b/src/libs/gui/PatchWindow.cpp @@ -15,29 +15,29 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "PatchWindow.h" +#include "PatchWindow.hpp" #include #include #include -#include "interface/EngineInterface.h" -#include "client/PatchModel.h" -#include "client/Store.h" -#include "App.h" -#include "PatchCanvas.h" -#include "LoadPluginWindow.h" -#include "NewSubpatchWindow.h" -#include "LoadPatchWindow.h" -#include "LoadSubpatchWindow.h" -#include "NodeControlWindow.h" -#include "PatchPropertiesWindow.h" -#include "ConfigWindow.h" -#include "MessagesWindow.h" -#include "PatchTreeWindow.h" -#include "BreadCrumbBox.h" -#include "ConnectWindow.h" -#include "ThreadedLoader.h" -#include "WindowFactory.h" -#include "PatchView.h" +#include "interface/EngineInterface.hpp" +#include "client/PatchModel.hpp" +#include "client/Store.hpp" +#include "App.hpp" +#include "PatchCanvas.hpp" +#include "LoadPluginWindow.hpp" +#include "NewSubpatchWindow.hpp" +#include "LoadPatchWindow.hpp" +#include "LoadSubpatchWindow.hpp" +#include "NodeControlWindow.hpp" +#include "PatchPropertiesWindow.hpp" +#include "ConfigWindow.hpp" +#include "MessagesWindow.hpp" +#include "PatchTreeWindow.hpp" +#include "BreadCrumbBox.hpp" +#include "ConnectWindow.hpp" +#include "ThreadedLoader.hpp" +#include "WindowFactory.hpp" +#include "PatchView.hpp" namespace Ingen { namespace GUI { diff --git a/src/libs/gui/PatchWindow.h b/src/libs/gui/PatchWindow.h deleted file mode 100644 index daa4af08..00000000 --- a/src/libs/gui/PatchWindow.h +++ /dev/null @@ -1,150 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef PATCHWINDOW_H -#define PATCHWINDOW_H - -#include -#include -#include -#include -#include -#include -#include -#include "client/PatchModel.h" -#include "PatchView.h" -using Ingen::Client::PatchModel; - -using std::string; using std::list; - - -namespace Ingen { namespace Client { - class PatchModel; - class PortModel; - class ControlModel; - class MetadataModel; -} } -using namespace Ingen::Client; - - -namespace Ingen { -namespace GUI { - -class LoadPluginWindow; -class LoadPatchWindow; -class NewSubpatchWindow; -class LoadSubpatchWindow; -class NewSubpatchWindow; -class NodeControlWindow; -class PatchDescriptionWindow; -class SubpatchModule; -class OmPort; -class BreadCrumbBox; - - -/** A window for a patch. - * - * \ingroup GUI - */ -class PatchWindow : public Gtk::Window -{ -public: - PatchWindow(BaseObjectType* cobject, const Glib::RefPtr& glade_xml); - ~PatchWindow(); - - void set_patch_from_path(const Path& path, SharedPtr view); - void set_patch(SharedPtr pc, SharedPtr view); - - SharedPtr patch() const { return _patch; } - - Gtk::MenuItem* menu_view_control_window() { return _menu_view_control_window; } - -protected: - void on_show(); - void on_hide(); - bool on_key_press_event(GdkEventKey* event); - -private: - - void patch_port_added(SharedPtr port); - void patch_port_removed(SharedPtr port); - - void event_import(); - void event_import_location(); - void event_save(); - void event_save_as(); - void event_upload(); - void event_copy(); - void event_delete(); - void event_quit(); - void event_destroy(); - void event_clear(); - void event_fullscreen_toggled(); - void event_arrange(); - void event_show_properties(); - void event_show_controls(); - void event_show_engine(); - - SharedPtr _patch; - SharedPtr _view; - - sigc::connection new_port_connection; - sigc::connection removed_port_connection; - - bool _enable_signal; - bool _position_stored; - int _x; - int _y; - - Gtk::MenuItem* _menu_import; - Gtk::MenuItem* _menu_import_location; - Gtk::MenuItem* _menu_save; - Gtk::MenuItem* _menu_save_as; - Gtk::MenuItem* _menu_upload; - Gtk::MenuItem* _menu_cut; - Gtk::MenuItem* _menu_copy; - Gtk::MenuItem* _menu_paste; - Gtk::MenuItem* _menu_delete; - Gtk::MenuItem* _menu_configuration; - Gtk::MenuItem* _menu_close; - Gtk::MenuItem* _menu_quit; - Gtk::MenuItem* _menu_fullscreen; - Gtk::MenuItem* _menu_clear; - Gtk::MenuItem* _menu_destroy_patch; - 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_messages_window; - Gtk::MenuItem* _menu_view_patch_tree_window; - Gtk::MenuItem* _menu_help_about; - - Gtk::VBox* _vbox; - Gtk::Viewport* _viewport; - BreadCrumbBox* _breadcrumb_box; - - //Gtk::Statusbar* _status_bar; - - /** Invisible bin used to store breadcrumbs when not shown by a view */ - Gtk::Alignment _breadcrumb_bin; -}; - - -} // namespace GUI -} // namespace Ingen - -#endif // PATCHWINDOW_H diff --git a/src/libs/gui/PatchWindow.hpp b/src/libs/gui/PatchWindow.hpp new file mode 100644 index 00000000..08048bd3 --- /dev/null +++ b/src/libs/gui/PatchWindow.hpp @@ -0,0 +1,150 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef PATCHWINDOW_H +#define PATCHWINDOW_H + +#include +#include +#include +#include +#include +#include +#include +#include "client/PatchModel.hpp" +#include "PatchView.hpp" +using Ingen::Client::PatchModel; + +using std::string; using std::list; + + +namespace Ingen { namespace Client { + class PatchModel; + class PortModel; + class ControlModel; + class MetadataModel; +} } +using namespace Ingen::Client; + + +namespace Ingen { +namespace GUI { + +class LoadPluginWindow; +class LoadPatchWindow; +class NewSubpatchWindow; +class LoadSubpatchWindow; +class NewSubpatchWindow; +class NodeControlWindow; +class PatchDescriptionWindow; +class SubpatchModule; +class OmPort; +class BreadCrumbBox; + + +/** A window for a patch. + * + * \ingroup GUI + */ +class PatchWindow : public Gtk::Window +{ +public: + PatchWindow(BaseObjectType* cobject, const Glib::RefPtr& glade_xml); + ~PatchWindow(); + + void set_patch_from_path(const Path& path, SharedPtr view); + void set_patch(SharedPtr pc, SharedPtr view); + + SharedPtr patch() const { return _patch; } + + Gtk::MenuItem* menu_view_control_window() { return _menu_view_control_window; } + +protected: + void on_show(); + void on_hide(); + bool on_key_press_event(GdkEventKey* event); + +private: + + void patch_port_added(SharedPtr port); + void patch_port_removed(SharedPtr port); + + void event_import(); + void event_import_location(); + void event_save(); + void event_save_as(); + void event_upload(); + void event_copy(); + void event_delete(); + void event_quit(); + void event_destroy(); + void event_clear(); + void event_fullscreen_toggled(); + void event_arrange(); + void event_show_properties(); + void event_show_controls(); + void event_show_engine(); + + SharedPtr _patch; + SharedPtr _view; + + sigc::connection new_port_connection; + sigc::connection removed_port_connection; + + bool _enable_signal; + bool _position_stored; + int _x; + int _y; + + Gtk::MenuItem* _menu_import; + Gtk::MenuItem* _menu_import_location; + Gtk::MenuItem* _menu_save; + Gtk::MenuItem* _menu_save_as; + Gtk::MenuItem* _menu_upload; + Gtk::MenuItem* _menu_cut; + Gtk::MenuItem* _menu_copy; + Gtk::MenuItem* _menu_paste; + Gtk::MenuItem* _menu_delete; + Gtk::MenuItem* _menu_configuration; + Gtk::MenuItem* _menu_close; + Gtk::MenuItem* _menu_quit; + Gtk::MenuItem* _menu_fullscreen; + Gtk::MenuItem* _menu_clear; + Gtk::MenuItem* _menu_destroy_patch; + 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_messages_window; + Gtk::MenuItem* _menu_view_patch_tree_window; + Gtk::MenuItem* _menu_help_about; + + Gtk::VBox* _vbox; + Gtk::Viewport* _viewport; + BreadCrumbBox* _breadcrumb_box; + + //Gtk::Statusbar* _status_bar; + + /** Invisible bin used to store breadcrumbs when not shown by a view */ + Gtk::Alignment _breadcrumb_bin; +}; + + +} // namespace GUI +} // namespace Ingen + +#endif // PATCHWINDOW_H diff --git a/src/libs/gui/Port.cpp b/src/libs/gui/Port.cpp index a03a60d4..4b824f15 100644 --- a/src/libs/gui/Port.cpp +++ b/src/libs/gui/Port.cpp @@ -17,13 +17,13 @@ #include #include -#include "interface/EngineInterface.h" -#include "client/PatchModel.h" -#include "client/PortModel.h" -#include "client/ControlModel.h" -#include "Configuration.h" -#include "App.h" -#include "Port.h" +#include "interface/EngineInterface.hpp" +#include "client/PatchModel.hpp" +#include "client/PortModel.hpp" +#include "client/ControlModel.hpp" +#include "Configuration.hpp" +#include "App.hpp" +#include "Port.hpp" using std::cerr; using std::endl; using namespace Ingen::Client; diff --git a/src/libs/gui/Port.h b/src/libs/gui/Port.h deleted file mode 100644 index 507ced21..00000000 --- a/src/libs/gui/Port.h +++ /dev/null @@ -1,57 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef PORT_H -#define PORT_H - -#include -#include -#include -#include - -namespace Ingen { namespace Client { class PortModel; } } -using Ingen::Client::PortModel; - -namespace Ingen { -namespace GUI { - - -/** A Port on an Module. - * - * \ingroup GUI - */ -class Port : public FlowCanvas::Port -{ -public: - Port(boost::shared_ptr module, SharedPtr pm, bool flip = false, bool destroyable = false); - - virtual ~Port() {} - - SharedPtr model() const { return _port_model; } - -private: - - void on_menu_destroy(); - - SharedPtr _port_model; -}; - - -} // namespace GUI -} // namespace Ingen - -#endif // PORT_H diff --git a/src/libs/gui/Port.hpp b/src/libs/gui/Port.hpp new file mode 100644 index 00000000..84a1643c --- /dev/null +++ b/src/libs/gui/Port.hpp @@ -0,0 +1,57 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef PORT_H +#define PORT_H + +#include +#include +#include +#include + +namespace Ingen { namespace Client { class PortModel; } } +using Ingen::Client::PortModel; + +namespace Ingen { +namespace GUI { + + +/** A Port on an Module. + * + * \ingroup GUI + */ +class Port : public FlowCanvas::Port +{ +public: + Port(boost::shared_ptr module, SharedPtr pm, bool flip = false, bool destroyable = false); + + virtual ~Port() {} + + SharedPtr model() const { return _port_model; } + +private: + + void on_menu_destroy(); + + SharedPtr _port_model; +}; + + +} // namespace GUI +} // namespace Ingen + +#endif // PORT_H diff --git a/src/libs/gui/PortPropertiesWindow.cpp b/src/libs/gui/PortPropertiesWindow.cpp index 92df6ce5..e3afad5b 100644 --- a/src/libs/gui/PortPropertiesWindow.cpp +++ b/src/libs/gui/PortPropertiesWindow.cpp @@ -17,12 +17,12 @@ #include #include -#include "interface/EngineInterface.h" -#include "client/NodeModel.h" -#include "client/PluginModel.h" -#include "App.h" -#include "ControlGroups.h" -#include "PortPropertiesWindow.h" +#include "interface/EngineInterface.hpp" +#include "client/NodeModel.hpp" +#include "client/PluginModel.hpp" +#include "App.hpp" +#include "ControlGroups.hpp" +#include "PortPropertiesWindow.hpp" using std::string; diff --git a/src/libs/gui/PortPropertiesWindow.h b/src/libs/gui/PortPropertiesWindow.h deleted file mode 100644 index b7900bc6..00000000 --- a/src/libs/gui/PortPropertiesWindow.h +++ /dev/null @@ -1,70 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef PORTPROPERTIESWINDOW_H -#define PORTPROPERTIESWINDOW_H - -#include -#include -#include -#include "client/PortModel.h" -using namespace Ingen::Client; - -namespace Ingen { -namespace GUI { - -class ControlGroup; - - -/** Port properties window. - * - * Loaded by libglade as a derived object. - * - * \ingroup GUI - */ -class PortPropertiesWindow : public Gtk::Dialog -{ -public: - PortPropertiesWindow(BaseObjectType* cobject, const Glib::RefPtr& refGlade); - - void init(ControlGroup* control, SharedPtr port_model); - -private: - void metadata_update(const string& key, const Atom& value); - void min_changed(); - void max_changed(); - - void ok(); - void cancel(); - - bool _enable_signal; - - float _initial_min; - float _initial_max; - - ControlGroup* _control; - SharedPtr _port_model; - Gtk::SpinButton* _min_spinner; - Gtk::SpinButton* _max_spinner; - Gtk::Button* _cancel_button; - Gtk::Button* _ok_button; -}; - -} // namespace GUI -} // namespace Ingen - -#endif // PORTPROPERTIESWINDOW_H diff --git a/src/libs/gui/PortPropertiesWindow.hpp b/src/libs/gui/PortPropertiesWindow.hpp new file mode 100644 index 00000000..8c8f1c96 --- /dev/null +++ b/src/libs/gui/PortPropertiesWindow.hpp @@ -0,0 +1,70 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef PORTPROPERTIESWINDOW_H +#define PORTPROPERTIESWINDOW_H + +#include +#include +#include +#include "client/PortModel.hpp" +using namespace Ingen::Client; + +namespace Ingen { +namespace GUI { + +class ControlGroup; + + +/** Port properties window. + * + * Loaded by libglade as a derived object. + * + * \ingroup GUI + */ +class PortPropertiesWindow : public Gtk::Dialog +{ +public: + PortPropertiesWindow(BaseObjectType* cobject, const Glib::RefPtr& refGlade); + + void init(ControlGroup* control, SharedPtr port_model); + +private: + void metadata_update(const string& key, const Atom& value); + void min_changed(); + void max_changed(); + + void ok(); + void cancel(); + + bool _enable_signal; + + float _initial_min; + float _initial_max; + + ControlGroup* _control; + SharedPtr _port_model; + Gtk::SpinButton* _min_spinner; + Gtk::SpinButton* _max_spinner; + Gtk::Button* _cancel_button; + Gtk::Button* _ok_button; +}; + +} // namespace GUI +} // namespace Ingen + +#endif // PORTPROPERTIESWINDOW_H diff --git a/src/libs/gui/RenameWindow.cpp b/src/libs/gui/RenameWindow.cpp index d9c474a8..04ffdd9f 100644 --- a/src/libs/gui/RenameWindow.cpp +++ b/src/libs/gui/RenameWindow.cpp @@ -17,11 +17,11 @@ #include #include -#include "interface/EngineInterface.h" -#include "client/ObjectModel.h" -#include "client/Store.h" -#include "App.h" -#include "RenameWindow.h" +#include "interface/EngineInterface.hpp" +#include "client/ObjectModel.hpp" +#include "client/Store.hpp" +#include "App.hpp" +#include "RenameWindow.hpp" using std::string; diff --git a/src/libs/gui/RenameWindow.h b/src/libs/gui/RenameWindow.h deleted file mode 100644 index 56ee3d5a..00000000 --- a/src/libs/gui/RenameWindow.h +++ /dev/null @@ -1,60 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef RENAMEWINDOW_H -#define RENAMEWINDOW_H - -#include -#include -#include -#include "client/ObjectModel.h" -using Ingen::Client::ObjectModel; - -namespace Ingen { -namespace GUI { - - -/** Rename window. Handles renaming of any (Ingen) object. - * - * \ingroup GUI - */ -class RenameWindow : public Gtk::Window -{ -public: - RenameWindow(BaseObjectType* cobject, const Glib::RefPtr& refGlade); - - void present(SharedPtr object) { set_object(object); Gtk::Window::present(); } - -private: - void set_object(SharedPtr object); - - void name_changed(); - void cancel_clicked(); - void ok_clicked(); - - SharedPtr _object; - - Gtk::Entry* _name_entry; - Gtk::Label* _message_label; - Gtk::Button* _cancel_button; - Gtk::Button* _ok_button; -}; - -} // namespace GUI -} // namespace Ingen - -#endif // RENAMEWINDOW_H diff --git a/src/libs/gui/RenameWindow.hpp b/src/libs/gui/RenameWindow.hpp new file mode 100644 index 00000000..3cf37f7c --- /dev/null +++ b/src/libs/gui/RenameWindow.hpp @@ -0,0 +1,60 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef RENAMEWINDOW_H +#define RENAMEWINDOW_H + +#include +#include +#include +#include "client/ObjectModel.hpp" +using Ingen::Client::ObjectModel; + +namespace Ingen { +namespace GUI { + + +/** Rename window. Handles renaming of any (Ingen) object. + * + * \ingroup GUI + */ +class RenameWindow : public Gtk::Window +{ +public: + RenameWindow(BaseObjectType* cobject, const Glib::RefPtr& refGlade); + + void present(SharedPtr object) { set_object(object); Gtk::Window::present(); } + +private: + void set_object(SharedPtr object); + + void name_changed(); + void cancel_clicked(); + void ok_clicked(); + + SharedPtr _object; + + Gtk::Entry* _name_entry; + Gtk::Label* _message_label; + Gtk::Button* _cancel_button; + Gtk::Button* _ok_button; +}; + +} // namespace GUI +} // namespace Ingen + +#endif // RENAMEWINDOW_H diff --git a/src/libs/gui/SubpatchModule.cpp b/src/libs/gui/SubpatchModule.cpp index 475774bc..b2a4d43f 100644 --- a/src/libs/gui/SubpatchModule.cpp +++ b/src/libs/gui/SubpatchModule.cpp @@ -15,18 +15,18 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "SubpatchModule.h" +#include "SubpatchModule.hpp" #include #include -#include "interface/EngineInterface.h" -#include "client/PatchModel.h" -#include "App.h" -#include "NodeModule.h" -#include "NodeControlWindow.h" -#include "PatchWindow.h" -#include "PatchCanvas.h" -#include "Port.h" -#include "WindowFactory.h" +#include "interface/EngineInterface.hpp" +#include "client/PatchModel.hpp" +#include "App.hpp" +#include "NodeModule.hpp" +#include "NodeControlWindow.hpp" +#include "PatchWindow.hpp" +#include "PatchCanvas.hpp" +#include "Port.hpp" +#include "WindowFactory.hpp" using std::cerr; using std::cout; using std::endl; namespace Ingen { diff --git a/src/libs/gui/SubpatchModule.h b/src/libs/gui/SubpatchModule.h deleted file mode 100644 index 4dc17e8b..00000000 --- a/src/libs/gui/SubpatchModule.h +++ /dev/null @@ -1,71 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - - -#ifndef SUBPATCHMODULE_H -#define SUBPATCHMODULE_H - -#include -#include -#include -#include "client/PatchModel.h" -#include "PatchPortModule.h" -#include "NodeModule.h" -using std::string; using std::list; - -namespace Ingen { namespace Client { - class PatchModel; - class NodeModel; - class PortModel; - class PatchWindow; -} } -using namespace Ingen::Client; - -namespace Ingen { -namespace GUI { - -class PatchCanvas; -class NodeControlWindow; - - -/** A module to represent a subpatch - * - * \ingroup GUI - */ -class SubpatchModule : public NodeModule -{ -public: - SubpatchModule(boost::shared_ptr canvas, SharedPtr controller); - virtual ~SubpatchModule() {} - - void on_double_click(GdkEventButton* ev); - - void show_dialog(); - void browse_to_patch(); - void menu_remove(); - - SharedPtr patch() { return _patch; } - -protected: - SharedPtr _patch; -}; - - -} // namespace GUI -} // namespace Ingen - -#endif // SUBPATCHMODULE_H diff --git a/src/libs/gui/SubpatchModule.hpp b/src/libs/gui/SubpatchModule.hpp new file mode 100644 index 00000000..44e37e62 --- /dev/null +++ b/src/libs/gui/SubpatchModule.hpp @@ -0,0 +1,71 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + +#ifndef SUBPATCHMODULE_H +#define SUBPATCHMODULE_H + +#include +#include +#include +#include "client/PatchModel.hpp" +#include "PatchPortModule.hpp" +#include "NodeModule.hpp" +using std::string; using std::list; + +namespace Ingen { namespace Client { + class PatchModel; + class NodeModel; + class PortModel; + class PatchWindow; +} } +using namespace Ingen::Client; + +namespace Ingen { +namespace GUI { + +class PatchCanvas; +class NodeControlWindow; + + +/** A module to represent a subpatch + * + * \ingroup GUI + */ +class SubpatchModule : public NodeModule +{ +public: + SubpatchModule(boost::shared_ptr canvas, SharedPtr controller); + virtual ~SubpatchModule() {} + + void on_double_click(GdkEventButton* ev); + + void show_dialog(); + void browse_to_patch(); + void menu_remove(); + + SharedPtr patch() { return _patch; } + +protected: + SharedPtr _patch; +}; + + +} // namespace GUI +} // namespace Ingen + +#endif // SUBPATCHMODULE_H diff --git a/src/libs/gui/ThreadedLoader.cpp b/src/libs/gui/ThreadedLoader.cpp index 75850a5f..653f18b0 100644 --- a/src/libs/gui/ThreadedLoader.cpp +++ b/src/libs/gui/ThreadedLoader.cpp @@ -18,10 +18,10 @@ #include #include #include -#include "client/PatchModel.h" -#include "module/Module.h" -#include "App.h" -#include "ThreadedLoader.h" +#include "client/PatchModel.hpp" +#include "module/Module.hpp" +#include "App.hpp" +#include "ThreadedLoader.hpp" using std::cout; using std::endl; namespace Ingen { diff --git a/src/libs/gui/ThreadedLoader.h b/src/libs/gui/ThreadedLoader.h deleted file mode 100644 index 1494a9fb..00000000 --- a/src/libs/gui/ThreadedLoader.h +++ /dev/null @@ -1,98 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef THREADEDLOADER_H -#define THREADEDLOADER_H - -#include -#include -#include -#include -#include -#include -#include -#include "interface/EngineInterface.h" -#include "client/PatchModel.h" -#include "client/Serializer.h" -#include "client/DeprecatedLoader.h" -#include "serialisation/Loader.h" -using std::string; -using std::list; -using boost::optional; - -using namespace Ingen::Client; -using namespace Ingen::Serialisation; - -namespace Ingen { -namespace GUI { - - -/** Thread for loading patch 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. - * - * Implemented as a slave with a list of closures (events) which processes - * all events in the (mutex protected) list each time it's whipped. - * - * \ingroup GUI - */ -class ThreadedLoader : public Raul::Slave -{ -public: - ThreadedLoader(SharedPtr engine); - ~ThreadedLoader(); - - // FIXME: there's a pattern here.... - // (same core interface as Loader/Serializer) - - void load_patch(bool merge, - const string& data_base_uri, - const Path& data_path, - MetadataMap engine_data, - optional engine_parent, - optional engine_name = optional(), - optional engine_poly = optional()); - - void save_patch(SharedPtr model, const string& filename, bool recursive); - -private: - - void save_patch_event(SharedPtr model, const string& filename, bool recursive); - - /** Returns nothing and takes no parameters (because they have all been bound) */ - typedef sigc::slot Closure; - - void _whipped(); - - SharedPtr _serialisation_module; - - SharedPtr _engine; - SharedPtr _loader; - - DeprecatedLoader _deprecated_loader; - Serializer _serializer; - Glib::Mutex _mutex; - list _events; -}; - - -} // namespace GUI -} // namespace Ingen - -#endif // LOADERRTHREAD_H diff --git a/src/libs/gui/ThreadedLoader.hpp b/src/libs/gui/ThreadedLoader.hpp new file mode 100644 index 00000000..e8574f6f --- /dev/null +++ b/src/libs/gui/ThreadedLoader.hpp @@ -0,0 +1,98 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef THREADEDLOADER_H +#define THREADEDLOADER_H + +#include +#include +#include +#include +#include +#include +#include +#include "interface/EngineInterface.hpp" +#include "client/PatchModel.hpp" +#include "client/Serializer.hpp" +#include "client/DeprecatedLoader.hpp" +#include "serialisation/Loader.hpp" +using std::string; +using std::list; +using boost::optional; + +using namespace Ingen::Client; +using namespace Ingen::Serialisation; + +namespace Ingen { +namespace GUI { + + +/** Thread for loading patch 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. + * + * Implemented as a slave with a list of closures (events) which processes + * all events in the (mutex protected) list each time it's whipped. + * + * \ingroup GUI + */ +class ThreadedLoader : public Raul::Slave +{ +public: + ThreadedLoader(SharedPtr engine); + ~ThreadedLoader(); + + // FIXME: there's a pattern here.... + // (same core interface as Loader/Serializer) + + void load_patch(bool merge, + const string& data_base_uri, + const Path& data_path, + MetadataMap engine_data, + optional engine_parent, + optional engine_name = optional(), + optional engine_poly = optional()); + + void save_patch(SharedPtr model, const string& filename, bool recursive); + +private: + + void save_patch_event(SharedPtr model, const string& filename, bool recursive); + + /** Returns nothing and takes no parameters (because they have all been bound) */ + typedef sigc::slot Closure; + + void _whipped(); + + SharedPtr _serialisation_module; + + SharedPtr _engine; + SharedPtr _loader; + + DeprecatedLoader _deprecated_loader; + Serializer _serializer; + Glib::Mutex _mutex; + list _events; +}; + + +} // namespace GUI +} // namespace Ingen + +#endif // LOADERRTHREAD_H diff --git a/src/libs/gui/UploadPatchWindow.cpp b/src/libs/gui/UploadPatchWindow.cpp index 7def01a0..46be0987 100644 --- a/src/libs/gui/UploadPatchWindow.cpp +++ b/src/libs/gui/UploadPatchWindow.cpp @@ -21,14 +21,14 @@ #include #include #include -#include -#include "interface/EngineInterface.h" -#include "client/Serializer.h" -#include "client/PatchModel.h" -#include "UploadPatchWindow.h" -#include "App.h" -#include "Configuration.h" -#include "ThreadedLoader.h" +#include +#include "interface/EngineInterface.hpp" +#include "client/Serializer.hpp" +#include "client/PatchModel.hpp" +#include "UploadPatchWindow.hpp" +#include "App.hpp" +#include "Configuration.hpp" +#include "ThreadedLoader.hpp" using boost::optional; using namespace Raul; diff --git a/src/libs/gui/UploadPatchWindow.h b/src/libs/gui/UploadPatchWindow.h deleted file mode 100644 index 13272215..00000000 --- a/src/libs/gui/UploadPatchWindow.h +++ /dev/null @@ -1,105 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef UPLOADPATCHWINDOW_H -#define UPLOADPATCHWINDOW_H - -#include -#include -#include -#include -#include -#include -#include -#include "client/PatchModel.h" -#include "client/PluginModel.h" -using Ingen::Client::PatchModel; -using Ingen::Client::MetadataMap; - -namespace Ingen { -namespace GUI { - -class UploadPatchWindow; - - -class UploadThread : public Raul::Thread { -public: - UploadThread(UploadPatchWindow* win, - const string& str, - const string& url); - -private: - static size_t curl_read_cb(void* ptr, size_t size, size_t nmemb, void *stream); - static int curl_progress_cb(void* thread, double dltotal, double dlnow, double ultotal, double ulnow); - - void _run(); - - CURL* _curl; - curl_slist* _headers; - UploadPatchWindow* _win; - size_t _length; - std::istringstream _stream; - std::string _url; -}; - - -/* Upload patch dialog. - * - * \ingroup GUI - */ -class UploadPatchWindow : public Gtk::Dialog -{ -public: - UploadPatchWindow(BaseObjectType* cobject, const Glib::RefPtr& xml); - - void present(SharedPtr patch); - - Gtk::ProgressBar* progress_bar() { return _upload_progress; } - - void set_response(int response) { _response = response; } - void set_progress(int pct) { _progress_pct = pct; } - -private: - bool is_symbol(const Glib::ustring& str); - void symbol_changed(); - void short_name_changed(); - void cancel_clicked(); - void upload_clicked(); - void on_show(); - void on_hide(); - bool progress_callback(); - - UploadThread* _thread; - - SharedPtr _patch; - - Raul::AtomicInt _progress_pct; - Raul::AtomicInt _response; - - Gtk::Entry* _symbol_entry; - Gtk::Entry* _short_name_entry; - Gtk::ProgressBar* _upload_progress; - Gtk::Button* _cancel_button; - Gtk::Button* _upload_button; - -}; - - -} // namespace GUI -} // namespace Ingen - -#endif // UPLOADPATCHWINDOW_H diff --git a/src/libs/gui/UploadPatchWindow.hpp b/src/libs/gui/UploadPatchWindow.hpp new file mode 100644 index 00000000..c3de55fa --- /dev/null +++ b/src/libs/gui/UploadPatchWindow.hpp @@ -0,0 +1,105 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef UPLOADPATCHWINDOW_H +#define UPLOADPATCHWINDOW_H + +#include +#include +#include +#include +#include +#include +#include +#include "client/PatchModel.hpp" +#include "client/PluginModel.hpp" +using Ingen::Client::PatchModel; +using Ingen::Client::MetadataMap; + +namespace Ingen { +namespace GUI { + +class UploadPatchWindow; + + +class UploadThread : public Raul::Thread { +public: + UploadThread(UploadPatchWindow* win, + const string& str, + const string& url); + +private: + static size_t curl_read_cb(void* ptr, size_t size, size_t nmemb, void *stream); + static int curl_progress_cb(void* thread, double dltotal, double dlnow, double ultotal, double ulnow); + + void _run(); + + CURL* _curl; + curl_slist* _headers; + UploadPatchWindow* _win; + size_t _length; + std::istringstream _stream; + std::string _url; +}; + + +/* Upload patch dialog. + * + * \ingroup GUI + */ +class UploadPatchWindow : public Gtk::Dialog +{ +public: + UploadPatchWindow(BaseObjectType* cobject, const Glib::RefPtr& xml); + + void present(SharedPtr patch); + + Gtk::ProgressBar* progress_bar() { return _upload_progress; } + + void set_response(int response) { _response = response; } + void set_progress(int pct) { _progress_pct = pct; } + +private: + bool is_symbol(const Glib::ustring& str); + void symbol_changed(); + void short_name_changed(); + void cancel_clicked(); + void upload_clicked(); + void on_show(); + void on_hide(); + bool progress_callback(); + + UploadThread* _thread; + + SharedPtr _patch; + + Raul::AtomicInt _progress_pct; + Raul::AtomicInt _response; + + Gtk::Entry* _symbol_entry; + Gtk::Entry* _short_name_entry; + Gtk::ProgressBar* _upload_progress; + Gtk::Button* _cancel_button; + Gtk::Button* _upload_button; + +}; + + +} // namespace GUI +} // namespace Ingen + +#endif // UPLOADPATCHWINDOW_H diff --git a/src/libs/gui/WindowFactory.cpp b/src/libs/gui/WindowFactory.cpp index 7c2e3eaa..9f128e8e 100644 --- a/src/libs/gui/WindowFactory.cpp +++ b/src/libs/gui/WindowFactory.cpp @@ -15,20 +15,20 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "WindowFactory.h" -#include "App.h" -#include "PatchWindow.h" -#include "GladeFactory.h" -#include "NodePropertiesWindow.h" -#include "PatchPropertiesWindow.h" -#include "NodeControlWindow.h" -#include "LoadPluginWindow.h" -#include "LoadPatchWindow.h" -#include "LoadRemotePatchWindow.h" -#include "UploadPatchWindow.h" -#include "LoadSubpatchWindow.h" -#include "RenameWindow.h" -#include "NewSubpatchWindow.h" +#include "WindowFactory.hpp" +#include "App.hpp" +#include "PatchWindow.hpp" +#include "GladeFactory.hpp" +#include "NodePropertiesWindow.hpp" +#include "PatchPropertiesWindow.hpp" +#include "NodeControlWindow.hpp" +#include "LoadPluginWindow.hpp" +#include "LoadPatchWindow.hpp" +#include "LoadRemotePatchWindow.hpp" +#include "UploadPatchWindow.hpp" +#include "LoadSubpatchWindow.hpp" +#include "RenameWindow.hpp" +#include "NewSubpatchWindow.hpp" namespace Ingen { namespace GUI { diff --git a/src/libs/gui/WindowFactory.h b/src/libs/gui/WindowFactory.h deleted file mode 100644 index c3170dce..00000000 --- a/src/libs/gui/WindowFactory.h +++ /dev/null @@ -1,105 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef WINDOW_FACTORY_H -#define WINDOW_FACTORY_H - -#include -#include -#include -#include "client/PatchModel.h" -#include "PatchView.h" - -using Ingen::Client::PatchModel; - -namespace Ingen { -namespace GUI { - -class PatchWindow; -class NodeControlWindow; -class NodePropertiesWindow; -class PatchPropertiesWindow; -class LoadPatchWindow; -class LoadRemotePatchWindow; -class UploadPatchWindow; -class RenameWindow; - - -/** Manager/Factory for all windows. - * - * This serves as a nice centralized spot for all window management issues, - * as well as an enumeration of all windows (the goal being to reduce that - * number as much as possible). - */ -class WindowFactory { -public: - WindowFactory(); - ~WindowFactory(); - - size_t num_open_patch_windows(); - - PatchWindow* patch_window(SharedPtr patch); - NodeControlWindow* control_window(SharedPtr node); - - void present_patch(SharedPtr patch, - PatchWindow* preferred = NULL, - SharedPtr patch = SharedPtr()); - - void present_controls(SharedPtr node); - - void present_load_plugin(SharedPtr patch, MetadataMap data = MetadataMap()); - void present_load_patch(SharedPtr patch, MetadataMap data = MetadataMap()); - void present_load_remote_patch(SharedPtr patch, MetadataMap data = MetadataMap()); - void present_upload_patch(SharedPtr patch); - void present_new_subpatch(SharedPtr patch, MetadataMap data = MetadataMap()); - void present_load_subpatch(SharedPtr patch, MetadataMap data = MetadataMap()); - void present_rename(SharedPtr object); - void present_properties(SharedPtr node); - - bool remove_patch_window(PatchWindow* win, GdkEventAny* ignored = NULL); - - void clear(); - -private: - typedef std::map PatchWindowMap; - typedef std::map ControlWindowMap; - - PatchWindow* new_patch_window(SharedPtr patch, SharedPtr view); - - - NodeControlWindow* new_control_window(SharedPtr node); - bool remove_control_window(NodeControlWindow* win, GdkEventAny* ignored); - - PatchWindowMap _patch_windows; - ControlWindowMap _control_windows; - - LoadPluginWindow* _load_plugin_win; - LoadPatchWindow* _load_patch_win; - LoadRemotePatchWindow* _load_remote_patch_win; - UploadPatchWindow* _upload_patch_win; - NewSubpatchWindow* _new_subpatch_win; - LoadSubpatchWindow* _load_subpatch_win; - NodePropertiesWindow* _node_properties_win; - PatchPropertiesWindow* _patch_properties_win; - RenameWindow* _rename_win; -}; - - -} // namespace GUI -} // namespace Ingen - -#endif // WINDOW_FACTORY_H diff --git a/src/libs/gui/WindowFactory.hpp b/src/libs/gui/WindowFactory.hpp new file mode 100644 index 00000000..0227f728 --- /dev/null +++ b/src/libs/gui/WindowFactory.hpp @@ -0,0 +1,105 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef WINDOW_FACTORY_H +#define WINDOW_FACTORY_H + +#include +#include +#include +#include "client/PatchModel.hpp" +#include "PatchView.hpp" + +using Ingen::Client::PatchModel; + +namespace Ingen { +namespace GUI { + +class PatchWindow; +class NodeControlWindow; +class NodePropertiesWindow; +class PatchPropertiesWindow; +class LoadPatchWindow; +class LoadRemotePatchWindow; +class UploadPatchWindow; +class RenameWindow; + + +/** Manager/Factory for all windows. + * + * This serves as a nice centralized spot for all window management issues, + * as well as an enumeration of all windows (the goal being to reduce that + * number as much as possible). + */ +class WindowFactory { +public: + WindowFactory(); + ~WindowFactory(); + + size_t num_open_patch_windows(); + + PatchWindow* patch_window(SharedPtr patch); + NodeControlWindow* control_window(SharedPtr node); + + void present_patch(SharedPtr patch, + PatchWindow* preferred = NULL, + SharedPtr patch = SharedPtr()); + + void present_controls(SharedPtr node); + + void present_load_plugin(SharedPtr patch, MetadataMap data = MetadataMap()); + void present_load_patch(SharedPtr patch, MetadataMap data = MetadataMap()); + void present_load_remote_patch(SharedPtr patch, MetadataMap data = MetadataMap()); + void present_upload_patch(SharedPtr patch); + void present_new_subpatch(SharedPtr patch, MetadataMap data = MetadataMap()); + void present_load_subpatch(SharedPtr patch, MetadataMap data = MetadataMap()); + void present_rename(SharedPtr object); + void present_properties(SharedPtr node); + + bool remove_patch_window(PatchWindow* win, GdkEventAny* ignored = NULL); + + void clear(); + +private: + typedef std::map PatchWindowMap; + typedef std::map ControlWindowMap; + + PatchWindow* new_patch_window(SharedPtr patch, SharedPtr view); + + + NodeControlWindow* new_control_window(SharedPtr node); + bool remove_control_window(NodeControlWindow* win, GdkEventAny* ignored); + + PatchWindowMap _patch_windows; + ControlWindowMap _control_windows; + + LoadPluginWindow* _load_plugin_win; + LoadPatchWindow* _load_patch_win; + LoadRemotePatchWindow* _load_remote_patch_win; + UploadPatchWindow* _upload_patch_win; + NewSubpatchWindow* _new_subpatch_win; + LoadSubpatchWindow* _load_subpatch_win; + NodePropertiesWindow* _node_properties_win; + PatchPropertiesWindow* _patch_properties_win; + RenameWindow* _rename_win; +}; + + +} // namespace GUI +} // namespace Ingen + +#endif // WINDOW_FACTORY_H diff --git a/src/libs/gui/gui.cpp b/src/libs/gui/gui.cpp index bd73ac91..689adf62 100644 --- a/src/libs/gui/gui.cpp +++ b/src/libs/gui/gui.cpp @@ -15,10 +15,10 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "gui.h" -#include "ConnectWindow.h" -#include "App.h" -#include "Configuration.h" +#include "gui.hpp" +#include "ConnectWindow.hpp" +#include "App.hpp" +#include "Configuration.hpp" namespace Ingen { namespace GUI { diff --git a/src/libs/gui/gui.h b/src/libs/gui/gui.h deleted file mode 100644 index 2c229109..00000000 --- a/src/libs/gui/gui.h +++ /dev/null @@ -1,45 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef INGEN_GUI_H -#define INGEN_GUI_H - -#include - -namespace Ingen { - -class Engine; - -namespace Shared { class EngineInterface; } - -namespace GUI { - - -extern "C" { - - void run(int argc, char** argv, - SharedPtr engine, - SharedPtr interface); - -} - - -} // namesace GUI -} // namespace Ingen - -#endif // INGEN_GUI_H - diff --git a/src/libs/gui/gui.hpp b/src/libs/gui/gui.hpp new file mode 100644 index 00000000..992aa9d4 --- /dev/null +++ b/src/libs/gui/gui.hpp @@ -0,0 +1,45 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef INGEN_GUI_H +#define INGEN_GUI_H + +#include + +namespace Ingen { + +class Engine; + +namespace Shared { class EngineInterface; } + +namespace GUI { + + +extern "C" { + + void run(int argc, char** argv, + SharedPtr engine, + SharedPtr interface); + +} + + +} // namesace GUI +} // namespace Ingen + +#endif // INGEN_GUI_H + -- cgit v1.2.1