+void
+AudioClock::set_slave_info ()
+{
+ if (!_left_layout || !_right_layout) {
+ return;
+ }
+
+ SyncSource sync_src = Config->get_sync_source();
+
+ if (_session->config.get_external_sync()) {
+ Slave* slave = _session->slave();
+
+ switch (sync_src) {
+ case JACK:
+ _left_layout->set_markup (string_compose ("<span size=\"%1\" foreground=\"white\">%2</span>",
+ INFO_FONT_SIZE, sync_source_to_string(sync_src, true)));
+ _right_layout->set_text ("");
+ break;
+ case MIDIClock:
+ if (slave) {
+ _left_layout->set_markup (string_compose ("<span size=\"%1\" foreground=\"white\">%2</span>",
+ INFO_FONT_SIZE, sync_source_to_string(sync_src, true)));
+ _right_layout->set_markup (string_compose ("<span size=\"%1\" foreground=\"white\">%2</span>",
+ INFO_FONT_SIZE, slave->approximate_current_delta()));
+ } else {
+ _left_layout->set_markup (string_compose ("<span size=\"%1\" foreground=\"white\">%2</span>",
+ INFO_FONT_SIZE, _("--pending--")));
+ _right_layout->set_text ("");
+ }
+ break;
+ case LTC:
+ case MTC:
+ if (slave) {
+ bool matching;
+ TimecodeSlave* tcslave;
+ if ((tcslave = dynamic_cast<TimecodeSlave*>(_session->slave())) != 0) {
+ matching = (tcslave->apparent_timecode_format() == _session->config.get_timecode_format());
+ _left_layout->set_markup (string_compose ("<span size=\"%1\"><span foreground=\"white\">%2</span><span foreground=\"%3\">%4</span></span>",
+ INFO_FONT_SIZE, sync_source_to_string(sync_src, true)[0], (matching?"green":"red"),
+ dynamic_cast<TimecodeSlave*>(slave)->approximate_current_position()));
+ _right_layout->set_markup (string_compose ("<span size=\"%1\" foreground=\"white\">%2</span>",
+ INFO_FONT_SIZE, slave->approximate_current_delta()));
+ }
+ } else {
+ _left_layout->set_markup (string_compose ("<span size=\"%1\" foreground=\"white\">%2</span>",
+ INFO_FONT_SIZE, _("--pending--")));
+ _right_layout->set_text ("");
+ }
+ break;
+ }
+ } else {
+ _left_layout->set_markup (string_compose ("<span size=\"%1\" foreground=\"white\">INT/%2</span>",
+ INFO_FONT_SIZE, sync_source_to_string(sync_src, true)));
+ _right_layout->set_text ("");
+ }
+}
+