diff options
author | Gregor Kleen <pngwjpgh@users.noreply.github.com> | 2016-08-02 22:46:52 +0200 |
---|---|---|
committer | Gregor Kleen <pngwjpgh@users.noreply.github.com> | 2016-08-02 22:46:52 +0200 |
commit | 3989c89f0f3945f949d2929cc0af3994910a2771 (patch) | |
tree | 9c656c781ec4fa054befa4b9e0b2c2d671fc9170 /src/Trivstream/Types.hs | |
parent | f31a65bcd1642b3f042bd906674f4064cfc9362c (diff) | |
download | trivstream-master.tar trivstream-master.tar.gz trivstream-master.tar.bz2 trivstream-master.tar.xz trivstream-master.zip |
Diffstat (limited to 'src/Trivstream/Types.hs')
-rw-r--r-- | src/Trivstream/Types.hs | 9 |
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 | ||
34 | data AudioBackend = Pulse | Jack | 35 | data AudioBackend = Pulse | Jack |
35 | deriving (Enum, Eq, Generic) | 36 | deriving (Enum, Eq, Generic, Show, Read) |
36 | 37 | ||
37 | instance Default AudioBackend where | 38 | instance Default AudioBackend where |
38 | def = Pulse | 39 | def = Pulse |
@@ -54,7 +55,7 @@ instance Serialize SampleRate | |||
54 | data AudioConfig = AudioConfig | 55 | data 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) |
59 | makeLenses ''AudioConfig | 60 | makeLenses ''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 | ||
68 | instance Serialize AudioConfig | 69 | instance Serialize AudioConfig |
69 | 70 | ||
70 | 71 | ||
71 | data Mode = Server | Client | 72 | data Mode = Server | Client |
72 | deriving (Enum, Eq, Generic, Show) | 73 | deriving (Enum, Eq, Generic, Show, Read) |
73 | 74 | ||
74 | instance Default Mode where | 75 | instance Default Mode where |
75 | def = Server | 76 | def = Server |