metronome 0.1 → 0.1.1
raw patch · 3 files changed
+5/−5 lines, 3 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Control.Concurrent.STMOrIO: instance STMOrIO IO
- Control.Concurrent.STMOrIO: instance STMOrIO STM
- Control.Concurrent.STMOrIO: instance STMOrIO t => RW t TChan
- Control.Concurrent.STMOrIO: instance STMOrIO t => RW t TVar
- System.Metronome: _actions :: Track -> [Action]
- System.Metronome: _alive :: Thread a -> Bool
- System.Metronome: _core :: Thread a -> a
- System.Metronome: _frequency :: Track -> Frequency
- System.Metronome: _muted :: Track -> Bool
- System.Metronome: _priority :: Track -> Priority
- System.Metronome: _running :: Thread a -> Bool
- System.Metronome: _schedule :: Metronome -> [(Priority, Action)]
- System.Metronome: _sync :: Track -> Ticks
- System.Metronome: _ticks :: Metronome -> [MTime]
+ Control.Concurrent.STMOrIO: instance Control.Concurrent.STMOrIO.STMOrIO GHC.Conc.Sync.STM
+ Control.Concurrent.STMOrIO: instance Control.Concurrent.STMOrIO.STMOrIO GHC.Types.IO
+ Control.Concurrent.STMOrIO: instance Control.Concurrent.STMOrIO.STMOrIO t => Control.Concurrent.STMOrIO.RW t Control.Concurrent.STM.TChan.TChan
+ Control.Concurrent.STMOrIO: instance Control.Concurrent.STMOrIO.STMOrIO t => Control.Concurrent.STMOrIO.RW t GHC.Conc.Sync.TVar
+ System.Metronome: [_actions] :: Track -> [Action]
+ System.Metronome: [_alive] :: Thread a -> Bool
+ System.Metronome: [_core] :: Thread a -> a
+ System.Metronome: [_frequency] :: Track -> Frequency
+ System.Metronome: [_muted] :: Track -> Bool
+ System.Metronome: [_priority] :: Track -> Priority
+ System.Metronome: [_running] :: Thread a -> Bool
+ System.Metronome: [_schedule] :: Metronome -> [(Priority, Action)]
+ System.Metronome: [_sync] :: Track -> Ticks
+ System.Metronome: [_ticks] :: Metronome -> [MTime]
- System.Metronome: alive :: Lens (Thread a_a3ME) Bool
+ System.Metronome: alive :: Lens (Thread a_a7U2) Bool
- System.Metronome: core :: Lens (Thread a_a3ME) a_a3ME
+ System.Metronome: core :: Lens (Thread a_a7U2) a_a7U2
- System.Metronome: running :: Lens (Thread a_a3ME) Bool
+ System.Metronome: running :: Lens (Thread a_a7U2) Bool
Files
- System/Metronome.hs +2/−2
- System/Metronome/Practical.hs +2/−2
- metronome.cabal +1/−1
System/Metronome.hs view
@@ -53,7 +53,7 @@ ) where -import Sound.OpenSoundControl (utcr, sleepThreadUntil)+import Sound.OSC (time, sleepThreadUntil) import Control.Concurrent.STM (STM, TVar, TChan , atomically, newBroadcastTChan, orElse, dupTChan) import Control.Concurrent (forkIO, myThreadId, killThread) import Control.Monad (join, liftM, forever, when)@@ -169,7 +169,7 @@ metronome km = do kc <- atomically newBroadcastTChan -- non leaking channel forkIO' $ \kill -> forever . runThread km kill $ \m@(Metronome ts _) -> do- t <- utcr -- time now+ t <- time -- time now -- throw away the past ticking time case dropWhile (< t) ts of [] -> return m -- no ticks left to wait
System/Metronome/Practical.hs view
@@ -70,7 +70,7 @@ import Control.Concurrent.STMOrIO import Control.Concurrent.STM-import Sound.OpenSoundControl+import Sound.OSC import System.Metronome import Data.Lens.Lazy @@ -129,7 +129,7 @@ -- | create and fork a running metronome. dummyMetronome :: MTime -- ^ time between ticks, in seconds -> IO (Control Metronome, TrackForker) -- ^ metronome control structure and a function to fork tracks-dummyMetronome d = utcr >>= \t0 -> var (Thread True True $ Metronome [t0, t0 + d ..] []) >>= \m -> metronome m >>= \f -> return (m,f)+dummyMetronome d = time >>= \t0 -> var (Thread True True $ Metronome [t0, t0 + d ..] []) >>= \m -> metronome m >>= \f -> return (m,f) -- | create and fork a stopped track by a metronome dummyTrack :: TrackForker -- ^ a track forking action from a metronome fork
metronome.cabal view
@@ -1,5 +1,5 @@ Name: metronome-Version: 0.1+Version: 0.1.1 Synopsis: Time Synchronized execution. Description: Metronome and tracks, useful to execute IO actions at regular intervals. State exposed via STM. License: BSD3