highlight mismatching slave TC

git-svn-id: svn://localhost/ardour2/branches/3.0@13442 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Robin Gareus
2012-11-11 22:06:42 +00:00
parent 8872844a60
commit b36caf3b6f

View File

@@ -1027,8 +1027,16 @@ AudioClock::set_slave_info ()
case MTC:
case MIDIClock:
if (slave) {
_left_layout->set_markup (string_compose ("<span size=\"%1\" foreground=\"green\">%2</span>",
INFO_FONT_SIZE, dynamic_cast<TimecodeSlave*>(slave)->approximate_current_position()));
bool matching;
TimecodeSlave* tcslave;
if ((tcslave = dynamic_cast<TimecodeSlave*>(_session->slave())) != 0) {
matching = (tcslave->apparent_timecode_format() == _session->config.get_timecode_format());
} else {
matching = true;
}
_left_layout->set_markup (string_compose ("<span size=\"%1\" foreground=\"%2\">%3</span>",
INFO_FONT_SIZE, (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 {