packages feed

hamid 0.7 → 0.8

raw patch · 2 files changed

+48/−100 lines, 2 files

Files

hamid.cabal view
@@ -1,34 +1,36 @@ -name:                   hamid-version:                0.7-synopsis:               Binding to the OS level MIDI services+name:               hamid+version:            0.8+cabal-version:      >= 1.6+synopsis:           Binding to the OS level MIDI services (fork of system-midi). -description:            Partial implementation of the MIDI 1.0 standard to communicate-                        with physical or virtual MIDI devices, eg. MIDI keyboards.-                        Supported operating systems are Mac OS X and Win32 (not tested-                        under Leopard and Vista). See also the alsa-midi library for similar-                        function under Linux. Please note that there was no effort made (yet) to-                        be compatible with the other existing Haskell MIDI libraries.+description:        Cross-platform binding to Midi libraries. +                    Supports OS X and Windows (limited testing).+                    +                    The API use the same represeentation as Codec.Midi so system+                    and file I/O have the same interface. -                        Fork by Hans Höglund, adding support for Codec.Midi types et al.+                    This package was based on the system-midi package. -license:                BSD3-license-file:           LICENSE-author:                 Balazs Komuves-copyright:              (c) 2008 Balazs Komuves-maintainer:             hans@hanshoglund.se-stability:              Unstable-category:               Sound, System-tested-with:            GHC == 6.8.2-cabal-version:          >= 1.2-build-type:             Simple+license:            BSD3+license-file:       LICENSE+author:             Balazs Komuves, Hans Hoglund+copyright:          (c) 2008-2012 Balazs Komuves, Hans Hoglund+maintainer:         Hans Hoglund <hans@hanshoglund.se>+stability:          Stable+category:           Sound, System+build-type:         Simple -extra-source-files:     examples/monitor.hs, -                        examples/chords.hs, -                        examples/playmidi.hs,-                        examples/SMF.hs, -                        examples/GM.hs+extra-source-files: examples/monitor.hs, +                    examples/chords.hs, +                    examples/playmidi.hs,+                    examples/SMF.hs, +                    examples/GM.hs +source-repository head+  type:             git+  location:         git://github.com/hanshoglund/hamid.git+   library     build-depends:         base        >= 4 && < 5,@@ -45,8 +47,6 @@         TypeSynonymInstances,         FlexibleInstances,         EmptyDataDecls-    ghc-options:-        -threaded      if os(darwin)         other-modules:@@ -68,7 +68,7 @@         extra-libraries:             winmm -    if !os(darwin) && !   os(windows)+    if !os(darwin) && !os(windows)         other-modules:             System.MIDI.Placeholder 
src/System/MIDI/Placeholder.hs view
@@ -30,82 +30,30 @@          ) where -import Data.Word import System.MIDI.Base --- | The opaque data type representing a MIDI source.-data Source ---- | The opaque data type representing a MIDI destination.-data Destination ---- | The opaque data type representing a MIDI connection.-data Connection ---- Placeholder-class MIDIHasName c where---- | Enumerates the MIDI sources present in the system.-enumerateSources :: IO [Source]-enumerateSources = undefined---- | Enumerates the MIDI destinations present in the system.-enumerateDestinations :: IO [Destination]-enumerateDestinations = undefined---- | These functions return the name, model and manufacturer of a MIDI source \/ destination.--- --- Note: On Win32, only `getName` returns a somewhat meaningful string at the moment.-getName :: MIDIHasName a => a -> IO String-getModel :: MIDIHasName a => a -> IO String-getManufacturer :: MIDIHasName a => a -> IO String--getName = undefined-getModel = undefined-getManufacturer = undefined---- | --- Opens a MIDI Source.--- There are two possibilites to receive MIDI messages. The user can either support a callback function,--- or get the messages from an asynchronous buffer. However, mixing the two approaches is not allowed.-openSource :: Source -> Maybe ClientCallback -> IO Connection -openSource = undefined+data Source                 = Source      deriving (Eq, Ord, Show)+data Destination            = Destination deriving (Eq, Ord, Show)+data Connection             = Connection  deriving (Eq, Ord, Show) --- | Opens a MIDI Destination.-openDestination :: Destination -> IO Connection -openDestination = undefined+enumerateSources            = noImpl+enumerateDestinations       = noImpl --- | Gets the next event from a buffered connection (see also `openSource`)-getNextEvent :: Connection -> IO (Maybe MidiEvent)-getNextEvent = undefined+class MIDIHasName a where+getName                     = noImpl +getManufacturer             = noImpl +getModel                    = noImpl +openSource                  = noImpl+openDestination             = noImpl+close                       = noImpl+send                        = noImpl+sendSysEx                   = noImpl+start                       = noImpl+stop                        = noImpl --- | Gets all the events from the buffer (see also `openSource`)-getEvents :: Connection -> IO [MidiEvent]-getEvents = undefined-        --- | Sends a short message. The connection must be a `Destination`.-send :: Connection -> MidiMessage -> IO ()-send = undefined+getNextEvent                = noImpl+getEvents                   = noImpl+currentTime                 = noImpl --- | Sends a system exclusive message. You shouldn't include the starting \/ trailing bytes 0xF0 and 0xF7.--- --- Note: On Win32, the connection must be a `Destination`-sendSysEx :: Connection -> [Word8] -> IO ()-sendSysEx = undefined- --- | Starts a connection. This is required for receiving MIDI messages, and also for starting the clock.-start :: Connection -> IO ()-start = undefined+noImpl = error "Not implemented" --- | Stops a connection.-stop :: Connection -> IO ()-stop = undefined-    --- | Closes a MIDI Connection.-close :: Connection -> IO ()-close = undefined- --- | Returns the time elapsed since the last `start` call, in milisecs.-currentTime :: Connection -> IO Word32-currentTime = undefined-