初始化

This commit is contained in:
xhm
2023-11-21 23:05:03 +08:00
commit 2455630dad
2252 changed files with 466529 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
namespace CPF.Mac.QTKit
{
public struct QTTime
{
public static readonly QTTime Zero = new QTTime(0L, 1, (TimeFlags)0);
public static readonly QTTime IndefiniteTime = new QTTime(0L, 1, TimeFlags.TimeIsIndefinite);
public long TimeValue;
public int TimeScale;
public TimeFlags Flags;
public QTTime(long timeValue, int timeScale, TimeFlags flags)
{
TimeValue = timeValue;
TimeScale = timeScale;
Flags = flags;
}
public QTTime(long timeValue, int timeScale)
{
TimeValue = timeValue;
TimeScale = timeScale;
Flags = (TimeFlags)0;
}
public override string ToString()
{
if (Flags == (TimeFlags)0)
{
return $"[TimeValue={TimeValue} scale={TimeScale}]";
}
return $"[TimeValue={TimeValue} scale={TimeScale} Flags={Flags}]";
}
}
}

View File

@@ -0,0 +1,20 @@
namespace CPF.Mac.QTKit
{
public struct QTTimeRange
{
public QTTime Time;
public QTTime Duration;
public QTTimeRange(QTTime time, QTTime duration)
{
Time = time;
Duration = duration;
}
public override string ToString()
{
return string.Format("[Time={0} Duration={2}]", Time, Duration);
}
}
}

View File

@@ -0,0 +1,10 @@
using System;
namespace CPF.Mac.QTKit
{
[Flags]
public enum TimeFlags
{
TimeIsIndefinite = 0x1
}
}