21 constexpr double pixelsOffset { 2 };
33 const auto trackRectT1 = zoomInfo.
PositionToTime(viewRect.width, 0,
true);
34 return viewRect.width / (trackRectT1 - h);
38 int sampleRate,
double stretchRatio,
double pixelsPerSecond)
40 const auto secondsPerSample = stretchRatio /
sampleRate;
41 const auto pixelsPerSample = pixelsPerSecond * secondsPerSample;
42 return pixelsPerSample > 0.5;
53 : trackRectT0 { zoomInfo.PositionToTime(0, 0, true) }
56 clip.
GetRate(), clip.GetStretchRatio(), averagePixelsPerSecond) }
58 const auto trackRectT1 = zoomInfo.
PositionToTime(rect.width, 0,
true);
66 const auto tpost = trackRectT1 - playStartTime;
72 t0 = std::max(tpre, .0);
119 const int hiddenRightOffset =
120 (time64 < rect.width) ? (
int)time64 : rect.width;
135 wxInt64 time64 = zoomInfo.
TimeToPosition(playStartTime, 0,
false);
138 leftOffset = (time64 < rect.width) ? (
int)time64 : rect.width;
153 const int distortedRightOffset =
154 (time64 < rect.width) ? (
int)time64 : rect.width;
162 bool* outShowSamples)
167 const auto clipEndingAdjustment =
169 if (outShowSamples !=
nullptr)
171 constexpr auto edgeLeft =
173 constexpr auto edgeRight =
175 const auto left = std::clamp(
177 edgeLeft, edgeRight);
178 const auto right = std::clamp(
181 clipEndingAdjustment,
183 edgeLeft, edgeRight);
189 static_cast<int>(left), viewRect.y,
190 std::max(1,
static_cast<int>(right - left)), viewRect.height);
virtual double GetPlayEndTime() const =0
virtual int GetRate() const =0
virtual double GetStretchRatio() const =0
virtual double GetPlayStartTime() const =0
double PositionToTime(int64 position, int64 origin=0, bool ignoreFisheye=false) const
int64 TimeToPosition(double time, int64 origin=0, bool ignoreFisheye=false) const
STM: Converts a project time to screen x position.
bool ShowIndividualSamples(int sampleRate, double stretchRatio, double pixelsPerSecond)
double GetBlankSpaceBeforePlayEndTime(const ClipTimes &clip)
double CalculateAdjustmentForZoomLevel(double avgPixPerSecond, bool showSamples)
double GetPixelsPerSecond(const wxRect &viewRect, const ZoomInfo &zoomInfo)
constexpr auto sampleRate
double GetRate(const Track &track)
ClipParameters(const ClipTimes &clip, const wxRect &rect, const ZoomInfo &zoomInfo)
static wxRect GetClipRect(const ClipTimes &clip, const ZoomInfo &zoomInfo, const wxRect &viewRect, bool *outShowSamples=nullptr)
const double averagePixelsPerSecond
const bool showIndividualSamples