Safe Haskell | None |
---|---|
Language | Haskell2010 |
Time and timing utilities.
- referenceTime :: UTCTime
- utcToMp4 :: Num t => UTCTime -> t
- mp4CurrentTime :: Num t => IO t
- durationFromSeconds :: Num t => TimeScale -> Integer -> t
- oneSecond32 :: TimeScale -> TS32 label
- oneSecond64 :: TimeScale -> TS64 label
- diffTimeToTicks :: Integral t => NominalDiffTime -> TimeScale -> t
- ticksToDiffTime :: Integral t => t -> TimeScale -> NominalDiffTime
- newtype TimeScale = TimeScale Word32
- type Timing version = Versioned TimingV0 TimingV1 version
- data TS version label where
- type TS32 = Scalar Word32
- type TS64 = Scalar Word64
- newtype Ticks timeScale = MkTicks Word64
- newtype Ticks32 timeScale = MkTicks32 Word32
Documentation
referenceTime :: UTCTime Source #
According to the standard, fields with absolute dates and times are in seconds since 19040101 at midnight (UTC). This is this reference time.
utcToMp4 :: Num t => UTCTime -> t Source #
Convert a UTCTime
to a number of seconds since referenceTime
.
mp4CurrentTime :: Num t => IO t Source #
Get the current time as number of seconds since referenceTime
oneSecond32 :: TimeScale -> TS32 label Source #
Utility function to generate the equivalent of one second (1 s
)
oneSecond64 :: TimeScale -> TS64 label Source #
Utility function to generate the equivalent of one second (1 s
)
diffTimeToTicks :: Integral t => NominalDiffTime -> TimeScale -> t Source #
Convert a NominalDiffTime
to the number of Ticks
with respect
to a given TimeScale
.
ticksToDiffTime :: Integral t => t -> TimeScale -> NominalDiffTime Source #
Convert a NominalDiffTime
to the number of Ticks
with respect
to a given TimeScale
.
Default time-scale value
Based on history and tradition this value is 90000
.
MPEG-2 TS defines a single clock for each program, running at 27MHz. The
timescale of MPEG-2 TS Hint Tracks should be divisable by 90000.
type Timing version = Versioned TimingV0 TimingV1 version Source #
Time and timing information about a movie.
The creation/modification times are in seconds since midnight, Jan. 1, 1904, in UTC time. Time scale declares the time coordinate system, it specifies the number of time units that pass one second. The time coordinate system is used by e.g. the duration field, which by the way contains the duration of the longest track, if known, or simply the equivalent of 1s.
newtype Ticks timeScale Source #
A type that denotes a time relative to a TimeScale
which is included in
its type. Ticks
is the number of time units passed, where each time unit
has a physical duration of timescale * 1/s
i.e. timescale
Ticks
last
about 1 s
.
TODO use this instead of raw Word32s
Bounded (Ticks timeScale) Source # | |
Enum (Ticks timeScale) Source # | |
Eq (Ticks timeScale) Source # | |
Integral (Ticks timeScale) Source # | |
Num (Ticks timeScale) Source # | |
Ord (Ticks timeScale) Source # | |
Real (Ticks timeScale) Source # | |
Show (Ticks timeScale) Source # | |
Storable (Ticks timeScale) Source # | |
Bits (Ticks timeScale) Source # | |
IsBoxContent (Ticks n) Source # | |
newtype Ticks32 timeScale Source #
Bounded (Ticks32 timeScale) Source # | |
Enum (Ticks32 timeScale) Source # | |
Eq (Ticks32 timeScale) Source # | |
Integral (Ticks32 timeScale) Source # | |
Num (Ticks32 timeScale) Source # | |
Ord (Ticks32 timeScale) Source # | |
Real (Ticks32 timeScale) Source # | |
Show (Ticks32 timeScale) Source # | |
Storable (Ticks32 timeScale) Source # | |
Bits (Ticks32 timeScale) Source # | |
IsBoxContent (Ticks32 n) Source # | |