GUI side of cue behavior (makes it available in the ruler context menu)

This commit is contained in:
Paul Davis 2022-01-06 12:00:18 -07:00
parent 8bf494e5a8
commit 0baf0d859d
3 changed files with 20 additions and 0 deletions

View File

@ -1055,6 +1055,8 @@ private:
ArdourCanvas::Rectangle* cd_marker_bar;
ArdourCanvas::Rectangle* cue_marker_bar;
void toggle_cue_behavior ();
Gtk::Label minsec_label;
Gtk::Label bbt_label;
Gtk::Label timecode_label;

View File

@ -1918,3 +1918,15 @@ Editor::find_marker_from_location_id (PBD::ID const & id, bool is_start) const
return 0;
}
void
Editor::toggle_cue_behavior ()
{
CueBehavior cb (Config->get_cue_behavior());
if (cb & ARDOUR::FollowCues) {
Config->set_cue_behavior (ARDOUR::CueBehavior (cb & ~ARDOUR::FollowCues));
} else {
Config->set_cue_behavior (ARDOUR::CueBehavior (cb | ARDOUR::FollowCues));
}
}

View File

@ -216,6 +216,8 @@ Editor::popup_ruler_menu (timepos_t const & where, ItemType t)
// always build from scratch
MenuList& ruler_items = editor_ruler_menu->items();
CheckMenuItem* cme;
editor_ruler_menu->set_name ("ArdourContextMenu");
ruler_items.clear();
@ -244,6 +246,10 @@ Editor::popup_ruler_menu (timepos_t const & where, ItemType t)
break;
case CueMarkerBarItem:
ruler_items.push_back (CheckMenuElem (_("Ignore cue markers")));
cme = static_cast<Gtk::CheckMenuItem*> (&ruler_items.back());
cme->set_active (Config->get_cue_behavior() != ARDOUR::FollowCues);
cme->signal_activate().connect (sigc::mem_fun (*this, &Editor::toggle_cue_behavior));
for (int32_t n = 0; n < TriggerBox::default_triggers_per_box; ++n) {
/* XXX the "letter" names of the cues need to be subject to i18n somehow */
ruler_items.push_back (MenuElem (string_compose (_("Cue %1"), (char) ('A' + n)), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_add_new_marker), where, Location::IsCueMarker, n)));