summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--midi-dump.hs13
1 files changed, 11 insertions, 2 deletions
diff --git a/midi-dump.hs b/midi-dump.hs
index c4e319a..034c8f8 100644
--- a/midi-dump.hs
+++ b/midi-dump.hs
@@ -20,9 +20,15 @@ import Data.Int
20import Data.ByteString.Char8 (pack) 20import Data.ByteString.Char8 (pack)
21 21
22import Control.Concurrent.Chan 22import Control.Concurrent.Chan
23import Prelude hiding ((.)) 23import Prelude hiding ((.), id)
24import BasePrelude hiding (loop) 24import BasePrelude hiding (loop)
25 25
26import qualified Sound.ALSA.Sequencer.Address
27import qualified Sound.ALSA.Sequencer.Port
28import qualified Sound.ALSA.Sequencer.Queue
29import qualified Sound.ALSA.Sequencer
30
31
26verbose = False 32verbose = False
27 33
28main = main' `AlsaExc.catch` handler 34main = main' `AlsaExc.catch` handler
@@ -63,7 +69,10 @@ main' = withAlsaInit $ \h public private q publicAddr privateAddr -> do
63 execute_ sqlite "CREATE TABLE IF NOT EXISTS chunks (id INTEGER PRIMARY KEY, sec INTEGER, nsec INTEGER, midi BLOB)" 69 execute_ sqlite "CREATE TABLE IF NOT EXISTS chunks (id INTEGER PRIMARY KEY, sec INTEGER, nsec INTEGER, midi BLOB)"
64 saver <- startSaver sqlite 70 saver <- startSaver sqlite
65 71
66 (_, ()) <- execRWST loop (saver, sqlite, startTime, startTimeReal, h, public, private, q, publicAddr, privateAddr) (emptyLoopState startTime) 72 let env = (saver, sqlite, startTime, startTimeReal, h, public, private, q, publicAddr, privateAddr)
73 env :: (Chan (Int64, Int64, [EVENT]), Connection, TimeSpec, TimeSpec, Sound.ALSA.Sequencer.T Sound.ALSA.Sequencer.DuplexMode, Sound.ALSA.Sequencer.Port.T, Sound.ALSA.Sequencer.Port.T, Sound.ALSA.Sequencer.Queue.T, Sound.ALSA.Sequencer.Address.T, Sound.ALSA.Sequencer.Address.T)
74
75 (_, ()) <- execRWST loop env (emptyLoopState startTime)
67 return () 76 return ()
68 77
69loop = do 78loop = do