11#ifndef __AUDACITY_SCRUBBING__
12#define __AUDACITY_SCRUBBING__
16#include <wx/longlong.h>
18#include "../../ScrubState.h"
21#include "../../widgets/Overlay.h"
34#define USE_SCRUB_THREAD
42 ,
public std::enable_shared_from_this< Scrubber >
54 static bool ShouldScrubPinned();
57 void MarkScrubStart(wxCoord xx,
bool smoothScrolling,
bool seek);
61 bool MaybeStartScrubbing(wxCoord xx);
62 bool StartKeyboardScrubbing(
double time0,
bool backwards);
63 double GetKeyboardScrubbingSpeed();
65 void ContinueScrubbingUI();
66 void ContinueScrubbingPoll();
72 {
return mScrubStartPosition; }
75 {
return mSpeedPlaying;}
77 {
return IsScrubbing() && mSpeedPlaying; }
79 {
return mKeyboardScrubbing; }
81 {
return IsScrubbing() && mKeyboardScrubbing; }
83 { mBackwards = backwards;}
89 {
return GetScrubStartPosition() >= 0; }
90 bool IsScrubbing()
const;
93 {
return mSmoothScrollingScrub; }
95 { mSmoothScrollingScrub = value; }
97 bool ChoseSeeking()
const;
100 bool TemporarilySeeks()
const;
103 bool ShowsBar()
const;
106 { mCancelled =
true; }
108 bool ShouldDrawScrubSpeed();
109 double FindScrubSpeed(
bool seeking,
double time)
const;
112 void HandleScrollWheel(
int steps);
115 bool CanScrub()
const;
118 void PopulatePopupMenu(wxMenu &menu);
120 void OnScrubOrSeek(
bool seek);
127 void DoKeyboardScrub(
bool backwards,
bool keyUp);
130 template<
void (Scrubber::*pfn)(const CommandContext&)>
132 { (this->*pfn)(*mProject); }
137 wxString StatusMessageForWave()
const;
139 void Pause(
bool paused);
140 bool IsPaused()
const;
141 void CheckMenuItems();
143 bool IsTransportingPinned()
const;
153 void DoScrub(
bool seek);
154 void OnActivateOrDeactivateApp(wxActivateEvent & event);
163 wxCoord mLastScrubPosition {};
164 bool mScrubSeekPress {};
169 bool mSpeedPlaying{
true};
170 bool mKeyboardScrubbing{};
180 DECLARE_EVENT_TABLE()
182#ifdef USE_SCRUB_THREAD
186 std::atomic<bool> mFinishThread{
false };
195 double mMaxSpeed { 1.0 };
197 bool mShowScrubbing {
false };
198 bool mMayDragToSeek{
false };
Utility ClientData::Site to register hooks into a host class that attach client data.
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
A listener notified of changes in preferences.
virtual void UpdatePrefs()=0
bool IsKeyboardScrubbing() const
Scrubber & operator=(const Scrubber &)=delete
Scrubber(const Scrubber &)=delete
double GetMaxScrubSpeed() const
bool IsScrollScrubbing() const
wxCoord mScrubStartPosition
bool mSmoothScrollingScrub
std::unique_ptr< ScrubPoller > mPoller
bool WasKeyboardScrubbing() const
int mScrubSpeedDisplayCountdown
AudacityProject * mProject
void SetBackwards(bool backwards)
ScrubbingOptions mOptions
void SetSeekPress(bool value)
bool MayDragToSeek() const
bool WasSpeedPlaying() const
bool IsSpeedPlaying() const
void SetScrollScrubbing(bool value)
wxCoord GetScrubStartPosition() const
void SetMayDragToSeek(bool value)
void Thunk(wxCommandEvent &)
Holds a msgid for the translation catalog; may also bind format arguments.
Services * Get()
Fetch the global instance, or nullptr if none is yet installed.
A convenient default parameter for class template Site.