diff options
author | David Robillard <d@drobilla.net> | 2008-02-23 18:48:59 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-02-23 18:48:59 +0000 |
commit | 52c970b2d32cce2090efbbaaed6ff50de80958df (patch) | |
tree | 8e69392e8054c8349ce6dad9a4b4028d08e1ae7c /src/AlsaDriver.cpp | |
parent | 8efff32d97b1b578f8c42fe2db7b30cfc44ecf2f (diff) | |
download | patchage-52c970b2d32cce2090efbbaaed6ff50de80958df.tar.gz patchage-52c970b2d32cce2090efbbaaed6ff50de80958df.tar.bz2 patchage-52c970b2d32cce2090efbbaaed6ff50de80958df.zip |
Rearrange event port referencing stuff to make a bit more sense.
git-svn-id: http://svn.drobilla.net/lad/patchage@1159 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/AlsaDriver.cpp')
-rw-r--r-- | src/AlsaDriver.cpp | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/src/AlsaDriver.cpp b/src/AlsaDriver.cpp index 6fa90fc..22d1924 100644 --- a/src/AlsaDriver.cpp +++ b/src/AlsaDriver.cpp @@ -316,7 +316,8 @@ AlsaDriver::add_connections(boost::shared_ptr<PatchagePort> port) if (!connected_addr) continue; - connected_port = _app->canvas()->find_port(*connected_addr, true); + PatchageEvent::PortRef ref(*connected_addr, true); + connected_port = _app->canvas()->find_port(ref); if (connected_port && !port->is_connected_to(connected_port)) _app->canvas()->add_connection(port, connected_port, port->color() + 0x22222200); @@ -327,22 +328,6 @@ AlsaDriver::add_connections(boost::shared_ptr<PatchagePort> port) } -/** Find the PatchagePort that corresponds to an Alsa Sequencer port. - * - * This function is not realtime safe, but safe to call from the GUI thread - * (e.g. in PatchageEvent::execute). - */ -boost::shared_ptr<PatchagePort> -AlsaDriver::find_port_view(Patchage* patchage, - const PatchageEvent::PortRef& ref) -{ - if (ref.type == PatchageEvent::PortRef::ALSA_ADDR) - return patchage->canvas()->find_port(ref.id.alsa_addr, ref.is_input); - else - return boost::shared_ptr<PatchagePort>(); -} - - /** Connects two Alsa Midi ports. * * \return Whether connection succeeded. @@ -521,11 +506,11 @@ AlsaDriver::_refresh_main() switch (ev->type) { case SND_SEQ_EVENT_PORT_SUBSCRIBED: - _events.push(PatchageEvent(this, PatchageEvent::CONNECTION, + _events.push(PatchageEvent(PatchageEvent::CONNECTION, ev->data.connect.sender, ev->data.connect.dest)); break; case SND_SEQ_EVENT_PORT_UNSUBSCRIBED: - _events.push(PatchageEvent(this, PatchageEvent::DISCONNECTION, + _events.push(PatchageEvent(PatchageEvent::DISCONNECTION, ev->data.connect.sender, ev->data.connect.dest)); break; case SND_SEQ_EVENT_PORT_START: @@ -537,7 +522,7 @@ AlsaDriver::_refresh_main() case SND_SEQ_EVENT_RESET: default: // FIXME: Ultra slow kludge, use proper find-grained events - _events.push(PatchageEvent(this, PatchageEvent::REFRESH)); + _events.push(PatchageEvent(PatchageEvent::REFRESH)); } } } |