module Mpv.Data.Property where

import Data.Aeson (Value)

import Mpv.Data.AudioDelay (AudioDelay)
import Mpv.Data.PlaybackState (PlaybackState)
import Mpv.Data.SubDelay (SubDelay)
import Mpv.Data.SubFps (SubFps)
import Mpv.Data.Track (TrackList)
import Mpv.Data.VideoDuration (VideoDuration)
import Mpv.Data.VideoExpired (VideoExpired)
import Mpv.Data.VideoProgress (VideoProgress)
import Mpv.Data.Volume (Volume)

data Property :: Type -> Type where
  Custom :: Text -> Property Value
  Duration :: Property VideoDuration
  SubFps :: Property SubFps
  SubDelay :: Property SubDelay
  AudioDelay :: Property AudioDelay
  TrackList :: Property TrackList
  PercentPos :: Property VideoProgress
  TimePos :: Property VideoExpired
  Paused :: Property PlaybackState
  Volume :: Property Volume

deriving stock instance Eq (Property v)
deriving stock instance Show (Property v)

propertyName :: Property v -> Text
propertyName :: forall v. Property v -> Text
propertyName = \case
  Custom Text
name -> Text
name
  Property v
Duration -> Text
"duration"
  Property v
SubFps -> Text
"sub-fps"
  Property v
SubDelay -> Text
"sub-delay"
  Property v
AudioDelay -> Text
"audio-delay"
  Property v
TrackList -> Text
"track-list"
  Property v
PercentPos -> Text
"percent-pos"
  Property v
TimePos -> Text
"time-pos"
  Property v
Paused -> Text
"pause"
  Property v
Volume -> Text
"volume"