From 228279d6717e69ffd2d2a886244179635ac27c2b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 11 Jun 2006 03:17:16 +0000 Subject: Got store working directly through SigClientInterface git-svn-id: http://svn.drobilla.net/lad/grauph@22 a436a847-0d15-0410-975c-d299462d15a1 --- src/progs/gtk/Store.h | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) (limited to 'src/progs/gtk/Store.h') diff --git a/src/progs/gtk/Store.h b/src/progs/gtk/Store.h index 9fb4b270..d3bcbf94 100644 --- a/src/progs/gtk/Store.h +++ b/src/progs/gtk/Store.h @@ -20,17 +20,22 @@ #include #include #include +#include "util/CountedPtr.h" using std::string; using std::map; -namespace LibOmClient { class PatchModel; class PluginModel; class SigClientInterface; } +namespace LibOmClient { + class SigClientInterface; + class ObjectModel; + class PluginModel; + class PatchModel; + class NodeModel; + class PortModel; +} using namespace LibOmClient; namespace OmGtk { -class GtkObjectController; -class PatchController; -class NodeController; -class PortController; + /** Singeton which holds all "Om Objects" for easy/fast lookup * @@ -38,14 +43,11 @@ class PortController; */ class Store { public: - GtkObjectController* object(const string& path) const; - PatchController* patch(const string& path) const; - NodeController* node(const string& path) const; - PortController* port(const string& path) const; + CountedPtr object(const string& path) const; + CountedPtr patch(const string& path) const; + CountedPtr node(const string& path) const; + CountedPtr port(const string& path) const; - void add_object(GtkObjectController* object); - void remove_object(GtkObjectController* object); - size_t num_objects() { return m_objects.size(); } void add_plugin(const PluginModel* pm); @@ -61,12 +63,18 @@ private: static Store* _instance; + void add_object(ObjectModel* object); + void remove_object(ObjectModel* object); + // Slots for SigClientInterface signals void destruction_event(const string& path); void new_plugin_event(const string& type, const string& uri, const string& name); + void new_patch_event(const string& path, uint32_t poly); + void new_node_event(const string& plugin_type, const string& plugin_uri, const string& node_path, bool is_polyphonic, uint32_t num_ports); + void new_port_event(const string& path, const string& data_type, bool is_output); - map m_objects; ///< Keyed by Om path - map m_plugins; ///< Keyed by URI + map m_objects; ///< Keyed by Om path + map m_plugins; ///< Keyed by URI }; -- cgit v1.2.1