MCPcopy Create free account
hub / github.com/TypesettingTools/Aegisub / OnPlaybackTimer

Method OnPlaybackTimer

src/audio_controller.cpp:62–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62void AudioController::OnPlaybackTimer(wxTimerEvent &)
63{
64 if (!player) return;
65
66 int64_t pos = player->GetCurrentPosition();
67 if (!player->IsPlaying() ||
68 (playback_mode != PM_ToEnd && pos >= player->GetEndPosition()+200))
69 {
70 // The +200 is to allow the player to end the sound output cleanly,
71 // otherwise a popping artifact can sometimes be heard.
72 Stop();
73 }
74 else
75 {
76 AnnouncePlaybackPosition(MillisecondsFromSamples(pos));
77 }
78}
79
80#ifdef wxHAS_POWER_EVENTS
81void AudioController::OnComputerSuspending(wxPowerEvent &)

Callers

nothing calls this directly

Calls 3

GetCurrentPositionMethod · 0.45
IsPlayingMethod · 0.45
GetEndPositionMethod · 0.45

Tested by

no test coverage detected