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;
47 Editor::clear_marker_display ()
49 for (LocationMarkerMap::iterator i = location_markers.begin(); i != location_markers.end(); ++i) {
53 location_markers.clear ();
57 Editor::add_new_location (Location *location)
59 ENSURE_GUI_THREAD (bind (mem_fun(*this, &Editor::add_new_location), location));
61 LocationMarkers *lam = new LocationMarkers;
64 if (location->is_cd_marker()) {
65 color = location_cd_marker_color;
66 } else if (location->is_mark()) {
67 color = location_marker_color;
68 } else if (location->is_auto_loop()) {
69 color = location_loop_color;
70 } else if (location->is_auto_punch()) {
71 color = location_punch_color;
73 color = location_range_color;
76 if (location->is_mark()) {
77 lam->start = new Marker (*this, *marker_group, color, location->name(), Marker::Mark, location->start());
80 } else if (location->is_auto_loop()) {
82 lam->start = new Marker (*this, *transport_marker_group, color,
83 location->name(), Marker::LoopStart, location->start());
84 lam->end = new Marker (*this, *transport_marker_group, color,
85 location->name(), Marker::LoopEnd, location->end());
87 } else if (location->is_auto_punch()) {
89 lam->start = new Marker (*this, *transport_marker_group, color,
90 location->name(), Marker::PunchIn, location->start());
91 lam->end = new Marker (*this, *transport_marker_group, color,
92 location->name(), Marker::PunchOut, location->end());
97 lam->start = new Marker (*this, *range_marker_group, color,
98 location->name(), Marker::Start, location->start());
99 lam->end = new Marker (*this, *range_marker_group, color,
100 location->name(), Marker::End, location->end());
103 if (location->is_hidden ()) {
109 location->start_changed.connect (mem_fun(*this, &Editor::location_changed));
110 location->end_changed.connect (mem_fun(*this, &Editor::location_changed));
111 location->changed.connect (mem_fun(*this, &Editor::location_changed));
112 location->name_changed.connect (mem_fun(*this, &Editor::location_changed));
113 location->FlagsChanged.connect (mem_fun(*this, &Editor::location_flags_changed));
115 pair<Location*,LocationMarkers*> newpair;
117 newpair.first = location;
118 newpair.second = lam;
120 location_markers.insert (newpair);
124 Editor::location_changed (Location *location)
126 ENSURE_GUI_THREAD (bind (mem_fun(*this, &Editor::location_changed), location));
128 LocationMarkers *lam = find_location_markers (location);
131 /* a location that isn't "marked" with markers */
135 lam->set_name (location->name());
136 lam->set_position (location->start(), location->end());
138 if (location->is_auto_loop()) {
139 update_loop_range_view ();
140 } else if (location->is_auto_punch()) {
141 update_punch_range_view ();
146 Editor::location_flags_changed (Location *location, void *src)
148 ENSURE_GUI_THREAD(bind (mem_fun(*this, &Editor::location_flags_changed), location, src));
150 LocationMarkers *lam = find_location_markers (location);
153 /* a location that isn't "marked" with markers */
157 if (location->is_cd_marker()) {
158 lam->set_color_rgba (location_cd_marker_color);
159 } else if (location->is_mark()) {
160 lam->set_color_rgba (location_marker_color);
161 } else if (location->is_auto_punch()) {
162 lam->set_color_rgba (location_punch_color);
163 } else if (location->is_auto_loop()) {
164 lam->set_color_rgba (location_loop_color);
166 lam->set_color_rgba (location_range_color);
169 if (location->is_hidden()) {
176 Editor::LocationMarkers::~LocationMarkers ()
187 Editor::LocationMarkers *
188 Editor::find_location_markers (Location *location)
190 LocationMarkerMap::iterator i;
192 for (i = location_markers.begin(); i != location_markers.end(); ++i) {
193 if ((*i).first == location) {
202 Editor::find_location_from_marker (Marker *marker, bool& is_start)
204 LocationMarkerMap::iterator i;
206 for (i = location_markers.begin(); i != location_markers.end(); ++i) {
207 LocationMarkers *lm = (*i).second;
208 if (lm->start == marker) {
211 } else if (lm->end == marker) {
221 Editor::refresh_location_display_internal (Locations::LocationList& locations)
223 clear_marker_display ();
225 for (Locations::LocationList::iterator i = locations.begin(); i != locations.end(); ++i) {
226 add_new_location (*i);
231 Editor::refresh_location_display ()
233 ENSURE_GUI_THREAD(mem_fun(*this, &Editor::refresh_location_display));
236 session->locations()->apply (*this, &Editor::refresh_location_display_internal);
241 Editor::refresh_location_display_s (Change ignored)
243 ENSURE_GUI_THREAD(bind (mem_fun(*this, &Editor::refresh_location_display_s), ignored));
246 session->locations()->apply (*this, &Editor::refresh_location_display_internal);
251 Editor::LocationMarkers::hide()
254 if (end) { end->hide(); }
258 Editor::LocationMarkers::show()
261 if (end) { end->show(); }
265 Editor::LocationMarkers::set_name (const string& str)
267 start->set_name (str);
268 if (end) { end->set_name (str); }
272 Editor::LocationMarkers::set_position (jack_nframes_t startf,
275 start->set_position (startf);
276 if (end) { end->set_position (endf); }
280 Editor::LocationMarkers::set_color_rgba (uint32_t rgba)
282 start->set_color_rgba (rgba);
283 if (end) { end->set_color_rgba (rgba); }
287 Editor::mouse_add_new_marker (jack_nframes_t where)
290 Location *location = new Location (where, where, "mark", Location::IsMark);
291 session->begin_reversible_command (_("add marker"));
292 session->add_undo (session->locations()->get_memento());
293 session->locations()->add (location, true);
294 session->add_redo_no_execute (session->locations()->get_memento());
295 session->commit_reversible_command ();
300 Editor::remove_marker (ArdourCanvas::Item& item, GdkEvent* event)
305 if ((marker = static_cast<Marker*> (item.get_data ("marker"))) == 0) {
306 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
310 Location* loc = find_location_from_marker (marker, is_start);
312 if (session && loc) {
314 /* you can't hide or delete this marker */
317 if (loc->is_auto_loop() || loc->is_auto_punch()) {
319 loc->set_hidden (true, this);
322 Glib::signal_idle().connect (bind (mem_fun(*this, &Editor::really_remove_marker), loc));
328 Editor::really_remove_marker (Location* loc)
330 session->begin_reversible_command (_("remove marker"));
331 session->add_undo (session->locations()->get_memento());
332 session->locations()->remove (loc);
333 session->add_redo_no_execute (session->locations()->get_memento());
334 session->commit_reversible_command ();
339 Editor::location_gone (Location *location)
341 ENSURE_GUI_THREAD(bind (mem_fun(*this, &Editor::location_gone), location));
343 LocationMarkerMap::iterator i;
345 if (location == transport_loop_location()) {
346 update_loop_range_view (true);
349 if (location == transport_punch_location()) {
350 update_punch_range_view (true);
353 for (i = location_markers.begin(); i != location_markers.end(); ++i) {
354 if ((*i).first == location) {
356 location_markers.erase (i);
363 Editor::tm_marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item)
365 if (tm_marker_menu == 0) {
366 build_tm_marker_menu ();
369 marker_menu_item = item;
370 tm_marker_menu->popup (1, ev->time);
375 Editor::marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item)
378 if ((marker = reinterpret_cast<Marker *> (item->get_data("marker"))) == 0) {
379 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
384 Location * loc = find_location_from_marker (marker, is_start);
385 if (loc == transport_loop_location() || loc == transport_punch_location()) {
386 if (transport_marker_menu == 0) {
387 build_transport_marker_menu ();
389 marker_menu_item = item;
390 transport_marker_menu->popup (1, ev->time);
393 if (loc->is_mark()) {
394 if (marker_menu == 0) {
395 build_marker_menu ();
399 // GTK2FIX use action group sensitivity
401 if (children.size() >= 3) {
402 MenuItem * loopitem = &children[2];
404 if (loc->is_mark()) {
405 loopitem->set_sensitive(false);
408 loopitem->set_sensitive(true);
413 marker_menu_item = item;
414 marker_menu->popup (1, ev->time);
417 if (loc->is_range_marker()) {
418 if (range_marker_menu == 0){
419 build_range_marker_menu ();
421 marker_menu_item = item;
422 range_marker_menu->popup (1, ev->time);
428 Editor::new_transport_marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item)
430 if (new_transport_marker_menu == 0) {
431 build_new_transport_marker_menu ();
434 new_transport_marker_menu->popup (1, ev->time);
439 Editor::transport_marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item)
441 if (transport_marker_menu == 0) {
442 build_transport_marker_menu ();
445 transport_marker_menu->popup (1, ev->time);
449 Editor::build_marker_menu ()
451 using namespace Menu_Helpers;
453 marker_menu = new Menu;
454 MenuList& items = marker_menu->items();
455 marker_menu->set_name ("ArdourContextMenu");
457 items.push_back (MenuElem (_("Locate to Mark"), mem_fun(*this, &Editor::marker_menu_set_playhead)));
458 items.push_back (MenuElem (_("Play from Mark"), mem_fun(*this, &Editor::marker_menu_play_from)));
459 items.push_back (MenuElem (_("Set Mark from Playhead"), mem_fun(*this, &Editor::marker_menu_set_from_playhead)));
461 items.push_back (SeparatorElem());
463 items.push_back (MenuElem (_("Rename Mark"), mem_fun(*this, &Editor::marker_menu_rename)));
464 items.push_back (MenuElem (_("Hide Mark"), mem_fun(*this, &Editor::marker_menu_hide)));
465 items.push_back (MenuElem (_("Remove Mark"), mem_fun(*this, &Editor::marker_menu_remove)));
470 Editor::build_range_marker_menu ()
472 using namespace Menu_Helpers;
474 range_marker_menu = new Menu;
475 MenuList& items = range_marker_menu->items();
476 range_marker_menu->set_name ("ArdourContextMenu");
478 items.push_back (MenuElem (_("Locate to Range Mark"), mem_fun(*this, &Editor::marker_menu_set_playhead)));
479 items.push_back (MenuElem (_("Play from Range Mark"), mem_fun(*this, &Editor::marker_menu_play_from)));
480 items.push_back (MenuElem (_("Loop Range"), mem_fun(*this, &Editor::marker_menu_loop_range)));
481 items.push_back (MenuElem (_("Set Range Mark from Playhead"), mem_fun(*this, &Editor::marker_menu_set_from_playhead)));
482 items.push_back (MenuElem (_("Set Range from Range Selection"), mem_fun(*this, &Editor::marker_menu_set_from_selection)));
484 items.push_back (SeparatorElem());
486 items.push_back (MenuElem (_("Rename Range"), mem_fun(*this, &Editor::marker_menu_rename)));
487 items.push_back (MenuElem (_("Hide Range"), mem_fun(*this, &Editor::marker_menu_hide)));
488 items.push_back (MenuElem (_("Remove Range"), mem_fun(*this, &Editor::marker_menu_remove)));
490 items.push_back (SeparatorElem());
492 items.push_back (MenuElem (_("Separate Regions in Range"), mem_fun(*this, &Editor::marker_menu_separate_regions_using_location)));
493 items.push_back (MenuElem (_("Select All in Range"), mem_fun(*this, &Editor::marker_menu_select_all_selectables_using_range)));
498 Editor::build_tm_marker_menu ()
500 using namespace Menu_Helpers;
502 tm_marker_menu = new Menu;
503 MenuList& items = tm_marker_menu->items();
504 tm_marker_menu->set_name ("ArdourContextMenu");
506 items.push_back (MenuElem (_("Edit"), mem_fun(*this, &Editor::marker_menu_edit)));
507 items.push_back (MenuElem (_("Remove"), mem_fun(*this, &Editor::marker_menu_remove)));
511 Editor::build_new_transport_marker_menu ()
513 using namespace Menu_Helpers;
515 new_transport_marker_menu = new Menu;
516 MenuList& items = new_transport_marker_menu->items();
517 new_transport_marker_menu->set_name ("ArdourContextMenu");
519 items.push_back (MenuElem (_("Set Loop Range"), mem_fun(*this, &Editor::new_transport_marker_menu_set_loop)));
520 items.push_back (MenuElem (_("Set Punch Range"), mem_fun(*this, &Editor::new_transport_marker_menu_set_punch)));
522 new_transport_marker_menu->signal_unmap_event().connect ( mem_fun(*this, &Editor::new_transport_marker_menu_popdown));
526 Editor::build_transport_marker_menu ()
528 using namespace Menu_Helpers;
530 transport_marker_menu = new Menu;
531 MenuList& items = transport_marker_menu->items();
532 transport_marker_menu->set_name ("ArdourContextMenu");
534 items.push_back (MenuElem (_("Locate to Range Mark"), mem_fun(*this, &Editor::marker_menu_set_playhead)));
535 items.push_back (MenuElem (_("Play from Range Mark"), mem_fun(*this, &Editor::marker_menu_play_from)));
536 items.push_back (MenuElem (_("Set Range Mark from Playhead"), mem_fun(*this, &Editor::marker_menu_set_from_playhead)));
537 items.push_back (MenuElem (_("Set Range from Range Selection"), mem_fun(*this, &Editor::marker_menu_set_from_selection)));
538 items.push_back (SeparatorElem());
539 items.push_back (MenuElem (_("Hide Range"), mem_fun(*this, &Editor::marker_menu_hide)));
540 items.push_back (SeparatorElem());
541 items.push_back (MenuElem (_("Separate Regions in Range"), mem_fun(*this, &Editor::marker_menu_separate_regions_using_location)));
542 items.push_back (MenuElem (_("Select All in Range"), mem_fun(*this, &Editor::marker_menu_select_all_selectables_using_range)));
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_all_selectables_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 select_all_within (l->start(), l->end() - 1, 0, DBL_MAX, Selection::Set);
583 Editor::marker_menu_separate_regions_using_location ()
587 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
588 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
595 if (((l = find_location_from_marker (marker, is_start)) != 0) && (l->end() > l->start())) {
596 separate_regions_using_location (*l);
602 Editor::marker_menu_play_from ()
606 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
607 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
614 if ((l = find_location_from_marker (marker, is_start)) != 0) {
617 session->request_locate (l->start(), true);
620 //session->request_bounded_roll (l->start(), l->end());
623 session->request_locate (l->start(), true);
625 session->request_locate (l->end(), true);
632 Editor::marker_menu_set_playhead ()
636 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
637 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
644 if ((l = find_location_from_marker (marker, is_start)) != 0) {
647 session->request_locate (l->start(), false);
651 session->request_locate (l->start(), false);
653 session->request_locate (l->end(), false);
660 Editor::marker_menu_set_from_playhead ()
664 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
665 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
672 if ((l = find_location_from_marker (marker, is_start)) != 0) {
675 l->set_start (session->transport_frame ());
679 l->set_start (session->transport_frame ());
681 l->set_end (session->transport_frame ());
688 Editor::marker_menu_set_from_selection ()
692 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
693 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
700 if ((l = find_location_from_marker (marker, is_start)) != 0) {
707 /* if range selection use first to last */
709 if (mouse_mode == Editing::MouseRange) {
710 if (!selection->time.empty()) {
711 l->set_start (selection->time.start());
712 l->set_end (selection->time.end_frame());
716 if (!selection->audio_regions.empty()) {
717 l->set_start (selection->audio_regions.start());
718 l->set_end (selection->audio_regions.end_frame());
726 Editor::marker_menu_loop_range ()
730 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
731 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
738 if ((l = find_location_from_marker (marker, is_start)) != 0) {
740 if ((l2 = transport_loop_location()) != 0) {
741 l2->set (l->start(), l->end());
743 // enable looping, reposition and start rolling
744 session->request_auto_loop(true);
745 session->request_locate (l2->start(), true);
751 Editor::marker_menu_edit ()
757 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
758 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
762 if ((mm = dynamic_cast<MeterMarker*> (marker)) != 0) {
763 edit_meter_section (&mm->meter());
764 } else if ((tm = dynamic_cast<TempoMarker*> (marker)) != 0) {
765 edit_tempo_section (&tm->tempo());
767 fatal << X_("programming erorr: unhandled marker type in Editor::marker_menu_edit")
774 Editor::marker_menu_remove ()
780 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
781 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
785 if ((mm = dynamic_cast<MeterMarker*> (marker)) != 0) {
786 remove_meter_marker (marker_menu_item);
787 } else if ((tm = dynamic_cast<TempoMarker*> (marker)) != 0) {
788 remove_tempo_marker (marker_menu_item);
790 remove_marker (*marker_menu_item, (GdkEvent*) 0);
795 Editor::marker_menu_rename ()
799 if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
800 fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
807 loc = find_location_from_marker (marker, is_start);
811 ArdourPrompter dialog (true);
814 dialog.set_prompt (_("New Name:"));
816 if (loc->is_mark()) {
817 dialog.set_title (_("ardour: rename mark"));
819 dialog.set_title (_("ardour: rename range"));
822 dialog.set_name ("MarkRenameWindow");
823 dialog.set_size_request (250, -1);
824 dialog.set_position (Gtk::WIN_POS_MOUSE);
826 dialog.add_button (_("Rename"), RESPONSE_ACCEPT);
827 dialog.set_response_sensitive (Gtk::RESPONSE_ACCEPT, false);
828 dialog.set_initial_text (loc->name());
832 switch (dialog.run ()) {
833 case RESPONSE_ACCEPT:
839 begin_reversible_command ( _("rename marker") );
840 session->add_undo( session->locations()->get_memento() );
842 dialog.get_result(txt);
845 session->add_redo_no_execute( session->locations()->get_memento() );
846 commit_reversible_command ();
850 Editor::new_transport_marker_menu_popdown (GdkEventAny *ev)
853 transport_bar_drag_rect->hide();
854 range_marker_drag_rect->hide();
860 Editor::new_transport_marker_menu_set_loop ()
862 if (!session) return;
864 begin_reversible_command (_("set loop range"));
868 if ((tll = transport_loop_location()) == 0) {
869 Location* loc = new Location (temp_location->start(), temp_location->end(), _("Loop"), Location::IsAutoLoop);
870 session->add_undo (session->locations()->get_memento());
871 session->locations()->add (loc, true);
872 session->set_auto_loop_location (loc);
873 session->add_redo_no_execute (session->locations()->get_memento());
876 session->add_undo (retype_return<void>(bind (mem_fun (*tll, &Location::set), tll->start(), tll->end())));
877 session->add_redo (retype_return<void>(bind (mem_fun (*tll, &Location::set), temp_location->start(), temp_location->end())));
878 tll->set_hidden (false, this);
879 tll->set (temp_location->start(), temp_location->end());
882 commit_reversible_command ();
886 Editor::new_transport_marker_menu_set_punch ()
888 if (!session) return;
890 begin_reversible_command (_("set punch range"));
894 if ((tpl = transport_punch_location()) == 0) {
895 tpl = new Location (temp_location->start(), temp_location->end(), _("Punch"), Location::IsAutoPunch);
896 session->add_undo (session->locations()->get_memento());
897 session->locations()->add (tpl, true);
898 session->set_auto_punch_location (tpl);
899 session->add_redo_no_execute (session->locations()->get_memento());
901 session->add_undo (retype_return<void>(bind (mem_fun (*tpl, &Location::set), tpl->start(), tpl->end())));
902 session->add_redo (retype_return<void>(bind (mem_fun (*tpl, &Location::set), temp_location->start(), temp_location->end())));
903 tpl->set_hidden(false, this);
904 tpl->set(temp_location->start(), temp_location->end());
907 commit_reversible_command ();
911 Editor::update_loop_range_view (bool visibility)
919 if (session->get_auto_loop() && ((tll = transport_loop_location()) != 0)) {
921 double x1 = frame_to_pixel (tll->start());
922 double x2 = frame_to_pixel (tll->end());
924 transport_loop_range_rect->property_x1() = x1;
925 transport_loop_range_rect->property_x2() = x2;
928 transport_loop_range_rect->show();
931 else if (visibility) {
932 transport_loop_range_rect->hide();
937 Editor::update_punch_range_view (bool visibility)
945 if ((session->get_punch_in() || session->get_punch_out()) && ((tpl = transport_punch_location()) != 0)) {
947 double x1 = frame_to_pixel (tpl->start());
948 double x2 = frame_to_pixel (tpl->end());
950 transport_punch_range_rect->property_x1() = x1;
951 transport_punch_range_rect->property_x2() = x2;
954 transport_punch_range_rect->show();
957 else if (visibility) {
958 transport_punch_range_rect->hide();
961 // if (session->get_punch_in()) {
962 // double x = frame_to_pixel (transport_punch_location->start());
963 // gnome_canvas_item_set (transport_punchin_line, "x1", x, "x2", x, NULL);
966 // gnome_canvas_item_show (transport_punchin_line);
969 // else if (visibility) {
970 // gnome_canvas_item_hide (transport_punchin_line);
973 // if (session->get_punch_out()) {
974 // double x = frame_to_pixel (transport_punch_location->end());
976 // gnome_canvas_item_set (transport_punchout_line, "x1", x, "x2", x, NULL);
979 // gnome_canvas_item_show (transport_punchout_line);
982 // else if (visibility) {
983 // gnome_canvas_item_hide (transport_punchout_line);