-- | This is just to be able to produce a Haddock documentation on a Linux system.
-- Linux is not supported at all the moment.

module System.MIDI.Placeholder {-# WARNING "Linux is not supported by hmidi at the moment!" #-}
  ( module System.MIDI.Base

  , Source
  , Destination
  , Connection
 
  , enumerateSources
  , enumerateDestinations
  
  , MIDIHasName
  , getName
  , getModel
  , getManufacturer

  , openSource
  , openDestination
  , close
  , send
  , sendSysEx
  , start
  , stop

  , getNextEvent
  , checkNextEvent
  , getEvents
  , getEventsUntil
  , currentTime
    
  ) 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 

class MIDIHasName c

instance MIDIHasName Source
instance MIDIHasName Destination

--------------------------------------------------------------------------------

linuxUndefined :: a
linuxUndefined :: a
linuxUndefined = [Char] -> a
forall a. HasCallStack => [Char] -> a
error [Char]
"hmidi: Linux is not supported"

--------------------------------------------------------------------------------

-- |Enumerates the MIDI sources present in the system.
enumerateSources :: IO [Source]
enumerateSources :: IO [Source]
enumerateSources = IO [Source]
forall a. a
linuxUndefined

-- |Enumerates the MIDI destinations present in the system.
enumerateDestinations :: IO [Destination]
enumerateDestinations :: IO [Destination]
enumerateDestinations = IO [Destination]
forall a. a
linuxUndefined

-- |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 :: a -> IO [Char]
getName = a -> IO [Char]
forall a. a
linuxUndefined
getModel :: a -> IO [Char]
getModel = a -> IO [Char]
forall a. a
linuxUndefined
getManufacturer :: a -> IO [Char]
getManufacturer = a -> IO [Char]
forall a. a
linuxUndefined

-- |Opens a MIDI Source.
-- There are two possibilites to receive MIDI messages. The user can either supply 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 :: Source -> Maybe ClientCallback -> IO Connection
openSource = Source -> Maybe ClientCallback -> IO Connection
forall a. a
linuxUndefined

-- |Opens a MIDI Destination.
openDestination :: Destination -> IO Connection 
openDestination :: Destination -> IO Connection
openDestination = Destination -> IO Connection
forall a. a
linuxUndefined

-- |Gets the next event from a buffered connection (see also `openSource`)
getNextEvent :: Connection -> IO (Maybe MidiEvent)
getNextEvent :: Connection -> IO (Maybe MidiEvent)
getNextEvent = Connection -> IO (Maybe MidiEvent)
forall a. a
linuxUndefined

-- | Checks the next event from a buffered connection, but does not remove it from the buffer.
checkNextEvent :: Connection -> IO (Maybe MidiEvent)
checkNextEvent :: Connection -> IO (Maybe MidiEvent)
checkNextEvent = Connection -> IO (Maybe MidiEvent)
forall a. a
linuxUndefined

-- | Gets all the events with timestamp less than the specified from the buffer.
getEventsUntil :: Connection -> TimeStamp -> IO [MidiEvent]
getEventsUntil :: Connection -> TimeStamp -> IO [MidiEvent]
getEventsUntil = Connection -> TimeStamp -> IO [MidiEvent]
forall a. a
linuxUndefined

-- |Gets all the events from the buffer (see also `openSource`)
getEvents :: Connection -> IO [MidiEvent]
getEvents :: Connection -> IO [MidiEvent]
getEvents = Connection -> IO [MidiEvent]
forall a. a
linuxUndefined
      
-- |Sends a short message. The connection must be a `Destination`.
send :: Connection -> MidiMessage -> IO ()
send :: Connection -> MidiMessage -> IO ()
send = Connection -> MidiMessage -> IO ()
forall a. a
linuxUndefined

-- |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 :: Connection -> [Word8] -> IO ()
sendSysEx = Connection -> [Word8] -> IO ()
forall a. a
linuxUndefined
 
-- |Starts a connection. This is required for receiving MIDI messages, and also for starting the clock.
start :: Connection -> IO ()
start :: Connection -> IO ()
start = Connection -> IO ()
forall a. a
linuxUndefined

-- |Stops a connection.
stop :: Connection -> IO ()
stop :: Connection -> IO ()
stop = Connection -> IO ()
forall a. a
linuxUndefined
  
-- |Closes a MIDI Connection.
close :: Connection -> IO ()
close :: Connection -> IO ()
close = Connection -> IO ()
forall a. a
linuxUndefined
 
-- |Returns the time elapsed since the last `start` call, in milisecs.
currentTime :: Connection -> IO Word32
currentTime :: Connection -> IO TimeStamp
currentTime = Connection -> IO TimeStamp
forall a. a
linuxUndefined
 
--------------------------------------------------------------------------------