aboutsummaryrefslogtreecommitdiff
path: root/DvdLib/Ifo/DvdTime.cs
diff options
context:
space:
mode:
authorDominik <git@secnd.me>2023-06-15 19:38:42 +0200
committerGitHub <noreply@github.com>2023-06-15 19:38:42 +0200
commit17f1e8d19b1fd693893d66d2275ed8ae2476344e (patch)
tree7f48be975faa92042769870957587b3c7864f631 /DvdLib/Ifo/DvdTime.cs
parente8ae7e5c38e28f13fa8de295e26c930cb46d9b79 (diff)
parent6771b5cabe96b4b3cbd1cd0c998d564f3dd17ed4 (diff)
Merge branch 'master' into segment-deletion
Diffstat (limited to 'DvdLib/Ifo/DvdTime.cs')
-rw-r--r--DvdLib/Ifo/DvdTime.cs39
1 files changed, 0 insertions, 39 deletions
diff --git a/DvdLib/Ifo/DvdTime.cs b/DvdLib/Ifo/DvdTime.cs
deleted file mode 100644
index d23140610..000000000
--- a/DvdLib/Ifo/DvdTime.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-#pragma warning disable CS1591
-
-using System;
-
-namespace DvdLib.Ifo
-{
- public class DvdTime
- {
- public readonly byte Hour, Minute, Second, Frames, FrameRate;
-
- public DvdTime(byte[] data)
- {
- Hour = GetBCDValue(data[0]);
- Minute = GetBCDValue(data[1]);
- Second = GetBCDValue(data[2]);
- Frames = GetBCDValue((byte)(data[3] & 0x3F));
-
- if ((data[3] & 0x80) != 0)
- {
- FrameRate = 30;
- }
- else if ((data[3] & 0x40) != 0)
- {
- FrameRate = 25;
- }
- }
-
- private static byte GetBCDValue(byte data)
- {
- return (byte)((((data & 0xF0) >> 4) * 10) + (data & 0x0F));
- }
-
- public static explicit operator TimeSpan(DvdTime time)
- {
- int ms = (int)(((1.0 / (double)time.FrameRate) * time.Frames) * 1000.0);
- return new TimeSpan(0, time.Hour, time.Minute, time.Second, ms);
- }
- }
-}