Editor::get_onscreen_tracks (TrackViewList& tvl)
{
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
- if ((*i)->y_position() < _canvas_height) {
+ if ((*i)->y_position() < _visible_canvas_height) {
tvl.push_back (*i);
}
}
return;
}
+ /* XXX this is superficially inefficient. Hide the selection in all
+ * tracks, then show it in all selected tracks.
+ *
+ * However, if you investigate what this actually does, it isn't
+ * anywhere nearly as bad as it may appear. Remember: nothing is
+ * redrawn or even recomputed during these two loops - that only
+ * happens when we next render ...
+ */
+
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
(*i)->hide_selection ();
}
}
if (found.empty()) {
+ selection->clear_objects();
+ selection->clear_time ();
return;
}
list<Selectable *> touched;
if (after) {
- start = cursor->current_frame;
+ start = cursor->current_frame();
end = _session->current_end_frame();
} else {
- if (cursor->current_frame > 0) {
+ if (cursor->current_frame() > 0) {
start = 0;
- end = cursor->current_frame - 1;
+ end = cursor->current_frame() - 1;
} else {
return;
}
bool
Editor::get_edit_op_range (framepos_t& start, framepos_t& end) const
{
- framepos_t m;
- bool ignored;
+// framepos_t m;
+// bool ignored;
/* if an explicit range exists, use it */
- if (!selection->time.empty()) {
+ if ( (mouse_mode == MouseRange || get_smart_mode() ) && !selection->time.empty()) {
/* we know that these are ordered */
start = selection->time.start();
end = selection->time.end_frame();
return true;
- }
-
- if (!mouse_frame (m, ignored)) {
- /* mouse is not in a canvas, try playhead+selected marker.
- this is probably most true when using menus.
- */
-
- if (selection->markers.empty()) {
- return false;
- }
-
- start = selection->markers.front()->position();
- end = _session->audible_frame();
-
} else {
-
- switch (_edit_point) {
- case EditAtPlayhead:
- if (selection->markers.empty()) {
- /* use mouse + playhead */
- start = m;
- end = _session->audible_frame();
- } else {
- /* use playhead + selected marker */
- start = _session->audible_frame();
- end = selection->markers.front()->position();
- }
- break;
-
- case EditAtMouse:
- /* use mouse + selected marker */
- if (selection->markers.empty()) {
- start = m;
- end = _session->audible_frame();
- } else {
- start = selection->markers.front()->position();
- end = m;
- }
- break;
-
- case EditAtSelectedMarker:
- /* use mouse + selected marker */
- if (selection->markers.empty()) {
-
- MessageDialog win (_("No edit range defined"),
- false,
- MESSAGE_INFO,
- BUTTONS_OK);
-
- win.set_secondary_text (
- _("the edit point is Selected Marker\nbut there is no selected marker."));
-
-
- win.set_default_response (RESPONSE_CLOSE);
- win.set_position (Gtk::WIN_POS_MOUSE);
- win.show_all();
-
- win.run ();
-
- return false; // NO RANGE
- }
- start = selection->markers.front()->position();
- end = m;
- break;
- }
- }
-
- if (start == end) {
+ start = 0;
+ end = 0;
return false;
}
-
- if (start > end) {
- swap (start, end);
- }
+
+// if (!mouse_frame (m, ignored)) {
+// /* mouse is not in a canvas, try playhead+selected marker.
+// this is probably most true when using menus.
+// */
+//
+// if (selection->markers.empty()) {
+// return false;
+// }
+
+// start = selection->markers.front()->position();
+// end = _session->audible_frame();
+
+// } else {
+
+// switch (_edit_point) {
+// case EditAtPlayhead:
+// if (selection->markers.empty()) {
+// /* use mouse + playhead */
+// start = m;
+// end = _session->audible_frame();
+// } else {
+// /* use playhead + selected marker */
+// start = _session->audible_frame();
+// end = selection->markers.front()->position();
+// }
+// break;
+
+// case EditAtMouse:
+// /* use mouse + selected marker */
+// if (selection->markers.empty()) {
+// start = m;
+// end = _session->audible_frame();
+// } else {
+// start = selection->markers.front()->position();
+// end = m;
+// }
+// break;
+
+// case EditAtSelectedMarker:
+// /* use mouse + selected marker */
+// if (selection->markers.empty()) {
+
+// MessageDialog win (_("No edit range defined"),
+// false,
+// MESSAGE_INFO,
+// BUTTONS_OK);
+
+// win.set_secondary_text (
+// _("the edit point is Selected Marker\nbut there is no selected marker."));
+
+
+// win.set_default_response (RESPONSE_CLOSE);
+// win.set_position (Gtk::WIN_POS_MOUSE);
+// win.show_all();
+
+// win.run ();
+
+// return false; // NO RANGE
+// }
+// start = selection->markers.front()->position();
+// end = m;
+// break;
+// }
+// }
+
+// if (start == end) {
+// return false;
+// }
+
+// if (start > end) {
+// swap (start, end);
+// }
/* turn range into one delimited by start...end,
not start...end-1
*/
- end++;
+// end++;
- return true;
+// return true;
}
void