1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-18 17:10:05 +02:00

Revert "Bug990 (seek key reponsiveness), and, change Scrub UI again, so Ctrl key seeks."

This reverts commit 841bca36ea321e6ea92578dd6668bc4011f1d30b.
This commit is contained in:
Paul Licameli 2015-05-29 19:45:43 -04:00
parent 841bca36ea
commit 9f2dfbc70b
4 changed files with 13 additions and 38 deletions

View File

@ -608,7 +608,6 @@ TrackPanel::TrackPanel(wxWindow * parent, wxWindowID id,
mMaxScrubSpeed = 1.0;
mScrubSpeedDisplayCountdown = 0;
mScrubHasFocus = false;
mScrubSeekKeypress = false;
#endif
#ifdef EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL
@ -1034,21 +1033,12 @@ void TrackPanel::OnTimer()
// Call ContinueScrubbing() here rather than in SelectionHandleDrag()
// so that even without drag events, we can instruct the play head to
// keep approaching the mouse cursor, when its maximum speed is limited.
// Thus scrubbing relies mostly on periodic polling of mouse and keys,
// not event notifications. But there are a few event handlers that
// leave messages for this routine, in mScrubSeekKeypress and in mScrubHasFocus.
if (IsScrubbing())
{
wxCoord position = ::wxGetMouseState().GetX();
// Detect key state here, or use the record of key transition
// made elsewhere.
const bool seek = mScrubSeekKeypress || IsScrubSeekKeyDown();
wxMouseState state = ::wxGetMouseState();
wxCoord position = state.GetX();
ScreenToClient(&position, NULL);
if (ContinueScrubbing(position, mScrubHasFocus, seek))
// Successfully enqueued one stutter
mScrubSeekKeypress = false;
// else if seeking, try again at the next round.
ContinueScrubbing(position, state.ShiftDown());
#ifdef EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL
if (mSmoothScrollingScrub)
@ -1637,14 +1627,6 @@ void TrackPanel::HandleShiftKey(bool down)
void TrackPanel::HandleControlKey(bool down)
{
#ifdef EXPERIMENTAL_SCRUBBING_BASIC
// Scrubbing is mostly not event driven, it uses periodic polling and tests
// key state. But it might otherwise miss a fast keypress and release,
// so this is not redundant:
if (down && IsScrubbing())
mScrubSeekKeypress = true;
#endif
mLastMouseEvent.m_controlDown = down;
HandleCursorForLastMouseEvent();
}
@ -2323,11 +2305,6 @@ double TrackPanel::FindScrubSpeed(double timeAtMouse) const
#endif
#ifdef EXPERIMENTAL_SCRUBBING_BASIC
bool TrackPanel::IsScrubSeekKeyDown()
{
return ::wxGetMouseState().CmdDown();
}
bool TrackPanel::IsScrubbing()
{
if (mScrubToken <= 0)
@ -2434,10 +2411,10 @@ bool TrackPanel::MaybeStartScrubbing(wxMouseEvent &event)
return false;
}
bool TrackPanel::ContinueScrubbing(wxCoord position, bool hasFocus, bool maySkip)
bool TrackPanel::ContinueScrubbing(wxCoord position, bool maySkip)
{
// When we don't have focus, enqueue silent scrubs until we regain focus.
if (!hasFocus)
if (!mScrubHasFocus)
return gAudioIO->EnqueueScrubBySignedSpeed(0, mMaxScrubSpeed, maySkip);
const double newEnd = PositionToTime(position, GetLeftOffset());
@ -7397,7 +7374,7 @@ void TrackPanel::DrawScrubSpeed(wxDC &dc)
return;
// Don't draw it during stutter play with shift down
if (!IsScrubSeekKeyDown() && (
if (!::wxGetMouseState().ShiftDown() && (
mScrubSpeedDisplayCountdown > 0

View File

@ -305,7 +305,6 @@ class AUDACITY_DLL_API TrackPanel:public wxPanel {
#endif
#ifdef EXPERIMENTAL_SCRUBBING_BASIC
static bool IsScrubSeekKeyDown();
bool IsScrubbing();
void ToggleScrubbing(
wxCoord xx
@ -314,7 +313,7 @@ class AUDACITY_DLL_API TrackPanel:public wxPanel {
#endif
);
bool MaybeStartScrubbing(wxMouseEvent &event);
bool ContinueScrubbing(wxCoord position, bool hasFocus, bool maySkip);
bool ContinueScrubbing(wxCoord position, bool maySkip);
bool StopScrubbing();
#endif
@ -782,8 +781,7 @@ protected:
wxCoord mScrubStartPosition;
double mMaxScrubSpeed;
int mScrubSpeedDisplayCountdown;
bool mScrubHasFocus; // To do: rely on wxWindow::HasFocus() instead, wx verions 2.9.0+
bool mScrubSeekKeypress;
bool mScrubHasFocus;
#endif
#ifdef EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL

View File

@ -105,11 +105,11 @@ void MousePrefs::CreateList()
AddItem(_("Shift-Left-Click"), _("Select"), _("Extend Selection Range"));
AddItem(_("Left-Double-Click"), _("Select"), _("Select Clip or Entire Track"));
#ifdef EXPERIMENTAL_SCRUBBING_BASIC
AddItem(_("Ctrl-Left-Click"), _("Select"), _("Scrub"));
AddItem(_("Ctrl"), _("Select"), _("Seek (while scrubbing)"));
AddItem(_("Ctrl-Left-Click"), _("Select"), _("Scrub"));
AddItem(_("Shift-Ctrl-Left-Click"), _("Select"), _("Seek"));
#endif
#ifdef EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL
AddItem(_("Ctrl-Left-Double-Click"), _("Select"), _("Scroll-Scrub"));
AddItem(_("Ctrl-Left-Double-Click"), _("Select"), _("Smooth Scrolling Scrub"));
AddItem(_("Wheel-Rotate"), _("Select"), _("Change scrub speed"));
#endif

View File

@ -85,9 +85,9 @@ ToolsToolBar::ToolsToolBar()
mMessageOfTool[selectTool] =
#if defined(__WXMAC__)
_("Click and drag to select audio, Command-Click to scrub, Command-Double-Click to scroll-scrub, Command to seek while scrubbing")
_("Click and drag to select audio, Command-Click and drag to scrub, Shift-Command-Click and drag to seek")
#else
_("Click and drag to select audio, Ctrl-Click to scrub, Ctrl-Double-Click to scroll-scrub, Ctrl to seek while scrubbing")
_("Click and drag to select audio, Ctrl-Click and drag to scrub, Shift-Ctrl-Click and drag to seek")
#endif
;