void edit_metadata ();
void import_metadata ();
+ void set_loop_sensitivity ();
void set_transport_sensitivity (bool);
//stuff for ProTools-style numpad
}
}
-
+void
+ARDOUR_UI::set_loop_sensitivity ()
+{
+ if (!_session || _session->config.get_external_sync()) {
+ auto_loop_button.set_sensitive (false);
+ } else {
+ auto_loop_button.set_sensitive (_session && _session->locations()->auto_loop_location());
+ }
+}
void
ARDOUR_UI::set_transport_sensitivity (bool yn)
_session->locations()->added.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::handle_locations_change, this, _1), gui_context());
_session->locations()->removed.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::handle_locations_change, this, _1), gui_context());
_session->config.ParameterChanged.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::session_parameter_changed, this, _1), gui_context ());
+ _session->auto_loop_location_changed.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::set_loop_sensitivity, this), gui_context ());
/* Clocks are on by default after we are connected to a session, so show that here.
*/
if (!_session->config.get_external_sync()) {
sync_button.set_text (S_("SyncSource|Int."));
- auto_loop_button.set_sensitive (true);
ActionManager::get_action ("Transport", "ToggleAutoPlay")->set_sensitive (true);
ActionManager::get_action ("Transport", "ToggleAutoReturn")->set_sensitive (true);
ActionManager::get_action ("Transport", "ToggleFollowEdits")->set_sensitive (true);
// but makes it clear to the user that it's disabled.
_session->request_play_loop (false, false);
}
- auto_loop_button.set_sensitive (false);
/* XXX we need to make sure that auto-play is off as well as insensitive */
ActionManager::get_action ("Transport", "ToggleAutoPlay")->set_sensitive (false);
ActionManager::get_action ("Transport", "ToggleAutoReturn")->set_sensitive (false);
ActionManager::get_action ("Transport", "ToggleFollowEdits")->set_sensitive (false);
}
+ set_loop_sensitivity ();
} else if (p == "follow-edits") {