X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Feditor_markers.cc;h=352eb260408b7d8a0442e297e260b90086e714df;hb=61b3131303e02c3d45737125abfd08445c3964f3;hp=8d86a0fbb2d3d5e09b9a843bff90137ad1218e5a;hpb=c86210a9d5bdb7b36ad58552a1f99f53d48781b3;p=ardour.git diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc index 8d86a0fbb2..352eb26040 100644 --- a/gtk2_ardour/editor_markers.cc +++ b/gtk2_ardour/editor_markers.cc @@ -636,7 +636,7 @@ Editor::build_range_marker_menu (bool loop_or_punch) } items.push_back (SeparatorElem()); - items.push_back (MenuElem (_("Export Range"), mem_fun(*this, &Editor::marker_menu_export_range))); + items.push_back (MenuElem (_("Export Range"), mem_fun(*this, &Editor::export_range))); items.push_back (SeparatorElem()); if (!loop_or_punch) { @@ -679,7 +679,7 @@ Editor::build_new_transport_marker_menu () items.push_back (MenuElem (_("Set Loop Range"), mem_fun(*this, &Editor::new_transport_marker_menu_set_loop))); items.push_back (MenuElem (_("Set Punch Range"), mem_fun(*this, &Editor::new_transport_marker_menu_set_punch))); - new_transport_marker_menu->signal_unmap_event().connect ( mem_fun(*this, &Editor::new_transport_marker_menu_popdown)); + new_transport_marker_menu->signal_unmap().connect ( mem_fun(*this, &Editor::new_transport_marker_menu_popdown)); } void @@ -814,26 +814,6 @@ Editor::marker_menu_set_playhead () } } -void -Editor::marker_menu_export_range () -{ - Marker* marker; - - if ((marker = reinterpret_cast (marker_menu_item->get_data ("marker"))) == 0) { - fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg; - /*NOTREACHED*/ - } - - Location* l; - bool is_start; - - if ((l = find_location_from_marker (marker, is_start)) != 0) { - if (l->is_range_marker()) { - export_range (l->start(), l->end()); - } - } -} - void Editor::marker_menu_range_to_next () { @@ -1110,14 +1090,12 @@ Editor::marker_menu_rename () commit_reversible_command (); } -gint -Editor::new_transport_marker_menu_popdown (GdkEventAny *ev) +void +Editor::new_transport_marker_menu_popdown () { // hide rects transport_bar_drag_rect->hide(); range_marker_drag_rect->hide(); - - return FALSE; } void @@ -1168,51 +1146,22 @@ Editor::update_punch_range_view (bool visibility) Location* tpl; if ((Config->get_punch_in() || Config->get_punch_out()) && ((tpl = transport_punch_location()) != 0)) { - - double x1 = frame_to_pixel (tpl->start()); - double x2 = frame_to_pixel (tpl->end()); - guint track_canvas_width,track_canvas_height; track_canvas->get_size(track_canvas_width,track_canvas_height); - - transport_punch_range_rect->property_x1() = x1; - transport_punch_range_rect->property_x2() = x2; - - transport_punch_range_rect->property_x1() = (Config->get_punch_in() ? x1 : 0); - transport_punch_range_rect->property_x2() = (Config->get_punch_out() ? x2 : track_canvas_width); + if (Config->get_punch_in()) { + transport_punch_range_rect->property_x1() = frame_to_pixel (tpl->start()); + transport_punch_range_rect->property_x2() = (Config->get_punch_out() ? frame_to_pixel (tpl->end()) : frame_to_pixel (JACK_MAX_FRAMES)); + } else { + transport_punch_range_rect->property_x1() = 0; + transport_punch_range_rect->property_x2() = (Config->get_punch_out() ? frame_to_pixel (tpl->end()) : track_canvas_width); + } if (visibility) { transport_punch_range_rect->show(); } - } - else if (visibility) { + } else if (visibility) { transport_punch_range_rect->hide(); } - -// if (session->get_punch_in()) { -// double x = frame_to_pixel (transport_punch_location->start()); -// gnome_canvas_item_set (transport_punchin_line, "x1", x, "x2", x, NULL); - -// if (visibility) { -// gnome_canvas_item_show (transport_punchin_line); -// } -// } -// else if (visibility) { -// gnome_canvas_item_hide (transport_punchin_line); -// } - -// if (session->get_punch_out()) { -// double x = frame_to_pixel (transport_punch_location->end()); - -// gnome_canvas_item_set (transport_punchout_line, "x1", x, "x2", x, NULL); - -// if (visibility) { -// gnome_canvas_item_show (transport_punchout_line); -// } -// } -// else if (visibility) { -// gnome_canvas_item_hide (transport_punchout_line); -// } } void