mirror of
https://gitee.com/csharpui/CPF.git
synced 2026-01-09 18:04:50 +08:00
初始化
This commit is contained in:
38
CPF.Mac/Mac/QTKit/QTTime.cs
Normal file
38
CPF.Mac/Mac/QTKit/QTTime.cs
Normal 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}]";
|
||||
}
|
||||
}
|
||||
}
|
||||
20
CPF.Mac/Mac/QTKit/QTTimeRange.cs
Normal file
20
CPF.Mac/Mac/QTKit/QTTimeRange.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
10
CPF.Mac/Mac/QTKit/TimeFlags.cs
Normal file
10
CPF.Mac/Mac/QTKit/TimeFlags.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
|
||||
namespace CPF.Mac.QTKit
|
||||
{
|
||||
[Flags]
|
||||
public enum TimeFlags
|
||||
{
|
||||
TimeIsIndefinite = 0x1
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user