diff options
author | David Robillard <d@drobilla.net> | 2006-10-03 22:24:22 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2006-10-03 22:24:22 +0000 |
commit | 91d5cb109563c67bdad5f3ebeaafc8e1e8f7e14a (patch) | |
tree | cb70af457552eb1b87f745989f41c31da8220583 /src/progs/ingenuity/PatchPortModule.cpp | |
parent | 35a5d92cfcf6815553a0939c3e2bf77c1108fd31 (diff) | |
download | ingen-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/PatchPortModule.cpp')
-rw-r--r-- | src/progs/ingenuity/PatchPortModule.cpp | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/src/progs/ingenuity/PatchPortModule.cpp b/src/progs/ingenuity/PatchPortModule.cpp index 8843882b..2804a6a6 100644 --- a/src/progs/ingenuity/PatchPortModule.cpp +++ b/src/progs/ingenuity/PatchPortModule.cpp @@ -29,10 +29,9 @@ namespace Ingenuity { -PatchPortModule::PatchPortModule(PatchCanvas* canvas, CountedPtr<PortModel> port) +PatchPortModule::PatchPortModule(boost::shared_ptr<PatchCanvas> canvas, CountedPtr<PortModel> port) : LibFlowCanvas::Module(canvas, "", 0, 0), // FIXME: coords? - m_port(port), - m_patch_port(NULL) + m_port(port) { /*if (port_model()->polyphonic() && port_model()->parent() != NULL && port_model()->parent_patch()->poly() > 1) { @@ -42,12 +41,9 @@ PatchPortModule::PatchPortModule(PatchCanvas* canvas, CountedPtr<PortModel> port assert(canvas); assert(port); - if (PtrCast<PatchModel>(port->parent())) { - if (m_patch_port) - delete m_patch_port; - - m_patch_port = new Port(this, port, true); - } + //if (PtrCast<PatchModel>(port->parent())) { + // m_patch_port = boost::shared_ptr<Port>(new Port(shared_from_this(), port, true)); + //} resize(); @@ -67,6 +63,21 @@ PatchPortModule::PatchPortModule(PatchCanvas* canvas, CountedPtr<PortModel> port } +boost::shared_ptr<PatchPortModule> +PatchPortModule::create(boost::shared_ptr<PatchCanvas> canvas, CountedPtr<PortModel> port) +{ + boost::shared_ptr<PatchPortModule> ret = boost::shared_ptr<PatchPortModule>( + new PatchPortModule(canvas, port)); + + for (MetadataMap::const_iterator m = port->metadata().begin(); m != port->metadata().end(); ++m) + ret->metadata_update(m->first, m->second); + + ret->resize(); + + return ret; +} + + void PatchPortModule::store_location() { |