{-# LANGUAGE TemplateHaskell #-}
module Sound.Data
    where
import qualified SDL.Mixer as Mix
import qualified Data.IntMap.Strict as IM
--import qualified Data.Map.Strict as M
import Control.Lens
import Geometry.Data
import Data.Word (Word8)
import Data.Int (Int16)

data SoundStatus 
    = JustStartedPlaying
    | Playing
    | ToStart
    | ToContinueStart
  deriving (Eq,Ord,Show)

newtype SoundID = SoundID { _getSoundID :: Int }
  deriving (Eq,Ord,Show)

newtype SoundData = SoundData
    {_loadedChunks :: IM.IntMap Mix.Chunk
    }
data Sound = Sound 
    { _soundTime        :: Maybe Int
    , _soundStatus      :: SoundStatus
    , _soundChannel     :: Maybe Mix.Channel
    , _soundAngDist     :: Maybe (Int16,Word8)
    , _soundPos         :: Point2
    , _soundVolume      :: Float
    , _soundChunkID     :: SoundID
    }
  deriving (Eq,Ord,Show)

makeLenses ''SoundData
makeLenses ''Sound
