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.
21 #include <sigc++/retype.h>
25 #include <libgnomecanvas/libgnomecanvas.h>
26 #include <gtkmm2ext/gtk_ui.h>
28 #include <ardour/location.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 (jack_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 (jack_nframes_t where)
291 Location *location = new Location (where, where, "mark", Location::IsMark);
292 session->begin_reversible_command (_("add marker"));
293 XMLNode &before, &after;
294 before = session->locations()->get_state();
295 session->locations()->add (location, true);
296 after = session->locations()->get_state();
297 session->add_command (MementoCommand<Locations>(*(session->locations()), before, after));
298 session->commit_reversible_command ();
303 Editor::remove_marker (ArdourCanvas::Item& item, GdkEvent* event)
308 if ((marker = static_cast<Marker*> (item.get_data ("marker"))) == 0) {
309 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
313 Location* loc = find_location_from_marker (marker, is_start);
315 if (session && loc) {
317 /* you can't hide or delete this marker */
320 if (loc->is_auto_loop() || loc->is_auto_punch()) {
322 loc->set_hidden (true, this);
325 Glib::signal_idle().connect (bind (mem_fun(*this, &Editor::really_remove_marker), loc));
331 Editor::really_remove_marker (Location* loc)
333 session->begin_reversible_command (_("remove marker"));
334 XMLNode &before, &after;
335 before = session->locations()->get_state();
336 session->locations()->remove (loc);
337 after = session->locations()->get_state();
338 session->add_command (MementoCommand<Locations>(*(session->locations()), before, after));
339 session->commit_reversible_command ();
344 Editor::location_gone (Location *location)
346 ENSURE_GUI_THREAD(bind (mem_fun(*this, &Editor::location_gone), location));
348 LocationMarkerMap::iterator i;
350 if (location == transport_loop_location()) {
351 update_loop_range_view (true);
354 if (location == transport_punch_location()) {
355 update_punch_range_view (true);
358 for (i = location_markers.begin(); i != location_markers.end(); ++i) {
359 if ((*i).first == location) {
361 location_markers.erase (i);
368 Editor::tm_marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item)
370 if (tm_marker_menu == 0) {
371 build_tm_marker_menu ();
374 marker_menu_item = item;
375 tm_marker_menu->popup (1, ev->time);
380 Editor::marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item)
383 if ((marker = reinterpret_cast<Marker *> (item->get_data("marker"))) == 0) {
384 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
389 Location * loc = find_location_from_marker (marker, is_start);
390 if (loc == transport_loop_location() || loc == transport_punch_location()) {
391 if (transport_marker_menu == 0) {
392 build_transport_marker_menu ();
394 marker_menu_item = item;
395 transport_marker_menu->popup (1, ev->time);
398 if (loc->is_mark()) {
399 if (marker_menu == 0) {
400 build_marker_menu ();
404 // GTK2FIX use action group sensitivity
406 if (children.size() >= 3) {
407 MenuItem * loopitem = &children[2];
409 if (loc->is_mark()) {
410 loopitem->set_sensitive(false);
413 loopitem->set_sensitive(true);
418 marker_menu_item = item;
419 marker_menu->popup (1, ev->time);
422 if (loc->is_range_marker()) {
423 if (range_marker_menu == 0){
424 build_range_marker_menu ();
426 marker_menu_item = item;
427 range_marker_menu->popup (1, ev->time);
433 Editor::new_transport_marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item)
435 if (new_transport_marker_menu == 0) {
436 build_new_transport_marker_menu ();
439 new_transport_marker_menu->popup (1, ev->time);
444 Editor::transport_marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item)
446 if (transport_marker_menu == 0) {
447 build_transport_marker_menu ();
450 transport_marker_menu->popup (1, ev->time);
454 Editor::build_marker_menu ()
456 using namespace Menu_Helpers;
458 marker_menu = new Menu;
459 MenuList& items = marker_menu->items();
460 marker_menu->set_name ("ArdourContextMenu");
462 items.push_back (MenuElem (_("Locate to Mark"), mem_fun(*this, &Editor::marker_menu_set_playhead)));
463 items.push_back (MenuElem (_("Play from Mark"), mem_fun(*this, &Editor::marker_menu_play_from)));
464 items.push_back (MenuElem (_("Set Mark from Playhead"), mem_fun(*this, &Editor::marker_menu_set_from_playhead)));
466 items.push_back (SeparatorElem());
468 items.push_back (MenuElem (_("Rename Mark"), mem_fun(*this, &Editor::marker_menu_rename)));
469 items.push_back (MenuElem (_("Hide Mark"), mem_fun(*this, &Editor::marker_menu_hide)));
470 items.push_back (MenuElem (_("Remove Mark"), mem_fun(*this, &Editor::marker_menu_remove)));
475 Editor::build_range_marker_menu ()
477 using namespace Menu_Helpers;
479 range_marker_menu = new Menu;
480 MenuList& items = range_marker_menu->items();
481 range_marker_menu->set_name ("ArdourContextMenu");
483 items.push_back (MenuElem (_("Locate to Range Mark"), mem_fun(*this, &Editor::marker_menu_set_playhead)));
484 items.push_back (MenuElem (_("Play from Range Mark"), mem_fun(*this, &Editor::marker_menu_play_from)));
485 items.push_back (MenuElem (_("Loop Range"), mem_fun(*this, &Editor::marker_menu_loop_range)));
486 items.push_back (MenuElem (_("Set Range Mark from Playhead"), mem_fun(*this, &Editor::marker_menu_set_from_playhead)));
487 items.push_back (MenuElem (_("Set Range from Range Selection"), mem_fun(*this, &Editor::marker_menu_set_from_selection)));
489 items.push_back (SeparatorElem());
491 items.push_back (MenuElem (_("Rename Range"), mem_fun(*this, &Editor::marker_menu_rename)));
492 items.push_back (MenuElem (_("Hide Range"), mem_fun(*this, &Editor::marker_menu_hide)));
493 items.push_back (MenuElem (_("Remove Range"), mem_fun(*this, &Editor::marker_menu_remove)));
495 items.push_back (SeparatorElem());
497 items.push_back (MenuElem (_("Separate Regions in Range"), mem_fun(*this, &Editor::marker_menu_separate_regions_using_location)));
498 items.push_back (MenuElem (_("Select All in Range"), mem_fun(*this, &Editor::marker_menu_select_all_selectables_using_range)));
503 Editor::build_tm_marker_menu ()
505 using namespace Menu_Helpers;
507 tm_marker_menu = new Menu;
508 MenuList& items = tm_marker_menu->items();
509 tm_marker_menu->set_name ("ArdourContextMenu");
511 items.push_back (MenuElem (_("Edit"), mem_fun(*this, &Editor::marker_menu_edit)));
512 items.push_back (MenuElem (_("Remove"), mem_fun(*this, &Editor::marker_menu_remove)));
516 Editor::build_new_transport_marker_menu ()
518 using namespace Menu_Helpers;
520 new_transport_marker_menu = new Menu;
521 MenuList& items = new_transport_marker_menu->items();
522 new_transport_marker_menu->set_name ("ArdourContextMenu");
524 items.push_back (MenuElem (_("Set Loop Range"), mem_fun(*this, &Editor::new_transport_marker_menu_set_loop)));
525 items.push_back (MenuElem (_("Set Punch Range"), mem_fun(*this, &Editor::new_transport_marker_menu_set_punch)));
527 new_transport_marker_menu->signal_unmap_event().connect ( mem_fun(*this, &Editor::new_transport_marker_menu_popdown));
531 Editor::build_transport_marker_menu ()
533 using namespace Menu_Helpers;
535 transport_marker_menu = new Menu;
536 MenuList& items = transport_marker_menu->items();
537 transport_marker_menu->set_name ("ArdourContextMenu");
539 items.push_back (MenuElem (_("Locate to Range Mark"), mem_fun(*this, &Editor::marker_menu_set_playhead)));
540 items.push_back (MenuElem (_("Play from Range Mark"), mem_fun(*this, &Editor::marker_menu_play_from)));
541 items.push_back (MenuElem (_("Set Range Mark from Playhead"), mem_fun(*this, &Editor::marker_menu_set_from_playhead)));
542 items.push_back (MenuElem (_("Set Range from Range Selection"), mem_fun(*this, &Editor::marker_menu_set_from_selection)));
543 items.push_back (SeparatorElem());
544 items.push_back (MenuElem (_("Hide Range"), mem_fun(*this, &Editor::marker_menu_hide)));
545 items.push_back (SeparatorElem());
546 items.push_back (MenuElem (_("Separate Regions in Range"), mem_fun(*this, &Editor::marker_menu_separate_regions_using_location)));
547 items.push_back (MenuElem (_("Select All in Range"), mem_fun(*this, &Editor::marker_menu_select_all_selectables_using_range)));
551 Editor::marker_menu_hide ()
555 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
556 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
563 if ((l = find_location_from_marker (marker, is_start)) != 0) {
564 l->set_hidden (true, this);
569 Editor::marker_menu_select_all_selectables_using_range ()
573 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
574 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
581 if (((l = find_location_from_marker (marker, is_start)) != 0) && (l->end() > l->start())) {
582 select_all_within (l->start(), l->end() - 1, 0, DBL_MAX, Selection::Set);
588 Editor::marker_menu_separate_regions_using_location ()
592 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
593 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
600 if (((l = find_location_from_marker (marker, is_start)) != 0) && (l->end() > l->start())) {
601 separate_regions_using_location (*l);
607 Editor::marker_menu_play_from ()
611 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
612 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
619 if ((l = find_location_from_marker (marker, is_start)) != 0) {
622 session->request_locate (l->start(), true);
625 //session->request_bounded_roll (l->start(), l->end());
628 session->request_locate (l->start(), true);
630 session->request_locate (l->end(), true);
637 Editor::marker_menu_set_playhead ()
641 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
642 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
649 if ((l = find_location_from_marker (marker, is_start)) != 0) {
652 session->request_locate (l->start(), false);
656 session->request_locate (l->start(), false);
658 session->request_locate (l->end(), false);
665 Editor::marker_menu_set_from_playhead ()
669 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
670 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
677 if ((l = find_location_from_marker (marker, is_start)) != 0) {
680 l->set_start (session->transport_frame ());
684 l->set_start (session->transport_frame ());
686 l->set_end (session->transport_frame ());
693 Editor::marker_menu_set_from_selection ()
697 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
698 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
705 if ((l = find_location_from_marker (marker, is_start)) != 0) {
712 /* if range selection use first to last */
714 if (mouse_mode == Editing::MouseRange) {
715 if (!selection->time.empty()) {
716 l->set_start (selection->time.start());
717 l->set_end (selection->time.end_frame());
721 if (!selection->audio_regions.empty()) {
722 l->set_start (selection->audio_regions.start());
723 l->set_end (selection->audio_regions.end_frame());
731 Editor::marker_menu_loop_range ()
735 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
736 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
743 if ((l = find_location_from_marker (marker, is_start)) != 0) {
745 if ((l2 = transport_loop_location()) != 0) {
746 l2->set (l->start(), l->end());
748 // enable looping, reposition and start rolling
749 session->request_auto_loop(true);
750 session->request_locate (l2->start(), true);
756 Editor::marker_menu_edit ()
762 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
763 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
767 if ((mm = dynamic_cast<MeterMarker*> (marker)) != 0) {
768 edit_meter_section (&mm->meter());
769 } else if ((tm = dynamic_cast<TempoMarker*> (marker)) != 0) {
770 edit_tempo_section (&tm->tempo());
772 fatal << X_("programming erorr: unhandled marker type in Editor::marker_menu_edit")
779 Editor::marker_menu_remove ()
785 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
786 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
790 if ((mm = dynamic_cast<MeterMarker*> (marker)) != 0) {
791 remove_meter_marker (marker_menu_item);
792 } else if ((tm = dynamic_cast<TempoMarker*> (marker)) != 0) {
793 remove_tempo_marker (marker_menu_item);
795 remove_marker (*marker_menu_item, (GdkEvent*) 0);
800 Editor::marker_menu_rename ()
804 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
805 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
812 loc = find_location_from_marker (marker, is_start);
816 ArdourPrompter dialog (true);
819 dialog.set_prompt (_("New Name:"));
821 if (loc->is_mark()) {
822 dialog.set_title (_("ardour: rename mark"));
824 dialog.set_title (_("ardour: rename range"));
827 dialog.set_name ("MarkRenameWindow");
828 dialog.set_size_request (250, -1);
829 dialog.set_position (Gtk::WIN_POS_MOUSE);
831 dialog.add_button (_("Rename"), RESPONSE_ACCEPT);
832 dialog.set_response_sensitive (Gtk::RESPONSE_ACCEPT, false);
833 dialog.set_initial_text (loc->name());
837 switch (dialog.run ()) {
838 case RESPONSE_ACCEPT:
844 begin_reversible_command ( _("rename marker") );
845 XMLNode &before = session->locations()->get_state();
847 dialog.get_result(txt);
850 XMLNode &after = session->locations()->get_state();
851 session->add_command (MementoCommand<Locations>(*(session->locations()), before, after));
852 commit_reversible_command ();
856 Editor::new_transport_marker_menu_popdown (GdkEventAny *ev)
859 transport_bar_drag_rect->hide();
860 range_marker_drag_rect->hide();
866 Editor::new_transport_marker_menu_set_loop ()
868 if (!session) return;
870 begin_reversible_command (_("set loop range"));
874 if ((tll = transport_loop_location()) == 0) {
875 Location* loc = new Location (temp_location->start(), temp_location->end(), _("Loop"), Location::IsAutoLoop);
876 XMLNode &before = session->locations()->get_state();
877 session->locations()->add (loc, true);
878 session->set_auto_loop_location (loc);
879 XMLNode &after = session->locations()->get_state();
880 session->add_command (MementoCommand<Locations>(*(session->locations()), before, after));
883 session->add_undo (retype_return<void>(bind (mem_fun (*tll, &Location::set), tll->start(), tll->end())));
884 session->add_redo (retype_return<void>(bind (mem_fun (*tll, &Location::set), temp_location->start(), temp_location->end())));
885 tll->set_hidden (false, this);
886 tll->set (temp_location->start(), temp_location->end());
889 commit_reversible_command ();
893 Editor::new_transport_marker_menu_set_punch ()
895 if (!session) return;
897 begin_reversible_command (_("set punch range"));
901 if ((tpl = transport_punch_location()) == 0) {
902 tpl = new Location (temp_location->start(), temp_location->end(), _("Punch"), Location::IsAutoPunch);
903 XMLNode &before = session->locations()->get_state();
904 session->locations()->add (tpl, true);
905 session->set_auto_punch_location (tpl);
906 XMLNode &after = session->locations()->get_state();
907 session->add_command (MementoCommand<Locations>(*(session->locations()), before, after));
909 session->add_undo (retype_return<void>(bind (mem_fun (*tpl, &Location::set), tpl->start(), tpl->end())));
910 session->add_redo (retype_return<void>(bind (mem_fun (*tpl, &Location::set), temp_location->start(), temp_location->end())));
911 tpl->set_hidden(false, this);
912 tpl->set(temp_location->start(), temp_location->end());
915 commit_reversible_command ();
919 Editor::update_loop_range_view (bool visibility)
927 if (session->get_auto_loop() && ((tll = transport_loop_location()) != 0)) {
929 double x1 = frame_to_pixel (tll->start());
930 double x2 = frame_to_pixel (tll->end());
932 transport_loop_range_rect->property_x1() = x1;
933 transport_loop_range_rect->property_x2() = x2;
936 transport_loop_range_rect->show();
939 else if (visibility) {
940 transport_loop_range_rect->hide();
945 Editor::update_punch_range_view (bool visibility)
953 if ((session->get_punch_in() || session->get_punch_out()) && ((tpl = transport_punch_location()) != 0)) {
955 double x1 = frame_to_pixel (tpl->start());
956 double x2 = frame_to_pixel (tpl->end());
958 transport_punch_range_rect->property_x1() = x1;
959 transport_punch_range_rect->property_x2() = x2;
962 transport_punch_range_rect->show();
965 else if (visibility) {
966 transport_punch_range_rect->hide();
969 // if (session->get_punch_in()) {
970 // double x = frame_to_pixel (transport_punch_location->start());
971 // gnome_canvas_item_set (transport_punchin_line, "x1", x, "x2", x, NULL);
974 // gnome_canvas_item_show (transport_punchin_line);
977 // else if (visibility) {
978 // gnome_canvas_item_hide (transport_punchin_line);
981 // if (session->get_punch_out()) {
982 // double x = frame_to_pixel (transport_punch_location->end());
984 // gnome_canvas_item_set (transport_punchout_line, "x1", x, "x2", x, NULL);
987 // gnome_canvas_item_show (transport_punchout_line);
990 // else if (visibility) {
991 // gnome_canvas_item_hide (transport_punchout_line);