; (gtk_accel_path "<Actions>/Editor/EditSelectRegionOptions" "")
(gtk_accel_path "<Actions>/Editor/crop" "c")
; (gtk_accel_path "<Actions>/redirectmenu/newsend" "")
+; (gtk_accel_path "<Actions>/Editor/ToggleGeneric MIDISurfaceSubMenu" "")
; (gtk_accel_path "<Actions>/Editor/MeterFalloff" "")
; (gtk_accel_path "<Actions>/RegionList/rlRemove" "")
(gtk_accel_path "<Actions>/Transport/GotoStart" "Home")
; (gtk_accel_path "<Actions>/Editor/Subframes80" "")
; (gtk_accel_path "<Actions>/options/FileHeaderFormatCAF" "")
(gtk_accel_path "<Actions>/Common/ToggleLocations" "<Alt>l")
+; (gtk_accel_path "<Actions>/Editor/ToggleGeneric MIDISurface" "")
(gtk_accel_path "<Actions>/Editor/editor-delete" "Delete")
; (gtk_accel_path "<Actions>/JACK/JACKLatency256" "")
(gtk_accel_path "<Actions>/Editor/select-all-between-cursors" "u")
; (gtk_accel_path "<Actions>/Snap/snap-to-region-sync" "")
(gtk_accel_path "<Actions>/Editor/edit-cursor-to-previous-region-sync" "apostrophe")
; (gtk_accel_path "<Actions>/redirectmenu/clear" "")
+; (gtk_accel_path "<Actions>/Editor/ToggleGeneric MIDISurfaceFeedback" "")
; (gtk_accel_path "<Actions>/Editor/PullupPlus4Minus1" "")
; (gtk_accel_path "<Actions>/JACK/JACKLatency512" "")
(gtk_accel_path "<Actions>/Editor/edit-cursor-to-next-region-end" "<Control>bracketright")
}
}
+struct TrackViewByPositionSorter
+{
+ bool operator() (const TimeAxisView* a, const TimeAxisView *b) {
+ return a->y_position < b->y_position;
+ }
+};
+
+bool
+Editor::extend_selection_to_track (TimeAxisView& view)
+{
+ if (selection->tracks.empty()) {
+
+ if (!selection->selected (&view)) {
+ selection->set (&view);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /* something is already selected, so figure out which range of things to add */
+
+ TrackViewList to_be_added;
+ TrackViewList sorted = track_views;
+ TrackViewByPositionSorter cmp;
+ bool passed_clicked = false;
+ bool forwards;
+
+ sorted.sort (cmp);
+
+ if (!selection->selected (&view)) {
+ to_be_added.push_back (&view);
+ }
+
+ /* figure out if we should go forward or backwards */
+
+ for (TrackViewList::iterator i = sorted.begin(); i != sorted.end(); ++i) {
+
+ if ((*i) == &view) {
+ passed_clicked = true;
+ }
+
+ if (selection->selected (*i)) {
+ if (passed_clicked) {
+ forwards = true;
+ } else {
+ forwards = false;
+ }
+ break;
+ }
+ }
+
+ passed_clicked = false;
+
+ if (forwards) {
+
+ for (TrackViewList::iterator i = sorted.begin(); i != sorted.end(); ++i) {
+
+ if ((*i) == &view) {
+ passed_clicked = true;
+ continue;
+ }
+
+ if (passed_clicked) {
+ if ((*i)->hidden()) {
+ continue;
+ }
+ if (selection->selected (*i)) {
+ break;
+ } else if (!(*i)->hidden()) {
+ to_be_added.push_back (*i);
+ }
+ }
+ }
+
+ } else {
+
+ for (TrackViewList::reverse_iterator r = sorted.rbegin(); r != sorted.rend(); ++r) {
+
+ if ((*r) == &view) {
+ passed_clicked = true;
+ continue;
+ }
+
+ if (passed_clicked) {
+
+ if ((*r)->hidden()) {
+ continue;
+ }
+
+ if (selection->selected (*r)) {
+ break;
+ } else if (!(*r)->hidden()) {
+ to_be_added.push_back (*r);
+ }
+ }
+ }
+ }
+
+ if (!to_be_added.empty()) {
+ selection->add (to_be_added);
+ return true;
+ }
+
+ return false;
+}
+
+
bool
Editor::set_selected_track (TimeAxisView& view, Selection::Operation op, bool no_remove)
{
case Selection::Set:
if (selection->selected (&view) && selection->tracks.size() == 1) {
/* no commit necessary */
- }
-
- selection->set (&view);
+ } else {
+ selection->set (&view);
+ commit = true;
+ }
break;
case Selection::Extend:
- /* not defined yet */
+ commit = extend_selection_to_track (view);
break;
}
Selection& get_selection() const { return *selection; }
Selection& get_cut_buffer() const { return *cut_buffer; }
+ bool extend_selection_to_track (TimeAxisView&);
+
void play_selection ();
void select_all_in_track (Selection::Operation op);
void select_all (Selection::Operation op);
switch (item_type) {
case RegionItem:
+ /* XXX make tying track/region selection optional */
c1 = set_selected_track_from_click (op, true);
c2 = set_selected_regionview_from_click (press, op, true);
commit = (c1 || c2);
case RegionViewNameHighlight:
case RegionViewName:
+ /* XXX make tying track/region selection optional */
c1 = set_selected_track_from_click (op, true);
c2 = set_selected_regionview_from_click (press, op, true);
commit = (c1 || c2);
case GainAutomationControlPointItem:
case PanAutomationControlPointItem:
case RedirectAutomationControlPointItem:
+ /* XXX make tying track/region selection optional */
c1 = set_selected_track_from_click (op, true);
c2 = set_selected_control_point_from_click (op, false);
commit = (c1 || c2);
virtual gulong frame_to_pixel (nframes_t frame) = 0;
virtual Selection& get_selection() const = 0;
virtual Selection& get_cut_buffer() const = 0;
+ virtual bool extend_selection_to_track (TimeAxisView&) = 0;
virtual void play_selection () = 0;
virtual void set_show_measures (bool yn) = 0;
virtual bool show_measures () const = 0;
break;
case Selection::Extend:
- /* not defined yet */
+ if (tracks->size() > 1) {
+ /* add each one, do not "extend" */
+ editor.get_selection().add (*tracks);
+ } else {
+ /* extend to the single track */
+ editor.extend_selection_to_track (*tracks->front());
+ }
break;
case Selection::Add:
#ifndef __ardour_svn_revision_h__
#define __ardour_svn_revision_h__
-static const char* ardour_svn_revision = "1180";
+static const char* ardour_svn_revision = "1232";
#endif