summaryrefslogtreecommitdiffstats
path: root/src/progs/gtk
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-06-12 01:13:38 +0000
committerDavid Robillard <d@drobilla.net>2006-06-12 01:13:38 +0000
commit699d3265031702602bdf4d6748b43ff14f2af72f (patch)
treed0b2e4c0a1f61ad968e9aa9b20bcedcf076a821e /src/progs/gtk
parent190e2cf3c91f8bd5b1a6f69d00e84a108c743898 (diff)
downloadingen-699d3265031702602bdf4d6748b43ff14f2af72f.tar.gz
ingen-699d3265031702602bdf4d6748b43ff14f2af72f.tar.bz2
ingen-699d3265031702602bdf4d6748b43ff14f2af72f.zip
Connections working through Store model/signal interface
git-svn-id: http://svn.drobilla.net/lad/grauph@30 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/progs/gtk')
-rw-r--r--src/progs/gtk/PatchController.cpp11
-rw-r--r--src/progs/gtk/PatchController.h4
2 files changed, 8 insertions, 7 deletions
diff --git a/src/progs/gtk/PatchController.cpp b/src/progs/gtk/PatchController.cpp
index 90ffe005..ada6b003 100644
--- a/src/progs/gtk/PatchController.cpp
+++ b/src/progs/gtk/PatchController.cpp
@@ -72,6 +72,7 @@ PatchController::PatchController(CountedPtr<PatchModel> model)
}*/
model->new_node_sig.connect(sigc::mem_fun(this, &PatchController::add_node));
+ model->new_connection_sig.connect(sigc::mem_fun(this, &PatchController::connection));
}
@@ -338,7 +339,7 @@ PatchController::create_view()
}
// Create connections
- for (list<ConnectionModel*>::const_iterator i = patch_model()->connections().begin();
+ for (list<CountedPtr<ConnectionModel> >::const_iterator i = patch_model()->connections().begin();
i != patch_model()->connections().end(); ++i) {
create_connection(*i);
}
@@ -351,7 +352,7 @@ PatchController::create_view()
/** Create a connection in the view (canvas).
*/
void
-PatchController::create_connection(const ConnectionModel* cm)
+PatchController::create_connection(CountedPtr<ConnectionModel> cm)
{
m_patch_view->canvas()->add_connection(
cm->src_port_path().parent().name(),
@@ -575,11 +576,11 @@ PatchController::remove_port(const Path& path, bool resize_module)
void
-PatchController::connection(ConnectionModel* const cm)
+PatchController::connection(CountedPtr<ConnectionModel> cm)
{
- assert(cm != NULL);
+ assert(cm);
- patch_model()->add_connection(cm);
+ //patch_model()->add_connection(cm);
if (m_patch_view != NULL)
create_connection(cm);
diff --git a/src/progs/gtk/PatchController.h b/src/progs/gtk/PatchController.h
index 553a35e1..840d5fe3 100644
--- a/src/progs/gtk/PatchController.h
+++ b/src/progs/gtk/PatchController.h
@@ -74,7 +74,7 @@ public:
virtual void add_port(CountedPtr<PortModel> pm);
virtual void remove_port(const Path& path, bool resize_module);
- void connection(ConnectionModel* const cm);
+ void connection(CountedPtr<ConnectionModel> cm);
void disconnection(const Path& src_port_path, const Path& dst_port_path);
void clear();
@@ -111,7 +111,7 @@ private:
void add_node(CountedPtr<NodeModel> nm);
void remove_node(const string& name);
- void create_connection(const ConnectionModel* cm);
+ void create_connection(CountedPtr<ConnectionModel> cm);
PatchWindow* m_window; ///< Window currently showing this patch
PatchView* m_patch_view; ///< View (canvas) of this patch