MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / GetPosition

Method GetPosition

TombEngine/Specific/Video/Video.cpp:20–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18 static const std::vector<std::string> VIDEO_EXTENSIONS = { ".mp4", ".avi", ".mkv", ".mov" };
19
20 int VideoHandler::GetPosition() const
21 {
22 if (_player == nullptr)
23 return 0;
24
25 auto* media = libvlc_media_player_get_media(_player);
26 long long duration = libvlc_media_get_duration(media);
27 float posNormalized = GetNormalizedPosition();
28
29 // Convert and return position in frames.
30 long long posMsec = posNormalized * duration;
31 return (int)((posMsec / 1000.0f) * FPS);
32 }
33
34 float VideoHandler::GetNormalizedPosition() const
35 {

Callers 5

DoSnowEffectFunction · 0.45
GetPushableSoundIDFunction · 0.45
IsValidForPlayerFunction · 0.45
ControlTeleporterFunction · 0.45
ControlSpikyWallFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected