11#ifndef __AUDACITY_SCRUBBING__
12#define __AUDACITY_SCRUBBING__
16#include <wx/longlong.h>
18#include "../../ScrubState.h"
21#include "../../widgets/Overlay.h"
22#include "../../commands/CommandContext.h"
23#include "../../commands/CommandManager.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);
73 {
return mScrubStartPosition; }
76 {
return mSpeedPlaying;}
78 {
return IsScrubbing() && mSpeedPlaying; }
80 {
return mKeyboardScrubbing; }
82 {
return IsScrubbing() && mKeyboardScrubbing; }
84 { mBackwards = backwards;}
90 {
return GetScrubStartPosition() >= 0; }
94 {
return mSmoothScrollingScrub; }
96 { mSmoothScrollingScrub = value; }
107 { mCancelled =
true; }
131 template<
void (Scrubber::*pfn)(const CommandContext&)>
133 { (this->*pfn)(*mProject); }
164 wxCoord mLastScrubPosition {};
165 bool mScrubSeekPress {};
170 bool mSpeedPlaying{
true};
171 bool mKeyboardScrubbing{};
177#ifdef EXPERIMENTAL_SCRUBBING_SCROLL_WHEEL
178 int mLogMaxScrubSpeed;
183 DECLARE_EVENT_TABLE()
185#ifdef USE_SCRUB_THREAD
189 std::atomic<bool> mFinishThread{
false };
198 double mMaxSpeed { 1.0 };
200 bool mShowScrubbing {
false };
201 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.
void ContinueScrubbingUI()
bool ShouldDrawScrubSpeed()
bool IsKeyboardScrubbing() const
void DoKeyboardScrub(bool backwards, bool keyUp)
Scrubber(const Scrubber &) PROHIBITED
double GetKeyboardScrubbingSpeed()
void HandleScrollWheel(int steps)
bool MaybeStartScrubbing(wxCoord xx)
double GetMaxScrubSpeed() const
bool IsScrollScrubbing() const
wxCoord mScrubStartPosition
bool mSmoothScrollingScrub
void OnToggleScrubRuler(const CommandContext &)
bool ChoseSeeking() const
bool TemporarilySeeks() const
std::unique_ptr< ScrubPoller > mPoller
bool WasKeyboardScrubbing() const
void OnActivateOrDeactivateApp(wxActivateEvent &event)
int mScrubSpeedDisplayCountdown
AudacityProject * mProject
void SetBackwards(bool backwards)
void UpdatePrefs() override
ScrubbingOptions mOptions
const TranslatableString & GetUntranslatedStateString() const
void SetSeekPress(bool value)
void OnSeek(const CommandContext &)
bool StartKeyboardScrubbing(double time0, bool backwards)
void OnScrub(const CommandContext &)
void OnKeyboardScrubForwards(const CommandContext &)
bool MayDragToSeek() const
bool WasSpeedPlaying() const
bool IsSpeedPlaying() const
void ContinueScrubbingPoll()
void OnKeyboardScrubBackwards(const CommandContext &)
bool IsTransportingPinned() const
void OnScrubOrSeek(bool seek)
void PopulatePopupMenu(wxMenu &menu)
void SetScrollScrubbing(bool value)
Scrubber & operator=(const Scrubber &) PROHIBITED
wxString StatusMessageForWave() const
double FindScrubSpeed(bool seeking, double time) const
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.