summaryrefslogtreecommitdiff
path: root/src/Trivstream/Types.hs
diff options
context:
space:
mode:
authorGregor Kleen <pngwjpgh@users.noreply.github.com>2016-08-02 22:46:52 +0200
committerGregor Kleen <pngwjpgh@users.noreply.github.com>2016-08-02 22:46:52 +0200
commit3989c89f0f3945f949d2929cc0af3994910a2771 (patch)
tree9c656c781ec4fa054befa4b9e0b2c2d671fc9170 /src/Trivstream/Types.hs
parentf31a65bcd1642b3f042bd906674f4064cfc9362c (diff)
downloadtrivstream-master.tar
trivstream-master.tar.gz
trivstream-master.tar.bz2
trivstream-master.tar.xz
trivstream-master.zip
minor cleanupHEADmaster
Diffstat (limited to 'src/Trivstream/Types.hs')
-rw-r--r--src/Trivstream/Types.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Trivstream/Types.hs b/src/Trivstream/Types.hs
index 8cdd592..6dbd949 100644
--- a/src/Trivstream/Types.hs
+++ b/src/Trivstream/Types.hs
@@ -7,6 +7,7 @@ module Trivstream.Types
7 , SampleRate(..) 7 , SampleRate(..)
8 , Configuration(..) 8 , Configuration(..)
9 , Mode (..) 9 , Mode (..)
10 , module Data.Default.Class
10 ) where 11 ) where
11 12
12 13
@@ -32,7 +33,7 @@ instance Serialize ChannelPosition
32 33
33 34
34data AudioBackend = Pulse | Jack 35data AudioBackend = Pulse | Jack
35 deriving (Enum, Eq, Generic) 36 deriving (Enum, Eq, Generic, Show, Read)
36 37
37instance Default AudioBackend where 38instance Default AudioBackend where
38 def = Pulse 39 def = Pulse
@@ -54,7 +55,7 @@ instance Serialize SampleRate
54data AudioConfig = AudioConfig 55data AudioConfig = AudioConfig
55 { _aBackend :: AudioBackend 56 { _aBackend :: AudioBackend
56 , _aChannels :: [Maybe ChannelPosition] 57 , _aChannels :: [Maybe ChannelPosition]
57 , _aRate :: SampleRate 58 , _aRate :: Maybe SampleRate
58 } deriving (Generic) 59 } deriving (Generic)
59makeLenses ''AudioConfig 60makeLenses ''AudioConfig
60 61
@@ -62,14 +63,14 @@ instance Default AudioConfig where
62 def = AudioConfig 63 def = AudioConfig
63 { _aBackend = def 64 { _aBackend = def
64 , _aChannels = [Just $ ChannelNormal PanLeft, Just $ ChannelNormal PanRight] 65 , _aChannels = [Just $ ChannelNormal PanLeft, Just $ ChannelNormal PanRight]
65 , _aRate = def 66 , _aRate = Just def
66 } 67 }
67 68
68instance Serialize AudioConfig 69instance Serialize AudioConfig
69 70
70 71
71data Mode = Server | Client 72data Mode = Server | Client
72 deriving (Enum, Eq, Generic, Show) 73 deriving (Enum, Eq, Generic, Show, Read)
73 74
74instance Default Mode where 75instance Default Mode where
75 def = Server 76 def = Server