From b15864870d34a1188eda93ad215734275037278e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 11 Sep 2006 11:10:35 +0000 Subject: Switched homebrew CountedPtr to boost::shared_ptr. Factories for patch windows, controller. Robustness updated in many places. Tons of cleanups, rewrites, bugfixes, etc. git-svn-id: http://svn.drobilla.net/lad/ingen@128 a436a847-0d15-0410-975c-d299462d15a1 --- src/progs/ingenuity/PatchController.h | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) (limited to 'src/progs/ingenuity/PatchController.h') diff --git a/src/progs/ingenuity/PatchController.h b/src/progs/ingenuity/PatchController.h index a5370826..2ee01738 100644 --- a/src/progs/ingenuity/PatchController.h +++ b/src/progs/ingenuity/PatchController.h @@ -19,9 +19,9 @@ #include #include +#include "util/CountedPtr.h" #include "NodeController.h" #include "PatchModel.h" -template class CountedPtr; namespace Ingen { namespace Client { class PatchModel; @@ -60,7 +60,6 @@ class NodeController; class PatchController : public NodeController { public: - PatchController(CountedPtr model); virtual ~PatchController(); /* @@ -68,16 +67,14 @@ public: virtual void remove_from_store(); */ - virtual void destroy(); - virtual void metadata_update(const string& key, const string& value); - virtual void add_port(CountedPtr pm); - virtual void remove_port(const Path& path, bool resize_module); + //virtual void add_port(CountedPtr pm); + //virtual void remove_port(const Path& path, bool resize_module); void connection(CountedPtr cm); void disconnection(const Path& src_port_path, const Path& dst_port_path); - void clear(); + //void clear(); void show_control_window(); void show_properties_window(); @@ -86,35 +83,31 @@ public: void claim_patch_view(); void create_module(OmFlowCanvas* canvas); - void create_view(); - PatchView* view() const { return m_patch_view; } + CountedPtr get_view(); PatchWindow* window() const { return m_window; } void window(PatchWindow* pw) { m_window = pw; } - inline string name() const { return m_model->name(); } - inline const Path& path() const { return m_model->path(); } - void set_path(const Path& new_path); //void enable(); //void disable(); - CountedPtr patch_model() const { return m_patch_model; } + const CountedPtr patch_model() const { return m_patch_model; } - void enable_controls_menuitem(); - void disable_controls_menuitem(); - private: - void add_node(CountedPtr object); - void remove_node(const string& name); + friend class ControllerFactory; + PatchController(CountedPtr model); - NodeController* create_controller_for_node(CountedPtr node); + void destroy(); + void add_node(CountedPtr object); + PatchPropertiesWindow* m_properties_window; - PatchWindow* m_window; ///< Patch Window currently showing m_patch_view - PatchView* m_patch_view; ///< View (canvas) of this patch + // FIXME: remove these + PatchWindow* m_window; ///< Patch Window currently showing m_patch_view + CountedPtr m_patch_view; ///< View (canvas) of this patch CountedPtr m_patch_model; -- cgit v1.2.1