summaryrefslogtreecommitdiff
path: root/libs/ardour/transport_master.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2019-01-24 22:05:20 -0700
committerPaul Davis <paul@linuxaudiosystems.com>2019-01-25 09:23:08 -0700
commit1be3301342c74fdbb92febcbc85e8d60fb09de0e (patch)
tree4fbdc594951ed02e89c0b47e10ccaae75e9b69fd /libs/ardour/transport_master.cc
parentc01ab83e1f13f6d56a2e8ec13e9d26683dc9bb25 (diff)
new approach to handling Transport Masters when engine is restarted
Trust that ::reset() works for all transport masters, and call it when engine is stopped. This way the transport masters are ready to be called again as soon as the engine restarts.
Diffstat (limited to 'libs/ardour/transport_master.cc')
-rw-r--r--libs/ardour/transport_master.cc15
1 files changed, 14 insertions, 1 deletions
diff --git a/libs/ardour/transport_master.cc b/libs/ardour/transport_master.cc
index 2564f87c5d..8799d51486 100644
--- a/libs/ardour/transport_master.cc
+++ b/libs/ardour/transport_master.cc
@@ -19,7 +19,9 @@
#include <vector>
+#include "pbd/boost_debug.h"
#include "pbd/debug.h"
+#include "pbd/i18n.h"
#include "ardour/audioengine.h"
#include "ardour/debug.h"
@@ -30,7 +32,6 @@
#include "ardour/types_convert.h"
#include "ardour/utils.h"
-#include "pbd/i18n.h"
namespace ARDOUR {
namespace Properties {
@@ -83,6 +84,9 @@ TransportMaster::TransportMaster (SyncSource t, std::string const & name)
TransportMaster::~TransportMaster()
{
+ DEBUG_TRACE (DEBUG::Destruction, string_compose ("destroying transport master \"%1\" along with port %2\n", name(), (_port ? _port->name() : std::string ("no port"))));
+
+ unregister_port ();
}
bool
@@ -431,6 +435,15 @@ TransportMaster::display_name (bool sh) const
return S_("SyncSource|JACK");
}
+void
+TransportMaster::unregister_port ()
+{
+ if (_port) {
+ AudioEngine::instance()->unregister_port (_port);
+ _port.reset ();
+ }
+}
+
boost::shared_ptr<Port>
TransportMasterViaMIDI::create_midi_port (std::string const & port_name)
{