hunk ./haskore-realtime.cabal 2 -Version: 0.1.1 +Version: 0.2 hunk ./haskore-realtime.cabal 28 - tag: 0.1.1 + tag: 0.2 hunk ./haskore-realtime.cabal 36 - midi >=0.1.1 && <0.2, + midi >=0.2 && <0.3, hunk ./haskore-realtime.cabal 43 - transformers >=0.2 && <0.3 + transformers >=0.2 && <0.3, + utility-ht >=0.0.8 && <0.1 hunk ./haskore-realtime.cabal 59 - Haskore.RealTime.Timer, - Haskore.RealTime.Timer.Immediate, - Haskore.RealTime.Timer.Thread, + Haskore.RealTime.Timer + Haskore.RealTime.Timer.Immediate + Haskore.RealTime.Timer.Thread hunk ./haskore-realtime.cabal 64 - Haskore.RealTime.EventList.TimeBody, - Haskore.RealTime.EventList.TimeTime, - Haskore.RealTime.ShellPipe, - Haskore.Interface.CSound.Play, + Haskore.RealTime.EventList.TimeBody + Haskore.RealTime.EventList.TimeTime + Haskore.RealTime.ShellPipe + Haskore.Interface.CSound.Play hunk ./haskore-realtime.cabal 69 + Other-Modules: + Haskore.RealTime.Utility hunk ./src/Haskore/Interface/CSound/Play.hs 12 -import System.IO (IO) +import Haskore.RealTime.Utility (catchCtrlC, ) + hunk ./src/Haskore/Interface/CSound/Play.hs 15 -import qualified System.Posix.Signals as Signals -import System.Cmd (system, ) +import System.Cmd (rawSystem, system, ) hunk ./src/Haskore/Interface/CSound/Play.hs 22 +import Control.Functor.HT (void, ) + + hunk ./src/Haskore/Interface/CSound/Play.hs 59 - else system ("mkfifo " ++ scorePipe) >> return () + else void $ rawSystem "mkfifo" [scorePipe] hunk ./src/Haskore/Interface/CSound/Play.hs 61 - system (fst cmd ++ orchName ++ " " ++ scorePipe ++ snd cmd) + void $ system (fst cmd ++ orchName ++ " " ++ scorePipe ++ snd cmd) hunk ./src/Haskore/Interface/CSound/Play.hs 75 - -- Disable sigPIPE. This means that the whole program - -- won't crash when the tool exits. Unfortunately there - -- doesn't seem to be another way of doing this. - Signals.installHandler Signals.sigPIPE - Signals.Ignore Nothing + catchCtrlC hunk ./src/Haskore/Interface/CSound/Play.hs 96 - -- Disable sigPIPE. This means that the whole program - -- won't crash when the tool exits. Unfortunately there - -- doesn't seem to be another way of doing this. - Signals.installHandler Signals.sigPIPE - Signals.Ignore Nothing + catchCtrlC hunk ./src/Haskore/Interface/CSound/Play.hs 116 - -- Disable sigPIPE. This means that the whole program - -- won't crash when the tool exits. Unfortunately there - -- doesn't seem to be another way of doing this. - Signals.installHandler Signals.sigPIPE - Signals.Ignore Nothing + catchCtrlC hunk ./src/Haskore/Interface/MIDI/Play.hs 30 -module Haskore.Interface.MIDI.Play where +module Haskore.Interface.MIDI.Play (play, playSimple, ) where hunk ./src/Haskore/Interface/MIDI/Play.hs 33 -import System.IO (IO) -import qualified System.IO as IO -import qualified System.Posix.Signals as Signals +import Haskore.RealTime.Utility (catchCtrlC, ) hunk ./src/Haskore/Interface/MIDI/Play.hs 44 +import qualified Data.ByteString.Lazy as B +import qualified System.IO as IO hunk ./src/Haskore/Interface/MIDI/Play.hs 49 -import Data.Char (chr, ) -import Data.Word (Word8, ) - hunk ./src/Haskore/Interface/MIDI/Play.hs 58 -play = playRaw [] . SaveMidi.toByteList . WriteMidi.fromRhythmicMusicMixed +play = playRaw [] . SaveMidi.toByteString . WriteMidi.fromRhythmicMusicMixed hunk ./src/Haskore/Interface/MIDI/Play.hs 61 -playSimple = playRaw [] . SaveMidi.toByteList . Render.mixedGeneralMidi +playSimple = playRaw [] . SaveMidi.toByteString . Render.mixedGeneralMidi hunk ./src/Haskore/Interface/MIDI/Play.hs 63 -playRaw :: [String] -> ByteList -> IO () +playRaw :: [String] -> B.ByteString -> IO () hunk ./src/Haskore/Interface/MIDI/Play.hs 66 - -- Disable sigPIPE. This means that the whole program - -- won't crash when the tool exits. Unfortunately there - -- doesn't seem to be another way of doing this. - Signals.installHandler Signals.sigPIPE - Signals.Ignore Nothing + catchCtrlC hunk ./src/Haskore/Interface/MIDI/Play.hs 74 - IO.hPutStr input (stringCharFromByte stream) + B.hPutStr input stream hunk ./src/Haskore/Interface/MIDI/Play.hs 77 - -type ByteList = [Word8] - -stringCharFromByte :: ByteList -> String -stringCharFromByte = map (chr . fromIntegral) - addfile ./src/Haskore/RealTime/Utility.hs hunk ./src/Haskore/RealTime/Utility.hs 1 +module Haskore.RealTime.Utility where + +import qualified System.Posix.Signals as Signals + +import Control.Functor.HT (void, ) + + +{- | +Disable sigPIPE. This means that the whole program +won't crash when the tool exits. Unfortunately there +doesn't seem to be another way of doing this. +-} +catchCtrlC :: IO () +catchCtrlC = + void $ + Signals.installHandler Signals.sigPIPE + Signals.Ignore Nothing hunk ./haskore-realtime.cabal 48 - directory >=1.0 && <1.1, - old-time >=1.0 && <1.1, - process >=1.0 && <1.1, + directory >=1.0 && <1.2, + old-time >=1.0 && <1.2, + process >=1.0 && <1.2, hunk ./haskore-realtime.cabal 43 - transformers >=0.2 && <0.3, + transformers >=0.2 && <0.4,