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.
20 #include <sigc++/retype.h>
24 #include <libgnomecanvas/libgnomecanvas.h>
25 #include <gtkmm2ext/gtk_ui.h>
26 #include <gtkmm2ext/window_title.h>
28 #include <ardour/location.h>
29 #include <pbd/memento_command.h>
33 #include "selection.h"
35 #include "gui_thread.h"
36 #include "simplerect.h"
44 using namespace ARDOUR;
47 using namespace Gtkmm2ext;
50 Editor::clear_marker_display ()
52 for (LocationMarkerMap::iterator i = location_markers.begin(); i != location_markers.end(); ++i) {
56 location_markers.clear ();
60 Editor::add_new_location (Location *location)
62 ENSURE_GUI_THREAD (bind (mem_fun(*this, &Editor::add_new_location), location));
64 LocationMarkers *lam = new LocationMarkers;
67 if (location->is_cd_marker()) {
68 color = location_cd_marker_color;
69 } else if (location->is_mark()) {
70 color = location_marker_color;
71 } else if (location->is_auto_loop()) {
72 color = location_loop_color;
73 } else if (location->is_auto_punch()) {
74 color = location_punch_color;
76 color = location_range_color;
79 if (location->is_mark()) {
80 lam->start = new Marker (*this, *marker_group, color, location->name(), Marker::Mark, location->start());
83 } else if (location->is_auto_loop()) {
85 lam->start = new Marker (*this, *transport_marker_group, color,
86 location->name(), Marker::LoopStart, location->start());
87 lam->end = new Marker (*this, *transport_marker_group, color,
88 location->name(), Marker::LoopEnd, location->end());
90 } else if (location->is_auto_punch()) {
92 lam->start = new Marker (*this, *transport_marker_group, color,
93 location->name(), Marker::PunchIn, location->start());
94 lam->end = new Marker (*this, *transport_marker_group, color,
95 location->name(), Marker::PunchOut, location->end());
100 lam->start = new Marker (*this, *range_marker_group, color,
101 location->name(), Marker::Start, location->start());
102 lam->end = new Marker (*this, *range_marker_group, color,
103 location->name(), Marker::End, location->end());
106 if (location->is_hidden ()) {
112 location->start_changed.connect (mem_fun(*this, &Editor::location_changed));
113 location->end_changed.connect (mem_fun(*this, &Editor::location_changed));
114 location->changed.connect (mem_fun(*this, &Editor::location_changed));
115 location->name_changed.connect (mem_fun(*this, &Editor::location_changed));
116 location->FlagsChanged.connect (mem_fun(*this, &Editor::location_flags_changed));
118 pair<Location*,LocationMarkers*> newpair;
120 newpair.first = location;
121 newpair.second = lam;
123 location_markers.insert (newpair);
127 Editor::location_changed (Location *location)
129 ENSURE_GUI_THREAD (bind (mem_fun(*this, &Editor::location_changed), location));
131 LocationMarkers *lam = find_location_markers (location);
134 /* a location that isn't "marked" with markers */
138 lam->set_name (location->name());
139 lam->set_position (location->start(), location->end());
141 if (location->is_auto_loop()) {
142 update_loop_range_view ();
143 } else if (location->is_auto_punch()) {
144 update_punch_range_view ();
149 Editor::location_flags_changed (Location *location, void *src)
151 ENSURE_GUI_THREAD(bind (mem_fun(*this, &Editor::location_flags_changed), location, src));
153 LocationMarkers *lam = find_location_markers (location);
156 /* a location that isn't "marked" with markers */
160 if (location->is_cd_marker()) {
161 lam->set_color_rgba (location_cd_marker_color);
162 } else if (location->is_mark()) {
163 lam->set_color_rgba (location_marker_color);
164 } else if (location->is_auto_punch()) {
165 lam->set_color_rgba (location_punch_color);
166 } else if (location->is_auto_loop()) {
167 lam->set_color_rgba (location_loop_color);
169 lam->set_color_rgba (location_range_color);
172 if (location->is_hidden()) {
179 Editor::LocationMarkers::~LocationMarkers ()
190 Editor::LocationMarkers *
191 Editor::find_location_markers (Location *location) const
193 LocationMarkerMap::const_iterator i;
195 for (i = location_markers.begin(); i != location_markers.end(); ++i) {
196 if ((*i).first == location) {
205 Editor::find_location_from_marker (Marker *marker, bool& is_start) const
207 LocationMarkerMap::const_iterator i;
209 for (i = location_markers.begin(); i != location_markers.end(); ++i) {
210 LocationMarkers *lm = (*i).second;
211 if (lm->start == marker) {
214 } else if (lm->end == marker) {
224 Editor::refresh_location_display_internal (Locations::LocationList& locations)
228 for (LocationMarkerMap::iterator i = location_markers.begin(); i != location_markers.end(); ++i) {
229 i->second->valid = false;
234 for (Locations::LocationList::iterator i = locations.begin(); i != locations.end(); ++i) {
236 LocationMarkerMap::iterator x;
238 if ((x = location_markers.find (*i)) != location_markers.end()) {
239 x->second->valid = true;
243 add_new_location (*i);
246 /* remove dead ones */
248 for (LocationMarkerMap::iterator i = location_markers.begin(); i != location_markers.end(); ) {
250 LocationMarkerMap::iterator tmp;
255 if (!i->second->valid) {
257 location_markers.erase (i);
266 Editor::refresh_location_display ()
268 ENSURE_GUI_THREAD(mem_fun(*this, &Editor::refresh_location_display));
271 session->locations()->apply (*this, &Editor::refresh_location_display_internal);
276 Editor::refresh_location_display_s (Change ignored)
278 ENSURE_GUI_THREAD(bind (mem_fun(*this, &Editor::refresh_location_display_s), ignored));
281 session->locations()->apply (*this, &Editor::refresh_location_display_internal);
286 Editor::LocationMarkers::hide()
289 if (end) { end->hide(); }
293 Editor::LocationMarkers::show()
296 if (end) { end->show(); }
300 Editor::LocationMarkers::set_name (const string& str)
302 start->set_name (str);
303 if (end) { end->set_name (str); }
307 Editor::LocationMarkers::set_position (nframes_t startf,
310 start->set_position (startf);
311 if (end) { end->set_position (endf); }
315 Editor::LocationMarkers::set_color_rgba (uint32_t rgba)
317 start->set_color_rgba (rgba);
318 if (end) { end->set_color_rgba (rgba); }
322 Editor::mouse_add_new_marker (nframes_t where)
326 session->locations()->next_available_name(markername,"mark");
327 Location *location = new Location (where, where, markername, Location::IsMark);
328 session->begin_reversible_command (_("add marker"));
329 XMLNode &before = session->locations()->get_state();
330 session->locations()->add (location, true);
331 XMLNode &after = session->locations()->get_state();
332 session->add_command (new MementoCommand<Locations>(*(session->locations()), &before, &after));
333 session->commit_reversible_command ();
335 /* find the marker we just added */
337 LocationMarkers *lam = find_location_markers (location);
339 /* make it the selected marker */
340 selection->set (lam->start);
346 Editor::remove_marker (ArdourCanvas::Item& item, GdkEvent* event)
351 if ((marker = static_cast<Marker*> (item.get_data ("marker"))) == 0) {
352 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
356 Location* loc = find_location_from_marker (marker, is_start);
358 if (session && loc) {
359 Glib::signal_idle().connect (bind (mem_fun(*this, &Editor::really_remove_marker), loc));
364 Editor::really_remove_marker (Location* loc)
366 session->begin_reversible_command (_("remove marker"));
367 XMLNode &before = session->locations()->get_state();
368 session->locations()->remove (loc);
369 XMLNode &after = session->locations()->get_state();
370 session->add_command (new MementoCommand<Locations>(*(session->locations()), &before, &after));
371 session->commit_reversible_command ();
376 Editor::location_gone (Location *location)
378 ENSURE_GUI_THREAD(bind (mem_fun(*this, &Editor::location_gone), location));
380 LocationMarkerMap::iterator i;
382 if (location == transport_loop_location()) {
383 update_loop_range_view (true);
386 if (location == transport_punch_location()) {
387 update_punch_range_view (true);
390 for (i = location_markers.begin(); i != location_markers.end(); ++i) {
391 if ((*i).first == location) {
393 location_markers.erase (i);
400 Editor::tm_marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item)
402 if (tm_marker_menu == 0) {
403 build_tm_marker_menu ();
406 marker_menu_item = item;
407 tm_marker_menu->popup (1, ev->time);
412 Editor::marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item)
415 if ((marker = reinterpret_cast<Marker *> (item->get_data("marker"))) == 0) {
416 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
421 Location * loc = find_location_from_marker (marker, is_start);
422 if (loc == transport_loop_location() || loc == transport_punch_location()) {
423 if (transport_marker_menu == 0) {
424 build_range_marker_menu (true);
426 marker_menu_item = item;
427 transport_marker_menu->popup (1, ev->time);
430 if (loc->is_mark()) {
431 bool start_or_end = loc->is_start() || loc->is_end();
434 if (start_end_marker_menu == 0)
435 build_marker_menu (true);
436 markerMenu = start_end_marker_menu;
438 if (marker_menu == 0)
439 build_marker_menu (false);
440 markerMenu = marker_menu;
444 // GTK2FIX use action group sensitivity
446 if (children.size() >= 3) {
447 MenuItem * loopitem = &children[2];
449 if (loc->is_mark()) {
450 loopitem->set_sensitive(false);
453 loopitem->set_sensitive(true);
458 marker_menu_item = item;
459 markerMenu->popup (1, ev->time);
462 if (loc->is_range_marker()) {
463 if (range_marker_menu == 0){
464 build_range_marker_menu (false);
466 marker_menu_item = item;
467 range_marker_menu->popup (1, ev->time);
473 Editor::new_transport_marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item)
475 if (new_transport_marker_menu == 0) {
476 build_new_transport_marker_menu ();
479 new_transport_marker_menu->popup (1, ev->time);
484 Editor::transport_marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item)
486 if (transport_marker_menu == 0) {
487 build_range_marker_menu (true);
490 transport_marker_menu->popup (1, ev->time);
494 Editor::build_marker_menu (bool start_or_end)
496 using namespace Menu_Helpers;
498 Menu *markerMenu = new Menu;
500 start_end_marker_menu = markerMenu;
502 marker_menu = markerMenu;
504 MenuList& items = markerMenu->items();
505 markerMenu->set_name ("ArdourContextMenu");
507 items.push_back (MenuElem (_("Locate to here"), mem_fun(*this, &Editor::marker_menu_set_playhead)));
508 items.push_back (MenuElem (_("Play from here"), mem_fun(*this, &Editor::marker_menu_play_from)));
509 items.push_back (MenuElem (_("Move Mark to Playhead"), mem_fun(*this, &Editor::marker_menu_set_from_playhead)));
511 items.push_back (SeparatorElem());
513 items.push_back (MenuElem (_("Hide"), mem_fun(*this, &Editor::marker_menu_hide)));
514 if (start_or_end) return;
515 items.push_back (MenuElem (_("Rename"), mem_fun(*this, &Editor::marker_menu_rename)));
516 items.push_back (MenuElem (_("Lock"), bind (mem_fun(*this, &Editor::marker_menu_lock), true)));
517 items.push_back (MenuElem (_("Unlock"), bind (mem_fun(*this, &Editor::marker_menu_lock), false)));
519 items.push_back (SeparatorElem());
521 items.push_back (MenuElem (_("Remove"), mem_fun(*this, &Editor::marker_menu_remove)));
525 Editor::build_range_marker_menu (bool loop_or_punch)
527 using namespace Menu_Helpers;
529 Menu *markerMenu = new Menu;
531 transport_marker_menu = markerMenu;
533 range_marker_menu = markerMenu;
535 MenuList& items = markerMenu->items();
536 markerMenu->set_name ("ArdourContextMenu");
538 items.push_back (MenuElem (_("Locate to Range Mark"), mem_fun(*this, &Editor::marker_menu_set_playhead)));
539 items.push_back (MenuElem (_("Play from Range Mark"), mem_fun(*this, &Editor::marker_menu_play_from)));
540 if (! loop_or_punch) {
541 items.push_back (MenuElem (_("Play Range"), mem_fun(*this, &Editor::marker_menu_play_range)));
542 items.push_back (MenuElem (_("Loop Range"), mem_fun(*this, &Editor::marker_menu_loop_range)));
544 items.push_back (MenuElem (_("Set Range Mark from Playhead"), mem_fun(*this, &Editor::marker_menu_set_from_playhead)));
545 items.push_back (MenuElem (_("Set Range from Range Selection"), mem_fun(*this, &Editor::marker_menu_set_from_selection)));
547 items.push_back (SeparatorElem());
549 items.push_back (MenuElem (_("Hide Range"), mem_fun(*this, &Editor::marker_menu_hide)));
550 if (! loop_or_punch) {
551 items.push_back (MenuElem (_("Rename Range"), mem_fun(*this, &Editor::marker_menu_rename)));
552 items.push_back (MenuElem (_("Remove Range"), mem_fun(*this, &Editor::marker_menu_remove)));
555 items.push_back (SeparatorElem());
557 items.push_back (MenuElem (_("Separate Regions in Range"), mem_fun(*this, &Editor::marker_menu_separate_regions_using_location)));
558 items.push_back (MenuElem (_("Select All in Range"), mem_fun(*this, &Editor::marker_menu_select_all_selectables_using_range)));
559 items.push_back (MenuElem (_("Select Range"), mem_fun(*this, &Editor::marker_menu_select_using_range)));
564 Editor::build_tm_marker_menu ()
566 using namespace Menu_Helpers;
568 tm_marker_menu = new Menu;
569 MenuList& items = tm_marker_menu->items();
570 tm_marker_menu->set_name ("ArdourContextMenu");
572 items.push_back (MenuElem (_("Edit"), mem_fun(*this, &Editor::marker_menu_edit)));
573 items.push_back (MenuElem (_("Remove"), mem_fun(*this, &Editor::marker_menu_remove)));
577 Editor::build_new_transport_marker_menu ()
579 using namespace Menu_Helpers;
581 new_transport_marker_menu = new Menu;
582 MenuList& items = new_transport_marker_menu->items();
583 new_transport_marker_menu->set_name ("ArdourContextMenu");
585 items.push_back (MenuElem (_("Set Loop Range"), mem_fun(*this, &Editor::new_transport_marker_menu_set_loop)));
586 items.push_back (MenuElem (_("Set Punch Range"), mem_fun(*this, &Editor::new_transport_marker_menu_set_punch)));
588 new_transport_marker_menu->signal_unmap_event().connect ( mem_fun(*this, &Editor::new_transport_marker_menu_popdown));
592 Editor::marker_menu_hide ()
596 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
597 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
604 if ((l = find_location_from_marker (marker, is_start)) != 0) {
605 l->set_hidden (true, this);
610 Editor::marker_menu_select_using_range ()
614 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
615 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
622 if (((l = find_location_from_marker (marker, is_start)) != 0) && (l->end() > l->start())) {
623 set_selection_from_range (*l);
628 Editor::marker_menu_select_all_selectables_using_range ()
632 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
633 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
640 if (((l = find_location_from_marker (marker, is_start)) != 0) && (l->end() > l->start())) {
641 select_all_within (l->start(), l->end() - 1, 0, DBL_MAX, track_views, Selection::Set);
647 Editor::marker_menu_separate_regions_using_location ()
651 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
652 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
659 if (((l = find_location_from_marker (marker, is_start)) != 0) && (l->end() > l->start())) {
660 separate_regions_using_location (*l);
666 Editor::marker_menu_play_from ()
670 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
671 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
678 if ((l = find_location_from_marker (marker, is_start)) != 0) {
681 session->request_locate (l->start(), true);
684 //session->request_bounded_roll (l->start(), l->end());
687 session->request_locate (l->start(), true);
689 session->request_locate (l->end(), true);
696 Editor::marker_menu_set_playhead ()
700 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
701 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
708 if ((l = find_location_from_marker (marker, is_start)) != 0) {
711 session->request_locate (l->start(), false);
715 session->request_locate (l->start(), false);
717 session->request_locate (l->end(), false);
724 Editor::marker_menu_set_from_playhead ()
728 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
729 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
736 if ((l = find_location_from_marker (marker, is_start)) != 0) {
739 l->set_start (session->transport_frame ());
743 l->set_start (session->transport_frame ());
745 l->set_end (session->transport_frame ());
752 Editor::marker_menu_set_from_selection ()
756 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
757 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
764 if ((l = find_location_from_marker (marker, is_start)) != 0) {
771 /* if range selection use first to last */
773 if (mouse_mode == Editing::MouseRange) {
774 if (!selection->time.empty()) {
775 l->set_start (selection->time.start());
776 l->set_end (selection->time.end_frame());
780 if (!selection->regions.empty()) {
781 l->set_start (selection->regions.start());
782 l->set_end (selection->regions.end_frame());
791 Editor::marker_menu_play_range ()
795 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
796 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
803 if ((l = find_location_from_marker (marker, is_start)) != 0) {
806 session->request_locate (l->start(), true);
809 session->request_bounded_roll (l->start(), l->end());
816 Editor::marker_menu_loop_range ()
820 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
821 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
828 if ((l = find_location_from_marker (marker, is_start)) != 0) {
830 if ((l2 = transport_loop_location()) != 0) {
831 l2->set (l->start(), l->end());
833 // enable looping, reposition and start rolling
834 session->request_play_loop(true);
835 session->request_locate (l2->start(), true);
841 Editor::marker_menu_edit ()
847 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
848 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
852 if ((mm = dynamic_cast<MeterMarker*> (marker)) != 0) {
853 edit_meter_section (&mm->meter());
854 } else if ((tm = dynamic_cast<TempoMarker*> (marker)) != 0) {
855 edit_tempo_section (&tm->tempo());
857 fatal << X_("programming erorr: unhandled marker type in Editor::marker_menu_edit")
864 Editor::marker_menu_remove ()
870 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
871 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
875 if ((mm = dynamic_cast<MeterMarker*> (marker)) != 0) {
876 remove_meter_marker (marker_menu_item);
877 } else if ((tm = dynamic_cast<TempoMarker*> (marker)) != 0) {
878 remove_tempo_marker (marker_menu_item);
880 remove_marker (*marker_menu_item, (GdkEvent*) 0);
885 Editor::marker_menu_lock (bool yn)
890 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
891 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
898 loc = find_location_from_marker (marker, ignored);
910 Editor::marker_menu_rename ()
914 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
915 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
922 loc = find_location_from_marker (marker, is_start);
926 ArdourPrompter dialog (true);
929 dialog.set_prompt (_("New Name:"));
931 WindowTitle title(Glib::get_application_name());
932 if (loc->is_mark()) {
933 title += _("Rename Mark");
935 title += _("Rename Range");
938 dialog.set_title(title.get_string());
940 dialog.set_name ("MarkRenameWindow");
941 dialog.set_size_request (250, -1);
942 dialog.set_position (Gtk::WIN_POS_MOUSE);
944 dialog.add_button (_("Rename"), RESPONSE_ACCEPT);
945 dialog.set_response_sensitive (Gtk::RESPONSE_ACCEPT, false);
946 dialog.set_initial_text (loc->name());
950 switch (dialog.run ()) {
951 case RESPONSE_ACCEPT:
957 begin_reversible_command ( _("rename marker") );
958 XMLNode &before = session->locations()->get_state();
960 dialog.get_result(txt);
963 XMLNode &after = session->locations()->get_state();
964 session->add_command (new MementoCommand<Locations>(*(session->locations()), &before, &after));
965 commit_reversible_command ();
969 Editor::new_transport_marker_menu_popdown (GdkEventAny *ev)
972 transport_bar_drag_rect->hide();
973 range_marker_drag_rect->hide();
979 Editor::new_transport_marker_menu_set_loop ()
981 set_loop_range (temp_location->start(), temp_location->end(), _("set loop range"));
985 Editor::new_transport_marker_menu_set_punch ()
987 set_punch_range (temp_location->start(), temp_location->end(), _("set punch range"));
991 Editor::update_loop_range_view (bool visibility)
999 if (session->get_play_loop() && ((tll = transport_loop_location()) != 0)) {
1001 double x1 = frame_to_pixel (tll->start());
1002 double x2 = frame_to_pixel (tll->end());
1004 transport_loop_range_rect->property_x1() = x1;
1005 transport_loop_range_rect->property_x2() = x2;
1008 transport_loop_range_rect->show();
1011 } else if (visibility) {
1012 transport_loop_range_rect->hide();
1017 Editor::update_punch_range_view (bool visibility)
1025 if ((Config->get_punch_in() || Config->get_punch_out()) && ((tpl = transport_punch_location()) != 0)) {
1027 double x1 = frame_to_pixel (tpl->start());
1028 double x2 = frame_to_pixel (tpl->end());
1030 transport_punch_range_rect->property_x1() = x1;
1031 transport_punch_range_rect->property_x2() = x2;
1034 transport_punch_range_rect->show();
1037 else if (visibility) {
1038 transport_punch_range_rect->hide();
1041 // if (session->get_punch_in()) {
1042 // double x = frame_to_pixel (transport_punch_location->start());
1043 // gnome_canvas_item_set (transport_punchin_line, "x1", x, "x2", x, NULL);
1045 // if (visibility) {
1046 // gnome_canvas_item_show (transport_punchin_line);
1049 // else if (visibility) {
1050 // gnome_canvas_item_hide (transport_punchin_line);
1053 // if (session->get_punch_out()) {
1054 // double x = frame_to_pixel (transport_punch_location->end());
1056 // gnome_canvas_item_set (transport_punchout_line, "x1", x, "x2", x, NULL);
1058 // if (visibility) {
1059 // gnome_canvas_item_show (transport_punchout_line);
1062 // else if (visibility) {
1063 // gnome_canvas_item_hide (transport_punchout_line);
1068 Editor::marker_selection_changed ()
1070 for (LocationMarkerMap::iterator i = location_markers.begin(); i != location_markers.end(); ++i) {
1071 LocationMarkers* lam = i->second;
1074 lam->start->hide_line();
1078 lam->end->hide_line();
1082 edit_point_clock_connection_a.disconnect();
1083 edit_point_clock_connection_b.disconnect();
1085 if (selection->markers.empty()) {
1086 edit_point_clock.set (0);
1090 for (MarkerSelection::iterator x = selection->markers.begin(); x != selection->markers.end(); ++x) {
1091 (*x)->add_line (cursor_group, canvas_height);
1095 edit_point_clock.set (selection->markers.front()->position());
1098 Location* loc = find_location_from_marker (selection->markers.front(), ignored);
1101 edit_point_clock_connection_a = loc->changed.connect (mem_fun (*this, &Editor::selected_marker_moved));
1102 edit_point_clock_connection_b = loc->start_changed.connect (mem_fun (*this, &Editor::selected_marker_moved));
1107 Editor::selected_marker_moved (Location* loc)
1109 edit_point_clock.set (loc->start());