mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-18 17:10:05 +02:00
More for bug 1014: stop scrubbing when switching out of select tool...
... Verified that this works for presses on tool buttons, and keys A, D, F1, ..., F6. Also fix conditional compilation with EXPERIMENTAL_SCRUBBING_BASIC not defined.
This commit is contained in:
parent
70d9e7b746
commit
0bed89419f
@ -172,14 +172,14 @@
|
||||
// Paul Licameli (PRL) 16 Apr 2015
|
||||
// Support for scrubbing in the AudioIO engine, without calls to it
|
||||
#define EXPERIMENTAL_SCRUBBING_SUPPORT
|
||||
|
||||
#ifdef EXPERIMENTAL_SCRUBBING_SUPPORT
|
||||
// The following enable parts of the scrubbing user interface.
|
||||
// You must define EXPERIMENTAL_SCRUBBING_SUPPORT if you enable this:
|
||||
#define EXPERIMENTAL_SCRUBBING_BASIC
|
||||
// You must define EXPERIMENTAL_SCRUBBING_BASIC if you enable this:
|
||||
#ifdef EXPERIMENTAL_SCRUBBING_BASIC
|
||||
#define EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL
|
||||
// You must define EXPERIMENTAL_SCRUBBING_BASIC if you enable this:
|
||||
#define EXPERIMENTAL_SCRUBBING_SCROLL_WHEEL
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Paul Licameli (PRL) 24 May 2015
|
||||
// Allow scrolling up to one half of a screenful beyond either end of the project,
|
||||
|
@ -1952,9 +1952,13 @@ void TrackPanel::SetCursorAndTipWhenSelectTool( Track * t,
|
||||
// choose boundaries only in snapping tolerance,
|
||||
// and may choose center.
|
||||
// But don't change the cursor when scrubbing.
|
||||
SelectionBoundary boundary = IsScrubbing()
|
||||
SelectionBoundary boundary =
|
||||
#ifdef EXPERIMENTAL_SCRUBBING_BASIC
|
||||
IsScrubbing()
|
||||
? SBNone
|
||||
: ChooseBoundary(event, t, r, !bShiftDown, !bShiftDown);
|
||||
:
|
||||
#endif
|
||||
ChooseBoundary(event, t, r, !bShiftDown, !bShiftDown);
|
||||
|
||||
#ifdef USE_MIDI
|
||||
// The MIDI HitTest will only succeed if we are on a midi track, so
|
||||
@ -6852,6 +6856,7 @@ void TrackPanel::HandleTrackSpecificMouseEvent(wxMouseEvent & event)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef EXPERIMENTAL_SCRUBBING_BASIC
|
||||
if ((!pTrack ||
|
||||
pTrack->GetKind() == Track::Wave) &&
|
||||
IsScrubbing()) {
|
||||
@ -6862,6 +6867,7 @@ void TrackPanel::HandleTrackSpecificMouseEvent(wxMouseEvent & event)
|
||||
else if (event.LeftIsDown())
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (pTrack && (pTrack->GetKind() == Track::Wave) &&
|
||||
(mMouseCapture == IsUncaptured || mMouseCapture == IsOverCutLine ||
|
||||
|
@ -316,7 +316,9 @@ class AUDACITY_DLL_API TrackPanel:public wxPanel {
|
||||
);
|
||||
bool MaybeStartScrubbing(wxMouseEvent &event);
|
||||
bool ContinueScrubbing(wxCoord position, bool hasFocus, bool seek);
|
||||
public:
|
||||
bool StopScrubbing();
|
||||
protected:
|
||||
#endif
|
||||
|
||||
virtual void SelectionHandleClick(wxMouseEvent &event,
|
||||
|
@ -33,6 +33,7 @@
|
||||
|
||||
|
||||
#include "../Audacity.h"
|
||||
#include "ToolsToolBar.h"
|
||||
|
||||
// For compilers that support precompilation, includes "wx/wx.h".
|
||||
#include <wx/wxprec.h>
|
||||
@ -46,12 +47,14 @@
|
||||
#include <wx/tooltip.h>
|
||||
|
||||
#include "MeterToolBar.h"
|
||||
#include "ToolsToolBar.h"
|
||||
|
||||
#include "../Prefs.h"
|
||||
#include "../AllThemeResources.h"
|
||||
#include "../ImageManipulation.h"
|
||||
#include "../Project.h"
|
||||
#ifdef EXPERIMENTAL_SCRUBBING_BASIC
|
||||
#include "../TrackPanel.h"
|
||||
#endif
|
||||
#include "../Theme.h"
|
||||
#include "../widgets/AButton.h"
|
||||
|
||||
@ -215,6 +218,18 @@ void ToolsToolBar::SetCurrentTool(int tool, bool show)
|
||||
//In multi-mode the current tool is shown by the
|
||||
//cursor icon. The buttons are not updated.
|
||||
|
||||
#ifdef EXPERIMENTAL_SCRUBBING_BASIC
|
||||
if (tool != selectTool) {
|
||||
AudacityProject *p = GetActiveProject();
|
||||
if (p) {
|
||||
TrackPanel *tp = p->GetTrackPanel();
|
||||
if (tp) {
|
||||
tp->StopScrubbing();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
bool leavingMulticlipMode =
|
||||
IsDown(multiTool) && show && tool != multiTool;
|
||||
|
||||
@ -278,6 +293,18 @@ void ToolsToolBar::OnTool(wxCommandEvent & evt)
|
||||
else
|
||||
mTool[i]->PopUp();
|
||||
|
||||
#ifdef EXPERIMENTAL_SCRUBBING_BASIC
|
||||
if (0 != mCurrentTool) {
|
||||
AudacityProject *p = GetActiveProject();
|
||||
if (p) {
|
||||
TrackPanel *tp = p->GetTrackPanel();
|
||||
if (tp) {
|
||||
tp->StopScrubbing();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
RedrawAllProjects();
|
||||
|
||||
gPrefs->Write(wxT("/GUI/ToolBars/Tools/MultiToolActive"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user