Audacity 3.2.0
Classes | Namespaces | Typedefs | Enumerations | Functions | Variables
Scrubbing.cpp File Reference
#include "Scrubbing.h"
#include <functional>
#include <thread>
#include "../../AudioIO.h"
#include "../../CommonCommandFlags.h"
#include "Project.h"
#include "../../ProjectAudioIO.h"
#include "../../ProjectAudioManager.h"
#include "ProjectHistory.h"
#include "../../ProjectWindows.h"
#include "ProjectStatus.h"
#include "../../ScrubState.h"
#include "Track.h"
#include "ViewInfo.h"
#include "../../WaveTrack.h"
#include "../../prefs/PlaybackPrefs.h"
#include "../../prefs/TracksPrefs.h"
#include "../../toolbars/ToolManager.h"
#include <algorithm>
#include <wx/app.h>
#include <wx/menu.h>
Include dependency graph for Scrubbing.cpp:

Go to the source code of this file.

Classes

class  Scrubber::ScrubPoller
 
struct  anonymous_namespace{Scrubbing.cpp}::MenuItem
 

Namespaces

namespace  anonymous_namespace{Scrubbing.cpp}
 

Typedefs

using anonymous_namespace{Scrubbing.cpp}::MenuItems = std::vector< MenuItem >
 

Enumerations

enum  { SCRUBBING_PIXEL_TOLERANCE = 10 , kOneSecondCountdown }
 

Functions

double anonymous_namespace{Scrubbing.cpp}::FindScrubbingSpeed (const ViewInfo &viewInfo, double maxScrubSpeed, double screen, double timeAtMouse)
 
double anonymous_namespace{Scrubbing.cpp}::FindSeekSpeed (const ViewInfo &viewInfo, double maxScrubSpeed, double screen, double timeAtMouse)
 
static const ReservedCommandFlagHasWaveDataFlag ()
 
const MenuItemsanonymous_namespace{Scrubbing.cpp}::menuItems ()
 
const MenuItemanonymous_namespace{Scrubbing.cpp}::FindMenuItem (bool seek)
 
static AudioIOStartStreamOptions::PolicyFactory ScrubbingPlaybackPolicyFactory (const ScrubbingOptions &options)
 

Variables

static constexpr PlaybackPolicy::Duration MinStutter {0.2}
 
static const AudacityProject::AttachedObjects::RegisteredFactory key
 
static const auto HasWaveDataPred
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SCRUBBING_PIXEL_TOLERANCE 
kOneSecondCountdown 

Definition at line 45 of file Scrubbing.cpp.

45 {
46 // PRL:
47 // Mouse must move at least this far to distinguish ctrl-drag to scrub
48 // from ctrl+click for playback.
50
51#ifdef EXPERIMENTAL_SCRUBBING_SCROLL_WHEEL
52 ScrubSpeedStepsPerOctave = 4,
53#endif
54
56 1000 / std::chrono::milliseconds{ScrubPollInterval}.count(),
57};
static constexpr auto ScrubPollInterval
Definition: ScrubState.h:109
@ SCRUBBING_PIXEL_TOLERANCE
Definition: Scrubbing.cpp:49
@ kOneSecondCountdown
Definition: Scrubbing.cpp:55

Function Documentation

◆ HasWaveDataFlag()

static const ReservedCommandFlag & HasWaveDataFlag ( )
static

Definition at line 253 of file Scrubbing.cpp.

253 { static ReservedCommandFlag flag{
255}; return flag; } // jkc
static const auto HasWaveDataPred
Definition: Scrubbing.cpp:243
static std::once_flag flag

References flag, and HasWaveDataPred.

Referenced by anonymous_namespace{Scrubbing.cpp}::menuItems().

Here is the caller graph for this function:

◆ ScrubbingPlaybackPolicyFactory()

static AudioIOStartStreamOptions::PolicyFactory ScrubbingPlaybackPolicyFactory ( const ScrubbingOptions options)
static

Definition at line 350 of file Scrubbing.cpp.

351{
352 return [options](auto&) -> std::unique_ptr<PlaybackPolicy>
353 {
354 return std::make_unique<ScrubbingPlaybackPolicy>(options);
355 };
356}

Variable Documentation

◆ HasWaveDataPred

const auto HasWaveDataPred
static
Initial value:
=
[](const AudacityProject &project){
auto range = TrackList::Get( project ).Any<const WaveTrack>()
+ [](const WaveTrack *pTrack){
return pTrack->GetEndTime() > pTrack->GetStartTime();
};
return !range.empty();
}
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:89
auto Any() -> TrackIterRange< TrackType >
Definition: Track.h:1429
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:467
A Track that contains audio waveform data.
Definition: WaveTrack.h:57
double GetStartTime() const override
Get the time at which the first clip in the track starts.
Definition: WaveTrack.cpp:1995
double GetEndTime() const override
Get the time at which the last clip in the track ends, plus recorded stuff.
Definition: WaveTrack.cpp:2015

Definition at line 243 of file Scrubbing.cpp.

Referenced by HasWaveDataFlag().

◆ key

Initial value:
{
[]( AudacityProject &parent ){
return std::make_shared< Scrubber >( &parent ); }
}

Definition at line 197 of file Scrubbing.cpp.

Referenced by Scrubber::Get().

◆ MinStutter

constexpr PlaybackPolicy::Duration MinStutter {0.2}
staticconstexpr

Definition at line 59 of file Scrubbing.cpp.