2 Copyright (C) 2000 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #include <gtkmm2ext/gtk_ui.h>
25 #include "ardour/session.h"
26 #include "ardour/location.h"
27 #include "ardour/profile.h"
28 #include "pbd/memento_command.h"
30 #include "canvas/canvas.h"
31 #include "canvas/item.h"
32 #include "canvas/rectangle.h"
34 #include "widgets/prompter.h"
38 #include "selection.h"
40 #include "gui_thread.h"
42 #include "editor_drag.h"
47 using namespace ARDOUR;
50 using namespace Gtkmm2ext;
53 Editor::clear_marker_display ()
55 for (LocationMarkerMap::iterator i = location_markers.begin(); i != location_markers.end(); ++i) {
59 location_markers.clear ();
60 _sorted_marker_lists.clear ();
64 Editor::add_new_location (Location *location)
66 ENSURE_GUI_THREAD (*this, &Editor::add_new_location, location);
68 ArdourCanvas::Container* group = add_new_location_internal (location);
70 /* Do a full update of the markers in this group */
71 update_marker_labels (group);
73 if (location->is_auto_punch()) {
74 update_punch_range_view ();
77 if (location->is_auto_loop()) {
78 update_loop_range_view ();
82 /** Add a new location, without a time-consuming update of all marker labels;
83 * the caller must call update_marker_labels () after calling this.
84 * @return canvas group that the location's marker was added to.
86 ArdourCanvas::Container*
87 Editor::add_new_location_internal (Location* location)
89 LocationMarkers *lam = new LocationMarkers;
92 /* make a note here of which group this marker ends up in */
93 ArdourCanvas::Container* group = 0;
95 if (location->is_cd_marker()) {
96 color = location_cd_marker_color;
97 } else if (location->is_mark()) {
98 color = location_marker_color;
99 } else if (location->is_auto_loop()) {
100 color = location_loop_color;
101 } else if (location->is_auto_punch()) {
102 color = location_punch_color;
104 color = location_range_color;
107 if (location->is_mark()) {
109 if (location->is_cd_marker() && ruler_cd_marker_action->get_active()) {
110 lam->start = new ArdourMarker (*this, *cd_marker_group, color, location->name(), ArdourMarker::Mark, location->start());
111 group = cd_marker_group;
113 lam->start = new ArdourMarker (*this, *marker_group, color, location->name(), ArdourMarker::Mark, location->start());
114 group = marker_group;
119 } else if (location->is_auto_loop()) {
122 lam->start = new ArdourMarker (*this, *transport_marker_group, color,
123 location->name(), ArdourMarker::LoopStart, location->start());
124 lam->end = new ArdourMarker (*this, *transport_marker_group, color,
125 location->name(), ArdourMarker::LoopEnd, location->end());
126 group = transport_marker_group;
128 } else if (location->is_auto_punch()) {
131 lam->start = new ArdourMarker (*this, *transport_marker_group, color,
132 location->name(), ArdourMarker::PunchIn, location->start());
133 lam->end = new ArdourMarker (*this, *transport_marker_group, color,
134 location->name(), ArdourMarker::PunchOut, location->end());
135 group = transport_marker_group;
137 } else if (location->is_session_range()) {
140 lam->start = new ArdourMarker (*this, *marker_group, color, _("start"), ArdourMarker::SessionStart, location->start());
141 lam->end = new ArdourMarker (*this, *marker_group, color, _("end"), ArdourMarker::SessionEnd, location->end());
142 group = marker_group;
146 if (location->is_cd_marker() && ruler_cd_marker_action->get_active()) {
147 lam->start = new ArdourMarker (*this, *cd_marker_group, color,
148 location->name(), ArdourMarker::RangeStart, location->start());
149 lam->end = new ArdourMarker (*this, *cd_marker_group, color,
150 location->name(), ArdourMarker::RangeEnd, location->end());
151 group = cd_marker_group;
153 lam->start = new ArdourMarker (*this, *range_marker_group, color,
154 location->name(), ArdourMarker::RangeStart, location->start());
155 lam->end = new ArdourMarker (*this, *range_marker_group, color,
156 location->name(), ArdourMarker::RangeEnd, location->end());
157 group = range_marker_group;
161 if (location->is_hidden ()) {
167 location->name_changed.connect (*this, invalidator (*this), boost::bind (&Editor::location_changed, this, _1), gui_context());
168 location->position_lock_style_changed.connect (*this, invalidator (*this), boost::bind (&Editor::location_changed, this, _1), gui_context());
169 location->FlagsChanged.connect (*this, invalidator (*this), boost::bind (&Editor::location_flags_changed, this, location), gui_context());
171 pair<Location*,LocationMarkers*> newpair;
173 newpair.first = location;
174 newpair.second = lam;
176 location_markers.insert (newpair);
178 if (select_new_marker && location->is_mark()) {
179 selection->set (lam->start);
180 select_new_marker = false;
183 lam->canvas_height_set (_visible_canvas_height);
184 lam->set_show_lines (_show_marker_lines);
186 /* Add these markers to the appropriate sorted marker lists, which will render
187 them unsorted until a call to update_marker_labels() sorts them out.
189 _sorted_marker_lists[group].push_back (lam->start);
191 _sorted_marker_lists[group].push_back (lam->end);
198 Editor::location_changed (Location *location)
200 ENSURE_GUI_THREAD (*this, &Editor::location_changed, location)
202 LocationMarkers *lam = find_location_markers (location);
205 /* a location that isn't "marked" with markers */
209 if (location->position_lock_style() == MusicTime) {
210 lam->set_name ("\u266B" + location->name ()); // BEAMED EIGHTH NOTES
212 lam->set_name (location->name ());
215 lam->set_position (location->start(), location->end());
217 if (location->is_auto_loop()) {
218 update_loop_range_view ();
219 } else if (location->is_auto_punch()) {
220 update_punch_range_view ();
223 check_marker_label (lam->start);
225 check_marker_label (lam->end);
229 /** Look at a marker and check whether its label, and those of the previous and next markers,
230 * need to have their labels updated (in case those labels need to be shortened or can be
234 Editor::check_marker_label (ArdourMarker* m)
236 /* Get a time-ordered list of markers from the last time anything changed */
237 std::list<ArdourMarker*>& sorted = _sorted_marker_lists[m->get_parent()];
239 list<ArdourMarker*>::iterator i = find (sorted.begin(), sorted.end(), m);
241 list<ArdourMarker*>::iterator prev = sorted.end ();
242 list<ArdourMarker*>::iterator next = i;
245 /* Look to see if the previous marker is still behind `m' in time */
246 if (i != sorted.begin()) {
251 if ((*prev)->position() > m->position()) {
252 /* This marker is no longer in the correct order with the previous one, so
253 * update all the markers in this group.
255 update_marker_labels (m->get_parent ());
260 /* Look to see if the next marker is still ahead of `m' in time */
261 if (next != sorted.end() && (*next)->position() < m->position()) {
262 /* This marker is no longer in the correct order with the next one, so
263 * update all the markers in this group.
265 update_marker_labels (m->get_parent ());
269 if (prev != sorted.end()) {
271 /* Update just the available space between the previous marker and this one */
273 double const p = sample_to_pixel (m->position() - (*prev)->position());
275 if (m->label_on_left()) {
276 (*prev)->set_right_label_limit (p / 2);
278 (*prev)->set_right_label_limit (p);
281 if ((*prev)->label_on_left ()) {
282 m->set_left_label_limit (p);
284 m->set_left_label_limit (p / 2);
288 if (next != sorted.end()) {
290 /* Update just the available space between this marker and the next */
292 double const p = sample_to_pixel ((*next)->position() - m->position());
294 if ((*next)->label_on_left()) {
295 m->set_right_label_limit (p / 2);
297 m->set_right_label_limit (p);
300 if (m->label_on_left()) {
301 (*next)->set_left_label_limit (p);
303 (*next)->set_left_label_limit (p / 2);
308 struct MarkerComparator {
309 bool operator() (ArdourMarker const * a, ArdourMarker const * b) {
310 return a->position() < b->position();
314 /** Update all marker labels in all groups */
316 Editor::update_marker_labels ()
318 for (std::map<ArdourCanvas::Container *, std::list<ArdourMarker *> >::iterator i = _sorted_marker_lists.begin(); i != _sorted_marker_lists.end(); ++i) {
319 update_marker_labels (i->first);
323 /** Look at all markers in a group and update label widths */
325 Editor::update_marker_labels (ArdourCanvas::Container* group)
327 list<ArdourMarker*>& sorted = _sorted_marker_lists[group];
329 if (sorted.empty()) {
333 /* We sort the list of markers and then set up the space available between each one */
335 sorted.sort (MarkerComparator ());
337 list<ArdourMarker*>::iterator i = sorted.begin ();
339 list<ArdourMarker*>::iterator prev = sorted.end ();
340 list<ArdourMarker*>::iterator next = i;
342 if (next != sorted.end()) {
346 while (i != sorted.end()) {
348 if (prev != sorted.end()) {
349 double const p = sample_to_pixel ((*i)->position() - (*prev)->position());
351 if ((*prev)->label_on_left()) {
352 (*i)->set_left_label_limit (p);
354 (*i)->set_left_label_limit (p / 2);
359 if (next != sorted.end()) {
360 double const p = sample_to_pixel ((*next)->position() - (*i)->position());
362 if ((*next)->label_on_left()) {
363 (*i)->set_right_label_limit (p / 2);
365 (*i)->set_right_label_limit (p);
377 Editor::location_flags_changed (Location *location)
379 ENSURE_GUI_THREAD (*this, &Editor::location_flags_changed, location, src)
381 LocationMarkers *lam = find_location_markers (location);
384 /* a location that isn't "marked" with markers */
388 // move cd markers to/from cd marker bar as appropriate
389 ensure_cd_marker_updated (lam, location);
391 if (location->is_cd_marker()) {
392 lam->set_color_rgba (location_cd_marker_color);
393 } else if (location->is_mark()) {
394 lam->set_color_rgba (location_marker_color);
395 } else if (location->is_auto_punch()) {
396 lam->set_color_rgba (location_punch_color);
397 } else if (location->is_auto_loop()) {
398 lam->set_color_rgba (location_loop_color);
400 lam->set_color_rgba (location_range_color);
403 if (location->is_hidden()) {
410 void Editor::update_cd_marker_display ()
412 for (LocationMarkerMap::iterator i = location_markers.begin(); i != location_markers.end(); ++i) {
413 LocationMarkers * lam = i->second;
414 Location * location = i->first;
416 ensure_cd_marker_updated (lam, location);
420 void Editor::ensure_cd_marker_updated (LocationMarkers * lam, Location * location)
422 if (location->is_cd_marker()
423 && (ruler_cd_marker_action->get_active() && lam->start->get_parent() != cd_marker_group))
425 //cerr << "reparenting non-cd marker so it can be relocated: " << location->name() << endl;
427 lam->start->reparent (*cd_marker_group);
430 lam->end->reparent (*cd_marker_group);
433 else if ( (!location->is_cd_marker() || !ruler_cd_marker_action->get_active())
434 && (lam->start->get_parent() == cd_marker_group))
436 //cerr << "reparenting non-cd marker so it can be relocated: " << location->name() << endl;
437 if (location->is_mark()) {
439 lam->start->reparent (*marker_group);
442 lam->end->reparent (*marker_group);
447 lam->start->reparent (*range_marker_group);
450 lam->end->reparent (*range_marker_group);
456 Editor::LocationMarkers::~LocationMarkers ()
462 Editor::LocationMarkers *
463 Editor::find_location_markers (Location *location) const
465 LocationMarkerMap::const_iterator i;
467 for (i = location_markers.begin(); i != location_markers.end(); ++i) {
468 if ((*i).first == location) {
477 Editor::find_location_from_marker (ArdourMarker *marker, bool& is_start) const
479 LocationMarkerMap::const_iterator i;
481 for (i = location_markers.begin(); i != location_markers.end(); ++i) {
482 LocationMarkers *lm = (*i).second;
483 if (lm->start == marker) {
486 } else if (lm->end == marker) {
496 Editor::refresh_location_display_internal (const Locations::LocationList& locations)
500 for (LocationMarkerMap::iterator i = location_markers.begin(); i != location_markers.end(); ++i) {
501 i->second->valid = false;
506 for (Locations::LocationList::const_iterator i = locations.begin(); i != locations.end(); ++i) {
508 LocationMarkerMap::iterator x;
510 if ((x = location_markers.find (*i)) != location_markers.end()) {
511 x->second->valid = true;
515 add_new_location_internal (*i);
518 /* remove dead ones */
520 for (LocationMarkerMap::iterator i = location_markers.begin(); i != location_markers.end(); ) {
522 LocationMarkerMap::iterator tmp;
527 if (!i->second->valid) {
529 remove_sorted_marker (i->second->start);
530 if (i->second->end) {
531 remove_sorted_marker (i->second->end);
534 LocationMarkers* m = i->second;
535 location_markers.erase (i);
542 update_punch_range_view ();
543 update_loop_range_view ();
547 Editor::refresh_location_display ()
549 ENSURE_GUI_THREAD (*this, &Editor::refresh_location_display)
552 _session->locations()->apply (*this, &Editor::refresh_location_display_internal);
555 update_marker_labels ();
559 Editor::LocationMarkers::hide()
568 Editor::LocationMarkers::show()
577 Editor::LocationMarkers::canvas_height_set (double h)
579 start->canvas_height_set (h);
581 end->canvas_height_set (h);
586 Editor::LocationMarkers::set_name (const string& str)
588 /* XXX: hack: don't change names of session start/end markers */
590 if (start->type() != ArdourMarker::SessionStart) {
591 start->set_name (str);
594 if (end && end->type() != ArdourMarker::SessionEnd) {
600 Editor::LocationMarkers::set_position (framepos_t startf,
603 start->set_position (startf);
605 end->set_position (endf);
610 Editor::LocationMarkers::set_color_rgba (uint32_t rgba)
612 start->set_color_rgba (rgba);
614 end->set_color_rgba (rgba);
619 Editor::LocationMarkers::set_show_lines (bool s)
621 start->set_show_line (s);
623 end->set_show_line (s);
628 Editor::LocationMarkers::set_selected (bool s)
630 start->set_selected (s);
632 end->set_selected (s);
637 Editor::LocationMarkers::setup_lines ()
639 start->setup_line ();
646 Editor::mouse_add_new_marker (framepos_t where, bool is_cd)
649 int flags = (is_cd ? Location::IsCDMarker|Location::IsMark : Location::IsMark);
652 _session->locations()->next_available_name(markername, _("mark"));
653 if (!choose_new_marker_name(markername)) {
656 Location *location = new Location (*_session, where, where, markername, (Location::Flags) flags, get_grid_music_divisions (0));
657 begin_reversible_command (_("add marker"));
659 XMLNode &before = _session->locations()->get_state();
660 _session->locations()->add (location, true);
661 XMLNode &after = _session->locations()->get_state();
662 _session->add_command (new MementoCommand<Locations>(*(_session->locations()), &before, &after));
664 /* find the marker we just added */
666 LocationMarkers *lam = find_location_markers (location);
668 /* make it the selected marker */
669 selection->set (lam->start);
672 commit_reversible_command ();
677 Editor::mouse_add_new_loop (framepos_t where)
683 /* Make this marker 1/8th of the visible area of the session so that
684 it's reasonably easy to manipulate after creation.
687 framepos_t const end = where + current_page_samples() / 8;
689 set_loop_range (where, end, _("set loop range"));
693 Editor::mouse_add_new_punch (framepos_t where)
699 /* Make this marker 1/8th of the visible area of the session so that
700 it's reasonably easy to manipulate after creation.
703 framepos_t const end = where + current_page_samples() / 8;
705 set_punch_range (where, end, _("set punch range"));
709 Editor::mouse_add_new_range (framepos_t where)
715 /* Make this marker 1/8th of the visible area of the session so that
716 it's reasonably easy to manipulate after creation.
719 framepos_t const end = where + current_page_samples() / 8;
722 _session->locations()->next_available_name (name, _("range"));
723 Location* loc = new Location (*_session, where, end, name, Location::IsRangeMarker);
725 begin_reversible_command (_("new range marker"));
726 XMLNode& before = _session->locations()->get_state ();
727 _session->locations()->add (loc, true);
728 XMLNode& after = _session->locations()->get_state ();
729 _session->add_command (new MementoCommand<Locations> (*_session->locations(), &before, &after));
730 commit_reversible_command ();
734 Editor::remove_marker (ArdourCanvas::Item& item, GdkEvent*)
736 ArdourMarker* marker;
739 if ((marker = static_cast<ArdourMarker*> (item.get_data ("marker"))) == 0) {
740 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
741 abort(); /*NOTREACHED*/
744 if (entered_marker == marker) {
745 entered_marker = NULL;
748 Location* loc = find_location_from_marker (marker, is_start);
750 if (_session && loc) {
751 Glib::signal_idle().connect (sigc::bind (sigc::mem_fun(*this, &Editor::really_remove_marker), loc));
756 Editor::really_remove_marker (Location* loc)
758 begin_reversible_command (_("remove marker"));
759 XMLNode &before = _session->locations()->get_state();
760 _session->locations()->remove (loc);
761 XMLNode &after = _session->locations()->get_state();
762 _session->add_command (new MementoCommand<Locations>(*(_session->locations()), &before, &after));
763 commit_reversible_command ();
768 Editor::location_gone (Location *location)
770 ENSURE_GUI_THREAD (*this, &Editor::location_gone, location)
772 LocationMarkerMap::iterator i;
774 if (location == transport_loop_location()) {
775 update_loop_range_view ();
778 if (location == transport_punch_location()) {
779 update_punch_range_view ();
782 for (i = location_markers.begin(); i != location_markers.end(); ++i) {
783 if (i->first == location) {
785 remove_sorted_marker (i->second->start);
786 if (i->second->end) {
787 remove_sorted_marker (i->second->end);
790 LocationMarkers* m = i->second;
791 location_markers.erase (i);
794 /* Markers that visually overlap with this (removed) marker
795 * need to be re-displayed.
796 * But finding such cases is similarly expensive as simply
797 * re-displaying all.. so:
799 refresh_location_display ();
806 Editor::tempo_or_meter_marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item)
808 marker_menu_item = item;
812 dynamic_cast_marker_object (marker_menu_item->get_data ("marker"), &mm, &tm);
814 bool can_remove = false;
817 can_remove = !mm->meter().initial ();
818 delete meter_marker_menu;
819 build_meter_marker_menu (mm, can_remove);
820 meter_marker_menu->popup (1, ev->time);
822 if (!tm->tempo().active()) {
825 can_remove = !tm->tempo().initial() && !tm->tempo().locked_to_meter();
826 delete tempo_marker_menu;
827 build_tempo_marker_menu (tm, can_remove);
828 tempo_marker_menu->popup (1, ev->time);
835 Editor::marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item)
837 ArdourMarker * marker;
838 if ((marker = reinterpret_cast<ArdourMarker *> (item->get_data("marker"))) == 0) {
839 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
840 abort(); /*NOTREACHED*/
844 Location * loc = find_location_from_marker (marker, is_start);
846 if (loc == transport_loop_location() || loc == transport_punch_location() || loc->is_session_range ()) {
848 delete transport_marker_menu;
849 build_range_marker_menu (loc, loc == transport_loop_location() || loc == transport_punch_location(), loc->is_session_range());
851 marker_menu_item = item;
852 transport_marker_menu->popup (1, ev->time);
854 } else if (loc->is_mark()) {
857 build_marker_menu (loc);
859 // GTK2FIX use action group sensitivity
861 if (children.size() >= 3) {
862 MenuItem * loopitem = &children[2];
864 if (loc->is_mark()) {
865 loopitem->set_sensitive(false);
868 loopitem->set_sensitive(true);
873 marker_menu_item = item;
874 marker_menu->popup (1, ev->time);
876 } else if (loc->is_range_marker()) {
877 delete range_marker_menu;
878 build_range_marker_menu (loc, false, false);
880 marker_menu_item = item;
881 range_marker_menu->popup (1, ev->time);
886 Editor::new_transport_marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item*)
888 if (new_transport_marker_menu == 0) {
889 build_new_transport_marker_menu ();
892 new_transport_marker_menu->popup (1, ev->time);
897 Editor::build_marker_menu (Location* loc)
899 using namespace Menu_Helpers;
901 marker_menu = new Menu;
903 MenuList& items = marker_menu->items();
904 marker_menu->set_name ("ArdourContextMenu");
906 items.push_back (MenuElem (_("Locate to Here"), sigc::mem_fun(*this, &Editor::marker_menu_set_playhead)));
907 items.push_back (MenuElem (_("Play from Here"), sigc::mem_fun(*this, &Editor::marker_menu_play_from)));
908 items.push_back (MenuElem (_("Move Mark to Playhead"), sigc::mem_fun(*this, &Editor::marker_menu_set_from_playhead)));
910 items.push_back (SeparatorElem());
912 items.push_back (MenuElem (_("Create Range to Next Marker"), sigc::mem_fun(*this, &Editor::marker_menu_range_to_next)));
914 items.push_back (MenuElem (_("Hide"), sigc::mem_fun(*this, &Editor::marker_menu_hide)));
915 items.push_back (MenuElem (_("Rename..."), sigc::mem_fun(*this, &Editor::marker_menu_rename)));
917 items.push_back (CheckMenuElem (_("Lock")));
918 Gtk::CheckMenuItem* lock_item = static_cast<Gtk::CheckMenuItem*> (&items.back());
919 if (loc->locked ()) {
920 lock_item->set_active ();
922 lock_item->signal_activate().connect (sigc::mem_fun (*this, &Editor::toggle_marker_menu_lock));
924 items.push_back (CheckMenuElem (_("Glue to Bars and Beats")));
925 Gtk::CheckMenuItem* glue_item = static_cast<Gtk::CheckMenuItem*> (&items.back());
926 glue_item->set_active (loc->position_lock_style() == MusicTime);
928 glue_item->signal_activate().connect (sigc::mem_fun (*this, &Editor::toggle_marker_menu_glue));
930 items.push_back (SeparatorElem());
932 items.push_back (MenuElem (_("Remove"), sigc::mem_fun(*this, &Editor::marker_menu_remove)));
936 Editor::build_range_marker_menu (Location* loc, bool loop_or_punch, bool session)
938 using namespace Menu_Helpers;
940 bool const loop_or_punch_or_session = loop_or_punch || session;
942 Menu* markerMenu = new Menu;
944 if (loop_or_punch_or_session) {
945 transport_marker_menu = markerMenu;
947 range_marker_menu = markerMenu;
949 MenuList& items = markerMenu->items();
950 markerMenu->set_name ("ArdourContextMenu");
952 items.push_back (MenuElem (_("Play Range"), sigc::mem_fun(*this, &Editor::marker_menu_play_range)));
953 items.push_back (MenuElem (_("Locate to Marker"), sigc::mem_fun(*this, &Editor::marker_menu_set_playhead)));
954 items.push_back (MenuElem (_("Play from Marker"), sigc::mem_fun(*this, &Editor::marker_menu_play_from)));
955 items.push_back (MenuElem (_("Loop Range"), sigc::mem_fun(*this, &Editor::marker_menu_loop_range)));
957 items.push_back (MenuElem (_("Set Marker from Playhead"), sigc::mem_fun(*this, &Editor::marker_menu_set_from_playhead)));
958 items.push_back (MenuElem (_("Set Range from Selection"), sigc::bind (sigc::mem_fun(*this, &Editor::marker_menu_set_from_selection), false)));
960 items.push_back (MenuElem (_("Zoom to Range"), sigc::mem_fun (*this, &Editor::marker_menu_zoom_to_range)));
962 items.push_back (SeparatorElem());
963 items.push_back (CheckMenuElem (_("Glue to Bars and Beats")));
965 Gtk::CheckMenuItem* glue_item = static_cast<Gtk::CheckMenuItem*> (&items.back());
966 glue_item->set_active (loc->position_lock_style() == MusicTime);
967 glue_item->signal_activate().connect (sigc::mem_fun (*this, &Editor::toggle_marker_menu_glue));
969 items.push_back (SeparatorElem());
970 items.push_back (MenuElem (_("Export Range..."), sigc::mem_fun(*this, &Editor::export_range)));
971 items.push_back (SeparatorElem());
973 if (!loop_or_punch_or_session) {
974 items.push_back (MenuElem (_("Hide Range"), sigc::mem_fun(*this, &Editor::marker_menu_hide)));
975 items.push_back (MenuElem (_("Rename Range..."), sigc::mem_fun(*this, &Editor::marker_menu_rename)));
979 items.push_back (MenuElem (_("Remove Range"), sigc::mem_fun(*this, &Editor::marker_menu_remove)));
982 if (!loop_or_punch_or_session || !session) {
983 items.push_back (SeparatorElem());
986 items.push_back (MenuElem (_("Separate Regions in Range"), sigc::mem_fun(*this, &Editor::marker_menu_separate_regions_using_location)));
987 items.push_back (MenuElem (_("Select All in Range"), sigc::mem_fun(*this, &Editor::marker_menu_select_all_selectables_using_range)));
988 items.push_back (MenuElem (_("Select Range"), sigc::mem_fun(*this, &Editor::marker_menu_select_using_range)));
992 Editor::build_tempo_marker_menu (TempoMarker* loc, bool can_remove)
994 using namespace Menu_Helpers;
996 tempo_marker_menu = new Menu;
998 MenuList& items = tempo_marker_menu->items();
999 tempo_marker_menu->set_name ("ArdourContextMenu");
1001 if (!loc->tempo().initial()) {
1002 if (loc->tempo().clamped()) {
1003 items.push_back (MenuElem (_("Unlock Continue"), sigc::mem_fun(*this, &Editor::toggle_tempo_clamped)));
1005 items.push_back (MenuElem (_("Lock Continue"), sigc::mem_fun(*this, &Editor::toggle_tempo_clamped)));
1008 TempoSection* prev_ts = _session->tempo_map().previous_tempo_section (&loc->tempo());
1009 if (prev_ts && prev_ts->end_note_types_per_minute() != loc->tempo().note_types_per_minute()) {
1010 items.push_back (MenuElem (_("Continue"), sigc::mem_fun(*this, &Editor::continue_previous_tempo)));
1014 TempoSection* next_ts = _session->tempo_map().next_tempo_section (&loc->tempo());
1015 if (next_ts && next_ts->note_types_per_minute() != loc->tempo().end_note_types_per_minute()) {
1016 items.push_back (MenuElem (_("Ramp to Next"), sigc::mem_fun(*this, &Editor::ramp_to_next_tempo)));
1019 if (loc->tempo().type() == TempoSection::Ramp) {
1020 items.push_back (MenuElem (_("Set Constant"), sigc::mem_fun(*this, &Editor::toggle_tempo_type)));
1023 if (loc->tempo().position_lock_style() == AudioTime && can_remove) {
1024 items.push_back (MenuElem (_("Lock to Music"), sigc::mem_fun(*this, &Editor::toggle_marker_lock_style)));
1025 } else if (can_remove) {
1026 items.push_back (MenuElem (_("Lock to Audio"), sigc::mem_fun(*this, &Editor::toggle_marker_lock_style)));
1029 items.push_back (MenuElem (_("Edit..."), sigc::mem_fun(*this, &Editor::marker_menu_edit)));
1030 items.push_back (MenuElem (_("Remove"), sigc::mem_fun(*this, &Editor::marker_menu_remove)));
1031 items.back().set_sensitive (can_remove);
1035 Editor::build_meter_marker_menu (MeterMarker* loc, bool can_remove)
1037 using namespace Menu_Helpers;
1039 meter_marker_menu = new Menu;
1041 MenuList& items = meter_marker_menu->items();
1042 meter_marker_menu->set_name ("ArdourContextMenu");
1044 if (loc->meter().position_lock_style() == AudioTime && can_remove) {
1045 items.push_back (MenuElem (_("Lock to Music"), sigc::mem_fun(*this, &Editor::toggle_marker_lock_style)));
1046 } else if (can_remove) {
1047 items.push_back (MenuElem (_("Lock to Audio"), sigc::mem_fun(*this, &Editor::toggle_marker_lock_style)));
1050 items.push_back (MenuElem (_("Edit..."), sigc::mem_fun(*this, &Editor::marker_menu_edit)));
1051 items.push_back (MenuElem (_("Remove"), sigc::mem_fun(*this, &Editor::marker_menu_remove)));
1053 items.back().set_sensitive (can_remove);
1057 Editor::build_new_transport_marker_menu ()
1059 using namespace Menu_Helpers;
1061 new_transport_marker_menu = new Menu;
1063 MenuList& items = new_transport_marker_menu->items();
1064 new_transport_marker_menu->set_name ("ArdourContextMenu");
1066 items.push_back (MenuElem (_("Set Loop Range"), sigc::mem_fun(*this, &Editor::new_transport_marker_menu_set_loop)));
1067 items.push_back (MenuElem (_("Set Punch Range"), sigc::mem_fun(*this, &Editor::new_transport_marker_menu_set_punch)));
1069 new_transport_marker_menu->signal_unmap().connect ( sigc::mem_fun(*this, &Editor::new_transport_marker_menu_popdown));
1073 Editor::marker_menu_hide ()
1075 ArdourMarker* marker;
1077 if ((marker = reinterpret_cast<ArdourMarker *> (marker_menu_item->get_data ("marker"))) == 0) {
1078 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
1079 abort(); /*NOTREACHED*/
1085 if ((l = find_location_from_marker (marker, is_start)) != 0) {
1086 l->set_hidden (true, this);
1091 Editor::marker_menu_select_using_range ()
1093 ArdourMarker* marker;
1095 if ((marker = reinterpret_cast<ArdourMarker *> (marker_menu_item->get_data ("marker"))) == 0) {
1096 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
1097 abort(); /*NOTREACHED*/
1103 if (((l = find_location_from_marker (marker, is_start)) != 0) && (l->end() > l->start())) {
1104 set_selection_from_range (*l);
1109 Editor::marker_menu_select_all_selectables_using_range ()
1111 ArdourMarker* marker;
1113 if ((marker = reinterpret_cast<ArdourMarker *> (marker_menu_item->get_data ("marker"))) == 0) {
1114 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
1115 abort(); /*NOTREACHED*/
1121 if (((l = find_location_from_marker (marker, is_start)) != 0) && (l->end() > l->start())) {
1122 select_all_within (l->start(), l->end() - 1, 0, DBL_MAX, track_views, Selection::Set, false);
1128 Editor::marker_menu_separate_regions_using_location ()
1130 ArdourMarker* marker;
1132 if ((marker = reinterpret_cast<ArdourMarker *> (marker_menu_item->get_data ("marker"))) == 0) {
1133 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
1134 abort(); /*NOTREACHED*/
1140 if (((l = find_location_from_marker (marker, is_start)) != 0) && (l->end() > l->start())) {
1141 separate_regions_using_location (*l);
1147 Editor::marker_menu_play_from ()
1149 ArdourMarker* marker;
1151 if ((marker = reinterpret_cast<ArdourMarker *> (marker_menu_item->get_data ("marker"))) == 0) {
1152 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
1153 abort(); /*NOTREACHED*/
1159 if ((l = find_location_from_marker (marker, is_start)) != 0) {
1162 _session->request_locate (l->start(), true);
1165 //_session->request_bounded_roll (l->start(), l->end());
1168 _session->request_locate (l->start(), true);
1170 _session->request_locate (l->end(), true);
1177 Editor::marker_menu_set_playhead ()
1179 ArdourMarker* marker;
1181 if ((marker = reinterpret_cast<ArdourMarker *> (marker_menu_item->get_data ("marker"))) == 0) {
1182 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
1183 abort(); /*NOTREACHED*/
1189 if ((l = find_location_from_marker (marker, is_start)) != 0) {
1192 _session->request_locate (l->start(), false);
1196 _session->request_locate (l->start(), false);
1198 _session->request_locate (l->end(), false);
1205 Editor::marker_menu_range_to_next ()
1207 ArdourMarker* marker;
1212 if ((marker = reinterpret_cast<ArdourMarker *> (marker_menu_item->get_data ("marker"))) == 0) {
1213 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
1214 abort(); /*NOTREACHED*/
1220 if ((l = find_location_from_marker (marker, is_start)) == 0) {
1226 _session->locations()->marks_either_side (marker->position(), start, end);
1228 if (end != max_framepos) {
1229 string range_name = l->name();
1230 range_name += "-range";
1232 Location* newrange = new Location (*_session, marker->position(), end, range_name, Location::IsRangeMarker);
1233 _session->locations()->add (newrange);
1238 Editor::marker_menu_set_from_playhead ()
1240 ArdourMarker* marker;
1242 if ((marker = reinterpret_cast<ArdourMarker *> (marker_menu_item->get_data ("marker"))) == 0) {
1243 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
1244 abort(); /*NOTREACHED*/
1249 const int32_t divisions = get_grid_music_divisions (0);
1251 if ((l = find_location_from_marker (marker, is_start)) != 0) {
1254 l->set_start (_session->audible_frame (), false, true, divisions);
1258 l->set_start (_session->audible_frame (), false, true, divisions);
1260 l->set_end (_session->audible_frame (), false, true, divisions);
1267 Editor::marker_menu_set_from_selection (bool /*force_regions*/)
1269 ArdourMarker* marker;
1271 if ((marker = reinterpret_cast<ArdourMarker *> (marker_menu_item->get_data ("marker"))) == 0) {
1272 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
1273 abort(); /*NOTREACHED*/
1279 if ((l = find_location_from_marker (marker, is_start)) != 0) {
1287 if (!selection->time.empty()) {
1288 l->set (selection->time.start(), selection->time.end_frame());
1289 } else if (!selection->regions.empty()) {
1290 l->set (selection->regions.start(), selection->regions.end_frame());
1298 Editor::marker_menu_play_range ()
1300 ArdourMarker* marker;
1302 if ((marker = reinterpret_cast<ArdourMarker *> (marker_menu_item->get_data ("marker"))) == 0) {
1303 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
1304 abort(); /*NOTREACHED*/
1310 if ((l = find_location_from_marker (marker, is_start)) != 0) {
1313 _session->request_locate (l->start(), true);
1316 _session->request_bounded_roll (l->start(), l->end());
1323 Editor::marker_menu_loop_range ()
1325 ArdourMarker* marker;
1327 if ((marker = reinterpret_cast<ArdourMarker *> (marker_menu_item->get_data ("marker"))) == 0) {
1328 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
1329 abort(); /*NOTREACHED*/
1335 if ((l = find_location_from_marker (marker, is_start)) != 0) {
1336 if (l != transport_loop_location()) {
1337 set_loop_range (l->start(), l->end(), _("loop range from marker"));
1339 _session->request_locate (l->start(), true);
1340 _session->request_play_loop (true);
1344 /** Temporal zoom to the range of the marker_menu_item (plus 5% either side) */
1346 Editor::marker_menu_zoom_to_range ()
1348 ArdourMarker* marker = reinterpret_cast<ArdourMarker *> (marker_menu_item->get_data ("marker"));
1352 Location* l = find_location_from_marker (marker, is_start);
1357 framecnt_t const extra = l->length() * 0.05;
1358 framepos_t a = l->start ();
1363 framepos_t b = l->end ();
1364 if (b < (max_framepos - extra)) {
1368 temporal_zoom_by_frame (a, b);
1372 Editor::dynamic_cast_marker_object (void* p, MeterMarker** m, TempoMarker** t) const
1374 ArdourMarker* marker = reinterpret_cast<ArdourMarker*> (p);
1376 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
1377 abort(); /*NOTREACHED*/
1380 *m = dynamic_cast<MeterMarker*> (marker);
1381 *t = dynamic_cast<TempoMarker*> (marker);
1385 Editor::marker_menu_edit ()
1389 dynamic_cast_marker_object (marker_menu_item->get_data ("marker"), &mm, &tm);
1392 edit_meter_section (&mm->meter());
1394 edit_tempo_section (&tm->tempo());
1399 Editor::marker_menu_remove ()
1403 dynamic_cast_marker_object (marker_menu_item->get_data ("marker"), &mm, &tm);
1406 remove_meter_marker (marker_menu_item);
1408 remove_tempo_marker (marker_menu_item);
1410 remove_marker (*marker_menu_item, (GdkEvent*) 0);
1415 Editor::toggle_marker_lock_style ()
1419 dynamic_cast_marker_object (marker_menu_item->get_data ("marker"), &mm, &tm);
1422 begin_reversible_command (_("change meter lock style"));
1423 XMLNode &before = _session->tempo_map().get_state();
1424 MeterSection* msp = &mm->meter();
1426 const Meter meter (msp->divisions_per_bar(), msp->note_divisor());
1427 const Timecode::BBT_Time bbt (msp->bbt());
1428 const PositionLockStyle pls = (msp->position_lock_style() == AudioTime) ? MusicTime : AudioTime;
1430 _session->tempo_map().replace_meter (*msp, meter, bbt, msp->frame(), pls);
1432 XMLNode &after = _session->tempo_map().get_state();
1433 _session->add_command(new MementoCommand<TempoMap>(_session->tempo_map(), &before, &after));
1434 commit_reversible_command ();
1436 TempoSection* tsp = &tm->tempo();
1438 const double pulse = tsp->pulse();
1439 const framepos_t frame = tsp->frame();
1440 const PositionLockStyle pls = (tsp->position_lock_style() == AudioTime) ? MusicTime : AudioTime;
1441 const Tempo tempo (tsp->note_types_per_minute(), tsp->note_type(), tsp->end_note_types_per_minute());
1443 begin_reversible_command (_("change tempo lock style"));
1444 XMLNode &before = _session->tempo_map().get_state();
1446 _session->tempo_map().replace_tempo (*tsp, tempo, pulse, frame, pls);
1448 XMLNode &after = _session->tempo_map().get_state();
1449 _session->add_command(new MementoCommand<TempoMap>(_session->tempo_map(), &before, &after));
1450 commit_reversible_command ();
1453 /* actally just resets the ts to constant using initial tempo */
1455 Editor::toggle_tempo_type ()
1459 dynamic_cast_marker_object (marker_menu_item->get_data ("marker"), &mm, &tm);
1462 TempoSection* tsp = &tm->tempo();
1464 const Tempo tempo (tsp->note_types_per_minute(), tsp->note_type());
1465 const double pulse = tsp->pulse();
1466 const framepos_t frame = tsp->frame();
1467 const PositionLockStyle pls = tsp->position_lock_style();
1469 begin_reversible_command (_("set tempo to constant"));
1470 XMLNode &before = _session->tempo_map().get_state();
1472 _session->tempo_map().replace_tempo (*tsp, tempo, pulse, frame, pls);
1474 XMLNode &after = _session->tempo_map().get_state();
1475 _session->add_command(new MementoCommand<TempoMap>(_session->tempo_map(), &before, &after));
1476 commit_reversible_command ();
1479 /* clamped locks the previous section end tempo to the start tempo */
1481 Editor::toggle_tempo_clamped ()
1485 dynamic_cast_marker_object (marker_menu_item->get_data ("marker"), &mm, &tm);
1488 begin_reversible_command (_("Clamp Tempo"));
1489 XMLNode &before = _session->tempo_map().get_state();
1491 TempoSection* tsp = &tm->tempo();
1492 TempoSection* prev = _session->tempo_map().previous_tempo_section (tsp);
1495 /* set to the end tempo of the previous section */
1496 Tempo new_tempo (prev->end_note_types_per_minute(), prev->note_type(), tsp->end_note_types_per_minute());
1497 _session->tempo_map().gui_change_tempo (tsp, new_tempo);
1500 tsp->set_clamped (!tsp->clamped());
1502 XMLNode &after = _session->tempo_map().get_state();
1503 _session->add_command(new MementoCommand<TempoMap>(_session->tempo_map(), &before, &after));
1504 commit_reversible_command ();
1509 Editor::continue_previous_tempo ()
1513 dynamic_cast_marker_object (marker_menu_item->get_data ("marker"), &mm, &tm);
1516 TempoMap& tmap (_session->tempo_map());
1517 TempoSection* tsp = &tm->tempo();
1518 TempoSection* prev_ts = tmap.previous_tempo_section (&tm->tempo());
1520 const Tempo tempo (prev_ts->end_note_types_per_minute(), tsp->note_type(), tsp->end_note_types_per_minute());
1521 const double pulse = tsp->pulse();
1522 const framepos_t frame = tsp->frame();
1523 const PositionLockStyle pls = tsp->position_lock_style();
1525 begin_reversible_command (_("continue previous tempo"));
1526 XMLNode &before = _session->tempo_map().get_state();
1528 tmap.replace_tempo (*tsp, tempo, pulse, frame, pls);
1530 XMLNode &after = _session->tempo_map().get_state();
1531 _session->add_command(new MementoCommand<TempoMap>(_session->tempo_map(), &before, &after));
1532 commit_reversible_command ();
1538 Editor::ramp_to_next_tempo ()
1542 dynamic_cast_marker_object (marker_menu_item->get_data ("marker"), &mm, &tm);
1545 TempoMap& tmap (_session->tempo_map());
1546 TempoSection* tsp = &tm->tempo();
1547 TempoSection* next_ts = tmap.next_tempo_section (&tm->tempo());
1549 const Tempo tempo (tsp->note_types_per_minute(), tsp->note_type(), next_ts->note_types_per_minute());
1550 const double pulse = tsp->pulse();
1551 const framepos_t frame = tsp->frame();
1552 const PositionLockStyle pls = tsp->position_lock_style();
1554 begin_reversible_command (_("ramp to next tempo"));
1555 XMLNode &before = _session->tempo_map().get_state();
1557 tmap.replace_tempo (*tsp, tempo, pulse, frame, pls);
1559 XMLNode &after = _session->tempo_map().get_state();
1560 _session->add_command(new MementoCommand<TempoMap>(_session->tempo_map(), &before, &after));
1561 commit_reversible_command ();
1567 Editor::toggle_marker_menu_lock ()
1569 ArdourMarker* marker;
1571 if ((marker = reinterpret_cast<ArdourMarker *> (marker_menu_item->get_data ("marker"))) == 0) {
1572 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
1573 abort(); /*NOTREACHED*/
1579 loc = find_location_from_marker (marker, ignored);
1585 if (loc->locked()) {
1593 Editor::marker_menu_rename ()
1595 ArdourMarker* marker;
1597 if ((marker = reinterpret_cast<ArdourMarker *> (marker_menu_item->get_data ("marker"))) == 0) {
1598 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
1599 abort(); /*NOTREACHED*/
1603 rename_marker (marker);
1607 Editor::rename_marker(ArdourMarker *marker)
1612 loc = find_location_from_marker (marker, is_start);
1618 if (loc == transport_loop_location() || loc == transport_punch_location() || loc->is_session_range()) {
1622 ArdourWidgets::Prompter dialog (true);
1625 dialog.set_prompt (_("New Name:"));
1627 if (loc->is_mark()) {
1628 dialog.set_title (_("Rename Mark"));
1630 dialog.set_title (_("Rename Range"));
1633 dialog.set_name ("MarkRenameWindow");
1634 dialog.set_size_request (250, -1);
1635 dialog.set_position (Gtk::WIN_POS_MOUSE);
1637 dialog.add_button (_("Rename"), RESPONSE_ACCEPT);
1638 dialog.set_response_sensitive (Gtk::RESPONSE_ACCEPT, false);
1639 dialog.set_initial_text (loc->name());
1643 switch (dialog.run ()) {
1644 case RESPONSE_ACCEPT:
1650 begin_reversible_command ( _("rename marker") );
1651 XMLNode &before = _session->locations()->get_state();
1653 dialog.get_result(txt);
1654 loc->set_name (txt);
1655 _session->set_dirty ();
1657 XMLNode &after = _session->locations()->get_state();
1658 _session->add_command (new MementoCommand<Locations>(*(_session->locations()), &before, &after));
1659 commit_reversible_command ();
1663 Editor::new_transport_marker_menu_popdown ()
1666 transport_bar_drag_rect->hide();
1672 Editor::new_transport_marker_menu_set_loop ()
1674 set_loop_range (temp_location->start(), temp_location->end(), _("set loop range"));
1678 Editor::new_transport_marker_menu_set_punch ()
1680 set_punch_range (temp_location->start(), temp_location->end(), _("set punch range"));
1684 Editor::update_loop_range_view ()
1686 if (_session == 0) {
1692 if (_session->get_play_loop() && ((tll = transport_loop_location()) != 0)) {
1694 double x1 = sample_to_pixel (tll->start());
1695 double x2 = sample_to_pixel (tll->end());
1697 transport_loop_range_rect->set_x0 (x1);
1698 transport_loop_range_rect->set_x1 (x2);
1700 transport_loop_range_rect->show();
1703 transport_loop_range_rect->hide();
1708 Editor::update_punch_range_view ()
1710 if (_session == 0) {
1716 if ((_session->config.get_punch_in() || _session->config.get_punch_out()) && ((tpl = transport_punch_location()) != 0)) {
1721 if (_session->config.get_punch_in()) {
1722 pixel_start = sample_to_pixel (tpl->start());
1726 if (_session->config.get_punch_out()) {
1727 pixel_end = sample_to_pixel (tpl->end());
1729 pixel_end = sample_to_pixel (max_framepos);
1732 transport_punch_range_rect->set_x0 (pixel_start);
1733 transport_punch_range_rect->set_x1 (pixel_end);
1734 transport_punch_range_rect->show();
1738 transport_punch_range_rect->hide();
1743 Editor::marker_selection_changed ()
1745 if (_session && _session->deletion_in_progress()) {
1749 for (LocationMarkerMap::iterator i = location_markers.begin(); i != location_markers.end(); ++i) {
1750 i->second->set_selected (false);
1753 for (MarkerSelection::iterator x = selection->markers.begin(); x != selection->markers.end(); ++x) {
1754 (*x)->set_selected (true);
1758 struct SortLocationsByPosition {
1759 bool operator() (Location* a, Location* b) {
1760 return a->start() < b->start();
1765 Editor::goto_nth_marker (int n)
1770 const Locations::LocationList& l (_session->locations()->list());
1771 Locations::LocationList ordered;
1774 SortLocationsByPosition cmp;
1777 for (Locations::LocationList::iterator i = ordered.begin(); n >= 0 && i != ordered.end(); ++i) {
1778 if ((*i)->is_mark() && !(*i)->is_hidden() && !(*i)->is_session_range()) {
1780 _session->request_locate ((*i)->start(), _session->transport_rolling());
1789 Editor::toggle_marker_menu_glue ()
1791 ArdourMarker* marker;
1793 if ((marker = reinterpret_cast<ArdourMarker *> (marker_menu_item->get_data ("marker"))) == 0) {
1794 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
1795 abort(); /*NOTREACHED*/
1801 loc = find_location_from_marker (marker, ignored);
1807 begin_reversible_command (_("change marker lock style"));
1808 XMLNode &before = _session->locations()->get_state();
1810 if (loc->position_lock_style() == MusicTime) {
1811 loc->set_position_lock_style (AudioTime);
1813 loc->set_position_lock_style (MusicTime);
1816 XMLNode &after = _session->locations()->get_state();
1817 _session->add_command(new MementoCommand<Locations>(*(_session->locations()), &before, &after));
1818 commit_reversible_command ();
1822 Editor::toggle_marker_lines ()
1824 _show_marker_lines = !_show_marker_lines;
1826 for (LocationMarkerMap::iterator i = location_markers.begin(); i != location_markers.end(); ++i) {
1827 i->second->set_show_lines (_show_marker_lines);
1832 Editor::remove_sorted_marker (ArdourMarker* m)
1834 for (std::map<ArdourCanvas::Container *, std::list<ArdourMarker *> >::iterator i = _sorted_marker_lists.begin(); i != _sorted_marker_lists.end(); ++i) {
1835 i->second.remove (m);
1840 Editor::find_marker_from_location_id (PBD::ID const & id, bool is_start) const
1842 for (LocationMarkerMap::const_iterator i = location_markers.begin(); i != location_markers.end(); ++i) {
1843 if (i->first->id() == id) {
1844 return is_start ? i->second->start : i->second->end;