Audacity 3.2.0
Functions
anonymous_namespace{ClipParameters.cpp} Namespace Reference

Functions

double CalculateAdjustmentForZoomLevel (double avgPixPerSecond, bool showSamples)
 
double GetPixelsPerSecond (const wxRect &viewRect, const ZoomInfo &zoomInfo)
 
bool ShowIndividualSamples (int sampleRate, double stretchRatio, double pixelsPerSecond)
 
double GetBlankSpaceBeforePlayEndTime (const ClipTimes &clip)
 

Function Documentation

◆ CalculateAdjustmentForZoomLevel()

double anonymous_namespace{ClipParameters.cpp}::CalculateAdjustmentForZoomLevel ( double  avgPixPerSecond,
bool  showSamples 
)

Definition at line 19 of file ClipParameters.cpp.

20{
21 constexpr double pixelsOffset { 2 }; // The desired offset in pixels
22 if (showSamples)
23 // adjustment so that the last circular point doesn't appear
24 // to be hanging off the end
25 return pixelsOffset /
26 avgPixPerSecond; // pixels / ( pixels / second ) = seconds
27 return .0;
28}

Referenced by ClipParameters::ClipParameters(), and ClipParameters::GetClipRect().

Here is the caller graph for this function:

◆ GetBlankSpaceBeforePlayEndTime()

double anonymous_namespace{ClipParameters.cpp}::GetBlankSpaceBeforePlayEndTime ( const ClipTimes clip)

Definition at line 45 of file ClipParameters.cpp.

46{
47 return 0.99 * clip.GetStretchRatio() / clip.GetRate();
48}
virtual int GetRate() const =0
virtual double GetStretchRatio() const =0

References ClipTimes::GetRate(), and ClipTimes::GetStretchRatio().

Referenced by ClipParameters::ClipParameters(), and ClipParameters::GetClipRect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetPixelsPerSecond()

double anonymous_namespace{ClipParameters.cpp}::GetPixelsPerSecond ( const wxRect &  viewRect,
const ZoomInfo zoomInfo 
)

Definition at line 30 of file ClipParameters.cpp.

31{
32 const auto h = zoomInfo.PositionToTime(0, 0, true);
33 const auto trackRectT1 = zoomInfo.PositionToTime(viewRect.width, 0, true);
34 return viewRect.width / (trackRectT1 - h);
35}
double PositionToTime(int64 position, int64 origin=0, bool ignoreFisheye=false) const
Definition: ZoomInfo.cpp:34

References ZoomInfo::PositionToTime().

Referenced by ClipParameters::GetClipRect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ShowIndividualSamples()

bool anonymous_namespace{ClipParameters.cpp}::ShowIndividualSamples ( int  sampleRate,
double  stretchRatio,
double  pixelsPerSecond 
)

Definition at line 37 of file ClipParameters.cpp.

39{
40 const auto secondsPerSample = stretchRatio / sampleRate;
41 const auto pixelsPerSample = pixelsPerSecond * secondsPerSample;
42 return pixelsPerSample > 0.5;
43}

References anonymous_namespace{ClipSegmentTest.cpp}::sampleRate.

Referenced by ClipParameters::GetClipRect().

Here is the caller graph for this function: