diff options
author | David Robillard <d@drobilla.net> | 2008-02-17 22:00:26 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-02-17 22:00:26 +0000 |
commit | bbb3abbe4b86a23ef884d38ca299aff13b8f9242 (patch) | |
tree | 71c193dc84cacc83daa1aa686a6e655d020f5f74 /src/AlsaDriver.cpp | |
parent | a26faf1aa846e9ab9c5ede7a424549e235cf6fb0 (diff) | |
download | patchage-bbb3abbe4b86a23ef884d38ca299aff13b8f9242.tar.gz patchage-bbb3abbe4b86a23ef884d38ca299aff13b8f9242.tar.bz2 patchage-bbb3abbe4b86a23ef884d38ca299aff13b8f9242.zip |
Remove Jack API dependence from PatchageEvent.
git-svn-id: http://svn.drobilla.net/lad/patchage@1151 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/AlsaDriver.cpp')
-rw-r--r-- | src/AlsaDriver.cpp | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/src/AlsaDriver.cpp b/src/AlsaDriver.cpp index fc5f5d1..aeca506 100644 --- a/src/AlsaDriver.cpp +++ b/src/AlsaDriver.cpp @@ -97,6 +97,14 @@ AlsaDriver::refresh() refresh_connections(); } + +boost::shared_ptr<PatchagePort> +AlsaDriver::create_port_view(Patchage* patchage, + const PatchageEvent::PortRef& ref) +{ + return boost::shared_ptr<PatchagePort>(); +} + boost::shared_ptr<PatchagePort> AlsaDriver::create_port(boost::shared_ptr<PatchageModule> parent, @@ -319,6 +327,22 @@ 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. @@ -497,11 +521,11 @@ AlsaDriver::_refresh_main() switch (ev->type) { case SND_SEQ_EVENT_PORT_SUBSCRIBED: - _events.push(PatchageEvent(PatchageEvent::CONNECTION, + _events.push(PatchageEvent(this, PatchageEvent::CONNECTION, ev->data.connect.sender, ev->data.connect.dest)); break; case SND_SEQ_EVENT_PORT_UNSUBSCRIBED: - _events.push(PatchageEvent(PatchageEvent::DISCONNECTION, + _events.push(PatchageEvent(this, PatchageEvent::DISCONNECTION, ev->data.connect.sender, ev->data.connect.dest)); break; case SND_SEQ_EVENT_PORT_START: @@ -513,7 +537,7 @@ AlsaDriver::_refresh_main() case SND_SEQ_EVENT_RESET: default: // FIXME: Ultra slow kludge, use proper find-grained events - _events.push(PatchageEvent(PatchageEvent::REFRESH)); + _events.push(PatchageEvent(this, PatchageEvent::REFRESH)); } } } |