From c012a42e53c1bccd5e113fea5f616115f6f85835 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Fri, 11 Dec 2015 10:10:38 -0500 Subject: Output a message whenever a midi file is saved. --- midi-dump.hs | 5 +++-- 1 file 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 recording <- gets _replay filename <- chooseFileName recording saveRecording filename recording - liftIO $ putStrLn $ "Saved to " ++ filename processCommand "dump" = sqlSelectEVERYTHING >>= saveRecording "dumped.mid" . mconcat processCommand "C" = do let notes = (Event.NoteEv Event.NoteOn . mkNote) <$> [60, 64, 67] @@ -280,7 +279,9 @@ backgroundWithWait fn = do modify $ \s -> s { _waitThreads = wait:_waitThreads s } saveEvents :: FilePath -> [RecordedEvent] -> MidiController () -saveEvents file evts@(_:_) = backgroundWithWait $ Codec.Midi.exportFile file (toSingleTrackMidi evts) +saveEvents file evts@(_:_) = backgroundWithWait $ do + Codec.Midi.exportFile file (toSingleTrackMidi evts) + liftIO $ putStrLn $ "Saved to " ++ file saveEvents _ _ = return () -- NOTE: The list must be in ascending order for this to work -- cgit v1.2.3