packages feed

bindings-EsounD-0.1: Bindings/EsounD.hsc

#include <bindings.dsl.h>
#include <esd.h>

module Bindings.EsounD where
#strict_import
import Bindings.AudioFile

#globalarray ESD_UNIX_SOCKET_DIR , CChar
#globalarray ESD_UNIX_SOCKET_NAME, CChar

#num ESD_BUF_SIZE
#num ESD_MAX_WRITE_SIZE
#num ESD_KEY_LEN
#num ESD_DEFAULT_PORT
#num ESD_DEFAULT_RATE
#num ESD_NAME_MAX
#num ESD_ENDIAN_KEY
#num ESD_VOLUME_BASE

#num ESD_PROTO_CONNECT
#num ESD_PROTO_LOCK
#num ESD_PROTO_UNLOCK
#num ESD_PROTO_STREAM_PLAY
#num ESD_PROTO_STREAM_REC
#num ESD_PROTO_STREAM_MON
#num ESD_PROTO_SAMPLE_CACHE
#num ESD_PROTO_SAMPLE_FREE
#num ESD_PROTO_SAMPLE_PLAY
#num ESD_PROTO_SAMPLE_LOOP
#num ESD_PROTO_SAMPLE_STOP
#num ESD_PROTO_SAMPLE_KILL
#num ESD_PROTO_STANDBY
#num ESD_PROTO_RESUME
#num ESD_PROTO_SAMPLE_GETID
#num ESD_PROTO_STREAM_FILT
#num ESD_PROTO_SERVER_INFO
#num ESD_PROTO_ALL_INFO
#num ESD_PROTO_SUBSCRIBE
#num ESD_PROTO_UNSUBSCRIBE
#num ESD_PROTO_STREAM_PAN
#num ESD_PROTO_SAMPLE_PAN
#num ESD_PROTO_STANDBY_MODE
#num ESD_PROTO_LATENCY
#num ESD_PROTO_MAX

#num ESD_MASK_BITS
#num ESD_BITS8
#num ESD_BITS16

#num ESD_MASK_CHAN
#num ESD_MONO
#num ESD_STEREO

#num ESD_MASK_MODE
#num ESD_STREAM
#num ESD_SAMPLE
#num ESD_ADPCM

#num ESD_MASK_FUNC
#num ESD_PLAY
#num ESD_MONITOR
#num ESD_RECORD
#num ESD_STOP
#num ESD_LOOP

#integral_t esd_format_t
#integral_t esd_proto_t

#integral_t octet

#ccall esd_open_sound, Ptr CChar -> IO CInt
#ccall esd_send_auth , CInt -> IO CInt
#ccall esd_lock      , CInt -> IO CInt
#ccall esd_unlock    , CInt -> IO CInt
#ccall esd_standby   , CInt -> IO CInt
#ccall esd_resume    , CInt -> IO CInt

#ccall esd_play_stream           , <esd_format_t> -> CInt -> Ptr CChar -> Ptr CChar -> IO CInt
#ccall esd_play_stream_fallback  , <esd_format_t> -> CInt -> Ptr CChar -> Ptr CChar -> IO CInt
#ccall esd_monitor_stream        , <esd_format_t> -> CInt -> Ptr CChar -> Ptr CChar -> IO CInt
#ccall esd_record_stream         , <esd_format_t> -> CInt -> Ptr CChar -> Ptr CChar -> IO CInt
#ccall esd_record_stream_fallback, <esd_format_t> -> CInt -> Ptr CChar -> Ptr CChar -> IO CInt
#ccall esd_filter_stream         , <esd_format_t> -> CInt -> Ptr CChar -> Ptr CChar -> IO CInt
#ccall esd_sample_cache          , CInt -> <esd_format_t> -> CInt -> CInt -> Ptr CChar -> IO CInt
#ccall esd_confirm_sample_cache  , CInt -> IO CInt
#ccall esd_sample_getid          , CInt -> Ptr CChar -> IO CInt
#ccall esd_sample_free           , CInt -> CInt -> IO CInt
#ccall esd_sample_play           , CInt -> CInt -> IO CInt
#ccall esd_sample_loop           , CInt -> CInt -> IO CInt
#ccall esd_sample_stop           , CInt -> CInt -> IO CInt
#ccall esd_sample_kill           , CInt -> CInt -> IO CInt
#ccall esd_close                 , CInt -> IO CInt
#ccall esd_get_latency           , CInt -> IO CInt

#starttype struct esd_server_info
#  field version, CInt
#  field format , <esd_format_t>
#  field rate   , CInt
#stoptype
#synonym_t esd_server_info_t, <esd_server_info>

#starttype struct esd_player_info
#  field next           , Ptr <esd_player_info>
#  field server         , Ptr <esd_server_info_t>
#  field source_id      , CInt
#  array_field name     , CChar
#  field rate           , CInt
#  field left_vol_scale , CInt
#  field right_vol_scale, CInt
#  field format         , <esd_format_t>
#stoptype
#synonym_t esd_player_info_t, <esd_player_info>

#starttype struct esd_sample_info
#  field next           , Ptr <esd_sample_info>
#  field server         , Ptr <esd_server_info_t>
#  field sample_id      , CInt
#  array_field name     , CChar
#  field rate           , CInt
#  field left_vol_scale , CInt
#  field right_vol_scale, CInt
#  field format         , <esd_format_t>
#  field length         , CInt
#stoptype
#synonym_t esd_sample_info_t, <esd_sample_info>

#starttype struct esd_info
#  field server     , Ptr <esd_server_info_t>
#  field player_list, Ptr <esd_player_info_t>
#  field sample_list, Ptr <esd_sample_info_t>
#stoptype
#synonym_t esd_info_t, <esd_info>

#num ESM_ERROR
#num ESM_ON_STANDBY
#num ESM_ON_AUTOSTANDBY
#num ESM_RUNNING
#integral_t esd_standby_mode_t

#callback esd_new_player_callback_t, Ptr <esd_player_info_t> -> IO CInt
#callback esd_old_player_callback_t, Ptr <esd_player_info_t> -> IO CInt
#callback esd_new_sample_callback_t, Ptr <esd_sample_info_t> -> IO CInt
#callback esd_old_sample_callback_t, Ptr <esd_sample_info_t> -> IO CInt

#starttype struct esd_update_info_callbacks
#  field esd_new_player_callback, Ptr <esd_new_player_callback_t>
#  field esd_old_player_callback, Ptr <esd_old_player_callback_t>
#  field esd_new_sample_callback, Ptr <esd_new_sample_callback_t>
#  field esd_old_sample_callback, Ptr <esd_old_sample_callback_t>
#stoptype
#synonym_t esd_update_info_callbacks_t, <esd_update_info_callbacks>

#ccall esd_print_server_info     , Ptr <esd_server_info_t> -> IO ()
#ccall esd_print_player_info     , Ptr <esd_player_info_t> -> IO ()
#ccall esd_print_sample_info     , Ptr <esd_sample_info_t> -> IO ()
#ccall esd_print_all_info        , Ptr <esd_info_t> -> IO ()
#ccall esd_get_server_info       , CInt -> IO (Ptr <esd_server_info_t>)
#ccall esd_free_server_info      , Ptr <esd_server_info_t> -> IO ()
#ccall esd_get_all_info          , CInt -> IO (Ptr <esd_info_t>)
#ccall esd_subscribe_all_info    , CInt -> IO (Ptr <esd_info_t>)
#ccall esd_update_info           , CInt -> Ptr <esd_info_t> -> Ptr <esd_update_info_callbacks_t> -> IO (Ptr <esd_info_t>)
#ccall esd_unsubscribe_info      , CInt -> IO (Ptr <esd_info_t>)
#ccall esd_free_all_info         , Ptr <esd_info_t> -> IO ()
#ccall esd_set_stream_pan        , CInt -> CInt -> CInt -> CInt -> IO CInt
#ccall esd_set_default_sample_pan, CInt -> CInt -> CInt -> CInt -> IO CInt
#ccall esd_get_standby_mode      , CInt -> IO <esd_standby_mode_t>

#ccall esd_send_file , CInt -> <AFfilehandle> -> CInt -> IO CInt
#ccall esd_play_file , Ptr CChar -> Ptr CChar -> CInt -> IO CInt
#ccall esd_file_cache, CInt -> Ptr CChar -> Ptr CChar -> IO CInt

#globalvar esd_audio_format, <esd_format_t>
#globalvar esd_audio_rate  , CInt
#globalvar esd_audio_device, Ptr CChar

#ccall esd_audio_devices, IO (Ptr CChar)
#ccall esd_audio_open   , IO CInt
#ccall esd_audio_close  , IO ()
#ccall esd_audio_pause  , IO ()
#ccall esd_audio_write  , Ptr () -> CInt -> IO CInt
#ccall esd_audio_read   , Ptr () -> CInt -> IO CInt
#ccall esd_audio_flush  , IO ()

#ccall esd_get_socket_dirname, IO (Ptr CChar)
#ccall esd_get_socket_name   , IO (Ptr CChar)

#ccall have_ipv6, IO CInt