mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
Ruler Markers: customize the menus for Cue Marks, including a way to change the Cue-ID
This commit is contained in:
parent
48c5974b2b
commit
f6813e0749
2 changed files with 50 additions and 9 deletions
|
|
@ -1813,6 +1813,7 @@ private:
|
||||||
void marker_menu_set_from_playhead ();
|
void marker_menu_set_from_playhead ();
|
||||||
void marker_menu_set_from_selection (bool force_regions);
|
void marker_menu_set_from_selection (bool force_regions);
|
||||||
void marker_menu_range_to_next ();
|
void marker_menu_range_to_next ();
|
||||||
|
void marker_menu_change_cue (int cue);
|
||||||
void marker_menu_zoom_to_range ();
|
void marker_menu_zoom_to_range ();
|
||||||
void new_transport_marker_menu_set_loop ();
|
void new_transport_marker_menu_set_loop ();
|
||||||
void new_transport_marker_menu_set_punch ();
|
void new_transport_marker_menu_set_punch ();
|
||||||
|
|
|
||||||
|
|
@ -1040,12 +1040,26 @@ Editor::build_marker_menu (Location* loc)
|
||||||
MenuList& items = marker_menu->items();
|
MenuList& items = marker_menu->items();
|
||||||
marker_menu->set_name ("ArdourContextMenu");
|
marker_menu->set_name ("ArdourContextMenu");
|
||||||
|
|
||||||
|
if (loc->is_cue_marker()) {
|
||||||
|
Menu *cues_menu = manage (new Menu());
|
||||||
|
MenuList& cue_items (cues_menu->items());
|
||||||
|
for (int32_t n = 0; n < default_triggers_per_box; ++n) {
|
||||||
|
/* XXX the "letter" names of the cues need to be subject to i18n somehow */
|
||||||
|
cue_items.push_back (MenuElem (string_compose (_("%1"), (char) ('A' + n)), sigc::bind (sigc::mem_fun(*this, &Editor::marker_menu_change_cue), n)));
|
||||||
|
}
|
||||||
|
items.push_back (Menu_Helpers::MenuElem ("Set Cue:", *cues_menu));
|
||||||
|
/* TODO: tweak marker_menu_range_to_next to make a range between 2 Cues? */
|
||||||
|
|
||||||
|
items.push_back (SeparatorElem());
|
||||||
|
}
|
||||||
|
|
||||||
items.push_back (MenuElem (_("Locate to Here"), sigc::mem_fun(*this, &Editor::marker_menu_set_playhead)));
|
items.push_back (MenuElem (_("Locate to Here"), sigc::mem_fun(*this, &Editor::marker_menu_set_playhead)));
|
||||||
items.push_back (MenuElem (_("Play from Here"), sigc::mem_fun(*this, &Editor::marker_menu_play_from)));
|
items.push_back (MenuElem (_("Play from Here"), sigc::mem_fun(*this, &Editor::marker_menu_play_from)));
|
||||||
items.push_back (MenuElem (_("Move Mark to Playhead"), sigc::mem_fun(*this, &Editor::marker_menu_set_from_playhead)));
|
items.push_back (MenuElem (_("Move Mark to Playhead"), sigc::mem_fun(*this, &Editor::marker_menu_set_from_playhead)));
|
||||||
|
|
||||||
items.push_back (SeparatorElem());
|
items.push_back (SeparatorElem());
|
||||||
|
|
||||||
|
if (!loc->is_cue_marker()) {
|
||||||
items.push_back (MenuElem (_("Create Range to Next Marker"), sigc::mem_fun(*this, &Editor::marker_menu_range_to_next)));
|
items.push_back (MenuElem (_("Create Range to Next Marker"), sigc::mem_fun(*this, &Editor::marker_menu_range_to_next)));
|
||||||
|
|
||||||
items.push_back (MenuElem (_("Promote to Time Origin"), sigc::mem_fun(*this, &Editor::marker_menu_set_origin)));
|
items.push_back (MenuElem (_("Promote to Time Origin"), sigc::mem_fun(*this, &Editor::marker_menu_set_origin)));
|
||||||
|
|
@ -1058,6 +1072,7 @@ Editor::build_marker_menu (Location* loc)
|
||||||
lock_item->set_active ();
|
lock_item->set_active ();
|
||||||
}
|
}
|
||||||
lock_item->signal_activate().connect (sigc::mem_fun (*this, &Editor::toggle_marker_menu_lock));
|
lock_item->signal_activate().connect (sigc::mem_fun (*this, &Editor::toggle_marker_menu_lock));
|
||||||
|
}
|
||||||
|
|
||||||
items.push_back (CheckMenuElem (_("Glue to Bars and Beats")));
|
items.push_back (CheckMenuElem (_("Glue to Bars and Beats")));
|
||||||
Gtk::CheckMenuItem* glue_item = static_cast<Gtk::CheckMenuItem*> (&items.back());
|
Gtk::CheckMenuItem* glue_item = static_cast<Gtk::CheckMenuItem*> (&items.back());
|
||||||
|
|
@ -1342,6 +1357,31 @@ Editor::marker_menu_set_playhead ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Editor::marker_menu_change_cue (int n)
|
||||||
|
{
|
||||||
|
ArdourMarker* marker;
|
||||||
|
if (!_session) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((marker = reinterpret_cast<ArdourMarker *> (marker_menu_item->get_data ("marker"))) == 0) {
|
||||||
|
fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
|
||||||
|
abort(); /*NOTREACHED*/
|
||||||
|
}
|
||||||
|
|
||||||
|
Location* loc;
|
||||||
|
bool is_start;
|
||||||
|
|
||||||
|
if ((loc = find_location_from_marker (marker, is_start)) == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (loc->is_cue_marker()) {
|
||||||
|
loc->set_cue_id(n);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Editor::marker_menu_range_to_next ()
|
Editor::marker_menu_range_to_next ()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue