diff --git a/libs/ardour/ardour/transport_master.h b/libs/ardour/ardour/transport_master.h index af98c0b3a2..595dceb068 100644 --- a/libs/ardour/ardour/transport_master.h +++ b/libs/ardour/ardour/transport_master.h @@ -456,6 +456,7 @@ class LIBARDOUR_API TransportMasterViaMIDI public: virtual ~TransportMasterViaMIDI (); + MIDI::Parser& transport_parser () { return parser; } boost::shared_ptr midi_port () const { return _midi_port; diff --git a/libs/ardour/ardour/transport_master_manager.h b/libs/ardour/ardour/transport_master_manager.h index 2a298f5093..6f40abe3c3 100644 --- a/libs/ardour/ardour/transport_master_manager.h +++ b/libs/ardour/ardour/transport_master_manager.h @@ -79,6 +79,7 @@ class LIBARDOUR_API TransportMasterManager : public boost::noncopyable boost::shared_ptr master_by_type (SyncSource src) const; boost::shared_ptr master_by_name (std::string const &) const; + boost::shared_ptr master_by_port (boost::shared_ptr const &p) const; TransportMasters const & transport_masters() const { return _transport_masters; } diff --git a/libs/ardour/transport_master_manager.cc b/libs/ardour/transport_master_manager.cc index ef096fe5ab..1273ae3639 100644 --- a/libs/ardour/transport_master_manager.cc +++ b/libs/ardour/transport_master_manager.cc @@ -677,6 +677,21 @@ TransportMasterManager::master_by_type (SyncSource src) const return boost::shared_ptr (); } +boost::shared_ptr +TransportMasterManager::master_by_port (boost::shared_ptr const &p) const +{ + Glib::Threads::RWLock::ReaderLock lm (lock); + + for (TransportMasters::const_iterator tm = _transport_masters.begin(); tm != _transport_masters.end(); ++tm) { + if ((*tm)->port() == p) { + return *tm; + } + } + + return boost::shared_ptr (); + +} + void TransportMasterManager::engine_stopped () {