Something went wrong. Try again.
A music player that connects to your cloud/distributed storage. forked from tokono.ma/diffuse
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869module Equalizer exposing (..)
import Coordinates exposing (Coordinates)import Json.Decodeimport Json.Encode
-- 🌳
type Knob = Low | Mid | High | Volume
type alias KnobOperation = { knob : Knob , startingPosition : Coordinates }
type alias Settings = { low : Float , mid : Float , high : Float , volume : Float }
maxAngle : FloatmaxAngle = 135
-- 🔱
defaultSettings : SettingsdefaultSettings = { low = 0 , mid = 0 , high = 0 , volume = 0.5 }
encodeSettings : Settings -> Json.Encode.ValueencodeSettings settings = Json.Encode.object [ ( "low", Json.Encode.float settings.low ) , ( "mid", Json.Encode.float settings.mid ) , ( "high", Json.Encode.float settings.high ) , ( "volume", Json.Encode.float settings.volume ) ]
settingsDecoder : Json.Decode.Decoder SettingssettingsDecoder = Json.Decode.map4 Settings (Json.Decode.field "low" Json.Decode.float) (Json.Decode.field "mid" Json.Decode.float) (Json.Decode.field "high" Json.Decode.float) (Json.Decode.field "volume" Json.Decode.float)