Add (persistent) volume control
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
module Dodge.Config.Data (
|
||||
Configuration (..)
|
||||
, defaultConfig
|
||||
, volume_master
|
||||
, volume_sound
|
||||
, volume_music
|
||||
) where
|
||||
|
||||
import Data.Aeson
|
||||
import Foreign.C.Types
|
||||
import GHC.Generics
|
||||
import qualified GHC.Int
|
||||
import qualified SDL
|
||||
import System.Directory
|
||||
import Control.Lens
|
||||
|
||||
data Configuration = Configuration
|
||||
{ _volume_master :: Float
|
||||
, _volume_sound :: Float
|
||||
, _volume_music :: Float
|
||||
}
|
||||
deriving (Generic, Show)
|
||||
|
||||
makeLenses ''Configuration
|
||||
|
||||
instance ToJSON Configuration where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
|
||||
instance FromJSON Configuration
|
||||
|
||||
defaultConfig = Configuration
|
||||
{ _volume_master = 1
|
||||
, _volume_sound = 1
|
||||
, _volume_music = 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user