11#ifndef __AUDACITY_SCRUBBING__
12#define __AUDACITY_SCRUBBING__
17#include <wx/longlong.h>
19#include "../../ScrubState.h"
22#include "../../widgets/Overlay.h"
35#define USE_SCRUB_THREAD
43 ,
public std::enable_shared_from_this< Scrubber >
55 static bool ShouldScrubPinned();
58 void MarkScrubStart(wxCoord xx,
bool smoothScrolling,
bool seek);
62 bool MaybeStartScrubbing(wxCoord xx);
63 bool StartKeyboardScrubbing(
double time0,
bool backwards);
64 double GetKeyboardScrubbingSpeed();
66 void ContinueScrubbingUI();
67 void ContinueScrubbingPoll();
73 {
return mScrubStartPosition; }
76 {
return mSpeedPlaying;}
78 {
return IsScrubbing() && mSpeedPlaying; }
80 {
return mKeyboardScrubbing; }
82 {
return IsScrubbing() && mKeyboardScrubbing; }
84 { mBackwards = backwards;}
90 {
return GetScrubStartPosition() >= 0; }
91 bool IsScrubbing()
const;
94 {
return mSmoothScrollingScrub; }
96 { mSmoothScrollingScrub = value; }
98 bool ChoseSeeking()
const;
101 bool TemporarilySeeks()
const;
104 bool ShowsBar()
const;
107 { mCancelled =
true; }
109 bool ShouldDrawScrubSpeed();
110 double FindScrubSpeed(
bool seeking,
double time)
const;
113 void HandleScrollWheel(
int steps);
116 bool CanScrub()
const;
119 void PopulatePopupMenu(wxMenu &menu);
121 void OnScrubOrSeek(
bool seek);
128 void DoKeyboardScrub(
bool backwards,
bool keyUp);
131 template<
void (Scrubber::*pfn)(const CommandContext&)>
133 { (this->*pfn)(*mProject); }
138 wxString StatusMessageForWave()
const;
140 void Pause(
bool paused);
141 bool IsPaused()
const;
142 void CheckMenuItems();
144 bool IsTransportingPinned()
const;
154 void DoScrub(
bool seek);
155 void OnActivateOrDeactivateApp(wxActivateEvent & event);
164 wxCoord mLastScrubPosition {};
165 bool mScrubSeekPress {};
170 bool mSpeedPlaying{
true};
171 bool mKeyboardScrubbing{};
181 DECLARE_EVENT_TABLE()
183#ifdef USE_SCRUB_THREAD
187 std::atomic<bool> mFinishThread{
false };
196 double mMaxSpeed { 1.0 };
198 bool mShowScrubbing {
false };
199 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.