Remove ScrubDrag and vari-speed based fake-scrubbing
This commit is contained in:
@@ -370,10 +370,6 @@ Editor::Editor ()
|
||||
, current_interthread_info (0)
|
||||
, analysis_window (0)
|
||||
, select_new_marker (false)
|
||||
, last_scrub_x (0)
|
||||
, scrubbing_direction (0)
|
||||
, scrub_reversals (0)
|
||||
, scrub_reverse_distance (0)
|
||||
, have_pending_keyboard_selection (false)
|
||||
, pending_keyboard_selection_start (0)
|
||||
, _grid_type (GridTypeBeat)
|
||||
|
||||
@@ -1645,12 +1645,6 @@ private:
|
||||
void reverse_selection ();
|
||||
void edit_envelope ();
|
||||
|
||||
double last_scrub_x;
|
||||
int scrubbing_direction;
|
||||
int scrub_reversals;
|
||||
int scrub_reverse_distance;
|
||||
void scrub (samplepos_t, double);
|
||||
|
||||
void set_punch_start_from_edit_point ();
|
||||
void set_punch_end_from_edit_point ();
|
||||
void set_loop_start_from_edit_point ();
|
||||
@@ -2616,7 +2610,6 @@ private:
|
||||
friend class RubberbandSelectDrag;
|
||||
friend class EditorRubberbandSelectDrag;
|
||||
friend class TimeFXDrag;
|
||||
friend class ScrubDrag;
|
||||
friend class SelectionDrag;
|
||||
friend class RangeMarkerBarDrag;
|
||||
friend class MouseZoomDrag;
|
||||
|
||||
@@ -5439,39 +5439,6 @@ TimeFXDrag::aborted (bool)
|
||||
_primary->get_time_axis_view ().hide_timestretch ();
|
||||
}
|
||||
|
||||
ScrubDrag::ScrubDrag (Editor* e, ArdourCanvas::Item* i)
|
||||
: Drag (e, i, Temporal::AudioTime)
|
||||
{
|
||||
DEBUG_TRACE (DEBUG::Drags, "New ScrubDrag\n");
|
||||
}
|
||||
|
||||
void
|
||||
ScrubDrag::start_grab (GdkEvent* event, Gdk::Cursor*)
|
||||
{
|
||||
Drag::start_grab (event);
|
||||
}
|
||||
|
||||
void
|
||||
ScrubDrag::motion (GdkEvent* /*event*/, bool)
|
||||
{
|
||||
_editor->scrub (adjusted_current_time (0, false).samples (), _drags->current_pointer_x ());
|
||||
}
|
||||
|
||||
void
|
||||
ScrubDrag::finished (GdkEvent* /*event*/, bool movement_occurred)
|
||||
{
|
||||
if (movement_occurred && _editor->session ()) {
|
||||
/* make sure we stop */
|
||||
_editor->session ()->request_stop ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ScrubDrag::aborted (bool)
|
||||
{
|
||||
/* XXX: TODO */
|
||||
}
|
||||
|
||||
SelectionDrag::SelectionDrag (Editor* e, ArdourCanvas::Item* i, Operation o)
|
||||
: Drag (e, i, e->default_time_domain ())
|
||||
, _operation (o)
|
||||
|
||||
@@ -1345,18 +1345,6 @@ private:
|
||||
bool _dragging_start;
|
||||
};
|
||||
|
||||
/** Scrub drag in audition mode */
|
||||
class ScrubDrag : public Drag
|
||||
{
|
||||
public:
|
||||
ScrubDrag (Editor *, ArdourCanvas::Item *);
|
||||
|
||||
void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
|
||||
void motion (GdkEvent *, bool);
|
||||
void finished (GdkEvent *, bool);
|
||||
void aborted (bool);
|
||||
};
|
||||
|
||||
/** Drag in range select mode */
|
||||
class SelectionDrag : public Drag
|
||||
{
|
||||
|
||||
@@ -2230,85 +2230,6 @@ Editor::leave_handler (ArdourCanvas::Item* item, GdkEvent*, ItemType item_type)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
Editor::scrub (samplepos_t sample, double current_x)
|
||||
{
|
||||
double delta;
|
||||
|
||||
if (scrubbing_direction == 0) {
|
||||
/* first move */
|
||||
_session->request_locate (sample, false, MustStop);
|
||||
_session->request_transport_speed (0.1);
|
||||
scrubbing_direction = 1;
|
||||
|
||||
} else {
|
||||
|
||||
if (last_scrub_x > current_x) {
|
||||
|
||||
/* pointer moved to the left */
|
||||
|
||||
if (scrubbing_direction > 0) {
|
||||
|
||||
/* we reversed direction to go backwards */
|
||||
|
||||
scrub_reversals++;
|
||||
scrub_reverse_distance += (int) (last_scrub_x - current_x);
|
||||
|
||||
} else {
|
||||
|
||||
/* still moving to the left (backwards) */
|
||||
|
||||
scrub_reversals = 0;
|
||||
scrub_reverse_distance = 0;
|
||||
|
||||
delta = 0.01 * (last_scrub_x - current_x);
|
||||
_session->request_transport_speed_nonzero (_session->actual_speed() - delta);
|
||||
}
|
||||
|
||||
} else {
|
||||
/* pointer moved to the right */
|
||||
|
||||
if (scrubbing_direction < 0) {
|
||||
/* we reversed direction to go forward */
|
||||
|
||||
scrub_reversals++;
|
||||
scrub_reverse_distance += (int) (current_x - last_scrub_x);
|
||||
|
||||
} else {
|
||||
/* still moving to the right */
|
||||
|
||||
scrub_reversals = 0;
|
||||
scrub_reverse_distance = 0;
|
||||
|
||||
delta = 0.01 * (current_x - last_scrub_x);
|
||||
_session->request_transport_speed_nonzero (_session->actual_speed() + delta);
|
||||
}
|
||||
}
|
||||
|
||||
/* if there have been more than 2 opposite motion moves detected, or one that moves
|
||||
back more than 10 pixels, reverse direction
|
||||
*/
|
||||
|
||||
if (scrub_reversals >= 2 || scrub_reverse_distance > 10) {
|
||||
|
||||
if (scrubbing_direction > 0) {
|
||||
/* was forwards, go backwards */
|
||||
_session->request_transport_speed (-0.1);
|
||||
scrubbing_direction = -1;
|
||||
} else {
|
||||
/* was backwards, go forwards */
|
||||
_session->request_transport_speed (0.1);
|
||||
scrubbing_direction = 1;
|
||||
}
|
||||
|
||||
scrub_reverse_distance = 0;
|
||||
scrub_reversals = 0;
|
||||
}
|
||||
}
|
||||
|
||||
last_scrub_x = current_x;
|
||||
}
|
||||
|
||||
GridType
|
||||
Editor::determine_mapping_grid_snap(timepos_t t)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user