summaryrefslogtreecommitdiff
path: root/libs/ardour/session_transport.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-05-25 20:56:03 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2015-06-29 14:18:15 -0400
commit0f9cac978eff240c6290978986187334d576156c (patch)
tree8fa1ad1ff36b4d8808a9c9dd45b9159330dd4c7c /libs/ardour/session_transport.cc
parente20242c242bac17548490ad3a234955ea5f2a09f (diff)
(re)implement Yevgeny's LTC branch changes in the context of ardour-merge-from-tracks (just the libs/* section)
Diffstat (limited to 'libs/ardour/session_transport.cc')
-rw-r--r--libs/ardour/session_transport.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc
index c0765c3991..80bfb10998 100644
--- a/libs/ardour/session_transport.cc
+++ b/libs/ardour/session_transport.cc
@@ -1619,6 +1619,13 @@ Session::mtc_status_changed (bool yn)
}
void
+Session::ltc_status_changed (bool yn)
+{
+ g_atomic_int_set (&_ltc_active, yn);
+ LTCSyncStateChanged( yn );
+}
+
+void
Session::use_sync_source (Slave* new_slave)
{
/* Runs in process() context */
@@ -1642,6 +1649,18 @@ Session::use_sync_source (Slave* new_slave)
mtc_status_connection.disconnect ();
}
+ LTC_Slave* ltc_slave = dynamic_cast<LTC_Slave*> (_slave);
+ if (ltc_slave) {
+ ltc_slave->ActiveChanged.connect_same_thread (ltc_status_connection, boost::bind (&Session::ltc_status_changed, this, _1));
+ LTCSyncStateChanged (ltc_slave->locked() );
+ } else {
+ if (g_atomic_int_get (&_ltc_active) ){
+ g_atomic_int_set (&_ltc_active, 0);
+ LTCSyncStateChanged( false );
+ }
+ ltc_status_connection.disconnect ();
+ }
+
DEBUG_TRACE (DEBUG::Slave, string_compose ("set new slave to %1\n", _slave));
// need to queue this for next process() cycle