Audacity 3.2.0
Classes | Functions | Variables
anonymous_namespace{WaveTrackView.cpp} Namespace Reference

Classes

struct  PlacementArray
 

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)
 

Variables

static const Track::ChannelGroupAttachments::RegisteredFactory key { [](auto &) { return std::make_unique<PlacementArray>(); } }
 

Function Documentation

◆ CalculateAdjustmentForZoomLevel()

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

Definition at line 1527 of file WaveTrackView.cpp.

1534 {
1535 static constexpr double pixelsOffset{ 2 };//The desired offset in pixels
1536
1537 auto h = zoomInfo.PositionToTime(0, 0, true);
1538 auto h1 = zoomInfo.PositionToTime(viewRect.width, 0, true);
1539
1540 // Determine whether we should show individual samples
1541 // or draw circular points as well
1542 outAveragePPS = viewRect.width / (rate * (h1 - h));// pixels per sample
1543 outShowSamples = outAveragePPS > 0.5;
1544
1545 if(outShowSamples)
1546 // adjustment so that the last circular point doesn't appear
1547 // to be hanging off the end
1548 return pixelsOffset / (outAveragePPS * rate); // pixels / ( pixels / second ) = seconds
1549 return .0;
1550 }
double PositionToTime(int64 position, int64 origin=0, bool ignoreFisheye=false) const
Definition: ZoomInfo.cpp:35

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 1144 of file WaveTrackView.cpp.

1145 {
1146 auto it = WaveTrackUtils::SelectedClip(viewInfo, begin, end);
1147 if (it == end)
1148 it = std::find_if(begin, end, comp);
1149 else
1150 it = std::next(it);
1151
1152 if (it == end)
1153 return *begin;
1154 return *it;
1155 }
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:

Variable Documentation

◆ key

const Track::ChannelGroupAttachments::RegisteredFactory anonymous_namespace{WaveTrackView.cpp}::key { [](auto &) { return std::make_unique<PlacementArray>(); } }
static