;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; LUSH Lisp Universal Shell
;;;   Copyright (C) 2002 Leon Bottou, Yann Le Cun, AT&T Corp, NECI.
;;; Includes parts of TL3:
;;;   Copyright (C) 1987-1999 Leon Bottou and Neuristique.
;;; Includes selected parts of SN3.2:
;;;   Copyright (C) 1991-2001 AT&T Corp.
;;;
;;; Includes information derived from the GSL (Gnu Scientific Library)
;;;   header files which are copyrighted and distributed under the GPL
;;;   by their respective authors.
;;;
;;; This program is free software; you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 2 of the License, or
;;; (at your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program; if not, write to the Free Software
;;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(libload "alsa/alsa-config")



#? *** seq

;; dummy function that adds Alsa C header files in C file
(eval `(de dummy_seq () ,alsa-cpheader-cmd ()))

#? * (dummy_seq)
#? * (snd_seq_open <handle> <name> <streams> <mode>)
#? * (snd_seq_open_lconf <handle> <name> <streams> <mode> <lconf>)
#? * (snd_seq_name <seq>)
#? * (snd_seq_type <seq>)
#? * (snd_seq_close <handle>)
#? * (snd_seq_poll_descriptors_count <handle> <events>)
#? * (snd_seq_poll_descriptors <handle> <pfds> <space> <events>)
#? * (snd_seq_poll_descriptors_revents <seq> <pfds> <nfds> <revents>)
#? * (snd_seq_nonblock <handle> <nonblock>)
#? * (snd_seq_client_id <handle>)
#? * (snd_seq_get_output_buffer_size <handle>)
#? * (snd_seq_get_input_buffer_size <handle>)
#? * (snd_seq_set_output_buffer_size <handle> <size>)
#? * (snd_seq_set_input_buffer_size <handle> <size>)
#? * (snd_seq_system_info_sizeof)
#? * (snd_seq_system_info_alloca <s>)
#? * (snd_seq_system_info_malloc <s>)
#? * (snd_seq_system_info_free <s>)
#? * (snd_seq_system_info_copy <dst> <src>)
#? * (snd_seq_system_info_get_queues <info>)
#? * (snd_seq_system_info_get_clients <info>)
#? * (snd_seq_system_info_get_ports <info>)
#? * (snd_seq_system_info_get_channels <info>)
#? * (snd_seq_system_info_get_cur_clients <info>)
#? * (snd_seq_system_info_get_cur_queues <info>)
#? * (snd_seq_system_info <handle> <info>)
#? * (snd_seq_client_info_sizeof)
#? * (snd_seq_client_info_alloca <s>)
#? * (snd_seq_client_info_malloc <s>)
#? * (snd_seq_client_info_free <s>)
#? * (snd_seq_client_info_copy <dst> <src>)
#? * (snd_seq_client_info_get_client <info>)
#? * (snd_seq_client_info_get_type <info>)
#? * (snd_seq_client_info_get_name <info>)
#? * (snd_seq_client_info_get_broadcast_filter <info>)
#? * (snd_seq_client_info_get_error_bounce <info>)
#? * (snd_seq_client_info_get_event_filter <info>)
#? * (snd_seq_client_info_get_num_ports <info>)
#? * (snd_seq_client_info_get_event_lost <info>)
#? * (snd_seq_client_info_set_client <info> <client>)
#? * (snd_seq_client_info_set_name <info> <name>)
#? * (snd_seq_client_info_set_broadcast_filter <info> <val>)
#? * (snd_seq_client_info_set_error_bounce <info> <val>)
#? * (snd_seq_client_info_set_event_filter <info> <filter>)
#? * (snd_seq_get_client_info <handle> <info>)
#? * (snd_seq_get_any_client_info <handle> <client> <info>)
#? * (snd_seq_set_client_info <handle> <info>)
#? * (snd_seq_query_next_client <handle> <info>)
#? * (snd_seq_client_pool_sizeof)
#? * (snd_seq_client_pool_alloca <s>)
#? * (snd_seq_client_pool_malloc <s>)
#? * (snd_seq_client_pool_free <s>)
#? * (snd_seq_client_pool_copy <dst> <src>)
#? * (snd_seq_client_pool_get_client <info>)
#? * (snd_seq_client_pool_get_output_pool <info>)
#? * (snd_seq_client_pool_get_input_pool <info>)
#? * (snd_seq_client_pool_get_output_room <info>)
#? * (snd_seq_client_pool_get_output_free <info>)
#? * (snd_seq_client_pool_get_input_free <info>)
#? * (snd_seq_client_pool_set_output_pool <info> <size>)
#? * (snd_seq_client_pool_set_input_pool <info> <size>)
#? * (snd_seq_client_pool_set_output_room <info> <size>)
#? * (snd_seq_get_client_pool <handle> <info>)
#? * (snd_seq_set_client_pool <handle> <info>)
#? * (snd_seq_port_info_sizeof)
#? * (snd_seq_port_info_alloca <s>)
#? * (snd_seq_port_info_malloc <s>)
#? * (snd_seq_port_info_free <s>)
#? * (snd_seq_port_info_copy <dst> <src>)
#? * (snd_seq_port_info_get_client <info>)
#? * (snd_seq_port_info_get_port <info>)
#? * (snd_seq_port_info_get_addr <info>)
#? * (snd_seq_port_info_get_name <info>)
#? * (snd_seq_port_info_get_capability <info>)
#? * (snd_seq_port_info_get_type <info>)
#? * (snd_seq_port_info_get_midi_channels <info>)
#? * (snd_seq_port_info_get_midi_voices <info>)
#? * (snd_seq_port_info_get_synth_voices <info>)
#? * (snd_seq_port_info_get_read_use <info>)
#? * (snd_seq_port_info_get_write_use <info>)
#? * (snd_seq_port_info_get_port_specified <info>)
#? * (snd_seq_port_info_set_client <info> <client>)
#? * (snd_seq_port_info_set_port <info> <port>)
#? * (snd_seq_port_info_set_addr <info> <addr>)
#? * (snd_seq_port_info_set_name <info> <name>)
#? * (snd_seq_port_info_set_capability <info> <capability>)
#? * (snd_seq_port_info_set_type <info> <type>)
#? * (snd_seq_port_info_set_midi_channels <info> <channels>)
#? * (snd_seq_port_info_set_midi_voices <info> <voices>)
#? * (snd_seq_port_info_set_synth_voices <info> <voices>)
#? * (snd_seq_port_info_set_port_specified <info> <val>)
#? * (snd_seq_create_port <handle> <info>)
#? * (snd_seq_delete_port <handle> <port>)
#? * (snd_seq_get_port_info <handle> <port> <info>)
#? * (snd_seq_get_any_port_info <handle> <client> <port> <info>)
#? * (snd_seq_set_port_info <handle> <port> <info>)
#? * (snd_seq_query_next_port <handle> <info>)
#? * (snd_seq_port_subscribe_sizeof)
#? * (snd_seq_port_subscribe_alloca <s>)
#? * (snd_seq_port_subscribe_malloc <s>)
#? * (snd_seq_port_subscribe_free <s>)
#? * (snd_seq_port_subscribe_copy <dst> <src>)
#? * (snd_seq_port_subscribe_get_sender <info>)
#? * (snd_seq_port_subscribe_get_dest <info>)
#? * (snd_seq_port_subscribe_get_queue <info>)
#? * (snd_seq_port_subscribe_get_exclusive <info>)
#? * (snd_seq_port_subscribe_get_time_update <info>)
#? * (snd_seq_port_subscribe_get_time_real <info>)
#? * (snd_seq_port_subscribe_set_sender <info> <addr>)
#? * (snd_seq_port_subscribe_set_dest <info> <addr>)
#? * (snd_seq_port_subscribe_set_queue <info> <q>)
#? * (snd_seq_port_subscribe_set_exclusive <info> <val>)
#? * (snd_seq_port_subscribe_set_time_update <info> <val>)
#? * (snd_seq_port_subscribe_set_time_real <info> <val>)
#? * (snd_seq_get_port_subscription <handle> <sub>)
#? * (snd_seq_subscribe_port <handle> <sub>)
#? * (snd_seq_unsubscribe_port <handle> <sub>)
#? * (snd_seq_query_subscribe_sizeof)
#? * (snd_seq_query_subscribe_alloca <s>)
#? * (snd_seq_query_subscribe_malloc <s>)
#? * (snd_seq_query_subscribe_free <s>)
#? * (snd_seq_query_subscribe_copy <dst> <src>)
#? * (snd_seq_query_subscribe_get_client <info>)
#? * (snd_seq_query_subscribe_get_port <info>)
#? * (snd_seq_query_subscribe_get_root <info>)
#? * (snd_seq_query_subscribe_get_type <info>)
#? * (snd_seq_query_subscribe_get_index <info>)
#? * (snd_seq_query_subscribe_get_num_subs <info>)
#? * (snd_seq_query_subscribe_get_addr <info>)
#? * (snd_seq_query_subscribe_get_queue <info>)
#? * (snd_seq_query_subscribe_get_exclusive <info>)
#? * (snd_seq_query_subscribe_get_time_update <info>)
#? * (snd_seq_query_subscribe_get_time_real <info>)
#? * (snd_seq_query_subscribe_set_client <info> <client>)
#? * (snd_seq_query_subscribe_set_port <info> <port>)
#? * (snd_seq_query_subscribe_set_root <info> <addr>)
#? * (snd_seq_query_subscribe_set_type <info> <type>)
#? * (snd_seq_query_subscribe_set_index <info> <index>)
#? * (snd_seq_query_port_subscribers <seq> <subs>)
#? * (snd_seq_queue_info_sizeof)
#? * (snd_seq_queue_info_alloca <s>)
#? * (snd_seq_queue_info_malloc <s>)
#? * (snd_seq_queue_info_free <s>)
#? * (snd_seq_queue_info_copy <dst> <src>)
#? * (snd_seq_queue_info_get_queue <info>)
#? * (snd_seq_queue_info_get_name <info>)
#? * (snd_seq_queue_info_get_owner <info>)
#? * (snd_seq_queue_info_get_locked <info>)
#? * (snd_seq_queue_info_get_flags <info>)
#? * (snd_seq_queue_info_set_name <info> <name>)
#? * (snd_seq_queue_info_set_owner <info> <owner>)
#? * (snd_seq_queue_info_set_locked <info> <locked>)
#? * (snd_seq_queue_info_set_flags <info> <flags>)
#? * (snd_seq_create_queue <seq> <info>)
#? * (snd_seq_alloc_named_queue <seq> <name>)
#? * (snd_seq_alloc_queue <handle>)
#? * (snd_seq_free_queue <handle> <q>)
#? * (snd_seq_get_queue_info <seq> <q> <info>)
#? * (snd_seq_set_queue_info <seq> <q> <info>)
#? * (snd_seq_query_named_queue <seq> <name>)
#? * (snd_seq_get_queue_usage <handle> <q>)
#? * (snd_seq_set_queue_usage <handle> <q> <used>)
#? * (snd_seq_queue_status_sizeof)
#? * (snd_seq_queue_status_alloca <s>)
#? * (snd_seq_queue_status_malloc <s>)
#? * (snd_seq_queue_status_free <s>)
#? * (snd_seq_queue_status_copy <dst> <src>)
#? * (snd_seq_queue_status_get_queue <info>)
#? * (snd_seq_queue_status_get_events <info>)
#? * (snd_seq_queue_status_get_tick_time <info>)
#? * (snd_seq_queue_status_get_real_time <info>)
#? * (snd_seq_queue_status_get_status <info>)
#? * (snd_seq_get_queue_status <handle> <q> <status>)
#? * (snd_seq_queue_tempo_sizeof)
#? * (snd_seq_queue_tempo_alloca <s>)
#? * (snd_seq_queue_tempo_malloc <s>)
#? * (snd_seq_queue_tempo_free <s>)
#? * (snd_seq_queue_tempo_copy <dst> <src>)
#? * (snd_seq_queue_tempo_get_queue <info>)
#? * (snd_seq_queue_tempo_get_tempo <info>)
#? * (snd_seq_queue_tempo_get_ppq <info>)
#? * (snd_seq_queue_tempo_get_skew <info>)
#? * (snd_seq_queue_tempo_get_skew_base <info>)
#? * (snd_seq_queue_tempo_set_tempo <info> <tempo>)
#? * (snd_seq_queue_tempo_set_ppq <info> <ppq>)
#? * (snd_seq_queue_tempo_set_skew <info> <skew>)
#? * (snd_seq_queue_tempo_set_skew_base <info> <base>)
#? * (snd_seq_get_queue_tempo <handle> <q> <tempo>)
#? * (snd_seq_set_queue_tempo <handle> <q> <tempo>)
#? * (snd_seq_queue_timer_sizeof)
#? * (snd_seq_queue_timer_alloca <s>)
#? * (snd_seq_queue_timer_malloc <s>)
#? * (snd_seq_queue_timer_free <s>)
#? * (snd_seq_queue_timer_copy <dst> <src>)
#? * (snd_seq_queue_timer_get_queue <info>)
#? * (snd_seq_queue_timer_get_type <info>)
#? * (snd_seq_queue_timer_get_id <info>)
#? * (snd_seq_queue_timer_get_resolution <info>)
#? * (snd_seq_queue_timer_set_type <info> <type>)
#? * (snd_seq_queue_timer_set_id <info> <id>)
#? * (snd_seq_queue_timer_set_resolution <info> <resolution>)
#? * (snd_seq_get_queue_timer <handle> <q> <timer>)
#? * (snd_seq_set_queue_timer <handle> <q> <timer>)
;; #? * (snd_seq_create_event)
#? * (snd_seq_free_event <ev>)
#? * (snd_seq_event_length <ev>)
#? * (snd_seq_event_output <handle> <ev>)
#? * (snd_seq_event_output_buffer <handle> <ev>)
#? * (snd_seq_event_output_direct <handle> <ev>)
#? * (snd_seq_event_input <handle> <ev>)
#? * (snd_seq_event_input_pending <seq> <fetch_sequencer>)
#? * (snd_seq_drain_output <handle>)
#? * (snd_seq_event_output_pending <seq>)
#? * (snd_seq_extract_output <handle> <ev>)
#? * (snd_seq_drop_output <handle>)
#? * (snd_seq_drop_output_buffer <handle>)
#? * (snd_seq_drop_input <handle>)
#? * (snd_seq_drop_input_buffer <handle>)
#? * (snd_seq_remove_events_sizeof)
#? * (snd_seq_remove_events_alloca <s>)
#? * (snd_seq_remove_events_malloc <s>)
#? * (snd_seq_remove_events_free <s>)
#? * (snd_seq_remove_events_copy <dst> <src>)
#? * (snd_seq_remove_events_get_condition <info>)
#? * (snd_seq_remove_events_get_queue <info>)
#? * (snd_seq_remove_events_get_time <info>)
#? * (snd_seq_remove_events_get_dest <info>)
#? * (snd_seq_remove_events_get_channel <info>)
#? * (snd_seq_remove_events_get_event_type <info>)
#? * (snd_seq_remove_events_get_tag <info>)
#? * (snd_seq_remove_events_set_condition <info> <flags>)
#? * (snd_seq_remove_events_set_queue <info> <queue>)
#? * (snd_seq_remove_events_set_time <info> <time>)
#? * (snd_seq_remove_events_set_dest <info> <addr>)
#? * (snd_seq_remove_events_set_channel <info> <channel>)
#? * (snd_seq_remove_events_set_event_type <info> <type>)
#? * (snd_seq_remove_events_set_tag <info> <tag>)
#? * (snd_seq_remove_events <handle> <info>)
#? * (snd_seq_set_bit <nr> <array>)
#? * (snd_seq_change_bit <nr> <array>)
#? * (snd_seq_get_bit <nr> <array>)
#? * (snd_seq_type_check <ev> <x>)
#? * (snd_seq_ev_is_result_type <ev>)
#? * (snd_seq_ev_is_note_type <ev>)
#? * (snd_seq_ev_is_control_type <ev>)
#? * (snd_seq_ev_is_channel_type <ev>)
#? * (snd_seq_ev_is_queue_type <ev>)
#? * (snd_seq_ev_is_message_type <ev>)
#? * (snd_seq_ev_is_subscribe_type <ev>)
#? * (snd_seq_ev_is_sample_type <ev>)
#? * (snd_seq_ev_is_user_type <ev>)
#? * (snd_seq_ev_is_instr_type <ev>)
#? * (snd_seq_ev_is_fixed_type <ev>)
#? * (snd_seq_ev_is_variable_type <ev>)
#? * (snd_seq_ev_is_varusr_type <ev>)
#? * (snd_seq_ev_is_reserved <ev>)
#? * (snd_seq_ev_is_prior <ev>)
#? * (snd_seq_ev_length_type <ev>)
#? * (snd_seq_ev_is_fixed <ev>)
#? * (snd_seq_ev_is_variable <ev>)
#? * (snd_seq_ev_is_varusr <ev>)
#? * (snd_seq_ev_timestamp_type <ev>)
#? * (snd_seq_ev_is_tick <ev>)
#? * (snd_seq_ev_is_real <ev>)
#? * (snd_seq_ev_timemode_type <ev>)
#? * (snd_seq_ev_is_abstime <ev>)
#? * (snd_seq_ev_is_reltime <ev>)
#? * (snd_seq_ev_is_direct <ev>)

;; ********************************************************


(setq SND_SEQ_OPEN_OUTPUT       	1)     ;;	/**< open for output (write) */
(setq SND_SEQ_OPEN_INPUT        	2)     ;;	/**< open for input (read) */
(setq SND_SEQ_OPEN_DUPLEX	        3)     ;;       /**< open for both input and output (read/write) */

(setq SND_SEQ_NONBLOCK                    1)     ;;	/**< non-blocking mode (flag to open mode) */

(setq SND_SEQ_ADDRESS_UNKNOWN		253)     ;;	/**< unknown source */
(setq SND_SEQ_ADDRESS_SUBSCRIBERS	254)     ;;	/**< send event to all subscribed ports */
(setq SND_SEQ_ADDRESS_BROADCAST	        255)     ;;	/**< send event to all queues/clients/ports/channels */

(setq SND_SEQ_CLIENT_SYSTEM		  0)     ;;	/**< system client */
(setq SND_SEQ_CLIENT_DUMMY		 62)     ;;	/**< dummy ports */
(setq SND_SEQ_CLIENT_OSS		 63)     ;;	/**< OSS sequencer emulator */


(setq SND_SEQ_USER_CLIENT                 1)        ;;	/**< user client */
(setq SND_SEQ_KERNEL_CLIENT               2)        ;;	/**< kernel client */

(setq SND_SEQ_PORT_SYSTEM_TIMER           0)     ;;	/**< system timer port */
(setq SND_SEQ_PORT_SYSTEM_ANNOUNCE        1)     ;;	/**< system announce port */

(setq SND_SEQ_PORT_CAP_READ		  1)     ;;     /**< readable from this port */
(setq SND_SEQ_PORT_CAP_WRITE		  2)     ;;     /**< writable to this port */
(setq SND_SEQ_PORT_CAP_SYNC_READ	  4)     ;;	/**< allow read subscriptions */
(setq SND_SEQ_PORT_CAP_SYNC_WRITE	  8)     ;;	/**< allow write subscriptions */
(setq SND_SEQ_PORT_CAP_DUPLEX		 16)     ;;	/**< allow read/write duplex */
(setq SND_SEQ_PORT_CAP_SUBS_READ	 32)     ;;	/**< allow read subscription */
(setq SND_SEQ_PORT_CAP_SUBS_WRITE	 64)     ;;	/**< allow write subscription */
(setq SND_SEQ_PORT_CAP_NO_EXPORT	128)     ;;	/**< routing not allowed */

(setq SND_SEQ_PORT_TYPE_SPECIFIC	      1)     ;;	/**< hardware specific */
(setq SND_SEQ_PORT_TYPE_MIDI_GENERIC	      2)     ;;	/**< generic MIDI device */
(setq SND_SEQ_PORT_TYPE_MIDI_GM 	      4)     ;;	/**< General MIDI compatible device */
(setq SND_SEQ_PORT_TYPE_MIDI_GS	              8)     ;;	/**< GS compatible device */
(setq SND_SEQ_PORT_TYPE_MIDI_XG	             16)     ;;	/**< XG compatible device */
(setq SND_SEQ_PORT_TYPE_MIDI_MT32            32)     ;;	/**< MT-32 compatible device */
(setq SND_SEQ_PORT_TYPE_SYNTH		   1024)     ;;	/**< Synth device */
(setq SND_SEQ_PORT_TYPE_DIRECT_SAMPLE      2048)     ;;	/**< Sampling device (support sample download) */
(setq SND_SEQ_PORT_TYPE_SAMPLE   	   4096)     ;;	/**< Sampling device (sample can be downloaded at any time) */
(setq SND_SEQ_PORT_TYPE_APPLICATION	1048576)     ;;	/**< application (sequencer/editor) */

(setq SND_SEQ_QUERY_SUBS_READ                0)     ;;	/**< query read subscriptions */
(setq SND_SEQ_QUERY_SUBS_WRITE	             1)     ;;        /**< query write subscriptions */


(setq SND_SEQ_QUEUE_DIRECT	           253)     ;;	/**< direct dispatch */

(setq SND_SEQ_TIMER_ALSA                     0)     ;;	/* ALSA timer */
(setq SND_SEQ_TIMER_MIDI_CLOCK               1)     ;;	/* Midi Clock (CLOCK event) */
(setq SND_SEQ_TIMER_MIDI_TICK                2)     ;;	/* Midi Timer Tick (TICK event */


(setq SND_SEQ_REMOVE_INPUT		 1)     ;;	/**< Flush input queues */
(setq SND_SEQ_REMOVE_OUTPUT		 2)     ;;	/**< Flush output queues */
(setq SND_SEQ_REMOVE_DEST		 4)     ;;	/**< Restrict by destination q:client:port */
(setq SND_SEQ_REMOVE_DEST_CHANNEL        8)     ;;	/**< Restrict by channel */
(setq SND_SEQ_REMOVE_TIME_BEFORE	16)     ;;	/**< Restrict to before time */
(setq SND_SEQ_REMOVE_TIME_AFTER	        32)     ;;	/**< Restrict to time or after */
(setq SND_SEQ_REMOVE_TIME_TICK	        64)     ;;	/**< Time is in ticks */
(setq SND_SEQ_REMOVE_EVENT_TYPE	       128)     ;;	/**< Restrict to event type */
(setq SND_SEQ_REMOVE_IGNORE_OFF        256)     ;;	/**< Do not flush off events */
(setq SND_SEQ_REMOVE_TAG_MATCH 	       512)     ;;	/**< Restrict to events with given tag */


(setq SND_SEQ_EVFLG_RESULT                  0)
(setq SND_SEQ_EVFLG_NOTE                    1)
(setq SND_SEQ_EVFLG_CONTROL                 2)
(setq SND_SEQ_EVFLG_QUEUE                   3)
(setq SND_SEQ_EVFLG_SYSTEM                  4)
(setq SND_SEQ_EVFLG_MESSAGE                 5)
(setq SND_SEQ_EVFLG_CONNECTION              6)
(setq SND_SEQ_EVFLG_SAMPLE                  7)
(setq SND_SEQ_EVFLG_USERS                   8)
(setq SND_SEQ_EVFLG_INSTR                   9)
(setq SND_SEQ_EVFLG_QUOTE                  10)
(setq SND_SEQ_EVFLG_NONE                   11)
(setq SND_SEQ_EVFLG_RAW                    12)
(setq SND_SEQ_EVFLG_FIXED                  13)
(setq SND_SEQ_EVFLG_VARIABLE               14)
(setq SND_SEQ_EVFLG_VARUS                  15)

(setq SND_SEQ_EVFLG_NOTE_ONEARG             0)   
(setq SND_SEQ_EVFLG_NOTE_TWOARG             1)

(setq SND_SEQ_EVFLG_QUEUE_NOARG              0)  
(setq SND_SEQ_EVFLG_QUEUE_TICK               1)
(setq SND_SEQ_EVFLG_QUEUE_TIME               2)
(setq SND_SEQ_EVFLG_QUEUE_VALU               3)


(setq SND_SEQ_TYPE_HW                   0)           ;;		/**< hardware */
(setq SND_SEQ_TYPE_SHM                  1)           ;;		/**< shared memory (NYI) */
(setq SND_SEQ_TYPE_INET	                2)           ;; 	/**< network (NYI) */




(de  snd_seq_open ( handle name streams mode )
     ((-gptr- "snd_seq_t **") handle )
     ((-str-) name )
     ((-int-) streams )
     ((-int-) mode)
     (int #{ snd_seq_open( $handle ,$name->data ,$streams ,$mode  )  #} )
)

(de  snd_seq_open_lconf ( handle  name  streams mode  lconf )
     ((-gptr- "snd_seq_t **")  handle )
     ((-str-) name )
     ((-int-) streams )
     ((-int-) mode )
     ((-gptr- "snd_config_t *") lconf)
     (int #{ snd_seq_open_lconf( $handle ,$name->data ,$streams ,$mode ,$lconf  )  #} )
)

(de snd_seq_name (  seq )
    ((-gptr- "snd_seq_t *") seq)
    (gptr #{ snd_seq_name( $seq  )  #} )                ; const char * -> gptr
)

(de snd_seq_type (  seq )
    ((-gptr- "snd_seq_t *") seq)
    (int #{ snd_seq_type( $seq  )  #} )                    ; snd_seq_type_t -> int
)


(de snd_seq_close ( handle )
    ((-gptr- "snd_seq_t *") handle)
    (int #{ snd_seq_close( $handle  )  #} )
)

(de snd_seq_poll_descriptors_count (  handle events )
    ((-gptr- "snd_seq_t *") handle )
    ((-short-) events)
    (int #{ snd_seq_poll_descriptors_count( $handle ,$events  )  #} )
)

(de snd_seq_poll_descriptors (  handle pfds space events )
    ((-gptr- "snd_seq_t *") handle )
    ((-gptr- "struct pollfd *") pfds )
    ((-int-) space )                   ; unsigned int -> int
    ((-short-) events)
    (int #{ snd_seq_poll_descriptors( $handle ,$pfds ,$space ,$events  )  #} )
)

(de snd_seq_poll_descriptors_revents (  seq pfds nfds revents )
    ((-gptr- "snd_seq_t *") seq )
    ((-gptr- "struct pollfd *") pfds )
    ((-int-) nfds )                   ; unsigned int -> int
    ((-gptr- "unsigned short *") revents)
    (int #{ snd_seq_poll_descriptors_revents( $seq ,$pfds ,$nfds ,$revents  )  #} )
)

(de snd_seq_nonblock (  handle nonblock )
    ((-gptr- "snd_seq_t *") handle )
    ((-int-) nonblock)
    (int #{ snd_seq_nonblock( $handle ,$nonblock  )  #} )
)

(de snd_seq_client_id (  handle )
    ((-gptr- "snd_seq_t *") handle)
    (int #{ snd_seq_client_id( $handle  )  #} )
)


(de snd_seq_get_output_buffer_size (  handle )
    ((-gptr- "snd_seq_t *") handle)
    (int #{ snd_seq_get_output_buffer_size( $handle  )  #} )          ;; size_t -> int
)

(de snd_seq_get_input_buffer_size (  handle )
    ((-gptr- "snd_seq_t *") handle)
    (int #{ snd_seq_get_input_buffer_size( $handle  )  #} )          ;; size_t -> int
)

(de snd_seq_set_output_buffer_size (  handle size )
    ((-gptr- "snd_seq_t *") handle )
    ((-int-) size)                 ;; size_t -> int
    (int #{ snd_seq_set_output_buffer_size( $handle ,$size  )  #} )
)

(de snd_seq_set_input_buffer_size (  handle size )
    ((-gptr- "snd_seq_t *") handle )
    ((-int-) size)          ;; size_t -> int
    (int #{ snd_seq_set_input_buffer_size( $handle ,$size  )  #} )
)

(de snd_seq_system_info_sizeof ( )
    (int #{ snd_seq_system_info_sizeof()  #} )          ;; size_t -> int
)


(de snd_seq_system_info_alloca ( s ) 
    ((-gptr- "snd_seq_system_info_t **") s)
    #{ snd_seq_system_info_alloca ($s); #}
    ()
)	

(de snd_seq_system_info_malloc (  s )
    ((-gptr- "snd_seq_system_info_t **") s)
    (int #{ snd_seq_system_info_malloc( $s  )  #} )
)

(de snd_seq_system_info_free (  s )
    ((-gptr- "snd_seq_system_info_t *") s)
    #{ snd_seq_system_info_free( $s  );  #} 
    ()
)

(de snd_seq_system_info_copy (  dst src )
    ((-gptr- "snd_seq_system_info_t *") dst )
    ((-gptr- "const snd_seq_system_info_t *") src)
    #{ snd_seq_system_info_copy( $dst ,$src  );  #} 
    ()
)


(de snd_seq_system_info_get_queues (  info )
    ((-gptr- "const snd_seq_system_info_t *") info)
    (int #{ snd_seq_system_info_get_queues( $info  )  #} )
)

(de snd_seq_system_info_get_clients (  info )
    ((-gptr- "const snd_seq_system_info_t *") info)
    (int #{ snd_seq_system_info_get_clients( $info  )  #} )
)

(de snd_seq_system_info_get_ports (  info )
    ((-gptr- "const snd_seq_system_info_t *") info)
    (int #{ snd_seq_system_info_get_ports( $info  )  #} )
)

(de snd_seq_system_info_get_channels (  info )
    ((-gptr- "const snd_seq_system_info_t *") info)
    (int #{ snd_seq_system_info_get_channels( $info  )  #} )
)

(de snd_seq_system_info_get_cur_clients (  info )
    ((-gptr- "const snd_seq_system_info_t *") info)
    (int #{ snd_seq_system_info_get_cur_clients( $info  )  #} )
)

(de snd_seq_system_info_get_cur_queues (  info )
    ((-gptr- "const snd_seq_system_info_t *") info)
    (int #{ snd_seq_system_info_get_cur_queues( $info  )  #} )
)


(de snd_seq_system_info (  handle info )
    ((-gptr- "snd_seq_t *") handle )
    ((-gptr- "snd_seq_system_info_t *") info)
    (int #{ snd_seq_system_info( $handle ,$info  )  #} )
)



(de snd_seq_client_info_sizeof ()
    (int #{ snd_seq_client_info_sizeof(    )  #} )          ;; size_t -> int
)

(de snd_seq_client_info_alloca( s ) 
    ((-gptr- "snd_seq_client_info_t **") s)
    #{ snd_seq_client_info_alloca($s);  #}
    ()
)

(de snd_seq_client_info_malloc (  s )
    ((-gptr- "snd_seq_client_info_t **") s)
    (int #{ snd_seq_client_info_malloc( $s  )  #} )
)

(de snd_seq_client_info_free (  s )
    ((-gptr- "snd_seq_client_info_t *") s)
    #{ snd_seq_client_info_free( $s  );  #} 
    ()
)

(de snd_seq_client_info_copy (  dst src )
    ((-gptr- "snd_seq_client_info_t *") dst )
    ((-gptr- "const snd_seq_client_info_t *") src)
    #{ snd_seq_client_info_copy( $dst ,$src  );  #} 
    ()
)


(de snd_seq_client_info_get_client (  info )
    ((-gptr- "const snd_seq_client_info_t *") info)
    (int #{ snd_seq_client_info_get_client( $info  )  #} )
)

(de snd_seq_client_info_get_type (  info )
    ((-gptr- "const snd_seq_client_info_t *") info)
    (int #{ snd_seq_client_info_get_type( $info  )  #} )        ;; snd_seq_client_type_t -> int
)

(de snd_seq_client_info_get_name (  info )
    ((-gptr- "snd_seq_client_info_t *") info)
    (gptr #{ snd_seq_client_info_get_name( $info  )  #} )         ;; const char * -> gptr
)

(de snd_seq_client_info_get_broadcast_filter (  info )
    ((-gptr- "const snd_seq_client_info_t *") info)
    (int #{ snd_seq_client_info_get_broadcast_filter( $info  )  #} )
)

(de snd_seq_client_info_get_error_bounce (  info )
    ((-gptr- "const snd_seq_client_info_t *") info)
    (int #{ snd_seq_client_info_get_error_bounce( $info  )  #} )
)

(de snd_seq_client_info_get_event_filter (  info )
    ((-gptr- "const snd_seq_client_info_t *") info)
    (gptr #{ snd_seq_client_info_get_event_filter( $info  )  #} )          ;; const unsigned char * -> gptr
)

(de snd_seq_client_info_get_num_ports (  info )
    ((-gptr- "const snd_seq_client_info_t *") info)
    (int #{ snd_seq_client_info_get_num_ports( $info  )  #} )
)

(de snd_seq_client_info_get_event_lost (  info )
    ((-gptr- "const snd_seq_client_info_t *") info)
    (int #{ snd_seq_client_info_get_event_lost( $info  )  #} )
)


(de snd_seq_client_info_set_client (  info client )
    ((-gptr- "snd_seq_client_info_t *") info )
    ((-int-) client)
    #{ snd_seq_client_info_set_client( $info ,$client  );  #} 
    ()
)

(de snd_seq_client_info_set_name (  info name )
    ((-gptr- "snd_seq_client_info_t *") info )
    ((-str-) name)
    #{ snd_seq_client_info_set_name( $info ,$name->data  );  #} 
    ()
)

(de snd_seq_client_info_set_broadcast_filter (  info val )
    ((-gptr- "snd_seq_client_info_t *") info )
    ((-int-) val)
    #{ snd_seq_client_info_set_broadcast_filter( $info ,$val  );  #} 
    ()
)

(de snd_seq_client_info_set_error_bounce (  info val )
    ((-gptr- "snd_seq_client_info_t *") info )
    ((-int-) val)
    #{ snd_seq_client_info_set_error_bounce( $info ,$val  );  #} 
    ()
)

(de snd_seq_client_info_set_event_filter (  info filter )
    ((-gptr- "snd_seq_client_info_t *") info )
    ((-gptr- "unsigned char *") filter)
    #{ snd_seq_client_info_set_event_filter( $info ,$filter  );  #} 
    ()
)


(de snd_seq_get_client_info (  handle info )
    ((-gptr- "snd_seq_t *") handle )
    ((-gptr- "snd_seq_client_info_t *") info)
    (int #{ snd_seq_get_client_info( $handle ,$info  )  #} )
)

(de snd_seq_get_any_client_info (  handle client info )
    ((-gptr- "snd_seq_t *") handle )
    ((-int-) client )
    ((-gptr- "snd_seq_client_info_t *") info)
    (int #{ snd_seq_get_any_client_info( $handle ,$client ,$info  )  #} )
)

(de snd_seq_set_client_info (  handle info )
    ((-gptr- "snd_seq_t *") handle )
    ((-gptr- "snd_seq_client_info_t *") info)
    (int #{ snd_seq_set_client_info( $handle ,$info  )  #} )
)

(de snd_seq_query_next_client (  handle info )
    ((-gptr- "snd_seq_t *") handle )
    ((-gptr- "snd_seq_client_info_t *") info)
    (int #{ snd_seq_query_next_client( $handle ,$info  )  #} )
)



(de snd_seq_client_pool_sizeof ()
    (int #{ snd_seq_client_pool_sizeof(    )  #} )          ;; size_t -> int
)

(de snd_seq_client_pool_alloca ( s )
    ((-gptr- "snd_seq_client_pool_t **") s)
    #{ snd_seq_client_pool_alloca($s); #}
    ()
)

(de snd_seq_client_pool_malloc (  s )
    ((-gptr- "snd_seq_client_pool_t **") s)
    (int #{ snd_seq_client_pool_malloc( $s  )  #} )
)

(de snd_seq_client_pool_free (  s )
    ((-gptr- "snd_seq_client_pool_t *") s)
    #{ snd_seq_client_pool_free( $s );  #} 
    ()
)

(de snd_seq_client_pool_copy ( dst src )
    ((-gptr- "snd_seq_client_pool_t *") dst )
    ((-gptr- "const snd_seq_client_pool_t *") src)
    #{ snd_seq_client_pool_copy( $dst ,$src  );  #} 
    ()
)


(de snd_seq_client_pool_get_client (  info )
    ((-gptr- "const snd_seq_client_pool_t *") info)
    (int #{ snd_seq_client_pool_get_client( $info  )  #} )
)

(de snd_seq_client_pool_get_output_pool (  info )
    ((-gptr- "const snd_seq_client_pool_t *") info)
    (int #{ snd_seq_client_pool_get_output_pool( $info  )  #} )          ;; size_t -> int
)

(de snd_seq_client_pool_get_input_pool (  info )
    ((-gptr- "const snd_seq_client_pool_t *") info)
    (int #{ snd_seq_client_pool_get_input_pool( $info  )  #} )          ;; size_t -> int
)

(de snd_seq_client_pool_get_output_room (  info )
    ((-gptr- "const snd_seq_client_pool_t *") info)
    (int #{ snd_seq_client_pool_get_output_room( $info  )  #} )          ;; size_t -> int
)

(de snd_seq_client_pool_get_output_free (  info )
    ((-gptr- "const snd_seq_client_pool_t *") info)
    (int #{ snd_seq_client_pool_get_output_free( $info  )  #} )          ;; size_t -> int
)

(de snd_seq_client_pool_get_input_free (  info )
    ((-gptr- "const snd_seq_client_pool_t *") info)
    (int #{ snd_seq_client_pool_get_input_free( $info  )  #} )          ;; size_t -> int
)

(de snd_seq_client_pool_set_output_pool ( info size )
    ((-gptr- "snd_seq_client_pool_t *") info )
    ((-int-) size)          ;; size_t -> int
    #{ snd_seq_client_pool_set_output_pool( $info ,$size  );  #} 
    ()
)

(de snd_seq_client_pool_set_input_pool (  info  size  )
    ((-gptr- "snd_seq_client_pool_t *") info )
    ((-int-) size)          ;; size_t -> int
    #{ snd_seq_client_pool_set_input_pool( $info ,$size  );  #} 
    ()
)

(de snd_seq_client_pool_set_output_room (  info  size  )
    ((-gptr- "snd_seq_client_pool_t *") info )
    ((-int-) size)          ;; size_t -> int
    #{ snd_seq_client_pool_set_output_room( $info ,$size  );  #} 
    ()
)


(de snd_seq_get_client_pool (  handle  info  )
    ((-gptr- "snd_seq_t *") handle )
    ((-gptr- "snd_seq_client_pool_t *") info)
    (int #{ snd_seq_get_client_pool( $handle ,$info  )  #} )
)

(de snd_seq_set_client_pool (  handle  info  )
    ((-gptr- "snd_seq_t *") handle )
    ((-gptr- "snd_seq_client_pool_t *") info)
    (int #{ snd_seq_set_client_pool( $handle ,$info  )  #} )
)




(de snd_seq_port_info_sizeof ( )
    (int #{ snd_seq_port_info_sizeof(  )  #} )          ;; size_t -> int
)

(de snd_seq_port_info_alloca ( s ) 
    ((-gptr- "snd_seq_port_info_t **") s)
    #{ snd_seq_port_info_alloca($s); #}
    ()
)


(de snd_seq_port_info_malloc (  s  )
    ((-gptr- "snd_seq_port_info_t **") s)
    (int #{ snd_seq_port_info_malloc( $s )  #} )
)

(de snd_seq_port_info_free (  s  )
    ((-gptr- "snd_seq_port_info_t *") s)
    #{ snd_seq_port_info_free( $s );  #} 
    ()
)

(de snd_seq_port_info_copy (  dst  src  )
    ((-gptr- "snd_seq_port_info_t *") dst )
    ((-gptr- "const snd_seq_port_info_t *") src)
    #{ snd_seq_port_info_copy( $dst ,$src  );  #} 
    ()
)


(de snd_seq_port_info_get_client (  info  )
    ((-gptr- "const snd_seq_port_info_t *") info)
    (int #{ snd_seq_port_info_get_client( $info  )  #} )
)

(de snd_seq_port_info_get_port (  info  )
    ((-gptr- "const snd_seq_port_info_t *") info)
    (int #{ snd_seq_port_info_get_port( $info  )  #} )
)

(de snd_seq_port_info_get_addr (  info  )
    ((-gptr- "const snd_seq_port_info_t *") info)
    (gptr #{ snd_seq_port_info_get_addr( $info  )  #} )     ;  const snd_seq_addr_t * -> gptr
)

(de snd_seq_port_info_get_name (  info  )
    ((-gptr- "const snd_seq_port_info_t *") info)
    (gptr #{ snd_seq_port_info_get_name( $info  )  #} )            ;  const char * -> gptr
)

(de snd_seq_port_info_get_capability (  info  )
    ((-gptr- "const snd_seq_port_info_t *") info)
    (int #{ snd_seq_port_info_get_capability( $info  )  #} )          ;  unsigned int -> int
)

(de snd_seq_port_info_get_type (  info  )
    ((-gptr- "const snd_seq_port_info_t *") info)
    (int #{ snd_seq_port_info_get_type( $info  )  #} )     ;  unsigned int ->int
)

(de snd_seq_port_info_get_midi_channels (  info  )
    ((-gptr- "const snd_seq_port_info_t *") info)
    (int #{ snd_seq_port_info_get_midi_channels( $info  )  #} )
)

(de snd_seq_port_info_get_midi_voices (  info  )
    ((-gptr- "const snd_seq_port_info_t *") info)
    (int #{ snd_seq_port_info_get_midi_voices( $info  )  #} )
)

(de snd_seq_port_info_get_synth_voices (  info  )
    ((-gptr- "const snd_seq_port_info_t *") info)
    (int #{ snd_seq_port_info_get_synth_voices( $info  )  #} )
)

(de snd_seq_port_info_get_read_use (  info  )
    ((-gptr- "const snd_seq_port_info_t *") info)
    (int #{ snd_seq_port_info_get_read_use( $info  )  #} )
)

(de snd_seq_port_info_get_write_use (  info  )
    ((-gptr- "const snd_seq_port_info_t *") info)
    (int #{ snd_seq_port_info_get_write_use( $info  )  #} )
)

(de snd_seq_port_info_get_port_specified (  info  )
    ((-gptr- "const snd_seq_port_info_t *") info)
    (int #{ snd_seq_port_info_get_port_specified( $info  )  #} )
)


(de snd_seq_port_info_set_client (  info  client  )
    ((-gptr- "snd_seq_port_info_t *") info )
    ((-int-) client)
    #{ snd_seq_port_info_set_client( $info ,$client  );  #} 
    ()
)

(de snd_seq_port_info_set_port (  info  port  )
    ((-gptr- "snd_seq_port_info_t *") info )
    ((-int-) port)
    #{ snd_seq_port_info_set_port( $info ,$port  );  #} 
    ()
)

(de snd_seq_port_info_set_addr (  info  addr  )
    ((-gptr- "snd_seq_port_info_t *") info )
    ((-gptr- "const snd_seq_addr_t *") addr)
    #{ snd_seq_port_info_set_addr( $info ,$addr  );  #} 
    ()
)

(de snd_seq_port_info_set_name (  info  name  )
    ((-gptr- "snd_seq_port_info_t *") info )
    ((-str-) name)
    #{ snd_seq_port_info_set_name( $info ,$name->data  );  #} 
    ()
)

(de snd_seq_port_info_set_capability (  info  capability  )
    ((-gptr- "snd_seq_port_info_t *") info )
    ((-int-) capability)                   ; unsigned int -> int
    #{ snd_seq_port_info_set_capability( $info ,$capability  );  #} 
    ()
)

(de snd_seq_port_info_set_type (  info  type  )
    ((-gptr- "snd_seq_port_info_t *") info )
    ((-int-) type)                   ; unsigned int -> int
    #{ snd_seq_port_info_set_type( $info ,$type  );  #} 
    ()
)

(de snd_seq_port_info_set_midi_channels (  info  channels  )
    ((-gptr- "snd_seq_port_info_t *") info )
    ((-int-) channels)
    #{ snd_seq_port_info_set_midi_channels( $info ,$channels  );  #} 
    ()
)

(de snd_seq_port_info_set_midi_voices (  info  voices  )
    ((-gptr- "snd_seq_port_info_t *") info )
    ((-int-) voices)
    #{ snd_seq_port_info_set_midi_voices( $info ,$voices  );  #} 
    ()
)

(de snd_seq_port_info_set_synth_voices (  info  voices  )
    ((-gptr- "snd_seq_port_info_t *") info )
    ((-int-) voices)
    #{ snd_seq_port_info_set_synth_voices( $info ,$voices  );  #} 
    ()
)

(de snd_seq_port_info_set_port_specified (  info  val  )
    ((-gptr- "snd_seq_port_info_t *") info )
    ((-int-) val)
    #{ snd_seq_port_info_set_port_specified( $info ,$val  );  #} 
    ()
)


(de snd_seq_create_port (  handle  info  )
    ((-gptr- "snd_seq_t *") handle )
    ((-gptr- "snd_seq_port_info_t *") info)
    (int #{ snd_seq_create_port( $handle ,$info  )  #} )
)

(de snd_seq_delete_port (  handle  port  )
    ((-gptr- "snd_seq_t *") handle )
    ((-int-) port)
    (int #{ snd_seq_delete_port( $handle ,$port  )  #} )
)

(de snd_seq_get_port_info (  handle  port  info  )
    ((-gptr- "snd_seq_t *") handle )
    ((-int-) port )
    ((-gptr- "snd_seq_port_info_t *") info)
    (int #{ snd_seq_get_port_info( $handle ,$port ,$info  )  #} )
)

(de snd_seq_get_any_port_info (  handle  client  port  info  )
    ((-gptr- "snd_seq_t *") handle )
    ((-int-) client )
    ((-int-) port )
    ((-gptr- "snd_seq_port_info_t *") info)
    (int #{ snd_seq_get_any_port_info( $handle ,$client ,$port ,$info  )  #} )
)

(de snd_seq_set_port_info (  handle  port  info  )
    ((-gptr- "snd_seq_t *") handle )
    ((-int-) port )
    ((-gptr- "snd_seq_port_info_t *") info)
    (int #{ snd_seq_set_port_info( $handle ,$port ,$info  )  #} )
)

(de snd_seq_query_next_port (  handle  info  )
    ((-gptr- "snd_seq_t *") handle )
    ((-gptr- "snd_seq_port_info_t *") info)
    (int #{ snd_seq_query_next_port( $handle ,$info  )  #} )
)




(de snd_seq_port_subscribe_sizeof ()
    (int #{ snd_seq_port_subscribe_sizeof()  #} )          ;; size_t -> int
)

(de snd_seq_port_subscribe_alloca ( s )
    ((-gptr- "snd_seq_port_subscribe_t **") s)
    #{ snd_seq_port_subscribe_alloca($s); #}
    ()
)


(de snd_seq_port_subscribe_malloc ( s )
    ((-gptr- "snd_seq_port_subscribe_t **") s)
    (int #{ snd_seq_port_subscribe_malloc( $s )  #} )
)

(de snd_seq_port_subscribe_free ( s )
    ((-gptr- "snd_seq_port_subscribe_t *") s)
    #{ snd_seq_port_subscribe_free( $s );  #} 
    ()
)

(de snd_seq_port_subscribe_copy (  dst  src  )
    ((-gptr- "snd_seq_port_subscribe_t *") dst )
    ((-gptr- "const snd_seq_port_subscribe_t *") src)
    #{ snd_seq_port_subscribe_copy( $dst ,$src  );  #} 
    ()
)


(de snd_seq_port_subscribe_get_sender (  info  )
    ((-gptr- "const snd_seq_port_subscribe_t *") info)
    (gptr #{ snd_seq_port_subscribe_get_sender( $info  )  #} )       ;  const snd_seq_addr_t *  -> gptr
)

(de snd_seq_port_subscribe_get_dest (  info  )
    ((-gptr- "const snd_seq_port_subscribe_t *") info)
    (gptr #{ snd_seq_port_subscribe_get_dest( $info  )  #} )         ;;const snd_seq_addr_t * -> gptr
)

(de snd_seq_port_subscribe_get_queue (  info  )
    ((-gptr- "const snd_seq_port_subscribe_t *") info)
    (int #{ snd_seq_port_subscribe_get_queue( $info  )  #} )
)

(de snd_seq_port_subscribe_get_exclusive (  info  )
    ((-gptr- "const snd_seq_port_subscribe_t *") info)
    (int #{ snd_seq_port_subscribe_get_exclusive( $info  )  #} )
)

(de snd_seq_port_subscribe_get_time_update (  info  )
    ((-gptr- "const snd_seq_port_subscribe_t *") info)
    (int #{ snd_seq_port_subscribe_get_time_update( $info  )  #} )
)

(de snd_seq_port_subscribe_get_time_real (  info  )
    ((-gptr- "const snd_seq_port_subscribe_t *") info)
    (int #{ snd_seq_port_subscribe_get_time_real( $info  )  #} )
)


(de snd_seq_port_subscribe_set_sender (  info  addr  )
    ((-gptr- "snd_seq_port_subscribe_t *") info )
    ((-gptr- "const snd_seq_addr_t *") addr)
    #{ snd_seq_port_subscribe_set_sender( $info ,$addr  );  #} 
    ()
)

(de snd_seq_port_subscribe_set_dest (  info  addr  )
    ((-gptr- "snd_seq_port_subscribe_t *") info )
    ((-gptr- "const snd_seq_addr_t *") addr)
    #{ snd_seq_port_subscribe_set_dest( $info ,$addr  );  #} 
    ()
)

(de snd_seq_port_subscribe_set_queue (  info  q  )
    ((-gptr- "snd_seq_port_subscribe_t *") info)
    ((-int-) q)
    #{ snd_seq_port_subscribe_set_queue( $info ,$q  );  #} 
    ()
)

(de snd_seq_port_subscribe_set_exclusive (  info  val  )
    ((-gptr- "snd_seq_port_subscribe_t *") info )
    ((-int-) val)
    #{ snd_seq_port_subscribe_set_exclusive( $info ,$val  );  #} 
    ()
)

(de snd_seq_port_subscribe_set_time_update (  info  val  )
    ((-gptr- "snd_seq_port_subscribe_t *") info )
    ((-int-) val)
    #{ snd_seq_port_subscribe_set_time_update( $info ,$val  );  #} 
    ()
)

(de snd_seq_port_subscribe_set_time_real (  info  val  )
    ((-gptr- "snd_seq_port_subscribe_t *") info )
    ((-int-) val)
    #{ snd_seq_port_subscribe_set_time_real( $info ,$val  );  #} 
    ()
)


(de snd_seq_get_port_subscription (  handle  sub  )
    ((-gptr- "snd_seq_t *") handle )
    ((-gptr- "snd_seq_port_subscribe_t *") sub)
    (int #{ snd_seq_get_port_subscription( $handle ,$sub  )  #} )
)

(de snd_seq_subscribe_port (  handle  sub  )
    ((-gptr- "snd_seq_t *") handle )
    ((-gptr- "snd_seq_port_subscribe_t *") sub)
    (int #{ snd_seq_subscribe_port( $handle ,$sub  )  #} )
)

(de snd_seq_unsubscribe_port (  handle  sub  )
    ((-gptr- "snd_seq_t *") handle )
    ((-gptr- "snd_seq_port_subscribe_t *") sub)
    (int #{ snd_seq_unsubscribe_port( $handle ,$sub  )  #} )
)



(de snd_seq_query_subscribe_sizeof ()
    (int #{ snd_seq_query_subscribe_sizeof()  #} )          ;; size_t -> int
)

(de snd_seq_query_subscribe_alloca ( s )
    ((-gptr- "snd_seq_query_subscribe_t **") s)
    #{ snd_seq_query_subscribe_alloca($s); #}
    ()
)

(de snd_seq_query_subscribe_malloc ( s )
    ((-gptr- "snd_seq_query_subscribe_t **") s)
    (int #{ snd_seq_query_subscribe_malloc( $s )  #} )
)

(de snd_seq_query_subscribe_free ( s )
    ((-gptr- "snd_seq_query_subscribe_t *") s)
    #{ snd_seq_query_subscribe_free( $s );  #} 
    ()
)

(de snd_seq_query_subscribe_copy (  dst  src  )
    ((-gptr- "snd_seq_query_subscribe_t *") dst )
    ((-gptr- "const snd_seq_query_subscribe_t *") src)
    #{ snd_seq_query_subscribe_copy( $dst ,$src  );  #} 
    ()
)


(de snd_seq_query_subscribe_get_client (  info  )
    ((-gptr- "const snd_seq_query_subscribe_t *") info)
    (int #{ snd_seq_query_subscribe_get_client( $info  )  #} )
)

(de snd_seq_query_subscribe_get_port (  info  )
    ((-gptr- "const snd_seq_query_subscribe_t *") info)
    (int #{ snd_seq_query_subscribe_get_port( $info  )  #} )
)

(de snd_seq_query_subscribe_get_root (  info  )
    ((-gptr- "const snd_seq_query_subscribe_t *") info)
    (gptr  #{ snd_seq_query_subscribe_get_root( $info  )  #} )       ;;const snd_seq_addr_t * -> gptr
)

(de snd_seq_query_subscribe_get_type (  info  )
    ((-gptr- "const snd_seq_query_subscribe_t *") info)
    (int #{ snd_seq_query_subscribe_get_type( $info  )  #} )       ; snd_seq_query_subs_type_t -> int
)

(de snd_seq_query_subscribe_get_index (  info  )
    ((-gptr- "const snd_seq_query_subscribe_t *") info)
    (int #{ snd_seq_query_subscribe_get_index( $info  )  #} )
)

(de snd_seq_query_subscribe_get_num_subs (  info  )
    ((-gptr- "const snd_seq_query_subscribe_t *") info)
    (int #{ snd_seq_query_subscribe_get_num_subs( $info  )  #} )
)

(de snd_seq_query_subscribe_get_addr (  info  )
    ((-gptr- "const snd_seq_query_subscribe_t *") info)
    (gptr #{ snd_seq_query_subscribe_get_addr( $info  )  #} )         ;;const snd_seq_addr_t * -> gptr
)

(de snd_seq_query_subscribe_get_queue (  info  )
    ((-gptr- "const snd_seq_query_subscribe_t *") info)
    (int #{ snd_seq_query_subscribe_get_queue( $info  )  #} )
)

(de snd_seq_query_subscribe_get_exclusive (  info  )
    ((-gptr- "const snd_seq_query_subscribe_t *") info)
    (int #{ snd_seq_query_subscribe_get_exclusive( $info  )  #} )
)

(de snd_seq_query_subscribe_get_time_update (  info  )
    ((-gptr- "const snd_seq_query_subscribe_t *") info)
    (int #{ snd_seq_query_subscribe_get_time_update( $info  )  #} )
)

(de snd_seq_query_subscribe_get_time_real (  info  )
    ((-gptr- "const snd_seq_query_subscribe_t *") info)
    (int #{ snd_seq_query_subscribe_get_time_real( $info  )  #} )
)


(de snd_seq_query_subscribe_set_client (  info  client  )
    ((-gptr- "snd_seq_query_subscribe_t *") info )
    ((-int-) client)
    #{ snd_seq_query_subscribe_set_client( $info ,$client  );  #} 
    ()
)

(de snd_seq_query_subscribe_set_port (  info  port  )
    ((-gptr- "snd_seq_query_subscribe_t *") info )
    ((-int-) port)
    #{ snd_seq_query_subscribe_set_port( $info ,$port  );  #} 
    ()
)

(de snd_seq_query_subscribe_set_root (  info  addr  )
    ((-gptr- "snd_seq_query_subscribe_t *") info )
    ((-gptr- "const snd_seq_addr_t *") addr)
    #{ snd_seq_query_subscribe_set_root( $info ,$addr  );  #} 
    ()
)

(de snd_seq_query_subscribe_set_type (  info  type  )
    ((-gptr- "snd_seq_query_subscribe_t *") info )
    ((-int-)   type)                                               ;; snd_seq_query_subs_type_t -> int
    #{ snd_seq_query_subscribe_set_type( $info ,$type  );  #} 
    ()
)

(de snd_seq_query_subscribe_set_index (  info  index  )
    ((-gptr- "snd_seq_query_subscribe_t *") info )
    ((-int-) index)
    #{ snd_seq_query_subscribe_set_index( $info ,$index  );  #} 
    ()
)


(de snd_seq_query_port_subscribers (  seq  subs  )
    ((-gptr- "snd_seq_t *") seq )
    ((-gptr- "snd_seq_query_subscribe_t *")  subs)
    (int #{ snd_seq_query_port_subscribers( $seq ,$subs  )  #} )
)


(de snd_seq_queue_info_sizeof ()
    (int #{ snd_seq_queue_info_sizeof()  #} )          ;; size_t -> int
)

(de snd_seq_queue_info_alloca ( s )
    ((-gptr- "snd_seq_queue_info_t **") s)
    #{ snd_seq_queue_info_alloca($s); #}
    ()
)


(de snd_seq_queue_info_malloc ( s )
    ((-gptr- "snd_seq_queue_info_t **") s)
    (int #{ snd_seq_queue_info_malloc( $s )  #} )
)

(de snd_seq_queue_info_free ( s )
    ((-gptr- "snd_seq_queue_info_t *") s)
    #{ snd_seq_queue_info_free( $s );  #} 
    ()
)

(de snd_seq_queue_info_copy (  dst  src  )
    ((-gptr- "snd_seq_queue_info_t *") dst )
    ((-gptr- "const snd_seq_queue_info_t *") src)
    #{ snd_seq_queue_info_copy( $dst ,$src  );  #} 
    ()
)


(de snd_seq_queue_info_get_queue (  info  )
    ((-gptr- "const snd_seq_queue_info_t *") info)
    (int #{ snd_seq_queue_info_get_queue( $info  )  #} )
)

(de snd_seq_queue_info_get_name (  info  )
    ((-gptr- "const snd_seq_queue_info_t *") info)
    (gptr  #{ snd_seq_queue_info_get_name( $info  )  #} )        ;  const char * -> gptr
)

(de snd_seq_queue_info_get_owner (  info  )
    ((-gptr- "const snd_seq_queue_info_t *") info)
    (int #{ snd_seq_queue_info_get_owner( $info  )  #} )
)

(de snd_seq_queue_info_get_locked (  info  )
    ((-gptr- "const snd_seq_queue_info_t *") info)
    (int #{ snd_seq_queue_info_get_locked( $info  )  #} )
)

(de snd_seq_queue_info_get_flags (  info  )
    ((-gptr- "const snd_seq_queue_info_t *") info)
    (int #{ snd_seq_queue_info_get_flags( $info  )  #} )   ;  unsigned int -> int
)


(de snd_seq_queue_info_set_name (  info  name  )
    ((-gptr- "snd_seq_queue_info_t *") info )
    ((-str-) name)
    #{ snd_seq_queue_info_set_name( $info ,$name->data  );  #} 
    ()
)

(de snd_seq_queue_info_set_owner (  info  owner  )
    ((-gptr- "snd_seq_queue_info_t *") info )
    ((-int-) owner)
    #{ snd_seq_queue_info_set_owner( $info ,$owner  );  #} 
    ()
)

(de snd_seq_queue_info_set_locked (  info  locked  )
    ((-gptr- "snd_seq_queue_info_t *") info )
    ((-int-) locked)
    #{ snd_seq_queue_info_set_locked( $info ,$locked  );  #} 
    ()
)

(de snd_seq_queue_info_set_flags (  info  flags  )
    ((-gptr- "snd_seq_queue_info_t *") info )
    ((-int-) flags)                   ; unsigned int -> int
    #{ snd_seq_queue_info_set_flags( $info ,$flags  );  #} 
    ()
)


(de snd_seq_create_queue (  seq  info  )
    ((-gptr- "snd_seq_t *") seq )
    ((-gptr- "snd_seq_queue_info_t *") info)
    (int #{ snd_seq_create_queue( $seq ,$info  )  #} )
)

(de snd_seq_alloc_named_queue (  seq  name  )
    ((-gptr- "snd_seq_t *") seq )
    ((-str-) name)
    (int #{ snd_seq_alloc_named_queue( $seq ,$name->data  )  #} )
)

(de snd_seq_alloc_queue (  handle  )
    ((-gptr- "snd_seq_t *") handle)
    (int #{ snd_seq_alloc_queue( $handle  )  #} )
)

(de snd_seq_free_queue (  handle  q  )
    ((-gptr- "snd_seq_t *") handle )
    ((-int-) q)
    (int #{ snd_seq_free_queue( $handle ,$q  )  #} )
)

(de snd_seq_get_queue_info (  seq  q  info  )
    ((-gptr- "snd_seq_t *") seq )
    ((-int-) q )
    ((-gptr- "snd_seq_queue_info_t *") info)
    (int #{ snd_seq_get_queue_info( $seq ,$q ,$info  )  #} )
)

(de snd_seq_set_queue_info (  seq  q  info  )
    ((-gptr- "snd_seq_t *") seq )
    ((-int-) q )
    ((-gptr- "snd_seq_queue_info_t *") info)
    (int #{ snd_seq_set_queue_info( $seq ,$q ,$info  )  #} )
)

(de snd_seq_query_named_queue (  seq  name  )
    ((-gptr- "snd_seq_t *") seq )
    ((-str-) name)
    (int #{ snd_seq_query_named_queue( $seq ,$name->data  )  #} )
)


(de snd_seq_get_queue_usage (  handle  q  )
    ((-gptr- "snd_seq_t *") handle )
    ((-int-) q)
    (int #{ snd_seq_get_queue_usage( $handle ,$q  )  #} )
)

(de snd_seq_set_queue_usage (  handle  q  used  )
    ((-gptr- "snd_seq_t *") handle )
    ((-int-) q )
    ((-int-) used)
    (int #{ snd_seq_set_queue_usage( $handle ,$q ,$used  )  #} )
)





(de snd_seq_queue_status_sizeof ()
    (int #{ snd_seq_queue_status_sizeof()  #} )          ;; size_t -> int
)


(de snd_seq_queue_status_alloca ( s ) 
    ((-gptr- "snd_seq_queue_status_t **") s)
    #{ snd_seq_queue_status_alloca($s); #}
    ()
)

(de snd_seq_queue_status_malloc ( s )
    ((-gptr- "snd_seq_queue_status_t **") s)
    (int #{ snd_seq_queue_status_malloc( $s )  #} )
)

(de snd_seq_queue_status_free (  s  )
    ((-gptr- "snd_seq_queue_status_t *") s)
    #{ snd_seq_queue_status_free( $s  );  #} 
    ()
)

(de snd_seq_queue_status_copy (  dst  src  )
    ((-gptr- "snd_seq_queue_status_t *") dst )
    ((-gptr- "const snd_seq_queue_status_t *") src)
    #{ snd_seq_queue_status_copy( $dst ,$src  );  #} 
    ()
)


(de snd_seq_queue_status_get_queue (  info  )
    ((-gptr- "const snd_seq_queue_status_t *") info)
    (int #{ snd_seq_queue_status_get_queue( $info  )  #} )
)

(de snd_seq_queue_status_get_events (  info  )
    ((-gptr- "const snd_seq_queue_status_t *") info)
    (int #{ snd_seq_queue_status_get_events( $info  )  #} )
)

(de snd_seq_queue_status_get_tick_time (  info  )
    ((-gptr- "const snd_seq_queue_status_t *") info)
    (int #{ snd_seq_queue_status_get_tick_time( $info  )  #} )           ;; snd_seq_tick_time_t -> int
)

(de snd_seq_queue_status_get_real_time (  info  )
    ((-gptr- "const snd_seq_queue_status_t *") info)
    (gptr #{ snd_seq_queue_status_get_real_time( $info  )  #} )        ;  const snd_seq_real_time_t * -> gptr
)

(de snd_seq_queue_status_get_status (  info  )
    ((-gptr- "const snd_seq_queue_status_t *") info)
    (int #{ snd_seq_queue_status_get_status( $info  )  #} )   ;  unsigned int -> int
)


(de snd_seq_get_queue_status (  handle  q  status  )
    ((-gptr- "snd_seq_t *") handle )
    ((-int-) q )
    ((-gptr- "snd_seq_queue_status_t *") status)
    (int #{ snd_seq_get_queue_status( $handle ,$q ,$status  )  #} )
)





(de snd_seq_queue_tempo_sizeof ()
    (int #{ snd_seq_queue_tempo_sizeof()  #} )          ;; size_t -> int
)

(de snd_seq_queue_tempo_alloca ( s ) 
    ((-gptr- "snd_seq_queue_tempo_t **") s)
    #{ snd_seq_queue_tempo_alloca($s); #}
    ()
)

(de snd_seq_queue_tempo_malloc (  s  )
    ((-gptr- "snd_seq_queue_tempo_t **") s)
    (int #{ snd_seq_queue_tempo_malloc( $s  )  #} )
)

(de snd_seq_queue_tempo_free (  s  )
    ((-gptr- "snd_seq_queue_tempo_t *") s)
    #{ snd_seq_queue_tempo_free( $s  );  #} 
    ()
)

(de snd_seq_queue_tempo_copy (  dst  src  )
    ((-gptr- "snd_seq_queue_tempo_t *") dst )
    ((-gptr- "const snd_seq_queue_tempo_t *") src)
    #{ snd_seq_queue_tempo_copy( $dst ,$src  );  #} 
    ()
)


(de snd_seq_queue_tempo_get_queue (  info  )
    ((-gptr- "const snd_seq_queue_tempo_t *") info)
    (int #{ snd_seq_queue_tempo_get_queue( $info  )  #} )
)

(de snd_seq_queue_tempo_get_tempo (  info  )
    ((-gptr- "const snd_seq_queue_tempo_t *") info)
    (int #{ snd_seq_queue_tempo_get_tempo( $info  )  #} )    ;  unsigned int -> int
)

(de snd_seq_queue_tempo_get_ppq (  info  )
    ((-gptr- "const snd_seq_queue_tempo_t *") info)
    (int #{ snd_seq_queue_tempo_get_ppq( $info  )  #} )
)

(de snd_seq_queue_tempo_get_skew (  info  )
    ((-gptr- "const snd_seq_queue_tempo_t *") info)
    (int #{ snd_seq_queue_tempo_get_skew( $info  )  #} )    ;  unsigned int -> int
)

(de snd_seq_queue_tempo_get_skew_base (  info  )
    ((-gptr- "const snd_seq_queue_tempo_t *") info)
    (int #{ snd_seq_queue_tempo_get_skew_base( $info  )  #} )   ;  unsigned int -> int
)

(de snd_seq_queue_tempo_set_tempo (  info  tempo  )
    ((-gptr- "snd_seq_queue_tempo_t *") info )
    ((-int-) tempo)                   ; unsigned int -> int
    #{ snd_seq_queue_tempo_set_tempo( $info ,$tempo  );  #} 
    ()
)

(de snd_seq_queue_tempo_set_ppq (  info  ppq  )
    ((-gptr- "snd_seq_queue_tempo_t *") info )
    ((-int-) ppq)
    #{ snd_seq_queue_tempo_set_ppq( $info ,$ppq  );  #} 
    ()
)

(de snd_seq_queue_tempo_set_skew (  info  skew  )
    ((-gptr- "snd_seq_queue_tempo_t *") info )
    ((-int-) skew)                   ; unsigned int -> int
    #{ snd_seq_queue_tempo_set_skew( $info ,$skew  );  #} 
    ()
)

(de snd_seq_queue_tempo_set_skew_base (  info  base  )
    ((-gptr- "snd_seq_queue_tempo_t *") info )
    ((-int-) base)                   ; unsigned int -> int
    #{ snd_seq_queue_tempo_set_skew_base( $info ,$base  );  #} 
    ()
)


(de snd_seq_get_queue_tempo (  handle  q  tempo  )
    ((-gptr- "snd_seq_t *") handle )
    ((-int-) q )
    ((-gptr- "snd_seq_queue_tempo_t *") tempo)
    (int #{ snd_seq_get_queue_tempo( $handle ,$q ,$tempo  )  #} )
)

(de snd_seq_set_queue_tempo (  handle  q  tempo  )
    ((-gptr- "snd_seq_t *") handle )
    ((-int-) q )
    ((-gptr- "snd_seq_queue_tempo_t *") tempo)
    (int #{ snd_seq_set_queue_tempo( $handle ,$q ,$tempo  )  #} )
)




(de snd_seq_queue_timer_sizeof ()
    (int #{ snd_seq_queue_timer_sizeof()  #} )          ;; size_t -> int
)

(de snd_seq_queue_timer_alloca ( s ) 
    ((-gptr- "snd_seq_queue_timer_t **") s)
    #{ snd_seq_queue_timer_alloca($s); #}
    ()
)


(de snd_seq_queue_timer_malloc (  s  )
    ((-gptr- "snd_seq_queue_timer_t **") s)
    (int #{ snd_seq_queue_timer_malloc( $s  )  #} )
)

(de snd_seq_queue_timer_free (  s  )
    ((-gptr- "snd_seq_queue_timer_t *") s)
    #{ snd_seq_queue_timer_free( $s  );  #} 
    ()
)

(de snd_seq_queue_timer_copy (  dst  src  )
    ((-gptr- "snd_seq_queue_timer_t *") dst )
    ((-gptr- "const snd_seq_queue_timer_t *") src)
    #{ snd_seq_queue_timer_copy( $dst ,$src  );  #} 
    ()
)


(de snd_seq_queue_timer_get_queue (  info  )
    ((-gptr- "const snd_seq_queue_timer_t *") info)
    (int #{ snd_seq_queue_timer_get_queue( $info  )  #} )
)

(de snd_seq_queue_timer_get_type (  info  )
    ((-gptr- "const snd_seq_queue_timer_t *") info)
    (int #{ snd_seq_queue_timer_get_type( $info  )  #} )          ;; snd_seq_queue_timer_type_t -> int
)

(de snd_seq_queue_timer_get_id (  info  )
    ((-gptr- "const snd_seq_queue_timer_t *") info)
    (gptr #{ snd_seq_queue_timer_get_id( $info  )  #} )             ;  const snd_timer_id_t * -> gptr
)

(de snd_seq_queue_timer_get_resolution (  info  )
    ((-gptr- "const snd_seq_queue_timer_t *") info)
    (int #{ snd_seq_queue_timer_get_resolution( $info  )  #} )   ;  unsigned int -> int
)


(de snd_seq_queue_timer_set_type (  info  type  )
    ((-gptr- "snd_seq_queue_timer_t *") info )
    ((-int-)  type)                                                ;; snd_seq_queue_timer_type_t -> int
    #{ snd_seq_queue_timer_set_type( $info ,$type  );  #} 
    ()
)

(de snd_seq_queue_timer_set_id (  info  id  )
    ((-gptr- "snd_seq_queue_timer_t *") info )
    ((-gptr- "const snd_timer_id_t *") id)
    #{ snd_seq_queue_timer_set_id( $info ,$id  );  #} 
    ()
)

(de snd_seq_queue_timer_set_resolution (  info  resolution  )
    ((-gptr- "snd_seq_queue_timer_t *") info )
    ((-int-) resolution)                   ; unsigned int -> int
    #{ snd_seq_queue_timer_set_resolution( $info ,$resolution  );  #} 
    ()
)


(de snd_seq_get_queue_timer (  handle  q  timer  )
    ((-gptr- "snd_seq_t *") handle )
    ((-int-) q )
    ((-gptr- "snd_seq_queue_timer_t *") timer)
    (int #{ snd_seq_get_queue_timer( $handle ,$q ,$timer  )  #} )
)

(de snd_seq_set_queue_timer (  handle  q  timer  )
    ((-gptr- "snd_seq_t *") handle )
    ((-int-) q )
    ((-gptr- "snd_seq_queue_timer_t *") timer)
    (int #{ snd_seq_set_queue_timer( $handle ,$q ,$timer  )  #} )
)


; (de snd_seq_create_event ()
;     (gptr  #{ snd_seq_create_event()  #} )   ;  snd_seq_event_t * -> gptr
; )

(de snd_seq_free_event (  ev  )
    ((-gptr- "snd_seq_event_t *") ev)
    (int #{ snd_seq_free_event( $ev  )  #} )
)

(de snd_seq_event_length (  ev  )
    ((-gptr- "snd_seq_event_t *") ev)
    (int #{ snd_seq_event_length( $ev  )  #} )          ;; ssize_t -> int
)

(de snd_seq_event_output (  handle  ev  )
    ((-gptr- "snd_seq_t *") handle )
    ((-gptr- "snd_seq_event_t *") ev)
    (int #{ snd_seq_event_output( $handle ,$ev  )  #} )
)

(de snd_seq_event_output_buffer (  handle  ev  )
    ((-gptr- "snd_seq_t *") handle )
    ((-gptr- "snd_seq_event_t *") ev)
    (int #{ snd_seq_event_output_buffer( $handle ,$ev  )  #} )
)

(de snd_seq_event_output_direct (  handle  ev  )
    ((-gptr- "snd_seq_t *") handle )
    ((-gptr- "snd_seq_event_t *") ev)
    (int #{ snd_seq_event_output_direct( $handle ,$ev  )  #} )
)

(de snd_seq_event_input (  handle  ev  )
    ((-gptr- "snd_seq_t *") handle )
    ((-gptr- "snd_seq_event_t **") ev)
    (int #{ snd_seq_event_input( $handle ,$ev  )  #} )
)

(de snd_seq_event_input_pending (  seq  fetch_sequencer  )
    ((-gptr- "snd_seq_t *") seq )
    ((-int-) fetch_sequencer)
    (int #{ snd_seq_event_input_pending( $seq ,$fetch_sequencer  )  #} )
)

(de snd_seq_drain_output (  handle  )
    ((-gptr- "snd_seq_t *") handle)
    (int #{ snd_seq_drain_output( $handle  )  #} )
)

(de snd_seq_event_output_pending (  seq  )
    ((-gptr- "snd_seq_t *") seq)
    (int #{ snd_seq_event_output_pending( $seq  )  #} )
)

(de snd_seq_extract_output (  handle  ev  )
    ((-gptr- "snd_seq_t *") handle )
    ((-gptr- "snd_seq_event_t **") ev)
    (int #{ snd_seq_extract_output( $handle ,$ev  )  #} )
)

(de snd_seq_drop_output (  handle  )
    ((-gptr- "snd_seq_t *") handle)
    (int #{ snd_seq_drop_output( $handle  )  #} )
)

(de snd_seq_drop_output_buffer (  handle  )
    ((-gptr- "snd_seq_t *") handle)
    (int #{ snd_seq_drop_output_buffer( $handle  )  #} )
)

(de snd_seq_drop_input (  handle  )
    ((-gptr- "snd_seq_t *") handle)
    (int #{ snd_seq_drop_input( $handle  )  #} )
)

(de snd_seq_drop_input_buffer (  handle  )
    ((-gptr- "snd_seq_t *") handle)
    (int #{ snd_seq_drop_input_buffer( $handle  )  #} )
)



(de snd_seq_remove_events_sizeof ( )
    (int #{ snd_seq_remove_events_sizeof()  #} )          ;; size_t -> int
)

(de snd_seq_remove_events_alloca ( s ) 
    ((-gptr- "snd_seq_remove_events_t **") s)
    #{ snd_seq_remove_events_alloca($s);  #}
    ()
)

(de snd_seq_remove_events_malloc (  s  )
    ((-gptr- "snd_seq_remove_events_t **") s)
    (int #{ snd_seq_remove_events_malloc( $s  )  #} )
)

(de snd_seq_remove_events_free (  s  )
    ((-gptr- "snd_seq_remove_events_t *") s)
    #{ snd_seq_remove_events_free( $s  );  #} 
    ()
)

(de snd_seq_remove_events_copy (  dst  src  )
    ((-gptr- "snd_seq_remove_events_t *") dst )
    ((-gptr- "const snd_seq_remove_events_t *") src)
    #{ snd_seq_remove_events_copy( $dst ,$src  );  #} 
    ()
)


(de snd_seq_remove_events_get_condition (  info  )
    ((-gptr- "const snd_seq_remove_events_t *") info)
    (int #{ snd_seq_remove_events_get_condition( $info  )  #} )   ;  unsigned int -> int
)

(de snd_seq_remove_events_get_queue (  info  )
    ((-gptr- "const snd_seq_remove_events_t *") info)
    (int #{ snd_seq_remove_events_get_queue( $info  )  #} )
)

(de snd_seq_remove_events_get_time (  info  )
    ((-gptr- "const snd_seq_remove_events_t *") info)
    (gptr #{ snd_seq_remove_events_get_time( $info  )  #} )  ;  const snd_seq_timestamp_t * -> gptr
)

(de snd_seq_remove_events_get_dest (  info  )
    ((-gptr- "const snd_seq_remove_events_t *") info)
    (gptr  #{ snd_seq_remove_events_get_dest( $info  )  #} )  ;  const snd_seq_addr_t * -> gptr
)

(de snd_seq_remove_events_get_channel (  info  )
    ((-gptr- "const snd_seq_remove_events_t *") info)
    (int #{ snd_seq_remove_events_get_channel( $info  )  #} )
)

(de snd_seq_remove_events_get_event_type (  info  )
    ((-gptr- "const snd_seq_remove_events_t *") info)
    (int #{ snd_seq_remove_events_get_event_type( $info  )  #} )
)

(de snd_seq_remove_events_get_tag (  info  )
    ((-gptr- "const snd_seq_remove_events_t *") info)
    (int #{ snd_seq_remove_events_get_tag( $info  )  #} )
)


(de snd_seq_remove_events_set_condition (  info  flags  )
    ((-gptr- "snd_seq_remove_events_t *") info )
    ((-int-) flags)                   ; unsigned int -> int
    #{ snd_seq_remove_events_set_condition( $info ,$flags  );  #} 
    ()
)

(de snd_seq_remove_events_set_queue (  info  queue  )
    ((-gptr- "snd_seq_remove_events_t *") info )
    ((-int-) queue)
    #{ snd_seq_remove_events_set_queue( $info ,$queue  );  #} 
    ()
)

(de snd_seq_remove_events_set_time (  info  time  )
    ((-gptr- "snd_seq_remove_events_t *") info )
    ((-gptr- "const snd_seq_timestamp_t *") time)
    #{ snd_seq_remove_events_set_time( $info ,$time  );  #} 
    ()
)

(de snd_seq_remove_events_set_dest (  info  addr  )
    ((-gptr- "snd_seq_remove_events_t *") info )
    ((-gptr- "const snd_seq_addr_t *") addr)
    #{ snd_seq_remove_events_set_dest( $info ,$addr  );  #} 
    ()
)

(de snd_seq_remove_events_set_channel (  info  channel  )
    ((-gptr- "snd_seq_remove_events_t *") info )
    ((-int-) channel)
    #{ snd_seq_remove_events_set_channel( $info ,$channel  );  #} 
    ()
)

(de snd_seq_remove_events_set_event_type (  info  type  )
    ((-gptr- "snd_seq_remove_events_t *") info )
    ((-int-) type)
    #{ snd_seq_remove_events_set_event_type( $info ,$type  );  #} 
    ()
)

(de snd_seq_remove_events_set_tag (  info  tag  )
    ((-gptr- "snd_seq_remove_events_t *") info )
    ((-int-) tag)
    #{ snd_seq_remove_events_set_tag( $info ,$tag  );  #} 
    ()
)


(de snd_seq_remove_events (  handle  info  )
    ((-gptr- "snd_seq_t *") handle )
    ((-gptr- "snd_seq_remove_events_t *") info)
    (int #{ snd_seq_remove_events( $handle ,$info  )  #} )
)


(de snd_seq_set_bit (  nr  array  )
    ((-int-) nr )
    ((-gptr-) array)
    #{ snd_seq_set_bit( $nr ,$array  );  #} 
    ()
)

(de snd_seq_change_bit (  nr  array  )
    ((-int-) nr )
    ((-gptr-) array)
    (int #{ snd_seq_change_bit( $nr ,$array  )  #} )
)

(de snd_seq_get_bit (  nr  array  )
    ((-int-) nr )
    ((-gptr-) array)
    (int #{ snd_seq_get_bit( $nr ,$array  )  #} )
)



(de snd_seq_type_check (ev x) 
    ((-gptr- "snd_seq_event_t *") ev)
    ((-int-) x)
    (int #{ snd_seq_type_check($ev,$x)  #})
    )

(de snd_seq_ev_is_result_type (ev) 
    ((-gptr- "snd_seq_event_t *") ev)
    (int #{ snd_seq_ev_is_result_type ($ev)  #})
    )

(de snd_seq_ev_is_note_type (ev) 
    ((-gptr- "snd_seq_event_t *") ev)
    (int #{ snd_seq_ev_is_note_type ($ev)  #})
    )

(de snd_seq_ev_is_control_type (ev) 
    ((-gptr- "snd_seq_event_t *") ev)
    (int #{ snd_seq_ev_is_control_type ($ev)  #})
    )

(de snd_seq_ev_is_channel_type (ev) 
    ((-gptr- "snd_seq_event_t *") ev)
    (int #{ snd_seq_ev_is_channel_type ($ev)  #})
    )

(de snd_seq_ev_is_queue_type (ev) 
    ((-gptr- "snd_seq_event_t *") ev)
    (int #{ snd_seq_ev_is_queue_type ($ev)  #})
    )

(de snd_seq_ev_is_message_type (ev) 
    ((-gptr- "snd_seq_event_t *") ev)
    (int #{ snd_seq_ev_is_message_type ($ev)  #})
    )

(de snd_seq_ev_is_subscribe_type (ev) 
    ((-gptr- "snd_seq_event_t *") ev)
    (int #{ snd_seq_ev_is_subscribe_type ($ev)  #})
    )

(de snd_seq_ev_is_sample_type (ev) 
    ((-gptr- "snd_seq_event_t *") ev)
    (int #{ snd_seq_ev_is_sample_type ($ev)  #})
    )

(de snd_seq_ev_is_user_type (ev) 
    ((-gptr- "snd_seq_event_t *") ev)
    (int #{ snd_seq_ev_is_user_type ($ev)  #})
    )

(de snd_seq_ev_is_instr_type (ev) 
    ((-gptr- "snd_seq_event_t *") ev)
    (int #{ snd_seq_ev_is_instr_type ($ev)  #})
    )

(de snd_seq_ev_is_fixed_type (ev) 
    ((-gptr- "snd_seq_event_t *") ev)
    (int #{ snd_seq_ev_is_fixed_type ($ev)  #})
    )

(de snd_seq_ev_is_variable_type (ev)	
    ((-gptr- "snd_seq_event_t *") ev)
    (int #{ snd_seq_ev_is_variable_type ($ev)  #})
    )

(de snd_seq_ev_is_varusr_type (ev) 
    ((-gptr- "snd_seq_event_t *") ev)
    (int #{ snd_seq_ev_is_varusr_type ($ev)  #})
    )

(de snd_seq_ev_is_reserved (ev) 
    ((-gptr- "snd_seq_event_t *") ev)
    (int #{ snd_seq_ev_is_reserved ($ev)  #})
    )

(de snd_seq_ev_is_prior (ev)	
    ((-gptr- "snd_seq_event_t *") ev)
    (int #{ snd_seq_ev_is_prior ($ev)  #})
    )

(de snd_seq_ev_length_type (ev) 
    ((-gptr- "snd_seq_event_t *") ev)
    (int #{ snd_seq_ev_length_type ($ev)  #})
    )

(de snd_seq_ev_is_fixed (ev)	
    ((-gptr- "snd_seq_event_t *") ev)
    (int #{ snd_seq_ev_is_fixed ($ev)  #})
    )

(de snd_seq_ev_is_variable (ev) 
    ((-gptr- "snd_seq_event_t *") ev)
    (int #{ snd_seq_ev_is_variable ($ev)  #})
    )

(de snd_seq_ev_is_varusr (ev) 
    ((-gptr- "snd_seq_event_t *") ev)
    (int #{ snd_seq_ev_is_varusr ($ev)  #})
    )

(de snd_seq_ev_timestamp_type (ev) 
    ((-gptr- "snd_seq_event_t *") ev)
    (int #{ snd_seq_ev_timestamp_type ($ev)  #})
    )

(de snd_seq_ev_is_tick (ev) 
    ((-gptr- "snd_seq_event_t *") ev)
    (int #{ snd_seq_ev_is_tick ($ev)  #})
    )

(de snd_seq_ev_is_real (ev) 
    ((-gptr- "snd_seq_event_t *") ev)
    (int #{ snd_seq_ev_is_real ($ev)  #})
    )

(de snd_seq_ev_timemode_type (ev) 
    ((-gptr- "snd_seq_event_t *") ev)
    (int #{ snd_seq_ev_timemode_type ($ev)  #})
    )

(de snd_seq_ev_is_abstime (ev) 
    ((-gptr- "snd_seq_event_t *") ev)
    (int #{ snd_seq_ev_is_abstime ($ev)  #})
    )

(de snd_seq_ev_is_reltime (ev) 
    ((-gptr- "snd_seq_event_t *") ev)
    (int #{ snd_seq_ev_is_reltime ($ev)  #})
    )

(de snd_seq_ev_is_direct (ev) 
    ((-gptr- "snd_seq_event_t *") ev)
    (int #{ snd_seq_ev_is_direct ($ev)  #})
    )


;; ********************************************************

(dhc-make ()
  dummy_seq
  snd_seq_open
  snd_seq_open_lconf
  snd_seq_name
  snd_seq_type
  snd_seq_close
  snd_seq_poll_descriptors_count
  snd_seq_poll_descriptors
  snd_seq_poll_descriptors_revents
  snd_seq_nonblock
  snd_seq_client_id
  snd_seq_get_output_buffer_size
  snd_seq_get_input_buffer_size
  snd_seq_set_output_buffer_size
  snd_seq_set_input_buffer_size
  snd_seq_system_info_sizeof
  snd_seq_system_info_alloca
  snd_seq_system_info_malloc
  snd_seq_system_info_free
  snd_seq_system_info_copy
  snd_seq_system_info_get_queues
  snd_seq_system_info_get_clients
  snd_seq_system_info_get_ports
  snd_seq_system_info_get_channels
  snd_seq_system_info_get_cur_clients
  snd_seq_system_info_get_cur_queues
  snd_seq_system_info
  snd_seq_client_info_sizeof
  snd_seq_client_info_alloca
  snd_seq_client_info_malloc
  snd_seq_client_info_free
  snd_seq_client_info_copy
  snd_seq_client_info_get_client
  snd_seq_client_info_get_type
  snd_seq_client_info_get_name
  snd_seq_client_info_get_broadcast_filter
  snd_seq_client_info_get_error_bounce
  snd_seq_client_info_get_event_filter
  snd_seq_client_info_get_num_ports
  snd_seq_client_info_get_event_lost
  snd_seq_client_info_set_client
  snd_seq_client_info_set_name
  snd_seq_client_info_set_broadcast_filter
  snd_seq_client_info_set_error_bounce
  snd_seq_client_info_set_event_filter
  snd_seq_get_client_info
  snd_seq_get_any_client_info
  snd_seq_set_client_info
  snd_seq_query_next_client
  snd_seq_client_pool_sizeof
  snd_seq_client_pool_alloca
  snd_seq_client_pool_malloc
  snd_seq_client_pool_free
  snd_seq_client_pool_copy
  snd_seq_client_pool_get_client
  snd_seq_client_pool_get_output_pool
  snd_seq_client_pool_get_input_pool
  snd_seq_client_pool_get_output_room
  snd_seq_client_pool_get_output_free
  snd_seq_client_pool_get_input_free
  snd_seq_client_pool_set_output_pool
  snd_seq_client_pool_set_input_pool
  snd_seq_client_pool_set_output_room
  snd_seq_get_client_pool
  snd_seq_set_client_pool
  snd_seq_port_info_sizeof
  snd_seq_port_info_alloca
  snd_seq_port_info_malloc
  snd_seq_port_info_free
  snd_seq_port_info_copy
  snd_seq_port_info_get_client
  snd_seq_port_info_get_port
  snd_seq_port_info_get_addr
  snd_seq_port_info_get_name
  snd_seq_port_info_get_capability
  snd_seq_port_info_get_type
  snd_seq_port_info_get_midi_channels
  snd_seq_port_info_get_midi_voices
  snd_seq_port_info_get_synth_voices
  snd_seq_port_info_get_read_use
  snd_seq_port_info_get_write_use
  snd_seq_port_info_get_port_specified
  snd_seq_port_info_set_client
  snd_seq_port_info_set_port
  snd_seq_port_info_set_addr
  snd_seq_port_info_set_name
  snd_seq_port_info_set_capability
  snd_seq_port_info_set_type
  snd_seq_port_info_set_midi_channels
  snd_seq_port_info_set_midi_voices
  snd_seq_port_info_set_synth_voices
  snd_seq_port_info_set_port_specified
  snd_seq_create_port
  snd_seq_delete_port
  snd_seq_get_port_info
  snd_seq_get_any_port_info
  snd_seq_set_port_info
  snd_seq_query_next_port
  snd_seq_port_subscribe_sizeof
  snd_seq_port_subscribe_alloca
  snd_seq_port_subscribe_malloc
  snd_seq_port_subscribe_free
  snd_seq_port_subscribe_copy
  snd_seq_port_subscribe_get_sender
  snd_seq_port_subscribe_get_dest
  snd_seq_port_subscribe_get_queue
  snd_seq_port_subscribe_get_exclusive
  snd_seq_port_subscribe_get_time_update
  snd_seq_port_subscribe_get_time_real
  snd_seq_port_subscribe_set_sender
  snd_seq_port_subscribe_set_dest
  snd_seq_port_subscribe_set_queue
  snd_seq_port_subscribe_set_exclusive
  snd_seq_port_subscribe_set_time_update
  snd_seq_port_subscribe_set_time_real
  snd_seq_get_port_subscription
  snd_seq_subscribe_port
  snd_seq_unsubscribe_port
  snd_seq_query_subscribe_sizeof
  snd_seq_query_subscribe_alloca
  snd_seq_query_subscribe_malloc
  snd_seq_query_subscribe_free
  snd_seq_query_subscribe_copy
  snd_seq_query_subscribe_get_client
  snd_seq_query_subscribe_get_port
  snd_seq_query_subscribe_get_root
  snd_seq_query_subscribe_get_type
  snd_seq_query_subscribe_get_index
  snd_seq_query_subscribe_get_num_subs
  snd_seq_query_subscribe_get_addr
  snd_seq_query_subscribe_get_queue
  snd_seq_query_subscribe_get_exclusive
  snd_seq_query_subscribe_get_time_update
  snd_seq_query_subscribe_get_time_real
  snd_seq_query_subscribe_set_client
  snd_seq_query_subscribe_set_port
  snd_seq_query_subscribe_set_root
  snd_seq_query_subscribe_set_type
  snd_seq_query_subscribe_set_index
  snd_seq_query_port_subscribers
  snd_seq_queue_info_sizeof
  snd_seq_queue_info_alloca
  snd_seq_queue_info_malloc
  snd_seq_queue_info_free
  snd_seq_queue_info_copy
  snd_seq_queue_info_get_queue
  snd_seq_queue_info_get_name
  snd_seq_queue_info_get_owner
  snd_seq_queue_info_get_locked
  snd_seq_queue_info_get_flags
  snd_seq_queue_info_set_name
  snd_seq_queue_info_set_owner
  snd_seq_queue_info_set_locked
  snd_seq_queue_info_set_flags
  snd_seq_create_queue
  snd_seq_alloc_named_queue
  snd_seq_alloc_queue
  snd_seq_free_queue
  snd_seq_get_queue_info
  snd_seq_set_queue_info
  snd_seq_query_named_queue
  snd_seq_get_queue_usage
  snd_seq_set_queue_usage
  snd_seq_queue_status_sizeof
  snd_seq_queue_status_alloca
  snd_seq_queue_status_malloc
  snd_seq_queue_status_free
  snd_seq_queue_status_copy
  snd_seq_queue_status_get_queue
  snd_seq_queue_status_get_events
  snd_seq_queue_status_get_tick_time
  snd_seq_queue_status_get_real_time
  snd_seq_queue_status_get_status
  snd_seq_get_queue_status
  snd_seq_queue_tempo_sizeof
  snd_seq_queue_tempo_alloca
  snd_seq_queue_tempo_malloc
  snd_seq_queue_tempo_free
  snd_seq_queue_tempo_copy
  snd_seq_queue_tempo_get_queue
  snd_seq_queue_tempo_get_tempo
  snd_seq_queue_tempo_get_ppq
  snd_seq_queue_tempo_get_skew
  snd_seq_queue_tempo_get_skew_base
  snd_seq_queue_tempo_set_tempo
  snd_seq_queue_tempo_set_ppq
  snd_seq_queue_tempo_set_skew
  snd_seq_queue_tempo_set_skew_base
  snd_seq_get_queue_tempo
  snd_seq_set_queue_tempo
  snd_seq_queue_timer_sizeof
  snd_seq_queue_timer_alloca
  snd_seq_queue_timer_malloc
  snd_seq_queue_timer_free
  snd_seq_queue_timer_copy
  snd_seq_queue_timer_get_queue
  snd_seq_queue_timer_get_type
  snd_seq_queue_timer_get_id
  snd_seq_queue_timer_get_resolution
  snd_seq_queue_timer_set_type
  snd_seq_queue_timer_set_id
  snd_seq_queue_timer_set_resolution
  snd_seq_get_queue_timer
  snd_seq_set_queue_timer
;;  snd_seq_create_event
  snd_seq_free_event
  snd_seq_event_length
  snd_seq_event_output
  snd_seq_event_output_buffer
  snd_seq_event_output_direct
  snd_seq_event_input
  snd_seq_event_input_pending
  snd_seq_drain_output
  snd_seq_event_output_pending
  snd_seq_extract_output
  snd_seq_drop_output
  snd_seq_drop_output_buffer
  snd_seq_drop_input
  snd_seq_drop_input_buffer
  snd_seq_remove_events_sizeof
  snd_seq_remove_events_alloca
  snd_seq_remove_events_malloc
  snd_seq_remove_events_free
  snd_seq_remove_events_copy
  snd_seq_remove_events_get_condition
  snd_seq_remove_events_get_queue
  snd_seq_remove_events_get_time
  snd_seq_remove_events_get_dest
  snd_seq_remove_events_get_channel
  snd_seq_remove_events_get_event_type
  snd_seq_remove_events_get_tag
  snd_seq_remove_events_set_condition
  snd_seq_remove_events_set_queue
  snd_seq_remove_events_set_time
  snd_seq_remove_events_set_dest
  snd_seq_remove_events_set_channel
  snd_seq_remove_events_set_event_type
  snd_seq_remove_events_set_tag
  snd_seq_remove_events
  snd_seq_set_bit
  snd_seq_change_bit
  snd_seq_get_bit
  snd_seq_type_check
  snd_seq_ev_is_result_type
  snd_seq_ev_is_note_type
  snd_seq_ev_is_control_type
  snd_seq_ev_is_channel_type
  snd_seq_ev_is_queue_type
  snd_seq_ev_is_message_type
  snd_seq_ev_is_subscribe_type
  snd_seq_ev_is_sample_type
  snd_seq_ev_is_user_type
  snd_seq_ev_is_instr_type
  snd_seq_ev_is_fixed_type
  snd_seq_ev_is_variable_type
  snd_seq_ev_is_varusr_type
  snd_seq_ev_is_reserved
  snd_seq_ev_is_prior
  snd_seq_ev_length_type
  snd_seq_ev_is_fixed
  snd_seq_ev_is_variable
  snd_seq_ev_is_varusr
  snd_seq_ev_timestamp_type
  snd_seq_ev_is_tick
  snd_seq_ev_is_real
  snd_seq_ev_timemode_type
  snd_seq_ev_is_abstime
  snd_seq_ev_is_reltime
  snd_seq_ev_is_direct
)
