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>
27 #include <ardour/location.h>
28 #include <pbd/memento_command.h>
32 #include "selection.h"
34 #include "gui_thread.h"
35 #include "simplerect.h"
43 using namespace ARDOUR;
48 Editor::clear_marker_display ()
50 for (LocationMarkerMap::iterator i = location_markers.begin(); i != location_markers.end(); ++i) {
54 location_markers.clear ();
58 Editor::add_new_location (Location *location)
60 ENSURE_GUI_THREAD (bind (mem_fun(*this, &Editor::add_new_location), location));
62 LocationMarkers *lam = new LocationMarkers;
65 if (location->is_cd_marker()) {
66 color = location_cd_marker_color;
67 } else if (location->is_mark()) {
68 color = location_marker_color;
69 } else if (location->is_auto_loop()) {
70 color = location_loop_color;
71 } else if (location->is_auto_punch()) {
72 color = location_punch_color;
74 color = location_range_color;
77 if (location->is_mark()) {
78 lam->start = new Marker (*this, *marker_group, color, location->name(), Marker::Mark, location->start());
81 } else if (location->is_auto_loop()) {
83 lam->start = new Marker (*this, *transport_marker_group, color,
84 location->name(), Marker::LoopStart, location->start());
85 lam->end = new Marker (*this, *transport_marker_group, color,
86 location->name(), Marker::LoopEnd, location->end());
88 } else if (location->is_auto_punch()) {
90 lam->start = new Marker (*this, *transport_marker_group, color,
91 location->name(), Marker::PunchIn, location->start());
92 lam->end = new Marker (*this, *transport_marker_group, color,
93 location->name(), Marker::PunchOut, location->end());
98 lam->start = new Marker (*this, *range_marker_group, color,
99 location->name(), Marker::Start, location->start());
100 lam->end = new Marker (*this, *range_marker_group, color,
101 location->name(), Marker::End, location->end());
104 if (location->is_hidden ()) {
110 location->start_changed.connect (mem_fun(*this, &Editor::location_changed));
111 location->end_changed.connect (mem_fun(*this, &Editor::location_changed));
112 location->changed.connect (mem_fun(*this, &Editor::location_changed));
113 location->name_changed.connect (mem_fun(*this, &Editor::location_changed));
114 location->FlagsChanged.connect (mem_fun(*this, &Editor::location_flags_changed));
116 pair<Location*,LocationMarkers*> newpair;
118 newpair.first = location;
119 newpair.second = lam;
121 location_markers.insert (newpair);
125 Editor::location_changed (Location *location)
127 ENSURE_GUI_THREAD (bind (mem_fun(*this, &Editor::location_changed), location));
129 LocationMarkers *lam = find_location_markers (location);
132 /* a location that isn't "marked" with markers */
136 lam->set_name (location->name());
137 lam->set_position (location->start(), location->end());
139 if (location->is_auto_loop()) {
140 update_loop_range_view ();
141 } else if (location->is_auto_punch()) {
142 update_punch_range_view ();
147 Editor::location_flags_changed (Location *location, void *src)
149 ENSURE_GUI_THREAD(bind (mem_fun(*this, &Editor::location_flags_changed), location, src));
151 LocationMarkers *lam = find_location_markers (location);
154 /* a location that isn't "marked" with markers */
158 if (location->is_cd_marker()) {
159 lam->set_color_rgba (location_cd_marker_color);
160 } else if (location->is_mark()) {
161 lam->set_color_rgba (location_marker_color);
162 } else if (location->is_auto_punch()) {
163 lam->set_color_rgba (location_punch_color);
164 } else if (location->is_auto_loop()) {
165 lam->set_color_rgba (location_loop_color);
167 lam->set_color_rgba (location_range_color);
170 if (location->is_hidden()) {
177 Editor::LocationMarkers::~LocationMarkers ()
188 Editor::LocationMarkers *
189 Editor::find_location_markers (Location *location)
191 LocationMarkerMap::iterator i;
193 for (i = location_markers.begin(); i != location_markers.end(); ++i) {
194 if ((*i).first == location) {
203 Editor::find_location_from_marker (Marker *marker, bool& is_start)
205 LocationMarkerMap::iterator i;
207 for (i = location_markers.begin(); i != location_markers.end(); ++i) {
208 LocationMarkers *lm = (*i).second;
209 if (lm->start == marker) {
212 } else if (lm->end == marker) {
222 Editor::refresh_location_display_internal (Locations::LocationList& locations)
224 clear_marker_display ();
226 for (Locations::LocationList::iterator i = locations.begin(); i != locations.end(); ++i) {
227 add_new_location (*i);
232 Editor::refresh_location_display ()
234 ENSURE_GUI_THREAD(mem_fun(*this, &Editor::refresh_location_display));
237 session->locations()->apply (*this, &Editor::refresh_location_display_internal);
242 Editor::refresh_location_display_s (Change ignored)
244 ENSURE_GUI_THREAD(bind (mem_fun(*this, &Editor::refresh_location_display_s), ignored));
247 session->locations()->apply (*this, &Editor::refresh_location_display_internal);
252 Editor::LocationMarkers::hide()
255 if (end) { end->hide(); }
259 Editor::LocationMarkers::show()
262 if (end) { end->show(); }
266 Editor::LocationMarkers::set_name (const string& str)
268 start->set_name (str);
269 if (end) { end->set_name (str); }
273 Editor::LocationMarkers::set_position (nframes_t startf,
276 start->set_position (startf);
277 if (end) { end->set_position (endf); }
281 Editor::LocationMarkers::set_color_rgba (uint32_t rgba)
283 start->set_color_rgba (rgba);
284 if (end) { end->set_color_rgba (rgba); }
288 Editor::mouse_add_new_marker (nframes_t where)
292 session->locations()->next_available_name(markername,"mark");
293 Location *location = new Location (where, where, markername, Location::IsMark);
294 session->begin_reversible_command (_("add marker"));
295 XMLNode &before = session->locations()->get_state();
296 session->locations()->add (location, true);
297 XMLNode &after = session->locations()->get_state();
298 session->add_command (new MementoCommand<Locations>(*(session->locations()), &before, &after));
299 session->commit_reversible_command ();
304 Editor::remove_marker (ArdourCanvas::Item& item, GdkEvent* event)
309 if ((marker = static_cast<Marker*> (item.get_data ("marker"))) == 0) {
310 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
314 Location* loc = find_location_from_marker (marker, is_start);
316 if (session && loc) {
317 Glib::signal_idle().connect (bind (mem_fun(*this, &Editor::really_remove_marker), loc));
322 Editor::really_remove_marker (Location* loc)
324 session->begin_reversible_command (_("remove marker"));
325 XMLNode &before = session->locations()->get_state();
326 session->locations()->remove (loc);
327 XMLNode &after = session->locations()->get_state();
328 session->add_command (new MementoCommand<Locations>(*(session->locations()), &before, &after));
329 session->commit_reversible_command ();
334 Editor::location_gone (Location *location)
336 ENSURE_GUI_THREAD(bind (mem_fun(*this, &Editor::location_gone), location));
338 LocationMarkerMap::iterator i;
340 if (location == transport_loop_location()) {
341 update_loop_range_view (true);
344 if (location == transport_punch_location()) {
345 update_punch_range_view (true);
348 for (i = location_markers.begin(); i != location_markers.end(); ++i) {
349 if ((*i).first == location) {
351 location_markers.erase (i);
358 Editor::tm_marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item)
360 if (tm_marker_menu == 0) {
361 build_tm_marker_menu ();
364 marker_menu_item = item;
365 tm_marker_menu->popup (1, ev->time);
370 Editor::marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item)
373 if ((marker = reinterpret_cast<Marker *> (item->get_data("marker"))) == 0) {
374 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
379 Location * loc = find_location_from_marker (marker, is_start);
380 if (loc == transport_loop_location() || loc == transport_punch_location()) {
381 if (transport_marker_menu == 0) {
382 build_range_marker_menu (true);
384 marker_menu_item = item;
385 transport_marker_menu->popup (1, ev->time);
388 if (loc->is_mark()) {
389 bool start_or_end = loc->is_start() || loc->is_end();
392 if (start_end_marker_menu == 0)
393 build_marker_menu (true);
394 markerMenu = start_end_marker_menu;
396 if (marker_menu == 0)
397 build_marker_menu (false);
398 markerMenu = marker_menu;
402 // GTK2FIX use action group sensitivity
404 if (children.size() >= 3) {
405 MenuItem * loopitem = &children[2];
407 if (loc->is_mark()) {
408 loopitem->set_sensitive(false);
411 loopitem->set_sensitive(true);
416 marker_menu_item = item;
417 markerMenu->popup (1, ev->time);
420 if (loc->is_range_marker()) {
421 if (range_marker_menu == 0){
422 build_range_marker_menu (false);
424 marker_menu_item = item;
425 range_marker_menu->popup (1, ev->time);
431 Editor::new_transport_marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item)
433 if (new_transport_marker_menu == 0) {
434 build_new_transport_marker_menu ();
437 new_transport_marker_menu->popup (1, ev->time);
442 Editor::transport_marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item)
444 if (transport_marker_menu == 0) {
445 build_range_marker_menu (true);
448 transport_marker_menu->popup (1, ev->time);
452 Editor::build_marker_menu (bool start_or_end)
454 using namespace Menu_Helpers;
456 Menu *markerMenu = new Menu;
458 start_end_marker_menu = markerMenu;
460 marker_menu = markerMenu;
462 MenuList& items = markerMenu->items();
463 markerMenu->set_name ("ArdourContextMenu");
465 items.push_back (MenuElem (_("Locate to Mark"), mem_fun(*this, &Editor::marker_menu_set_playhead)));
466 items.push_back (MenuElem (_("Play from Mark"), mem_fun(*this, &Editor::marker_menu_play_from)));
467 items.push_back (MenuElem (_("Set Mark from Playhead"), mem_fun(*this, &Editor::marker_menu_set_from_playhead)));
469 items.push_back (SeparatorElem());
471 items.push_back (MenuElem (_("Hide Mark"), mem_fun(*this, &Editor::marker_menu_hide)));
472 if (start_or_end) return;
473 items.push_back (MenuElem (_("Rename Mark"), mem_fun(*this, &Editor::marker_menu_rename)));
474 items.push_back (MenuElem (_("Remove Mark"), mem_fun(*this, &Editor::marker_menu_remove)));
479 Editor::build_range_marker_menu (bool loop_or_punch)
481 using namespace Menu_Helpers;
483 Menu *markerMenu = new Menu;
485 transport_marker_menu = markerMenu;
487 range_marker_menu = markerMenu;
489 MenuList& items = markerMenu->items();
490 markerMenu->set_name ("ArdourContextMenu");
492 items.push_back (MenuElem (_("Locate to Range Mark"), mem_fun(*this, &Editor::marker_menu_set_playhead)));
493 items.push_back (MenuElem (_("Play from Range Mark"), mem_fun(*this, &Editor::marker_menu_play_from)));
494 if (! loop_or_punch) {
495 items.push_back (MenuElem (_("Play Range"), mem_fun(*this, &Editor::marker_menu_play_range)));
496 items.push_back (MenuElem (_("Loop Range"), mem_fun(*this, &Editor::marker_menu_loop_range)));
498 items.push_back (MenuElem (_("Set Range Mark from Playhead"), mem_fun(*this, &Editor::marker_menu_set_from_playhead)));
499 items.push_back (MenuElem (_("Set Range from Range Selection"), mem_fun(*this, &Editor::marker_menu_set_from_selection)));
501 items.push_back (SeparatorElem());
503 items.push_back (MenuElem (_("Hide Range"), mem_fun(*this, &Editor::marker_menu_hide)));
504 if (! loop_or_punch) {
505 items.push_back (MenuElem (_("Rename Range"), mem_fun(*this, &Editor::marker_menu_rename)));
506 items.push_back (MenuElem (_("Remove Range"), mem_fun(*this, &Editor::marker_menu_remove)));
509 items.push_back (SeparatorElem());
511 items.push_back (MenuElem (_("Separate Regions in Range"), mem_fun(*this, &Editor::marker_menu_separate_regions_using_location)));
512 items.push_back (MenuElem (_("Select All in Range"), mem_fun(*this, &Editor::marker_menu_select_all_selectables_using_range)));
513 items.push_back (MenuElem (_("Select Range"), mem_fun(*this, &Editor::marker_menu_select_using_range)));
518 Editor::build_tm_marker_menu ()
520 using namespace Menu_Helpers;
522 tm_marker_menu = new Menu;
523 MenuList& items = tm_marker_menu->items();
524 tm_marker_menu->set_name ("ArdourContextMenu");
526 items.push_back (MenuElem (_("Edit"), mem_fun(*this, &Editor::marker_menu_edit)));
527 items.push_back (MenuElem (_("Remove"), mem_fun(*this, &Editor::marker_menu_remove)));
531 Editor::build_new_transport_marker_menu ()
533 using namespace Menu_Helpers;
535 new_transport_marker_menu = new Menu;
536 MenuList& items = new_transport_marker_menu->items();
537 new_transport_marker_menu->set_name ("ArdourContextMenu");
539 items.push_back (MenuElem (_("Set Loop Range"), mem_fun(*this, &Editor::new_transport_marker_menu_set_loop)));
540 items.push_back (MenuElem (_("Set Punch Range"), mem_fun(*this, &Editor::new_transport_marker_menu_set_punch)));
542 new_transport_marker_menu->signal_unmap_event().connect ( mem_fun(*this, &Editor::new_transport_marker_menu_popdown));
546 Editor::marker_menu_hide ()
550 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
551 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
558 if ((l = find_location_from_marker (marker, is_start)) != 0) {
559 l->set_hidden (true, this);
564 Editor::marker_menu_select_using_range ()
568 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
569 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
576 if (((l = find_location_from_marker (marker, is_start)) != 0) && (l->end() > l->start())) {
577 set_selection_from_range (*l);
582 Editor::marker_menu_select_all_selectables_using_range ()
586 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
587 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
594 if (((l = find_location_from_marker (marker, is_start)) != 0) && (l->end() > l->start())) {
595 select_all_within (l->start(), l->end() - 1, 0, DBL_MAX, Selection::Set);
601 Editor::marker_menu_separate_regions_using_location ()
605 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
606 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
613 if (((l = find_location_from_marker (marker, is_start)) != 0) && (l->end() > l->start())) {
614 separate_regions_using_location (*l);
620 Editor::marker_menu_play_from ()
624 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
625 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
632 if ((l = find_location_from_marker (marker, is_start)) != 0) {
635 session->request_locate (l->start(), true);
638 //session->request_bounded_roll (l->start(), l->end());
641 session->request_locate (l->start(), true);
643 session->request_locate (l->end(), true);
650 Editor::marker_menu_set_playhead ()
654 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
655 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
662 if ((l = find_location_from_marker (marker, is_start)) != 0) {
665 session->request_locate (l->start(), false);
669 session->request_locate (l->start(), false);
671 session->request_locate (l->end(), false);
678 Editor::marker_menu_set_from_playhead ()
682 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
683 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
690 if ((l = find_location_from_marker (marker, is_start)) != 0) {
693 l->set_start (session->transport_frame ());
697 l->set_start (session->transport_frame ());
699 l->set_end (session->transport_frame ());
706 Editor::marker_menu_set_from_selection ()
710 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
711 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
718 if ((l = find_location_from_marker (marker, is_start)) != 0) {
725 /* if range selection use first to last */
727 if (mouse_mode == Editing::MouseRange) {
728 if (!selection->time.empty()) {
729 l->set_start (selection->time.start());
730 l->set_end (selection->time.end_frame());
734 if (!selection->regions.empty()) {
735 l->set_start (selection->regions.start());
736 l->set_end (selection->regions.end_frame());
745 Editor::marker_menu_play_range ()
749 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
750 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
757 if ((l = find_location_from_marker (marker, is_start)) != 0) {
760 session->request_locate (l->start(), true);
763 session->request_bounded_roll (l->start(), l->end());
770 Editor::marker_menu_loop_range ()
774 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
775 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
782 if ((l = find_location_from_marker (marker, is_start)) != 0) {
784 if ((l2 = transport_loop_location()) != 0) {
785 l2->set (l->start(), l->end());
787 // enable looping, reposition and start rolling
788 session->request_play_loop(true);
789 session->request_locate (l2->start(), true);
795 Editor::marker_menu_edit ()
801 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
802 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
806 if ((mm = dynamic_cast<MeterMarker*> (marker)) != 0) {
807 edit_meter_section (&mm->meter());
808 } else if ((tm = dynamic_cast<TempoMarker*> (marker)) != 0) {
809 edit_tempo_section (&tm->tempo());
811 fatal << X_("programming erorr: unhandled marker type in Editor::marker_menu_edit")
818 Editor::marker_menu_remove ()
824 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
825 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
829 if ((mm = dynamic_cast<MeterMarker*> (marker)) != 0) {
830 remove_meter_marker (marker_menu_item);
831 } else if ((tm = dynamic_cast<TempoMarker*> (marker)) != 0) {
832 remove_tempo_marker (marker_menu_item);
834 remove_marker (*marker_menu_item, (GdkEvent*) 0);
839 Editor::marker_menu_rename ()
843 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
844 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
851 loc = find_location_from_marker (marker, is_start);
855 ArdourPrompter dialog (true);
858 dialog.set_prompt (_("New Name:"));
860 if (loc->is_mark()) {
861 dialog.set_title (_("ardour: rename mark"));
863 dialog.set_title (_("ardour: rename range"));
866 dialog.set_name ("MarkRenameWindow");
867 dialog.set_size_request (250, -1);
868 dialog.set_position (Gtk::WIN_POS_MOUSE);
870 dialog.add_button (_("Rename"), RESPONSE_ACCEPT);
871 dialog.set_response_sensitive (Gtk::RESPONSE_ACCEPT, false);
872 dialog.set_initial_text (loc->name());
876 switch (dialog.run ()) {
877 case RESPONSE_ACCEPT:
883 begin_reversible_command ( _("rename marker") );
884 XMLNode &before = session->locations()->get_state();
886 dialog.get_result(txt);
889 XMLNode &after = session->locations()->get_state();
890 session->add_command (new MementoCommand<Locations>(*(session->locations()), &before, &after));
891 commit_reversible_command ();
895 Editor::new_transport_marker_menu_popdown (GdkEventAny *ev)
898 transport_bar_drag_rect->hide();
899 range_marker_drag_rect->hide();
905 Editor::new_transport_marker_menu_set_loop ()
907 if (!session) return;
909 begin_reversible_command (_("set loop range"));
913 if ((tll = transport_loop_location()) == 0) {
914 Location* loc = new Location (temp_location->start(), temp_location->end(), _("Loop"), Location::IsAutoLoop);
915 XMLNode &before = session->locations()->get_state();
916 session->locations()->add (loc, true);
917 session->set_auto_loop_location (loc);
918 XMLNode &after = session->locations()->get_state();
919 session->add_command (new MementoCommand<Locations>(*(session->locations()), &before, &after));
922 XMLNode &before = tll->get_state();
923 tll->set_hidden (false, this);
924 tll->set (temp_location->start(), temp_location->end());
925 XMLNode &after = tll->get_state();
926 session->add_command (new MementoCommand<Location>(*tll, &before, &after));
929 commit_reversible_command ();
933 Editor::new_transport_marker_menu_set_punch ()
935 if (!session) return;
937 begin_reversible_command (_("set punch range"));
941 if ((tpl = transport_punch_location()) == 0) {
942 tpl = new Location (temp_location->start(), temp_location->end(), _("Punch"), Location::IsAutoPunch);
943 XMLNode &before = session->locations()->get_state();
944 session->locations()->add (tpl, true);
945 session->set_auto_punch_location (tpl);
946 XMLNode &after = session->locations()->get_state();
947 session->add_command (new MementoCommand<Locations>(*(session->locations()), &before, &after));
949 XMLNode &before = tpl->get_state();
950 tpl->set_hidden(false, this);
951 tpl->set(temp_location->start(), temp_location->end());
952 XMLNode &after = tpl->get_state();
953 session->add_command (new MementoCommand<Location>(*tpl, &before, &after));
956 commit_reversible_command ();
960 Editor::update_loop_range_view (bool visibility)
968 if (session->get_play_loop() && ((tll = transport_loop_location()) != 0)) {
970 double x1 = frame_to_pixel (tll->start());
971 double x2 = frame_to_pixel (tll->end());
973 transport_loop_range_rect->property_x1() = x1;
974 transport_loop_range_rect->property_x2() = x2;
977 transport_loop_range_rect->show();
980 else if (visibility) {
981 transport_loop_range_rect->hide();
986 Editor::update_punch_range_view (bool visibility)
994 if ((Config->get_punch_in() || Config->get_punch_out()) && ((tpl = transport_punch_location()) != 0)) {
996 double x1 = frame_to_pixel (tpl->start());
997 double x2 = frame_to_pixel (tpl->end());
999 transport_punch_range_rect->property_x1() = x1;
1000 transport_punch_range_rect->property_x2() = x2;
1003 transport_punch_range_rect->show();
1006 else if (visibility) {
1007 transport_punch_range_rect->hide();
1010 // if (session->get_punch_in()) {
1011 // double x = frame_to_pixel (transport_punch_location->start());
1012 // gnome_canvas_item_set (transport_punchin_line, "x1", x, "x2", x, NULL);
1014 // if (visibility) {
1015 // gnome_canvas_item_show (transport_punchin_line);
1018 // else if (visibility) {
1019 // gnome_canvas_item_hide (transport_punchin_line);
1022 // if (session->get_punch_out()) {
1023 // double x = frame_to_pixel (transport_punch_location->end());
1025 // gnome_canvas_item_set (transport_punchout_line, "x1", x, "x2", x, NULL);
1027 // if (visibility) {
1028 // gnome_canvas_item_show (transport_punchout_line);
1031 // else if (visibility) {
1032 // gnome_canvas_item_hide (transport_punchout_line);