packages feed

conductive-clock 0.1 → 0.2

raw patch · 4 files changed

+4/−135 lines, 4 filesdep −basedep −conductive-basedep −hosc

Dependencies removed: base, conductive-base, hosc, parseargs, vty

Files

− Sound/Conductive/ClockDisplay.hs
@@ -1,61 +0,0 @@----------------------------------------------------------------------------------- ClockDisplay.hs--- created: Sat Oct  2 01:12:08 JST 2010----------------------------------------------------------------------------------module Sound.Conductive.ClockDisplay where--import Control.Concurrent-import Data.List-import Sound.Conductive.ConductiveBaseData-import Sound.Conductive.MusicalEnvironment-import Sound.OpenSoundControl--- import Sound.OpenSoundControl.OSC--- import Sound.OpenSoundControl.Transport--- import Sound.OpenSoundControl.Transport.UDP--elapsed :: (RealFrac a1, Show a) => a1 -> a -> [Char]-elapsed minutes secs = let-    secsString = show secs-    s = if ((head $ tail secsString) == '.')-            then "0"++secsString-            else secsString-    in (show $ floor minutes) ++ ":" ++ (take 5 $ s)--clockTimeString :: MVar MusicalEnvironment -> String -> IO [Char]-clockTimeString e clock = do-    tempo <- eCurrentTempo e clock-    ts <- eCurrentTimeSignature e clock-    mt <- showCurrentTime e clock-    secs' <- eElapsedTime e clock-    let minutes = fromIntegral $ floor $ secs'/60-    let secs = secs' - (minutes*60)-    let e = elapsed minutes secs-    let timeString = concat [" "-                            ,clock-                            ,"  "-                            ,(show tempo)-                            ,"bpm"-                            ,"  "-                            ,(show ts)-                            ,"  "-                            ,mt-                            ,"  "-                            ,e-                            ]-    return timeString--clockTimeOSC :: MVar MusicalEnvironment -> String -> Int -> IO ()-clockTimeOSC e clock port = clockTimeString e clock -    >>= (\y -> withTransport (openUDP "127.0.0.1" port)-        (\x -> send x $ Message clock [String y])-        )--showClockTimeString :: MVar MusicalEnvironment -> String -> IO b-showClockTimeString e clock = clockTimeString e clock-    >>= (\x -> putStrLn x) >> threadDelay 200000 -    >> showClockTimeString e clock--
− Sound/Conductive/ClockListener.hs
@@ -1,31 +0,0 @@----------------------------------------------------------------------------------- ClockListener.hs--- created: Mon Aug 30 13:50:58 JST 2010----------------------------------------------------------------------------------module Sound.Conductive.ClockListener where--import Sound.Conductive.ClockDisplay-import Graphics.Vty-import Sound.OpenSoundControl--stringDatum :: OSC -> String-stringDatum (Message x [String ys]) = ys---- decodeClockTimeOSC---   :: Data.ByteString.Lazy.Internal.ByteString -> String--- decodeClockTimeOSC bs = stringDatum $  decodeOSC bs--receiveLoop :: UDP -> Graphics.Vty.Vty -> IO b-receiveLoop server vty = do-    osc <- recvFrom server-    -- putStrLn $ stringDatum $ fst osc-    update vty $ pic_for_image $ string def_attr $ stringDatum $ fst osc-    receiveLoop server vty--listener :: Int -> Graphics.Vty.Vty -> IO b-listener port vty = do-    s <- udpServer "127.0.0.1" port-    receiveLoop s vty
− Sound/Conductive/Main.hs
@@ -1,39 +0,0 @@----------------------------------------------------------------------------------- Main.hs--- created: Mon Aug 30 15:20:05 JST 2010----------------------------------------------------------------------------------module Sound.Conductive.Main where--import Sound.Conductive.ClockDisplay-import Sound.Conductive.ClockListener-import Graphics.Vty-import System.Console.ParseArgs--- import System.IO--data ClockDisplayArg = Port-    deriving (Ord, Eq, Show)--argumentDefinitions :: [ Arg ClockDisplayArg ]-argumentDefinitions =-       [ Arg { argIndex = Port-             , argName = Just "port"-             , argAbbr = Just 'p'-             , argData = argDataRequired "port" ArgtypeString-             , argDesc = "the port number which the clock display is listening at"-             }-       ]--portNumber :: Args ClockDisplayArg -> Int-portNumber args = read $ getRequiredArg args Port---- launch the program with a -p argument for the port number-main = do-    args <- parseArgsIO ArgsComplete argumentDefinitions-    vt <- mkVty-    DisplayRegion w h <- display_bounds $ terminal vt-    putStrLn $ show $ DisplayRegion w h-    listener (portNumber args) vt-
conductive-clock.cabal view
@@ -7,13 +7,13 @@ -- The package version. See the Haskell package versioning policy -- (http://www.haskell.org/haskellwiki/Package_versioning_policy) for -- standards guiding when and how versions should be incremented.-Version:             0.1+Version:             0.2  -- A short (one-line) description of the package. Synopsis:            a library for displaying musical time in a terminal-based clock  -- A longer description of the package.-Description:         This library is for generating strings containing clock time, sending them across OSC, and displaying them in a terminal. In addition to the library functions, it contains a sample executable for displaying musical time in a terminal-based clock.+Description:         PLEASE DO NOT INSTALL THIS AT THIS TIME. This library was for displaying a Conductive TempoClock in a separate terminal. Hackage says it does not build, and I have not been using it. This package is now empty, perhaps to return at a later date. It probably should have remained an experimental package on my website rather than appearing here in Hackage.  -- URL for the project homepage or repository. Homepage:            http://www.renickbell.net/doku.php?id=conductive-clock@@ -50,10 +50,10 @@  Library   -- Modules exported by the library.-  Exposed-modules:     Sound.Conductive.ClockDisplay, Sound.Conductive.Main, Sound.Conductive.ClockListener+  Exposed-modules:           -- Packages needed in order to build this package.-  Build-depends:       base < 5, conductive-base >=0.1 && <0.2, hosc >=0.8 && < 0.9, parseargs >=0.1 && <0.2, vty >=4.2 && < 4.3+  Build-depends:             -- Modules not exported by this package.   -- Other-modules: