---------------------------------------------------------------------------
| 819 | |
| 820 | //--------------------------------------------------------------------------- |
| 821 | int64_t TimeCode::ToFrames() const |
| 822 | { |
| 823 | if (!IsSet()) |
| 824 | return 0; |
| 825 | |
| 826 | int64_t TC = (int64_t(GetHours()) * 3600 |
| 827 | + int64_t(GetMinutes()) * 60 |
| 828 | + int64_t(GetSeconds())) * ((int64_t)GetFramesMax() + 1); |
| 829 | |
| 830 | if (IsDropFrame() && GetFramesMax()) |
| 831 | { |
| 832 | int64_t Dropped = 1 + (int64_t)(GetFramesMax() / 30); |
| 833 | |
| 834 | TC -= int64_t(GetHours()) * 108 * Dropped |
| 835 | + (int64_t(GetMinutes()) / 10) * 18 * Dropped |
| 836 | + (int64_t(GetMinutes()) % 10) * 2 * Dropped; |
| 837 | } |
| 838 | TC += GetFrames(); |
| 839 | if (IsNegative()) |
| 840 | TC = -TC; |
| 841 | |
| 842 | return TC; |
| 843 | } |
| 844 | |
| 845 | //--------------------------------------------------------------------------- |
| 846 | int64_t TimeCode::ToMilliseconds() const |
no outgoing calls
no test coverage detected