diff options
author | David Robillard <d@drobilla.net> | 2007-02-08 03:56:42 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-02-08 03:56:42 +0000 |
commit | 1359e05f9864bf420095347e46531628d1e3d683 (patch) | |
tree | cbfea845591c759c6b73abb14cf4e85ed72eb905 /src/PatchageFlowCanvas.cpp | |
parent | 37d05ae902f1fd6ce4c243e84502b0567990058f (diff) | |
download | patchage-1359e05f9864bf420095347e46531628d1e3d683.tar.gz patchage-1359e05f9864bf420095347e46531628d1e3d683.tar.bz2 patchage-1359e05f9864bf420095347e46531628d1e3d683.zip |
Circular nodes in FlowCanvas, related necessary redesign work and changes for API update.
Beginnings of a Machina GUI.
git-svn-id: http://svn.drobilla.net/lad/patchage@290 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/PatchageFlowCanvas.cpp')
-rw-r--r-- | src/PatchageFlowCanvas.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/PatchageFlowCanvas.cpp b/src/PatchageFlowCanvas.cpp index 70b8bc3..bdb5c0a 100644 --- a/src/PatchageFlowCanvas.cpp +++ b/src/PatchageFlowCanvas.cpp @@ -15,6 +15,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include <raul/SharedPtr.h> #include "config.h" #include "PatchageFlowCanvas.h" #include "Patchage.h" @@ -35,7 +36,7 @@ PatchageFlowCanvas::PatchageFlowCanvas(Patchage* app, int width, int height) boost::shared_ptr<PatchageModule> PatchageFlowCanvas::find_module(const string& name, ModuleType type) { - for (ModuleMap::iterator m = _modules.begin(); m != _modules.end(); ++m) { + for (ItemMap::iterator m = _items.begin(); m != _items.end(); ++m) { boost::shared_ptr<PatchageModule> pm = boost::dynamic_pointer_cast<PatchageModule>((*m).second); if (pm && pm->name() == name && pm->type() == type) { return pm; @@ -51,8 +52,11 @@ boost::shared_ptr<PatchagePort> PatchageFlowCanvas::find_port(const snd_seq_addr_t* alsa_addr) { boost::shared_ptr<PatchagePort> pp; - for (ModuleMap::iterator m = _modules.begin(); m != _modules.end(); ++m) { - for (PortVector::const_iterator p = (*m).second->ports().begin(); p != (*m).second->ports().end(); ++p) { + for (ItemMap::iterator m = _items.begin(); m != _items.end(); ++m) { + SharedPtr<Module> module = PtrCast<Module>(m->second); + if (!module) + continue; + for (PortVector::const_iterator p = module->ports().begin(); p != module->ports().end(); ++p) { pp = boost::dynamic_pointer_cast<PatchagePort>(*p); if (pp && pp->type() == ALSA_MIDI && pp->alsa_addr() && pp->alsa_addr()->client == alsa_addr->client |