---------------------------------------------------------------------------
| 858 | |
| 859 | //--------------------------------------------------------------------------- |
| 860 | double TimeCode::ToSeconds(bool TimeIsDropFrame) const |
| 861 | { |
| 862 | if (!IsSet()) |
| 863 | return 0; |
| 864 | |
| 865 | const auto FrameRate = (int64_t)GetFramesMax() + 1; |
| 866 | double Result; |
| 867 | if (TimeIsDropFrame) |
| 868 | { |
| 869 | auto SecondsTotal = GetHours() * 3600 |
| 870 | + GetMinutes() * 60 |
| 871 | + GetSeconds(); |
| 872 | const auto Frames = SecondsTotal * FrameRate + GetFrames(); |
| 873 | Result = ((double)Frames) / FrameRate; |
| 874 | } |
| 875 | else |
| 876 | { |
| 877 | Result = ((double)ToFrames()) / FrameRate; |
| 878 | if (Is1001fps()) |
| 879 | Result *= 1.001; |
| 880 | } |
| 881 | if (IsNegative()) |
| 882 | Result = -Result; |
| 883 | |
| 884 | return Result; |
| 885 | } |
| 886 | |
| 887 | //*************************************************************************** |
| 888 | // |
no outgoing calls
no test coverage detected