module Mpv.Data.SeekFlags where

import Polysemy.Time.Json (json)

data SeekReference =
  Absolute
  |
  Relative
  deriving stock (SeekReference -> SeekReference -> Bool
(SeekReference -> SeekReference -> Bool)
-> (SeekReference -> SeekReference -> Bool) -> Eq SeekReference
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SeekReference -> SeekReference -> Bool
$c/= :: SeekReference -> SeekReference -> Bool
== :: SeekReference -> SeekReference -> Bool
$c== :: SeekReference -> SeekReference -> Bool
Eq, Int -> SeekReference -> ShowS
[SeekReference] -> ShowS
SeekReference -> String
(Int -> SeekReference -> ShowS)
-> (SeekReference -> String)
-> ([SeekReference] -> ShowS)
-> Show SeekReference
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SeekReference] -> ShowS
$cshowList :: [SeekReference] -> ShowS
show :: SeekReference -> String
$cshow :: SeekReference -> String
showsPrec :: Int -> SeekReference -> ShowS
$cshowsPrec :: Int -> SeekReference -> ShowS
Show)

json ''SeekReference

instance Default SeekReference where
  def :: SeekReference
def =
    SeekReference
Relative

data SeekUnit =
  Percent
  |
  Time
  deriving stock (SeekUnit -> SeekUnit -> Bool
(SeekUnit -> SeekUnit -> Bool)
-> (SeekUnit -> SeekUnit -> Bool) -> Eq SeekUnit
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SeekUnit -> SeekUnit -> Bool
$c/= :: SeekUnit -> SeekUnit -> Bool
== :: SeekUnit -> SeekUnit -> Bool
$c== :: SeekUnit -> SeekUnit -> Bool
Eq, Int -> SeekUnit -> ShowS
[SeekUnit] -> ShowS
SeekUnit -> String
(Int -> SeekUnit -> ShowS)
-> (SeekUnit -> String) -> ([SeekUnit] -> ShowS) -> Show SeekUnit
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SeekUnit] -> ShowS
$cshowList :: [SeekUnit] -> ShowS
show :: SeekUnit -> String
$cshow :: SeekUnit -> String
showsPrec :: Int -> SeekUnit -> ShowS
$cshowsPrec :: Int -> SeekUnit -> ShowS
Show)

json ''SeekUnit

instance Default SeekUnit where
  def :: SeekUnit
def =
    SeekUnit
Time

data SeekRestart =
  Keyframes
  |
  Exact
  deriving stock (SeekRestart -> SeekRestart -> Bool
(SeekRestart -> SeekRestart -> Bool)
-> (SeekRestart -> SeekRestart -> Bool) -> Eq SeekRestart
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SeekRestart -> SeekRestart -> Bool
$c/= :: SeekRestart -> SeekRestart -> Bool
== :: SeekRestart -> SeekRestart -> Bool
$c== :: SeekRestart -> SeekRestart -> Bool
Eq, Int -> SeekRestart -> ShowS
[SeekRestart] -> ShowS
SeekRestart -> String
(Int -> SeekRestart -> ShowS)
-> (SeekRestart -> String)
-> ([SeekRestart] -> ShowS)
-> Show SeekRestart
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SeekRestart] -> ShowS
$cshowList :: [SeekRestart] -> ShowS
show :: SeekRestart -> String
$cshow :: SeekRestart -> String
showsPrec :: Int -> SeekRestart -> ShowS
$cshowsPrec :: Int -> SeekRestart -> ShowS
Show)

json ''SeekRestart

instance Default SeekRestart where
  def :: SeekRestart
def =
    SeekRestart
Keyframes

data SeekFlags =
  SeekFlags {
    SeekFlags -> SeekReference
reference :: SeekReference,
    SeekFlags -> SeekUnit
unit :: SeekUnit,
    SeekFlags -> SeekRestart
restart :: SeekRestart
  }
  deriving stock (SeekFlags -> SeekFlags -> Bool
(SeekFlags -> SeekFlags -> Bool)
-> (SeekFlags -> SeekFlags -> Bool) -> Eq SeekFlags
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SeekFlags -> SeekFlags -> Bool
$c/= :: SeekFlags -> SeekFlags -> Bool
== :: SeekFlags -> SeekFlags -> Bool
$c== :: SeekFlags -> SeekFlags -> Bool
Eq, Int -> SeekFlags -> ShowS
[SeekFlags] -> ShowS
SeekFlags -> String
(Int -> SeekFlags -> ShowS)
-> (SeekFlags -> String)
-> ([SeekFlags] -> ShowS)
-> Show SeekFlags
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SeekFlags] -> ShowS
$cshowList :: [SeekFlags] -> ShowS
show :: SeekFlags -> String
$cshow :: SeekFlags -> String
showsPrec :: Int -> SeekFlags -> ShowS
$cshowsPrec :: Int -> SeekFlags -> ShowS
Show, (forall x. SeekFlags -> Rep SeekFlags x)
-> (forall x. Rep SeekFlags x -> SeekFlags) -> Generic SeekFlags
forall x. Rep SeekFlags x -> SeekFlags
forall x. SeekFlags -> Rep SeekFlags x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SeekFlags x -> SeekFlags
$cfrom :: forall x. SeekFlags -> Rep SeekFlags x
Generic)
  deriving anyclass (SeekFlags
SeekFlags -> Default SeekFlags
forall a. a -> Default a
def :: SeekFlags
$cdef :: SeekFlags
Default)

json ''SeekFlags