Audacity 3.2.0
Functions
anonymous_namespace{WaveTrackView.cpp} Namespace Reference

Functions

template<typename Iter , typename Comp >
const WaveClipNextClipLooped (ViewInfo &viewInfo, Iter begin, Iter end, Comp comp)
 
double CalculateAdjustmentForZoomLevel (const wxRect &viewRect, const ZoomInfo &zoomInfo, int rate, double &outAveragePPS, bool &outShowSamples)
 

Function Documentation

◆ CalculateAdjustmentForZoomLevel()

double anonymous_namespace{WaveTrackView.cpp}::CalculateAdjustmentForZoomLevel ( const wxRect &  viewRect,
const ZoomInfo zoomInfo,
int  rate,
double &  outAveragePPS,
bool &  outShowSamples 
)

Definition at line 1472 of file WaveTrackView.cpp.

1479 {
1480 static constexpr double pixelsOffset{ 2 };//The desired offset in pixels
1481
1482 auto h = zoomInfo.PositionToTime(0, 0, true);
1483 auto h1 = zoomInfo.PositionToTime(viewRect.width, 0, true);
1484
1485 // Determine whether we should show individual samples
1486 // or draw circular points as well
1487 outAveragePPS = viewRect.width / (rate * (h1 - h));// pixels per sample
1488 outShowSamples = outAveragePPS > 0.5;
1489
1490 if(outShowSamples)
1491 // adjustment so that the last circular point doesn't appear
1492 // to be hanging off the end
1493 return pixelsOffset / (outAveragePPS * rate); // pixels / ( pixels / second ) = seconds
1494 return .0;
1495 }
double PositionToTime(wxInt64 position, wxInt64 origin=0, bool ignoreFisheye=false) const
Definition: ZoomInfo.cpp:41

References ZoomInfo::PositionToTime().

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

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

◆ NextClipLooped()

template<typename Iter , typename Comp >
const WaveClip * anonymous_namespace{WaveTrackView.cpp}::NextClipLooped ( ViewInfo viewInfo,
Iter  begin,
Iter  end,
Comp  comp 
)

Definition at line 1091 of file WaveTrackView.cpp.

1092 {
1093 auto it = WaveTrackUtils::SelectedClip(viewInfo, begin, end);
1094 if (it == end)
1095 it = std::find_if(begin, end, comp);
1096 else
1097 it = std::next(it);
1098
1099 if (it == end)
1100 return *begin;
1101 return *it;
1102 }
auto end(const Ptr< Type, BaseDeleter > &p)
Enables range-for.
Definition: PackedArray.h:159
auto begin(const Ptr< Type, BaseDeleter > &p)
Enables range-for.
Definition: PackedArray.h:150
Iter SelectedClip(const ViewInfo &viewInfo, Iter begin, Iter end)

References PackedArray::begin(), PackedArray::end(), and WaveTrackUtils::SelectedClip().

Referenced by WaveTrackView::SelectNextClip().

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