MIDIClock is not a Timecode slave, fix segfault

git-svn-id: svn://localhost/ardour2/branches/3.0@13446 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Robin Gareus 2012-11-11 23:11:53 +00:00
parent 6657159ba8
commit 4e1a813f4d
2 changed files with 14 additions and 2 deletions

View file

@ -1077,8 +1077,9 @@ ARDOUR_UI::update_timecode_format ()
if (_session) {
bool matching;
TimecodeSlave* tcslave;
SyncSource sync_src = Config->get_sync_source();
if ((tcslave = dynamic_cast<TimecodeSlave*>(_session->slave())) != 0) {
if ((sync_src == LTC || sync_src == MTC) && (tcslave = dynamic_cast<TimecodeSlave*>(_session->slave())) != 0) {
matching = (tcslave->apparent_timecode_format() == _session->config.get_timecode_format());
} else {
matching = true;

View file

@ -1028,9 +1028,20 @@ AudioClock::set_slave_info ()
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:
case MIDIClock:
if (slave) {
bool matching;
TimecodeSlave* tcslave;