module Sound.Fluidsynth.Internal where
import Foreign.Ptr (Ptr,FunPtr,plusPtr)
import Foreign.Ptr (wordPtrToPtr,castPtrToFunPtr)
import Foreign.Storable
import Foreign.C.Types
import Foreign.C.String (CString,CStringLen,CWString,CWStringLen)
import Foreign.Marshal.Alloc (alloca)
import Foreign.Marshal.Array (peekArray,pokeArray)
import Data.Int
import Data.Word
data C'fluid_settings_t = C'fluid_settings_t
foreign import ccall "new_fluid_settings" c'new_fluid_settings
:: IO (Ptr C'fluid_settings_t)
foreign import ccall "&new_fluid_settings" p'new_fluid_settings
:: FunPtr (IO (Ptr C'fluid_settings_t))
foreign import ccall "delete_fluid_settings" c'delete_fluid_settings
:: Ptr C'fluid_settings_t -> IO ()
foreign import ccall "&delete_fluid_settings" p'delete_fluid_settings
:: FunPtr (Ptr C'fluid_settings_t -> IO ())
foreign import ccall "fluid_settings_get_type" c'fluid_settings_get_type
:: Ptr C'fluid_settings_t -> CString -> IO CInt
foreign import ccall "&fluid_settings_get_type" p'fluid_settings_get_type
:: FunPtr (Ptr C'fluid_settings_t -> CString -> IO CInt)
foreign import ccall "fluid_settings_setstr" c'fluid_settings_setstr
:: Ptr C'fluid_settings_t -> CString -> CString -> IO CInt
foreign import ccall "&fluid_settings_setstr" p'fluid_settings_setstr
:: FunPtr (Ptr C'fluid_settings_t -> CString -> CString -> IO CInt)
foreign import ccall "fluid_settings_getstr" c'fluid_settings_getstr
:: Ptr C'fluid_settings_t -> CString -> Ptr CString -> IO CInt
foreign import ccall "&fluid_settings_getstr" p'fluid_settings_getstr
:: FunPtr (Ptr C'fluid_settings_t -> CString -> Ptr CString -> IO CInt)
foreign import ccall "fluid_settings_setnum" c'fluid_settings_setnum
:: Ptr C'fluid_settings_t -> CString -> CDouble -> IO CInt
foreign import ccall "&fluid_settings_setnum" p'fluid_settings_setnum
:: FunPtr (Ptr C'fluid_settings_t -> CString -> CDouble -> IO CInt)
foreign import ccall "fluid_settings_getnum" c'fluid_settings_getnum
:: Ptr C'fluid_settings_t -> CString -> Ptr CDouble -> IO CInt
foreign import ccall "&fluid_settings_getnum" p'fluid_settings_getnum
:: FunPtr (Ptr C'fluid_settings_t -> CString -> Ptr CDouble -> IO CInt)
foreign import ccall "fluid_settings_setint" c'fluid_settings_setint
:: Ptr C'fluid_settings_t -> CString -> CInt -> IO CInt
foreign import ccall "&fluid_settings_setint" p'fluid_settings_setint
:: FunPtr (Ptr C'fluid_settings_t -> CString -> CInt -> IO CInt)
foreign import ccall "fluid_settings_getint" c'fluid_settings_getint
:: Ptr C'fluid_settings_t -> CString -> Ptr CInt -> IO CInt
foreign import ccall "&fluid_settings_getint" p'fluid_settings_getint
:: FunPtr (Ptr C'fluid_settings_t -> CString -> Ptr CInt -> IO CInt)
c'FLUID_NO_TYPE = 1
c'FLUID_NO_TYPE :: (Num a) => a
c'FLUID_NUM_TYPE = 0
c'FLUID_NUM_TYPE :: (Num a) => a
c'FLUID_INT_TYPE = 1
c'FLUID_INT_TYPE :: (Num a) => a
c'FLUID_STR_TYPE = 2
c'FLUID_STR_TYPE :: (Num a) => a
c'FLUID_SET_TYPE = 3
c'FLUID_SET_TYPE :: (Num a) => a
data C'fluid_synth_t = C'fluid_synth_t
foreign import ccall "new_fluid_synth" c'new_fluid_synth
:: Ptr C'fluid_settings_t -> IO (Ptr C'fluid_synth_t)
foreign import ccall "&new_fluid_synth" p'new_fluid_synth
:: FunPtr (Ptr C'fluid_settings_t -> IO (Ptr C'fluid_synth_t))
foreign import ccall "delete_fluid_synth" c'delete_fluid_synth
:: Ptr C'fluid_synth_t -> IO ()
foreign import ccall "&delete_fluid_synth" p'delete_fluid_synth
:: FunPtr (Ptr C'fluid_synth_t -> IO ())
foreign import ccall "fluid_synth_noteon" c'fluid_synth_noteon
:: Ptr C'fluid_synth_t -> CInt -> CInt -> CInt -> IO CInt
foreign import ccall "&fluid_synth_noteon" p'fluid_synth_noteon
:: FunPtr (Ptr C'fluid_synth_t -> CInt -> CInt -> CInt -> IO CInt)
foreign import ccall "fluid_synth_noteoff" c'fluid_synth_noteoff
:: Ptr C'fluid_synth_t -> CInt -> CInt -> IO CInt
foreign import ccall "&fluid_synth_noteoff" p'fluid_synth_noteoff
:: FunPtr (Ptr C'fluid_synth_t -> CInt -> CInt -> IO CInt)
foreign import ccall "fluid_synth_cc" c'fluid_synth_cc
:: Ptr C'fluid_synth_t -> CInt -> CInt -> CInt -> IO CInt
foreign import ccall "&fluid_synth_cc" p'fluid_synth_cc
:: FunPtr (Ptr C'fluid_synth_t -> CInt -> CInt -> CInt -> IO CInt)
foreign import ccall "fluid_synth_pitch_bend" c'fluid_synth_pitch_bend
:: Ptr C'fluid_synth_t -> CInt -> CInt -> IO CInt
foreign import ccall "&fluid_synth_pitch_bend" p'fluid_synth_pitch_bend
:: FunPtr (Ptr C'fluid_synth_t -> CInt -> CInt -> IO CInt)
foreign import ccall "fluid_synth_pitch_wheel_sens" c'fluid_synth_pitch_wheel_sens
:: Ptr C'fluid_synth_t -> CInt -> CInt -> IO CInt
foreign import ccall "&fluid_synth_pitch_wheel_sens" p'fluid_synth_pitch_wheel_sens
:: FunPtr (Ptr C'fluid_synth_t -> CInt -> CInt -> IO CInt)
foreign import ccall "fluid_synth_program_change" c'fluid_synth_program_change
:: Ptr C'fluid_synth_t -> CInt -> CInt -> IO CInt
foreign import ccall "&fluid_synth_program_change" p'fluid_synth_program_change
:: FunPtr (Ptr C'fluid_synth_t -> CInt -> CInt -> IO CInt)
foreign import ccall "fluid_synth_bank_select" c'fluid_synth_bank_select
:: Ptr C'fluid_synth_t -> CInt -> CInt -> IO CInt
foreign import ccall "&fluid_synth_bank_select" p'fluid_synth_bank_select
:: FunPtr (Ptr C'fluid_synth_t -> CInt -> CInt -> IO CInt)
foreign import ccall "fluid_synth_sfload" c'fluid_synth_sfload
:: Ptr C'fluid_synth_t -> CString -> CInt -> IO CInt
foreign import ccall "&fluid_synth_sfload" p'fluid_synth_sfload
:: FunPtr (Ptr C'fluid_synth_t -> CString -> CInt -> IO CInt)
foreign import ccall "fluid_synth_sfreload" c'fluid_synth_sfreload
:: Ptr C'fluid_synth_t -> CUInt -> IO CInt
foreign import ccall "&fluid_synth_sfreload" p'fluid_synth_sfreload
:: FunPtr (Ptr C'fluid_synth_t -> CUInt -> IO CInt)
foreign import ccall "fluid_synth_sfunload" c'fluid_synth_sfunload
:: Ptr C'fluid_synth_t -> CUInt -> CInt -> IO CInt
foreign import ccall "&fluid_synth_sfunload" p'fluid_synth_sfunload
:: FunPtr (Ptr C'fluid_synth_t -> CUInt -> CInt -> IO CInt)
data C'fluid_audio_driver_t = C'fluid_audio_driver_t
foreign import ccall "new_fluid_audio_driver" c'new_fluid_audio_driver
:: Ptr C'fluid_settings_t -> Ptr C'fluid_synth_t -> IO (Ptr C'fluid_audio_driver_t)
foreign import ccall "&new_fluid_audio_driver" p'new_fluid_audio_driver
:: FunPtr (Ptr C'fluid_settings_t -> Ptr C'fluid_synth_t -> IO (Ptr C'fluid_audio_driver_t))
foreign import ccall "delete_fluid_audio_driver" c'delete_fluid_audio_driver
:: Ptr C'fluid_audio_driver_t -> IO ()
foreign import ccall "&delete_fluid_audio_driver" p'delete_fluid_audio_driver
:: FunPtr (Ptr C'fluid_audio_driver_t -> IO ())
data C'fluid_player_t = C'fluid_player_t
foreign import ccall "new_fluid_player" c'new_fluid_player
:: Ptr C'fluid_synth_t -> IO (Ptr C'fluid_player_t)
foreign import ccall "&new_fluid_player" p'new_fluid_player
:: FunPtr (Ptr C'fluid_synth_t -> IO (Ptr C'fluid_player_t))
foreign import ccall "delete_fluid_player" c'delete_fluid_player
:: Ptr C'fluid_player_t -> IO ()
foreign import ccall "&delete_fluid_player" p'delete_fluid_player
:: FunPtr (Ptr C'fluid_player_t -> IO ())
foreign import ccall "fluid_player_add" c'fluid_player_add
:: Ptr C'fluid_player_t -> CString -> IO CInt
foreign import ccall "&fluid_player_add" p'fluid_player_add
:: FunPtr (Ptr C'fluid_player_t -> CString -> IO CInt)
foreign import ccall "fluid_player_play" c'fluid_player_play
:: Ptr C'fluid_player_t -> IO CInt
foreign import ccall "&fluid_player_play" p'fluid_player_play
:: FunPtr (Ptr C'fluid_player_t -> IO CInt)
foreign import ccall "fluid_player_stop" c'fluid_player_stop
:: Ptr C'fluid_player_t -> IO CInt
foreign import ccall "&fluid_player_stop" p'fluid_player_stop
:: FunPtr (Ptr C'fluid_player_t -> IO CInt)
foreign import ccall "fluid_player_join" c'fluid_player_join
:: Ptr C'fluid_player_t -> IO CInt
foreign import ccall "&fluid_player_join" p'fluid_player_join
:: FunPtr (Ptr C'fluid_player_t -> IO CInt)
data C'fluid_event_t = C'fluid_event_t
foreign import ccall "new_fluid_event" c'new_fluid_event
:: IO (Ptr C'fluid_event_t)
foreign import ccall "&new_fluid_event" p'new_fluid_event
:: FunPtr (IO (Ptr C'fluid_event_t))
foreign import ccall "delete_fluid_event" c'delete_fluid_event
:: Ptr C'fluid_event_t -> IO ()
foreign import ccall "&delete_fluid_event" p'delete_fluid_event
:: FunPtr (Ptr C'fluid_event_t -> IO ())
foreign import ccall "fluid_event_set_source" c'fluid_event_set_source
:: Ptr C'fluid_event_t -> CShort -> IO ()
foreign import ccall "&fluid_event_set_source" p'fluid_event_set_source
:: FunPtr (Ptr C'fluid_event_t -> CShort -> IO ())
foreign import ccall "fluid_event_set_dest" c'fluid_event_set_dest
:: Ptr C'fluid_event_t -> CShort -> IO ()
foreign import ccall "&fluid_event_set_dest" p'fluid_event_set_dest
:: FunPtr (Ptr C'fluid_event_t -> CShort -> IO ())
foreign import ccall "fluid_event_timer" c'fluid_event_timer
:: Ptr C'fluid_event_t -> Ptr () -> IO ()
foreign import ccall "&fluid_event_timer" p'fluid_event_timer
:: FunPtr (Ptr C'fluid_event_t -> Ptr () -> IO ())
foreign import ccall "fluid_event_note" c'fluid_event_note
:: Ptr C'fluid_event_t -> CInt -> CShort -> CShort -> CUInt -> IO ()
foreign import ccall "&fluid_event_note" p'fluid_event_note
:: FunPtr (Ptr C'fluid_event_t -> CInt -> CShort -> CShort -> CUInt -> IO ())
foreign import ccall "fluid_event_noteon" c'fluid_event_noteon
:: Ptr C'fluid_event_t -> CInt -> CShort -> CShort -> IO ()
foreign import ccall "&fluid_event_noteon" p'fluid_event_noteon
:: FunPtr (Ptr C'fluid_event_t -> CInt -> CShort -> CShort -> IO ())
foreign import ccall "fluid_event_noteoff" c'fluid_event_noteoff
:: Ptr C'fluid_event_t -> CInt -> CShort -> IO ()
foreign import ccall "&fluid_event_noteoff" p'fluid_event_noteoff
:: FunPtr (Ptr C'fluid_event_t -> CInt -> CShort -> IO ())
foreign import ccall "fluid_event_program_change" c'fluid_event_program_change
:: Ptr C'fluid_event_t -> CInt -> CShort -> IO ()
foreign import ccall "&fluid_event_program_change" p'fluid_event_program_change
:: FunPtr (Ptr C'fluid_event_t -> CInt -> CShort -> IO ())
foreign import ccall "fluid_event_pitch_bend" c'fluid_event_pitch_bend
:: Ptr C'fluid_event_t -> CInt -> CInt -> IO ()
foreign import ccall "&fluid_event_pitch_bend" p'fluid_event_pitch_bend
:: FunPtr (Ptr C'fluid_event_t -> CInt -> CInt -> IO ())
foreign import ccall "fluid_event_pitch_wheelsens" c'fluid_event_pitch_wheelsens
:: Ptr C'fluid_event_t -> CInt -> CShort -> IO ()
foreign import ccall "&fluid_event_pitch_wheelsens" p'fluid_event_pitch_wheelsens
:: FunPtr (Ptr C'fluid_event_t -> CInt -> CShort -> IO ())
foreign import ccall "fluid_event_volume" c'fluid_event_volume
:: Ptr C'fluid_event_t -> CInt -> CShort -> IO ()
foreign import ccall "&fluid_event_volume" p'fluid_event_volume
:: FunPtr (Ptr C'fluid_event_t -> CInt -> CShort -> IO ())
foreign import ccall "fluid_event_get_source" c'fluid_event_get_source
:: Ptr C'fluid_event_t -> CShort
foreign import ccall "&fluid_event_get_source" p'fluid_event_get_source
:: FunPtr (Ptr C'fluid_event_t -> CShort)
foreign import ccall "fluid_event_get_dest" c'fluid_event_get_dest
:: Ptr C'fluid_event_t -> CShort
foreign import ccall "&fluid_event_get_dest" p'fluid_event_get_dest
:: FunPtr (Ptr C'fluid_event_t -> CShort)
data C'fluid_sequencer_t = C'fluid_sequencer_t
type C'fluid_event_callback_t = FunPtr (FunPtr (CUInt -> Ptr C'fluid_event_t -> Ptr C'fluid_sequencer_t -> Ptr () -> IO ()))
foreign import ccall "wrapper" mk'fluid_event_callback_t
:: (FunPtr (CUInt -> Ptr C'fluid_event_t -> Ptr C'fluid_sequencer_t -> Ptr () -> IO ())) -> IO C'fluid_event_callback_t
foreign import ccall "dynamic" mK'fluid_event_callback_t
:: C'fluid_event_callback_t -> (FunPtr (CUInt -> Ptr C'fluid_event_t -> Ptr C'fluid_sequencer_t -> Ptr () -> IO ()))
foreign import ccall "new_fluid_sequencer" c'new_fluid_sequencer
:: IO (Ptr C'fluid_sequencer_t)
foreign import ccall "&new_fluid_sequencer" p'new_fluid_sequencer
:: FunPtr (IO (Ptr C'fluid_sequencer_t))
foreign import ccall "delete_fluid_sequencer" c'delete_fluid_sequencer
:: Ptr C'fluid_sequencer_t -> IO ()
foreign import ccall "&delete_fluid_sequencer" p'delete_fluid_sequencer
:: FunPtr (Ptr C'fluid_sequencer_t -> IO ())
foreign import ccall "fluid_sequencer_register_client" c'fluid_sequencer_register_client
:: Ptr C'fluid_sequencer_t -> CString -> Ptr C'fluid_event_callback_t -> Ptr () -> IO CShort
foreign import ccall "&fluid_sequencer_register_client" p'fluid_sequencer_register_client
:: FunPtr (Ptr C'fluid_sequencer_t -> CString -> Ptr C'fluid_event_callback_t -> Ptr () -> IO CShort)
foreign import ccall "fluid_sequencer_unregister_client" c'fluid_sequencer_unregister_client
:: Ptr C'fluid_sequencer_t -> CShort -> IO ()
foreign import ccall "&fluid_sequencer_unregister_client" p'fluid_sequencer_unregister_client
:: FunPtr (Ptr C'fluid_sequencer_t -> CShort -> IO ())
foreign import ccall "fluid_sequencer_count_clients" c'fluid_sequencer_count_clients
:: Ptr C'fluid_sequencer_t -> IO CInt
foreign import ccall "&fluid_sequencer_count_clients" p'fluid_sequencer_count_clients
:: FunPtr (Ptr C'fluid_sequencer_t -> IO CInt)
foreign import ccall "fluid_sequencer_get_client_id" c'fluid_sequencer_get_client_id
:: Ptr C'fluid_sequencer_t -> CInt -> IO CShort
foreign import ccall "&fluid_sequencer_get_client_id" p'fluid_sequencer_get_client_id
:: FunPtr (Ptr C'fluid_sequencer_t -> CInt -> IO CShort)
foreign import ccall "fluid_sequencer_get_client_name" c'fluid_sequencer_get_client_name
:: Ptr C'fluid_sequencer_t -> CInt -> IO CString
foreign import ccall "&fluid_sequencer_get_client_name" p'fluid_sequencer_get_client_name
:: FunPtr (Ptr C'fluid_sequencer_t -> CInt -> IO CString)
foreign import ccall "fluid_sequencer_client_is_dest" c'fluid_sequencer_client_is_dest
:: Ptr C'fluid_sequencer_t -> CInt -> IO CInt
foreign import ccall "&fluid_sequencer_client_is_dest" p'fluid_sequencer_client_is_dest
:: FunPtr (Ptr C'fluid_sequencer_t -> CInt -> IO CInt)
foreign import ccall "fluid_sequencer_send_now" c'fluid_sequencer_send_now
:: Ptr C'fluid_sequencer_t -> Ptr C'fluid_event_t -> IO ()
foreign import ccall "&fluid_sequencer_send_now" p'fluid_sequencer_send_now
:: FunPtr (Ptr C'fluid_sequencer_t -> Ptr C'fluid_event_t -> IO ())
foreign import ccall "fluid_sequencer_send_at" c'fluid_sequencer_send_at
:: Ptr C'fluid_sequencer_t -> Ptr C'fluid_event_t -> CUInt -> Int -> IO ()
foreign import ccall "&fluid_sequencer_send_at" p'fluid_sequencer_send_at
:: FunPtr (Ptr C'fluid_sequencer_t -> Ptr C'fluid_event_t -> CUInt -> Int -> IO ())
foreign import ccall "fluid_sequencer_get_tick" c'fluid_sequencer_get_tick
:: Ptr C'fluid_sequencer_t -> IO CUInt
foreign import ccall "&fluid_sequencer_get_tick" p'fluid_sequencer_get_tick
:: FunPtr (Ptr C'fluid_sequencer_t -> IO CUInt)
foreign import ccall "fluid_sequencer_set_time_scale" c'fluid_sequencer_set_time_scale
:: Ptr C'fluid_sequencer_t -> CDouble -> IO ()
foreign import ccall "&fluid_sequencer_set_time_scale" p'fluid_sequencer_set_time_scale
:: FunPtr (Ptr C'fluid_sequencer_t -> CDouble -> IO ())
foreign import ccall "fluid_sequencer_get_time_scale" c'fluid_sequencer_get_time_scale
:: Ptr C'fluid_sequencer_t -> IO CDouble
foreign import ccall "&fluid_sequencer_get_time_scale" p'fluid_sequencer_get_time_scale
:: FunPtr (Ptr C'fluid_sequencer_t -> IO CDouble)
foreign import ccall "fluid_sequencer_register_fluidsynth" c'fluid_sequencer_register_fluidsynth
:: Ptr C'fluid_sequencer_t -> Ptr C'fluid_synth_t -> IO CShort
foreign import ccall "&fluid_sequencer_register_fluidsynth" p'fluid_sequencer_register_fluidsynth
:: FunPtr (Ptr C'fluid_sequencer_t -> Ptr C'fluid_synth_t -> IO CShort)