add ::usable() method to TransportMaster objects to allow GUI to show their usability after backend/engine changes

This commit is contained in:
Paul Davis 2019-09-16 13:46:06 -06:00
parent fb4cbb9f9e
commit 37d9ec34c8
4 changed files with 34 additions and 0 deletions

View file

@ -86,6 +86,8 @@ TransportMastersWidget::TransportMastersWidget ()
TransportMasterManager::instance().Added.connect (add_connection, invalidator (*this), boost::bind (&TransportMastersWidget::rebuild, this), gui_context());
TransportMasterManager::instance().Removed.connect (remove_connection, invalidator (*this), boost::bind (&TransportMastersWidget::rebuild, this), gui_context());
AudioEngine::instance()->Running.connect (engine_running_connection, invalidator (*this), boost::bind (&TransportMastersWidget::update_usability, this), gui_context());
rebuild ();
}
@ -244,6 +246,19 @@ TransportMastersWidget::rebuild ()
r->prop_change (all_change);
}
update_usability ();
}
void
TransportMastersWidget::update_usability ()
{
for (vector<Row*>::iterator r= rows.begin(); r != rows.end(); ++r) {
const bool usable = (*r)->tm->usable();
(*r)->use_button.set_sensitive (usable);
(*r)->collect_button.set_sensitive (usable);
(*r)->request_options.set_sensitive (usable);
}
}
TransportMastersWidget::Row::Row (TransportMastersWidget& p)