1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-14 17:14:07 +01:00

Move some static functions into ScrubbingOptions

This commit is contained in:
Paul Licameli
2016-05-19 19:16:13 -04:00
parent 8ed93b8147
commit 671f60492d
4 changed files with 17 additions and 9 deletions

View File

@@ -314,7 +314,7 @@ bool Scrubber::MaybeStartScrubbing(wxCoord xx)
// That idea seems unpopular... just make it one for move-scrub,
// but big for drag-scrub
mMaxScrubSpeed = options.maxScrubSpeed =
mDragging ? AudioIO::GetMaxScrubSpeed() : 1.0;
mDragging ? ScrubbingOptions::MaxAllowedScrubSpeed() : 1.0;
#endif
options.maxScrubTime = mProject->GetTracks()->GetEndTime();
ControlToolBar::PlayAppearance appearance =
@@ -502,8 +502,8 @@ void Scrubber::HandleScrollWheel(int steps)
static const double maxScrubSpeedBase =
pow(2.0, 1.0 / ScrubSpeedStepsPerOctave);
double newSpeed = pow(maxScrubSpeedBase, newLogMaxScrubSpeed);
if (newSpeed >= AudioIO::GetMinScrubSpeed() &&
newSpeed <= AudioIO::GetMaxScrubSpeed()) {
if (newSpeed >= ScrubbingOptions::MinAllowedScrubSpeed() &&
newSpeed <= ScrubbingOptions::MaxAllowedScrubSpeed()) {
mLogMaxScrubSpeed = newLogMaxScrubSpeed;
mMaxScrubSpeed = newSpeed;
if (!mSmoothScrollingScrub)

View File

@@ -28,6 +28,11 @@ struct ScrubbingOptions {
bool adjustStart {};
bool enqueueBySpeed {};
static double MaxAllowedScrubSpeed()
{ return 32.0; } // Is five octaves enough for your amusement?
static double MinAllowedScrubSpeed()
{ return 0.01; } // Mixer needs a lower bound speed. Scrub no slower than this.
};
// Scrub state object