summaryrefslogtreecommitdiffstats
path: root/src/libs/client/NodeModel.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-06-11 23:33:00 +0000
committerDavid Robillard <d@drobilla.net>2006-06-11 23:33:00 +0000
commit0b1c17f08f8eab4ada52ee98ba7353ec0260d3eb (patch)
tree09af4447ba74f392d12f2153b432cb60be1c08ab /src/libs/client/NodeModel.h
parent228279d6717e69ffd2d2a886244179635ac27c2b (diff)
downloadingen-0b1c17f08f8eab4ada52ee98ba7353ec0260d3eb.tar.gz
ingen-0b1c17f08f8eab4ada52ee98ba7353ec0260d3eb.tar.bz2
ingen-0b1c17f08f8eab4ada52ee98ba7353ec0260d3eb.zip
New nodes in gtk client working through Store signal interface
git-svn-id: http://svn.drobilla.net/lad/grauph@26 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/client/NodeModel.h')
-rw-r--r--src/libs/client/NodeModel.h22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/libs/client/NodeModel.h b/src/libs/client/NodeModel.h
index af4171ed..05df5ed5 100644
--- a/src/libs/client/NodeModel.h
+++ b/src/libs/client/NodeModel.h
@@ -21,9 +21,12 @@
#include <map>
#include <iostream>
#include <string>
+#include <sigc++/sigc++.h>
#include "ObjectModel.h"
#include "PortModel.h"
#include "util/Path.h"
+#include "util/CountedPtr.h"
+#include "PluginModel.h"
using std::string; using std::map; using std::find;
using std::cout; using std::cerr; using std::endl;
@@ -41,11 +44,11 @@ class PluginModel;
class NodeModel : public ObjectModel
{
public:
- NodeModel(const Path& node_path);
+ NodeModel(CountedPtr<PluginModel> plugin, const Path& path);
virtual ~NodeModel();
- PortModel* get_port(const string& port_name);
- void add_port(PortModel* pm);
+ CountedPtr<PortModel> get_port(const string& port_name);
+ void add_port(CountedPtr<PortModel> pm);
void remove_port(const string& port_path);
virtual void clear();
@@ -54,8 +57,8 @@ public:
void add_program(int bank, int program, const string& name);
void remove_program(int bank, int program);
- const PluginModel* plugin() const { return m_plugin; }
- void plugin(const PluginModel* const pi) { m_plugin = pi; }
+ CountedPtr<PluginModel> plugin() const { return m_plugin; }
+ //void plugin(CountedPtr<PluginModel> p) { m_plugin = p; }
virtual void set_path(const Path& p);
@@ -70,10 +73,15 @@ public:
PatchModel* parent_patch() const { return (PatchModel*)m_parent; }
+ // Signals
+ sigc::signal<void, CountedPtr<PortModel> > new_port_sig;
+
protected:
+ NodeModel(const Path& path);
+
bool m_polyphonic;
PortModelList m_ports; ///< List of ports (instead of map to preserve order)
- const PluginModel* m_plugin; ///< The plugin this node is an instance of
+ CountedPtr<PluginModel> m_plugin; ///< The plugin this node is an instance of
float m_x; ///< Just metadata, here as an optimization for OmGtk
float m_y; ///< Just metadata, here as an optimization for OmGtk
map<int, map<int, string> > m_banks; ///< DSSI banks
@@ -85,7 +93,7 @@ private:
};
-typedef map<string, NodeModel*> NodeModelMap;
+typedef map<string, CountedPtr<NodeModel> > NodeModelMap;
} // namespace LibOmClient