153{
154
159 }
160
162 auto width = viewInfo.GetTracksUsableWidth();
163
168 if (scrubber.HasMark()) {
169 auto position = scrubber.GetScrubStartPosition();
170 const auto offset = viewInfo.GetLeftOffset();
171 if(position >= viewInfo.GetLeftOffset() &&
172 position < offset + width)
174 }
175 }
176 else {
178 auto &scroller = window.GetPlaybackScroller();
179
180 const double playPos = scroller.GetRecentStreamTime();
181
183 const Mode mode = scroller.GetMode();
184 const bool pinned = ( mode == Mode::Pinned || mode == Mode::Right );
185
186
187
188 const auto tolerance = pinned
190 : 0;
191 bool onScreen = playPos >= 0.0 &&
193 playPos,
194 viewInfo.GetScreenEndTime() + tolerance);
195
198
199
200 if( viewInfo.bUpdateTrackIndicator &&
201 playPos >= 0 && !onScreen ) {
202
203
205 if (!pinned &&
207 !gAudioIO->IsPaused() &&
208
209
210
211
212 (!scrubber.IsScrubbing() || !scrubber.IsPaused())
213 )
214 {
215 auto newPos = playPos;
216 if (playPos < viewInfo.h) {
217
218
219
220
221 newPos = viewInfo.OffsetTimeByPixels( newPos, -width );
222 newPos = std::max( newPos, window.ScrollingLowerBoundTime() );
223 }
224 window.TP_ScrollWindow(newPos);
225
226 onScreen = playPos >= 0.0 &&
228 playPos,
229 viewInfo.GetScreenEndTime());
230 }
231 }
232
233
234
235
236 window.TP_RedrawScrollbars();
237
238 if (onScreen)
240 viewInfo.TimeToPosition(playPos, viewInfo.GetLeftOffset());
241 else
243
245 }
246
249}
constexpr auto kTimerInterval
static AdornedRulerPanel & Get(AudacityProject &project)
std::shared_ptr< PlayIndicatorOverlayBase > mPartner
bool IsAudioActive() const
static ProjectAudioIO & Get(AudacityProject &project)
static ProjectAudioManager & Get(AudacityProject &project)
PlayMode GetLastPlayMode() const
static Scrubber & Get(AudacityProject &project)
static ViewInfo & Get(AudacityProject &project)
bool between_incexc(LOW l, MID m, HIGH h)