diff options
author | David Robillard <d@drobilla.net> | 2006-09-14 02:27:02 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2006-09-14 02:27:02 +0000 |
commit | cc384f6f622cc10fd83616256080b80dc2123aaf (patch) | |
tree | 9a5f0d7f14e04ad7effcda8be6b5924b4d61e361 /src/libs/client/PatchModel.h | |
parent | 5525b33b79b7a920cf374704e67fc6b16fe5f77c (diff) | |
download | ingen-cc384f6f622cc10fd83616256080b80dc2123aaf.tar.gz ingen-cc384f6f622cc10fd83616256080b80dc2123aaf.tar.bz2 ingen-cc384f6f622cc10fd83616256080b80dc2123aaf.zip |
Cleaned up client-side model code significantly (made everything private
so only Store can change the state of models).
Extremely broken, just committing to move code between machines :).
git-svn-id: http://svn.drobilla.net/lad/ingen@133 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/client/PatchModel.h')
-rw-r--r-- | src/libs/client/PatchModel.h | 67 |
1 files changed, 34 insertions, 33 deletions
diff --git a/src/libs/client/PatchModel.h b/src/libs/client/PatchModel.h index 49a45503..7188cb1f 100644 --- a/src/libs/client/PatchModel.h +++ b/src/libs/client/PatchModel.h @@ -31,6 +31,8 @@ using std::list; using std::string; using std::map; namespace Ingen { namespace Client { +class Store; + /** Client's model of a patch. * @@ -39,43 +41,15 @@ namespace Client { class PatchModel : public NodeModel { public: - PatchModel(const string& patch_path, size_t internal_poly) - : NodeModel("ingen:patch", patch_path, false ), // FIXME - m_enabled(false), - m_poly(internal_poly) - { - cerr << "FIXME: patch poly\n"; - } - const NodeModelMap& nodes() const { return m_nodes; } const list<CountedPtr<ConnectionModel> >& connections() const { return m_connections; } - virtual void set_path(const Path& path); - - void add_child(CountedPtr<ObjectModel> c); - void remove_child(CountedPtr<ObjectModel> c); - - CountedPtr<NodeModel> get_node(const string& node_name); - void add_node(CountedPtr<NodeModel> nm); - //void remove_node(const string& name); - void remove_node(CountedPtr<NodeModel> nm); - - void rename_node(const Path& old_path, const Path& new_path); - void rename_node_port(const Path& old_path, const Path& new_path); - - CountedPtr<ConnectionModel> get_connection(const string& src_port_path, const string& dst_port_path); - void add_connection(CountedPtr<ConnectionModel> cm); - void remove_connection(const string& src_port_path, const string& dst_port_path); - - virtual void clear(); + CountedPtr<ConnectionModel> get_connection(const string& src_port_path, const string& dst_port_path) const; + CountedPtr<NodeModel> get_node(const string& node_name) const; - size_t poly() const { return m_poly; } - void poly(size_t p) { m_poly = p; } - const string& filename() const { return m_filename; } - void filename(const string& f) { m_filename = f; } - bool enabled() const { return m_enabled; } - void enable(); - void disable(); + size_t poly() const { return m_poly; } + const string& filename() const { return m_filename; } + bool enabled() const { return m_enabled; } bool polyphonic() const; // Signals @@ -87,6 +61,33 @@ public: sigc::signal<void> disabled_sig; private: + friend class Store; + + PatchModel(const Path& patch_path, size_t internal_poly) + : NodeModel("ingen:patch", patch_path, false ), // FIXME + m_enabled(false), + m_poly(internal_poly) + { + cerr << "FIXME: patch poly\n"; + } + + void filename(const string& f) { m_filename = f; } + void poly(size_t p) { m_poly = p; } + void enable(); + void disable(); + void clear(); + void set_path(const Path& path); + void add_node(CountedPtr<NodeModel> nm); + void remove_node(CountedPtr<NodeModel> nm); + void add_child(CountedPtr<ObjectModel> c); + void remove_child(CountedPtr<ObjectModel> c); + + void add_connection(CountedPtr<ConnectionModel> cm); + void remove_connection(const string& src_port_path, const string& dst_port_path); + + void rename_node(const Path& old_path, const Path& new_path); + void rename_node_port(const Path& old_path, const Path& new_path); + // Prevent copies (undefined) PatchModel(const PatchModel& copy); PatchModel& operator=(const PatchModel& copy); |