diff options
Diffstat (limited to 'Midi.hs')
-rw-r--r-- | Midi.hs | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -41,6 +41,14 @@ data CompleteRecording = CompleteRecording { | |||
41 | _recEvents :: [RecordedEvent] | 41 | _recEvents :: [RecordedEvent] |
42 | } | 42 | } |
43 | 43 | ||
44 | class Playable p where | ||
45 | playableEvents :: p -> [RecordedEvent] | ||
46 | instance Playable Recording where | ||
47 | playableEvents (StartRecording _) = [] | ||
48 | playableEvents (RecordingInProgress _ _ ls) = ls | ||
49 | instance Playable CompleteRecording where | ||
50 | playableEvents = _recEvents | ||
51 | |||
44 | instance FromRow CompleteRecording where | 52 | instance FromRow CompleteRecording where |
45 | fromRow = cons <$> field <*> field <*> field <*> field <*> field <*> field <*> field <*> field <*> field | 53 | fromRow = cons <$> field <*> field <*> field <*> field <*> field <*> field <*> field <*> field <*> field |
46 | where | 54 | where |