diff options
author | Andrew Cady <d@jerkface.net> | 2015-12-11 10:10:38 -0500 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2015-12-11 10:10:38 -0500 |
commit | c012a42e53c1bccd5e113fea5f616115f6f85835 (patch) | |
tree | aaf2c6ae9370fedb9cd157728ea25ceb619bc78f | |
parent | fb2de6dfe362f62f3dde0027833f09caf3e71529 (diff) |
Output a message whenever a midi file is saved.
-rw-r--r-- | midi-dump.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/midi-dump.hs b/midi-dump.hs index 56a1d50..5084258 100644 --- a/midi-dump.hs +++ b/midi-dump.hs | |||
@@ -240,7 +240,6 @@ processCommand "save" = do | |||
240 | recording <- gets _replay | 240 | recording <- gets _replay |
241 | filename <- chooseFileName recording | 241 | filename <- chooseFileName recording |
242 | saveRecording filename recording | 242 | saveRecording filename recording |
243 | liftIO $ putStrLn $ "Saved to " ++ filename | ||
244 | processCommand "dump" = sqlSelectEVERYTHING >>= saveRecording "dumped.mid" . mconcat | 243 | processCommand "dump" = sqlSelectEVERYTHING >>= saveRecording "dumped.mid" . mconcat |
245 | processCommand "C" = do | 244 | processCommand "C" = do |
246 | let notes = (Event.NoteEv Event.NoteOn . mkNote) <$> [60, 64, 67] | 245 | let notes = (Event.NoteEv Event.NoteOn . mkNote) <$> [60, 64, 67] |
@@ -280,7 +279,9 @@ backgroundWithWait fn = do | |||
280 | modify $ \s -> s { _waitThreads = wait:_waitThreads s } | 279 | modify $ \s -> s { _waitThreads = wait:_waitThreads s } |
281 | 280 | ||
282 | saveEvents :: FilePath -> [RecordedEvent] -> MidiController () | 281 | saveEvents :: FilePath -> [RecordedEvent] -> MidiController () |
283 | saveEvents file evts@(_:_) = backgroundWithWait $ Codec.Midi.exportFile file (toSingleTrackMidi evts) | 282 | saveEvents file evts@(_:_) = backgroundWithWait $ do |
283 | Codec.Midi.exportFile file (toSingleTrackMidi evts) | ||
284 | liftIO $ putStrLn $ "Saved to " ++ file | ||
284 | saveEvents _ _ = return () | 285 | saveEvents _ _ = return () |
285 | 286 | ||
286 | -- NOTE: The list must be in ascending order for this to work | 287 | -- NOTE: The list must be in ascending order for this to work |