linux/include/uapi/sound/asequencer.h

/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
/*
 *  Main header file for the ALSA sequencer
 *  Copyright (c) 1998-1999 by Frank van de Pol <[email protected]>
 *            (c) 1998-1999 by Jaroslav Kysela <[email protected]>
 */
#ifndef _UAPI__SOUND_ASEQUENCER_H
#define _UAPI__SOUND_ASEQUENCER_H

#include <sound/asound.h>

/** version of the sequencer */
#define SNDRV_SEQ_VERSION

/**
 * definition of sequencer event types
 */

/** system messages
 * event data type = #snd_seq_result
 */
#define SNDRV_SEQ_EVENT_SYSTEM
#define SNDRV_SEQ_EVENT_RESULT

/** note messages (channel specific)
 * event data type = #snd_seq_ev_note
 */
#define SNDRV_SEQ_EVENT_NOTE
#define SNDRV_SEQ_EVENT_NOTEON
#define SNDRV_SEQ_EVENT_NOTEOFF
#define SNDRV_SEQ_EVENT_KEYPRESS
	
/** control messages (channel specific)
 * event data type = #snd_seq_ev_ctrl
 */
#define SNDRV_SEQ_EVENT_CONTROLLER
#define SNDRV_SEQ_EVENT_PGMCHANGE
#define SNDRV_SEQ_EVENT_CHANPRESS
#define SNDRV_SEQ_EVENT_PITCHBEND
#define SNDRV_SEQ_EVENT_CONTROL14
#define SNDRV_SEQ_EVENT_NONREGPARAM
#define SNDRV_SEQ_EVENT_REGPARAM

/** synchronisation messages
 * event data type = #snd_seq_ev_ctrl
 */
#define SNDRV_SEQ_EVENT_SONGPOS
#define SNDRV_SEQ_EVENT_SONGSEL
#define SNDRV_SEQ_EVENT_QFRAME
#define SNDRV_SEQ_EVENT_TIMESIGN
#define SNDRV_SEQ_EVENT_KEYSIGN
	        
/** timer messages
 * event data type = snd_seq_ev_queue_control
 */
#define SNDRV_SEQ_EVENT_START
#define SNDRV_SEQ_EVENT_CONTINUE
#define SNDRV_SEQ_EVENT_STOP	
#define SNDRV_SEQ_EVENT_SETPOS_TICK
#define SNDRV_SEQ_EVENT_SETPOS_TIME
#define SNDRV_SEQ_EVENT_TEMPO
#define SNDRV_SEQ_EVENT_CLOCK
#define SNDRV_SEQ_EVENT_TICK
#define SNDRV_SEQ_EVENT_QUEUE_SKEW

/** others
 * event data type = none
 */
#define SNDRV_SEQ_EVENT_TUNE_REQUEST
#define SNDRV_SEQ_EVENT_RESET
#define SNDRV_SEQ_EVENT_SENSING

/** echo back, kernel private messages
 * event data type = any type
 */
#define SNDRV_SEQ_EVENT_ECHO
#define SNDRV_SEQ_EVENT_OSS

/** system status messages (broadcast for subscribers)
 * event data type = snd_seq_addr
 */
#define SNDRV_SEQ_EVENT_CLIENT_START
#define SNDRV_SEQ_EVENT_CLIENT_EXIT
#define SNDRV_SEQ_EVENT_CLIENT_CHANGE
#define SNDRV_SEQ_EVENT_PORT_START
#define SNDRV_SEQ_EVENT_PORT_EXIT
#define SNDRV_SEQ_EVENT_PORT_CHANGE

/** port connection changes
 * event data type = snd_seq_connect
 */
#define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED
#define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED

/* 70-89:  synthesizer events - obsoleted */

/** user-defined events with fixed length
 * event data type = any
 */
#define SNDRV_SEQ_EVENT_USR0
#define SNDRV_SEQ_EVENT_USR1
#define SNDRV_SEQ_EVENT_USR2
#define SNDRV_SEQ_EVENT_USR3
#define SNDRV_SEQ_EVENT_USR4
#define SNDRV_SEQ_EVENT_USR5
#define SNDRV_SEQ_EVENT_USR6
#define SNDRV_SEQ_EVENT_USR7
#define SNDRV_SEQ_EVENT_USR8
#define SNDRV_SEQ_EVENT_USR9

/* 100-118: instrument layer - obsoleted */
/* 119-129: reserved */

/* 130-139: variable length events
 * event data type = snd_seq_ev_ext
 * (SNDRV_SEQ_EVENT_LENGTH_VARIABLE must be set)
 */
#define SNDRV_SEQ_EVENT_SYSEX
#define SNDRV_SEQ_EVENT_BOUNCE
/* 132-134: reserved */
#define SNDRV_SEQ_EVENT_USR_VAR0
#define SNDRV_SEQ_EVENT_USR_VAR1
#define SNDRV_SEQ_EVENT_USR_VAR2
#define SNDRV_SEQ_EVENT_USR_VAR3
#define SNDRV_SEQ_EVENT_USR_VAR4

/* 150-151: kernel events with quote - DO NOT use in user clients */
#define SNDRV_SEQ_EVENT_KERNEL_ERROR
#define SNDRV_SEQ_EVENT_KERNEL_QUOTE

/* 152-191: reserved */

/* 192-254: hardware specific events */

/* 255: special event */
#define SNDRV_SEQ_EVENT_NONE


snd_seq_event_type_t;

/** event address */
struct snd_seq_addr {};

/** port connection */
struct snd_seq_connect {};


#define SNDRV_SEQ_ADDRESS_UNKNOWN
#define SNDRV_SEQ_ADDRESS_SUBSCRIBERS
#define SNDRV_SEQ_ADDRESS_BROADCAST
#define SNDRV_SEQ_QUEUE_DIRECT

	/* event mode flag - NOTE: only 8 bits available! */
#define SNDRV_SEQ_TIME_STAMP_TICK
#define SNDRV_SEQ_TIME_STAMP_REAL
#define SNDRV_SEQ_TIME_STAMP_MASK

#define SNDRV_SEQ_TIME_MODE_ABS
#define SNDRV_SEQ_TIME_MODE_REL
#define SNDRV_SEQ_TIME_MODE_MASK

#define SNDRV_SEQ_EVENT_LENGTH_FIXED
#define SNDRV_SEQ_EVENT_LENGTH_VARIABLE
#define SNDRV_SEQ_EVENT_LENGTH_VARUSR
#define SNDRV_SEQ_EVENT_LENGTH_MASK

#define SNDRV_SEQ_PRIORITY_NORMAL
#define SNDRV_SEQ_PRIORITY_HIGH
#define SNDRV_SEQ_PRIORITY_MASK

#define SNDRV_SEQ_EVENT_UMP

	/* note event */
struct snd_seq_ev_note {};

	/* controller event */
struct snd_seq_ev_ctrl {};

	/* generic set of bytes (12x8 bit) */
struct snd_seq_ev_raw8 {};

	/* generic set of integers (3x32 bit) */
struct snd_seq_ev_raw32 {};

	/* external stored data */
struct snd_seq_ev_ext {} __packed;

struct snd_seq_result {};


struct snd_seq_real_time {};

snd_seq_tick_time_t;	/* midi ticks */

snd_seq_timestamp;

struct snd_seq_queue_skew {};

	/* queue timer control */
struct snd_seq_ev_queue_control {};

	/* quoted event - inside the kernel only */
struct snd_seq_ev_quote {} __packed;

snd_seq_event_data;

	/* sequencer event */
struct snd_seq_event {};

	/* (compatible) event for UMP-capable clients */
struct snd_seq_ump_event {};

/*
 * bounce event - stored as variable size data
 */
struct snd_seq_event_bounce {};


	/* system information */
struct snd_seq_system_info {};


	/* system running information */
struct snd_seq_running_info {};


	/* known client numbers */
#define SNDRV_SEQ_CLIENT_SYSTEM
	/* internal client numbers */
#define SNDRV_SEQ_CLIENT_DUMMY
#define SNDRV_SEQ_CLIENT_OSS


	/* client types */
snd_seq_client_type_t;
#define NO_CLIENT
#define USER_CLIENT
#define KERNEL_CLIENT
                        
	/* event filter flags */
#define SNDRV_SEQ_FILTER_BROADCAST
#define SNDRV_SEQ_FILTER_MULTICAST
#define SNDRV_SEQ_FILTER_BOUNCE
#define SNDRV_SEQ_FILTER_NO_CONVERT
#define SNDRV_SEQ_FILTER_USE_EVENT

struct snd_seq_client_info {};

/* MIDI version numbers in client info */
#define SNDRV_SEQ_CLIENT_LEGACY_MIDI
#define SNDRV_SEQ_CLIENT_UMP_MIDI_1_0
#define SNDRV_SEQ_CLIENT_UMP_MIDI_2_0

/* client pool size */
struct snd_seq_client_pool {};


/* Remove events by specified criteria */

#define SNDRV_SEQ_REMOVE_INPUT
#define SNDRV_SEQ_REMOVE_OUTPUT
#define SNDRV_SEQ_REMOVE_DEST
#define SNDRV_SEQ_REMOVE_DEST_CHANNEL
#define SNDRV_SEQ_REMOVE_TIME_BEFORE
#define SNDRV_SEQ_REMOVE_TIME_AFTER
#define SNDRV_SEQ_REMOVE_TIME_TICK
#define SNDRV_SEQ_REMOVE_EVENT_TYPE
#define SNDRV_SEQ_REMOVE_IGNORE_OFF
#define SNDRV_SEQ_REMOVE_TAG_MATCH

struct snd_seq_remove_events {};


	/* known port numbers */
#define SNDRV_SEQ_PORT_SYSTEM_TIMER
#define SNDRV_SEQ_PORT_SYSTEM_ANNOUNCE

	/* port capabilities (32 bits) */
#define SNDRV_SEQ_PORT_CAP_READ
#define SNDRV_SEQ_PORT_CAP_WRITE

#define SNDRV_SEQ_PORT_CAP_SYNC_READ
#define SNDRV_SEQ_PORT_CAP_SYNC_WRITE

#define SNDRV_SEQ_PORT_CAP_DUPLEX

#define SNDRV_SEQ_PORT_CAP_SUBS_READ
#define SNDRV_SEQ_PORT_CAP_SUBS_WRITE
#define SNDRV_SEQ_PORT_CAP_NO_EXPORT
#define SNDRV_SEQ_PORT_CAP_INACTIVE
#define SNDRV_SEQ_PORT_CAP_UMP_ENDPOINT

	/* port type */
#define SNDRV_SEQ_PORT_TYPE_SPECIFIC
#define SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC
#define SNDRV_SEQ_PORT_TYPE_MIDI_GM
#define SNDRV_SEQ_PORT_TYPE_MIDI_GS
#define SNDRV_SEQ_PORT_TYPE_MIDI_XG
#define SNDRV_SEQ_PORT_TYPE_MIDI_MT32
#define SNDRV_SEQ_PORT_TYPE_MIDI_GM2
#define SNDRV_SEQ_PORT_TYPE_MIDI_UMP

/* other standards...*/
#define SNDRV_SEQ_PORT_TYPE_SYNTH
#define SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE
#define SNDRV_SEQ_PORT_TYPE_SAMPLE
/*...*/
#define SNDRV_SEQ_PORT_TYPE_HARDWARE
#define SNDRV_SEQ_PORT_TYPE_SOFTWARE
#define SNDRV_SEQ_PORT_TYPE_SYNTHESIZER
#define SNDRV_SEQ_PORT_TYPE_PORT
#define SNDRV_SEQ_PORT_TYPE_APPLICATION

/* misc. conditioning flags */
#define SNDRV_SEQ_PORT_FLG_GIVEN_PORT
#define SNDRV_SEQ_PORT_FLG_TIMESTAMP
#define SNDRV_SEQ_PORT_FLG_TIME_REAL

/* port direction */
#define SNDRV_SEQ_PORT_DIR_UNKNOWN
#define SNDRV_SEQ_PORT_DIR_INPUT
#define SNDRV_SEQ_PORT_DIR_OUTPUT
#define SNDRV_SEQ_PORT_DIR_BIDIRECTION

struct snd_seq_port_info {};


/* queue flags */
#define SNDRV_SEQ_QUEUE_FLG_SYNC

/* queue information */
struct snd_seq_queue_info {};

/* queue info/status */
struct snd_seq_queue_status {};


/* queue tempo */
struct snd_seq_queue_tempo {};


/* sequencer timer sources */
#define SNDRV_SEQ_TIMER_ALSA
#define SNDRV_SEQ_TIMER_MIDI_CLOCK
#define SNDRV_SEQ_TIMER_MIDI_TICK

/* queue timer info */
struct snd_seq_queue_timer {};


struct snd_seq_queue_client {};


#define SNDRV_SEQ_PORT_SUBS_EXCLUSIVE
#define SNDRV_SEQ_PORT_SUBS_TIMESTAMP
#define SNDRV_SEQ_PORT_SUBS_TIME_REAL

struct snd_seq_port_subscribe {};

/* type of query subscription */
#define SNDRV_SEQ_QUERY_SUBS_READ
#define SNDRV_SEQ_QUERY_SUBS_WRITE

struct snd_seq_query_subs {};

/*
 * UMP-specific information
 */
/* type of UMP info query */
#define SNDRV_SEQ_CLIENT_UMP_INFO_ENDPOINT
#define SNDRV_SEQ_CLIENT_UMP_INFO_BLOCK

struct snd_seq_client_ump_info {} __packed;

/*
 *  IOCTL commands
 */

#define SNDRV_SEQ_IOCTL_PVERSION
#define SNDRV_SEQ_IOCTL_CLIENT_ID
#define SNDRV_SEQ_IOCTL_SYSTEM_INFO
#define SNDRV_SEQ_IOCTL_RUNNING_MODE
#define SNDRV_SEQ_IOCTL_USER_PVERSION

#define SNDRV_SEQ_IOCTL_GET_CLIENT_INFO
#define SNDRV_SEQ_IOCTL_SET_CLIENT_INFO
#define SNDRV_SEQ_IOCTL_GET_CLIENT_UMP_INFO
#define SNDRV_SEQ_IOCTL_SET_CLIENT_UMP_INFO

#define SNDRV_SEQ_IOCTL_CREATE_PORT
#define SNDRV_SEQ_IOCTL_DELETE_PORT
#define SNDRV_SEQ_IOCTL_GET_PORT_INFO
#define SNDRV_SEQ_IOCTL_SET_PORT_INFO

#define SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT
#define SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT

#define SNDRV_SEQ_IOCTL_CREATE_QUEUE
#define SNDRV_SEQ_IOCTL_DELETE_QUEUE
#define SNDRV_SEQ_IOCTL_GET_QUEUE_INFO
#define SNDRV_SEQ_IOCTL_SET_QUEUE_INFO
#define SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE
#define SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS
#define SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO
#define SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO
#define SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER
#define SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER
#define SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT
#define SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT
#define SNDRV_SEQ_IOCTL_GET_CLIENT_POOL
#define SNDRV_SEQ_IOCTL_SET_CLIENT_POOL
#define SNDRV_SEQ_IOCTL_REMOVE_EVENTS
#define SNDRV_SEQ_IOCTL_QUERY_SUBS
#define SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION
#define SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT
#define SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT

#endif /* _UAPI__SOUND_ASEQUENCER_H */