Add Auditioned to Export Report Dialog.
[ardour.git] / gtk2_ardour / editor.cc
index 4a559167e85a0e0986c9b8c18569e667e70e80b4..f080ed24fb1c0ecc0513932de63db2fcb35f1b95 100644 (file)
@@ -323,6 +323,7 @@ Editor::Editor ()
        clicked_regionview = 0;
        clicked_axisview = 0;
        clicked_routeview = 0;
+       clicked_selection = 0;
        clicked_control_point = 0;
        last_update_frame = 0;
        last_paste_pos = 0;
@@ -822,6 +823,10 @@ Editor::~Editor()
        delete _snapshots;
        delete _locations;
        delete _playlist_selector;
+
+       for (list<XMLNode *>::iterator i = selection_op_history.begin(); i != selection_op_history.end(); ++i) {
+               delete *i;
+       }
 }
 
 XMLNode*
@@ -1890,14 +1895,13 @@ Editor::add_selection_context_items (Menu_Helpers::MenuList& edit_items)
 
        edit_items.push_back (SeparatorElem());
        edit_items.push_back (MenuElem (_("Crop Region to Range"), sigc::mem_fun(*this, &Editor::crop_region_to_selection)));
-       edit_items.push_back (MenuElem (_("Fill Range with Region"), sigc::mem_fun(*this, &Editor::region_fill_selection)));
        edit_items.push_back (MenuElem (_("Duplicate Range"), sigc::bind (sigc::mem_fun(*this, &Editor::duplicate_range), false)));
 
        edit_items.push_back (SeparatorElem());
        edit_items.push_back (MenuElem (_("Consolidate Range"), sigc::bind (sigc::mem_fun(*this, &Editor::bounce_range_selection), true, false)));
-       edit_items.push_back (MenuElem (_("Consolidate Range With Processing"), sigc::bind (sigc::mem_fun(*this, &Editor::bounce_range_selection), true, true)));
+       edit_items.push_back (MenuElem (_("Consolidate Range with Processing"), sigc::bind (sigc::mem_fun(*this, &Editor::bounce_range_selection), true, true)));
        edit_items.push_back (MenuElem (_("Bounce Range to Region List"), sigc::bind (sigc::mem_fun(*this, &Editor::bounce_range_selection), false, false)));
-       edit_items.push_back (MenuElem (_("Bounce Range to Region List With Processing"), sigc::bind (sigc::mem_fun(*this, &Editor::bounce_range_selection), false, true)));
+       edit_items.push_back (MenuElem (_("Bounce Range to Region List with Processing"), sigc::bind (sigc::mem_fun(*this, &Editor::bounce_range_selection), false, true)));
        edit_items.push_back (MenuElem (_("Export Range..."), sigc::mem_fun(*this, &Editor::export_selection)));
        if (ARDOUR_UI::instance()->video_timeline->get_duration() > 0) {
                edit_items.push_back (MenuElem (_("Export Video Range..."), sigc::bind (sigc::mem_fun(*(ARDOUR_UI::instance()), &ARDOUR_UI::export_video), true)));
@@ -1916,8 +1920,8 @@ Editor::add_dstream_context_items (Menu_Helpers::MenuList& edit_items)
        MenuList& play_items = play_menu->items();
        play_menu->set_name ("ArdourContextMenu");
 
-       play_items.push_back (MenuElem (_("Play From Edit Point"), sigc::mem_fun(*this, &Editor::play_from_edit_point)));
-       play_items.push_back (MenuElem (_("Play From Start"), sigc::mem_fun(*this, &Editor::play_from_start)));
+       play_items.push_back (MenuElem (_("Play from Edit Point"), sigc::mem_fun(*this, &Editor::play_from_edit_point)));
+       play_items.push_back (MenuElem (_("Play from Start"), sigc::mem_fun(*this, &Editor::play_from_start)));
        play_items.push_back (MenuElem (_("Play Region"), sigc::mem_fun(*this, &Editor::play_selected_region)));
        play_items.push_back (SeparatorElem());
        play_items.push_back (MenuElem (_("Loop Region"), sigc::bind (sigc::mem_fun (*this, &Editor::set_loop_from_region), true)));
@@ -1998,8 +2002,8 @@ Editor::add_bus_context_items (Menu_Helpers::MenuList& edit_items)
        MenuList& play_items = play_menu->items();
        play_menu->set_name ("ArdourContextMenu");
 
-       play_items.push_back (MenuElem (_("Play From Edit Point"), sigc::mem_fun(*this, &Editor::play_from_edit_point)));
-       play_items.push_back (MenuElem (_("Play From Start"), sigc::mem_fun(*this, &Editor::play_from_start)));
+       play_items.push_back (MenuElem (_("Play from Edit Point"), sigc::mem_fun(*this, &Editor::play_from_edit_point)));
+       play_items.push_back (MenuElem (_("Play from Start"), sigc::mem_fun(*this, &Editor::play_from_start)));
        edit_items.push_back (MenuElem (_("Play"), *play_menu));
 
        /* Selection */
@@ -3233,7 +3237,7 @@ Editor::build_snap_type_menu ()
 void
 Editor::setup_tooltips ()
 {
-       set_tooltip (smart_mode_button, _("Smart Mode (add Range functions to Grab mode)"));
+       set_tooltip (smart_mode_button, _("Smart Mode (add range functions to Grab Mode)"));
        set_tooltip (mouse_move_button, _("Grab Mode (select/move objects)"));
        set_tooltip (mouse_cut_button, _("Cut Mode (split regions)"));
        set_tooltip (mouse_select_button, _("Range Mode (select time ranges)"));
@@ -3248,13 +3252,13 @@ Editor::setup_tooltips ()
        set_tooltip (zoom_out_button, _("Zoom Out"));
        set_tooltip (zoom_preset_selector, _("Zoom to Time Scale"));
        set_tooltip (zoom_out_full_button, _("Zoom to Session"));
-       set_tooltip (zoom_focus_selector, _("Zoom focus"));
+       set_tooltip (zoom_focus_selector, _("Zoom Focus"));
        set_tooltip (tav_expand_button, _("Expand Tracks"));
        set_tooltip (tav_shrink_button, _("Shrink Tracks"));
        set_tooltip (visible_tracks_selector, _("Number of visible tracks"));
        set_tooltip (snap_type_selector, _("Snap/Grid Units"));
        set_tooltip (snap_mode_selector, _("Snap/Grid Mode"));
-       set_tooltip (edit_point_selector, _("Edit point"));
+       set_tooltip (edit_point_selector, _("Edit Point"));
        set_tooltip (edit_mode_selector, _("Edit Mode"));
        set_tooltip (nudge_clock, _("Nudge Clock\n(controls distance used to nudge regions and selections)"));
 }
@@ -4156,19 +4160,34 @@ Editor::playlist_deletion_dialog (boost::shared_ptr<Playlist> pl)
 
        label.show ();
 
+       dialog.add_button (_("Delete All Unused"), RESPONSE_YES); // needs clarification. this and all remaining ones
        dialog.add_button (_("Delete Playlist"), RESPONSE_ACCEPT);
-       dialog.add_button (_("Keep Playlist"), RESPONSE_REJECT);
+       Button* keep = dialog.add_button (_("Keep Playlist"), RESPONSE_REJECT);
+       dialog.add_button (_("Keep Remaining"), RESPONSE_NO); // ditto
        dialog.add_button (_("Cancel"), RESPONSE_CANCEL);
 
+       // by default gtk uses the left most button
+       keep->grab_focus ();
+
        switch (dialog.run ()) {
+       case RESPONSE_NO:
+               /* keep this and all remaining ones */
+               return -2;
+               break;
+
+       case RESPONSE_YES:
+               /* delete this and all others */
+               return 2;
+               break;
+
        case RESPONSE_ACCEPT:
                /* delete the playlist */
-               return 0;
+               return 1;
                break;
 
        case RESPONSE_REJECT:
                /* keep the playlist */
-               return 1;
+               return 0;
                break;
 
        default:
@@ -4715,10 +4734,7 @@ Editor::get_preferred_edit_position (EditIgnoreOption ignore, bool from_context_
        switch (ep) {
        case EditAtPlayhead:
                if (_dragging_playhead) {
-                       if (!mouse_frame (where, ignored)) {
-                               /* XXX not right but what can we do ? */
-                               return 0;
-                       }
+                       where = *_control_scroll_target;
                } else {
                        where = _session->audible_frame();
                }
@@ -5700,9 +5716,9 @@ Editor::super_rapid_screen_update ()
 
                } else {
 
-                       if (!_dragging_playhead && _session->requested_return_frame() < 0 && !pending_visual_change.being_handled) {
+                       if (!_dragging_playhead && _follow_playhead && _session->requested_return_frame() < 0 && !pending_visual_change.being_handled) {
                                framepos_t const frame = playhead_cursor->current_frame ();
-                               double target = ((double)frame - (double)current_page_samples()/3.0);
+                               double target = ((double)frame - (double)current_page_samples()/2.0);
                                if (target <= 0.0) {
                                        target = 0.0;
                                }
@@ -5954,22 +5970,41 @@ Editor::popup_note_context_menu (ArdourCanvas::Item* item, GdkEvent* event)
 
        MidiRegionView&       mrv = note->region_view();
        const RegionSelection rs  = get_regions_from_selection_and_entered ();
+       const uint32_t sel_size = mrv.selection_size ();
 
        MenuList& items = _note_context_menu.items();
        items.clear();
 
-       items.push_back(MenuElem(_("Delete"),
-                                sigc::mem_fun(mrv, &MidiRegionView::delete_selection)));
+       if (sel_size > 0) {
+               items.push_back(MenuElem(_("Delete"),
+                                        sigc::mem_fun(mrv, &MidiRegionView::delete_selection)));
+       }
+
        items.push_back(MenuElem(_("Edit..."),
-                                sigc::bind(sigc::mem_fun(*this, &Editor::edit_notes), &mrv)));
+                                sigc::bind(sigc::mem_fun(*this, &Editor::edit_notes), &mrv)));
+       if (sel_size != 1) {
+               items.back().set_sensitive (false);
+       }
+
        items.push_back(MenuElem(_("Transpose..."),
                                 sigc::bind(sigc::mem_fun(*this, &Editor::transpose_regions), rs)));
+
+
        items.push_back(MenuElem(_("Legatize"),
-                                sigc::bind(sigc::mem_fun(*this, &Editor::legatize_regions), rs, false)));
+                                sigc::bind(sigc::mem_fun(*this, &Editor::legatize_regions), rs, false)));
+       if (sel_size < 2) {
+               items.back().set_sensitive (false);
+       }
+
        items.push_back(MenuElem(_("Quantize..."),
                                 sigc::bind(sigc::mem_fun(*this, &Editor::quantize_regions), rs)));
+
        items.push_back(MenuElem(_("Remove Overlap"),
-                                sigc::bind(sigc::mem_fun(*this, &Editor::legatize_regions), rs, true)));
+                                sigc::bind(sigc::mem_fun(*this, &Editor::legatize_regions), rs, true)));
+       if (sel_size < 2) {
+               items.back().set_sensitive (false);
+       }
+
        items.push_back(MenuElem(_("Transform..."),
                                 sigc::bind(sigc::mem_fun(*this, &Editor::transform_regions), rs)));