-- | UGen DB record definitions.
module Sound.SC3.UGen.DB.Record where

import Sound.SC3.UGen.Rate

-- | UGen input descriptor
data I = I {input_indices :: (Int,Int)
           ,input_name :: String
           ,input_default :: Double
           ,input_enumeration :: Maybe String}
         deriving (Eq,Show)

-- | 'Left' indicates fixed,'Right' variable
type U_Output = Either Int Int

-- | UGen descriptor
data U = U {ugen_name :: String
           ,ugen_operating_rates :: [Rate]
           ,ugen_default_rate :: Rate
           ,ugen_filter :: Maybe [Int]
           ,ugen_inputs :: [I]
           ,ugen_mce_input :: Maybe Int
           ,ugen_outputs :: U_Output
           ,ugen_summary :: String
           }
         deriving (Eq,Show)

-- | Infinite default value
inf :: Double
inf = 10 ** 8

-- | Enumeration for @Onsets@ UGen @odftype@ input.
rcomplex :: Double
rcomplex = 3

true :: Double
true = 1

false :: Double
false = 0