module Mpv.Data.VideoDuration where

import Polysemy.Time (NanoSeconds)
import Polysemy.Time.Json (json)

newtype VideoDuration =
  VideoDuration { VideoDuration -> NanoSeconds
unVideoDuration :: NanoSeconds }
  deriving stock (VideoDuration -> VideoDuration -> Bool
(VideoDuration -> VideoDuration -> Bool)
-> (VideoDuration -> VideoDuration -> Bool) -> Eq VideoDuration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VideoDuration -> VideoDuration -> Bool
$c/= :: VideoDuration -> VideoDuration -> Bool
== :: VideoDuration -> VideoDuration -> Bool
$c== :: VideoDuration -> VideoDuration -> Bool
Eq, Int -> VideoDuration -> ShowS
[VideoDuration] -> ShowS
VideoDuration -> String
(Int -> VideoDuration -> ShowS)
-> (VideoDuration -> String)
-> ([VideoDuration] -> ShowS)
-> Show VideoDuration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VideoDuration] -> ShowS
$cshowList :: [VideoDuration] -> ShowS
show :: VideoDuration -> String
$cshow :: VideoDuration -> String
showsPrec :: Int -> VideoDuration -> ShowS
$cshowsPrec :: Int -> VideoDuration -> ShowS
Show)
  deriving newtype (Integer -> VideoDuration
VideoDuration -> VideoDuration
VideoDuration -> VideoDuration -> VideoDuration
(VideoDuration -> VideoDuration -> VideoDuration)
-> (VideoDuration -> VideoDuration -> VideoDuration)
-> (VideoDuration -> VideoDuration -> VideoDuration)
-> (VideoDuration -> VideoDuration)
-> (VideoDuration -> VideoDuration)
-> (VideoDuration -> VideoDuration)
-> (Integer -> VideoDuration)
-> Num VideoDuration
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
fromInteger :: Integer -> VideoDuration
$cfromInteger :: Integer -> VideoDuration
signum :: VideoDuration -> VideoDuration
$csignum :: VideoDuration -> VideoDuration
abs :: VideoDuration -> VideoDuration
$cabs :: VideoDuration -> VideoDuration
negate :: VideoDuration -> VideoDuration
$cnegate :: VideoDuration -> VideoDuration
* :: VideoDuration -> VideoDuration -> VideoDuration
$c* :: VideoDuration -> VideoDuration -> VideoDuration
- :: VideoDuration -> VideoDuration -> VideoDuration
$c- :: VideoDuration -> VideoDuration -> VideoDuration
+ :: VideoDuration -> VideoDuration -> VideoDuration
$c+ :: VideoDuration -> VideoDuration -> VideoDuration
Num, Eq VideoDuration
Eq VideoDuration
-> (VideoDuration -> VideoDuration -> Ordering)
-> (VideoDuration -> VideoDuration -> Bool)
-> (VideoDuration -> VideoDuration -> Bool)
-> (VideoDuration -> VideoDuration -> Bool)
-> (VideoDuration -> VideoDuration -> Bool)
-> (VideoDuration -> VideoDuration -> VideoDuration)
-> (VideoDuration -> VideoDuration -> VideoDuration)
-> Ord VideoDuration
VideoDuration -> VideoDuration -> Bool
VideoDuration -> VideoDuration -> Ordering
VideoDuration -> VideoDuration -> VideoDuration
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: VideoDuration -> VideoDuration -> VideoDuration
$cmin :: VideoDuration -> VideoDuration -> VideoDuration
max :: VideoDuration -> VideoDuration -> VideoDuration
$cmax :: VideoDuration -> VideoDuration -> VideoDuration
>= :: VideoDuration -> VideoDuration -> Bool
$c>= :: VideoDuration -> VideoDuration -> Bool
> :: VideoDuration -> VideoDuration -> Bool
$c> :: VideoDuration -> VideoDuration -> Bool
<= :: VideoDuration -> VideoDuration -> Bool
$c<= :: VideoDuration -> VideoDuration -> Bool
< :: VideoDuration -> VideoDuration -> Bool
$c< :: VideoDuration -> VideoDuration -> Bool
compare :: VideoDuration -> VideoDuration -> Ordering
$ccompare :: VideoDuration -> VideoDuration -> Ordering
Ord, Int -> VideoDuration
VideoDuration -> Int
VideoDuration -> [VideoDuration]
VideoDuration -> VideoDuration
VideoDuration -> VideoDuration -> [VideoDuration]
VideoDuration -> VideoDuration -> VideoDuration -> [VideoDuration]
(VideoDuration -> VideoDuration)
-> (VideoDuration -> VideoDuration)
-> (Int -> VideoDuration)
-> (VideoDuration -> Int)
-> (VideoDuration -> [VideoDuration])
-> (VideoDuration -> VideoDuration -> [VideoDuration])
-> (VideoDuration -> VideoDuration -> [VideoDuration])
-> (VideoDuration
    -> VideoDuration -> VideoDuration -> [VideoDuration])
-> Enum VideoDuration
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
enumFromThenTo :: VideoDuration -> VideoDuration -> VideoDuration -> [VideoDuration]
$cenumFromThenTo :: VideoDuration -> VideoDuration -> VideoDuration -> [VideoDuration]
enumFromTo :: VideoDuration -> VideoDuration -> [VideoDuration]
$cenumFromTo :: VideoDuration -> VideoDuration -> [VideoDuration]
enumFromThen :: VideoDuration -> VideoDuration -> [VideoDuration]
$cenumFromThen :: VideoDuration -> VideoDuration -> [VideoDuration]
enumFrom :: VideoDuration -> [VideoDuration]
$cenumFrom :: VideoDuration -> [VideoDuration]
fromEnum :: VideoDuration -> Int
$cfromEnum :: VideoDuration -> Int
toEnum :: Int -> VideoDuration
$ctoEnum :: Int -> VideoDuration
pred :: VideoDuration -> VideoDuration
$cpred :: VideoDuration -> VideoDuration
succ :: VideoDuration -> VideoDuration
$csucc :: VideoDuration -> VideoDuration
Enum, Num VideoDuration
Ord VideoDuration
Num VideoDuration
-> Ord VideoDuration
-> (VideoDuration -> Rational)
-> Real VideoDuration
VideoDuration -> Rational
forall a. Num a -> Ord a -> (a -> Rational) -> Real a
toRational :: VideoDuration -> Rational
$ctoRational :: VideoDuration -> Rational
Real, Enum VideoDuration
Real VideoDuration
Real VideoDuration
-> Enum VideoDuration
-> (VideoDuration -> VideoDuration -> VideoDuration)
-> (VideoDuration -> VideoDuration -> VideoDuration)
-> (VideoDuration -> VideoDuration -> VideoDuration)
-> (VideoDuration -> VideoDuration -> VideoDuration)
-> (VideoDuration
    -> VideoDuration -> (VideoDuration, VideoDuration))
-> (VideoDuration
    -> VideoDuration -> (VideoDuration, VideoDuration))
-> (VideoDuration -> Integer)
-> Integral VideoDuration
VideoDuration -> Integer
VideoDuration -> VideoDuration -> (VideoDuration, VideoDuration)
VideoDuration -> VideoDuration -> VideoDuration
forall a.
Real a
-> Enum a
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> (a, a))
-> (a -> a -> (a, a))
-> (a -> Integer)
-> Integral a
toInteger :: VideoDuration -> Integer
$ctoInteger :: VideoDuration -> Integer
divMod :: VideoDuration -> VideoDuration -> (VideoDuration, VideoDuration)
$cdivMod :: VideoDuration -> VideoDuration -> (VideoDuration, VideoDuration)
quotRem :: VideoDuration -> VideoDuration -> (VideoDuration, VideoDuration)
$cquotRem :: VideoDuration -> VideoDuration -> (VideoDuration, VideoDuration)
mod :: VideoDuration -> VideoDuration -> VideoDuration
$cmod :: VideoDuration -> VideoDuration -> VideoDuration
div :: VideoDuration -> VideoDuration -> VideoDuration
$cdiv :: VideoDuration -> VideoDuration -> VideoDuration
rem :: VideoDuration -> VideoDuration -> VideoDuration
$crem :: VideoDuration -> VideoDuration -> VideoDuration
quot :: VideoDuration -> VideoDuration -> VideoDuration
$cquot :: VideoDuration -> VideoDuration -> VideoDuration
Integral, Num VideoDuration
Num VideoDuration
-> (VideoDuration -> VideoDuration -> VideoDuration)
-> (VideoDuration -> VideoDuration)
-> (Rational -> VideoDuration)
-> Fractional VideoDuration
Rational -> VideoDuration
VideoDuration -> VideoDuration
VideoDuration -> VideoDuration -> VideoDuration
forall a.
Num a
-> (a -> a -> a) -> (a -> a) -> (Rational -> a) -> Fractional a
fromRational :: Rational -> VideoDuration
$cfromRational :: Rational -> VideoDuration
recip :: VideoDuration -> VideoDuration
$crecip :: VideoDuration -> VideoDuration
/ :: VideoDuration -> VideoDuration -> VideoDuration
$c/ :: VideoDuration -> VideoDuration -> VideoDuration
Fractional)

json ''VideoDuration