summaryrefslogtreecommitdiffstats
path: root/src/progs/ingenuity/PatchCanvas.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-10-03 22:24:22 +0000
committerDavid Robillard <d@drobilla.net>2006-10-03 22:24:22 +0000
commit91d5cb109563c67bdad5f3ebeaafc8e1e8f7e14a (patch)
treecb70af457552eb1b87f745989f41c31da8220583 /src/progs/ingenuity/PatchCanvas.h
parent35a5d92cfcf6815553a0939c3e2bf77c1108fd31 (diff)
downloadingen-91d5cb109563c67bdad5f3ebeaafc8e1e8f7e14a.tar.gz
ingen-91d5cb109563c67bdad5f3ebeaafc8e1e8f7e14a.tar.bz2
ingen-91d5cb109563c67bdad5f3ebeaafc8e1e8f7e14a.zip
shared_ptr bugfixes.
Updated Ingen to work with new FlowCanvas. Updated Patchage to work with new(er) FlowCanvas. git-svn-id: http://svn.drobilla.net/lad/ingen@152 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/progs/ingenuity/PatchCanvas.h')
-rw-r--r--src/progs/ingenuity/PatchCanvas.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/progs/ingenuity/PatchCanvas.h b/src/progs/ingenuity/PatchCanvas.h
index c6abeeb0..15312367 100644
--- a/src/progs/ingenuity/PatchCanvas.h
+++ b/src/progs/ingenuity/PatchCanvas.h
@@ -18,11 +18,14 @@
#define OMPATCHBAYAREA_H
#include <string>
+#include <boost/shared_ptr.hpp>
#include <flowcanvas/FlowCanvas.h>
+#include <flowcanvas/Module.h>
#include "util/CountedPtr.h"
#include "util/Path.h"
#include "ConnectionModel.h"
#include "PatchModel.h"
+#include "NodeModule.h"
using std::string;
using namespace LibFlowCanvas;
@@ -48,8 +51,14 @@ class PatchCanvas : public LibFlowCanvas::FlowCanvas
public:
PatchCanvas(CountedPtr<PatchModel> patch, int width, int height);
- NodeModule* find_module(const string& name)
- { return (NodeModule*)FlowCanvas::get_module(name); }
+ virtual ~PatchCanvas() {}
+
+ boost::shared_ptr<NodeModule> find_module(const string& name) {
+ return boost::dynamic_pointer_cast<NodeModule>(
+ FlowCanvas::get_module(name));
+ }
+
+ void build();
void add_node(CountedPtr<NodeModel> nm);
void remove_node(CountedPtr<NodeModel> nm);
@@ -74,12 +83,13 @@ private:
MetadataMap get_initial_data();
- void build_canvas();
-
bool canvas_event(GdkEvent* event);
- void connect(const LibFlowCanvas::Port* src_port, const LibFlowCanvas::Port* dst_port);
- void disconnect(const LibFlowCanvas::Port* src_port, const LibFlowCanvas::Port* dst_port);
+ void connect(boost::shared_ptr<LibFlowCanvas::Port> src,
+ boost::shared_ptr<LibFlowCanvas::Port> dst);
+
+ void disconnect(boost::shared_ptr<LibFlowCanvas::Port> src,
+ boost::shared_ptr<LibFlowCanvas::Port> dst);
CountedPtr<PatchModel> m_patch;