Blame view

include/sound/asequencer.h 2.91 KB
1a59d1b8e   Thomas Gleixner   treewide: Replace...
1
  /* SPDX-License-Identifier: GPL-2.0-or-later */
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
2
3
4
  /*
   *  Main header file for the ALSA sequencer
   *  Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl>
c1017a4cd   Jaroslav Kysela   [ALSA] Changed Ja...
5
   *            (c) 1998-1999 by Jaroslav Kysela <perex@perex.cz>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
6
7
8
   */
  #ifndef __SOUND_ASEQUENCER_H
  #define __SOUND_ASEQUENCER_H
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
9
  #include <linux/ioctl.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
10
  #include <sound/asound.h>
674e95ca4   David Howells   UAPI: (Scripted) ...
11
  #include <uapi/sound/asequencer.h>
c7e0b5bf9   Takashi Iwai   [ALSA] Remove xxx...
12
13
14
  
  /* helper macro */
  #define snd_seq_event_bounce_ext_data(ev) ((void*)((char *)(ev)->data.ext.ptr + sizeof(struct snd_seq_event_bounce)))
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
15
16
17
18
19
  
  /*
   * type check macros
   */
  /* result events: 0-4 */
c7e0b5bf9   Takashi Iwai   [ALSA] Remove xxx...
20
  #define snd_seq_ev_is_result_type(ev)	((ev)->type < 5)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
21
  /* channel specific events: 5-19 */
c7e0b5bf9   Takashi Iwai   [ALSA] Remove xxx...
22
  #define snd_seq_ev_is_channel_type(ev)	((ev)->type >= 5 && (ev)->type < 20)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
23
  /* note events: 5-9 */
c7e0b5bf9   Takashi Iwai   [ALSA] Remove xxx...
24
  #define snd_seq_ev_is_note_type(ev)	((ev)->type >= 5 && (ev)->type < 10)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
25
  /* control events: 10-19 */
c7e0b5bf9   Takashi Iwai   [ALSA] Remove xxx...
26
  #define snd_seq_ev_is_control_type(ev)	((ev)->type >= 10 && (ev)->type < 20)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
27
  /* queue control events: 30-39 */
c7e0b5bf9   Takashi Iwai   [ALSA] Remove xxx...
28
  #define snd_seq_ev_is_queue_type(ev)	((ev)->type >= 30 && (ev)->type < 40)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
29
  /* system status messages */
c7e0b5bf9   Takashi Iwai   [ALSA] Remove xxx...
30
  #define snd_seq_ev_is_message_type(ev)	((ev)->type >= 60 && (ev)->type < 69)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
31
  /* sample messages */
c7e0b5bf9   Takashi Iwai   [ALSA] Remove xxx...
32
  #define snd_seq_ev_is_sample_type(ev)	((ev)->type >= 70 && (ev)->type < 79)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
33
  /* user-defined messages */
c7e0b5bf9   Takashi Iwai   [ALSA] Remove xxx...
34
  #define snd_seq_ev_is_user_type(ev)	((ev)->type >= 90 && (ev)->type < 99)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
35
  /* fixed length events: 0-99 */
c7e0b5bf9   Takashi Iwai   [ALSA] Remove xxx...
36
  #define snd_seq_ev_is_fixed_type(ev)	((ev)->type < 100)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
37
  /* variable length events: 130-139 */
c7e0b5bf9   Takashi Iwai   [ALSA] Remove xxx...
38
  #define snd_seq_ev_is_variable_type(ev)	((ev)->type >= 130 && (ev)->type < 140)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
39
  /* reserved for kernel */
c7e0b5bf9   Takashi Iwai   [ALSA] Remove xxx...
40
  #define snd_seq_ev_is_reserved(ev)	((ev)->type >= 150)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
41
42
  
  /* direct dispatched events */
c7e0b5bf9   Takashi Iwai   [ALSA] Remove xxx...
43
  #define snd_seq_ev_is_direct(ev)	((ev)->queue == SNDRV_SEQ_QUEUE_DIRECT)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
44
45
46
47
48
  
  /*
   * macros to check event flags
   */
  /* prior events */
c7e0b5bf9   Takashi Iwai   [ALSA] Remove xxx...
49
  #define snd_seq_ev_is_prior(ev)		(((ev)->flags & SNDRV_SEQ_PRIORITY_MASK) == SNDRV_SEQ_PRIORITY_HIGH)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
50
51
  
  /* event length type */
c7e0b5bf9   Takashi Iwai   [ALSA] Remove xxx...
52
53
54
55
  #define snd_seq_ev_length_type(ev)	((ev)->flags & SNDRV_SEQ_EVENT_LENGTH_MASK)
  #define snd_seq_ev_is_fixed(ev)		(snd_seq_ev_length_type(ev) == SNDRV_SEQ_EVENT_LENGTH_FIXED)
  #define snd_seq_ev_is_variable(ev)	(snd_seq_ev_length_type(ev) == SNDRV_SEQ_EVENT_LENGTH_VARIABLE)
  #define snd_seq_ev_is_varusr(ev)	(snd_seq_ev_length_type(ev) == SNDRV_SEQ_EVENT_LENGTH_VARUSR)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
56
57
  
  /* time-stamp type */
c7e0b5bf9   Takashi Iwai   [ALSA] Remove xxx...
58
59
60
  #define snd_seq_ev_timestamp_type(ev)	((ev)->flags & SNDRV_SEQ_TIME_STAMP_MASK)
  #define snd_seq_ev_is_tick(ev)		(snd_seq_ev_timestamp_type(ev) == SNDRV_SEQ_TIME_STAMP_TICK)
  #define snd_seq_ev_is_real(ev)		(snd_seq_ev_timestamp_type(ev) == SNDRV_SEQ_TIME_STAMP_REAL)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
61
62
  
  /* time-mode type */
c7e0b5bf9   Takashi Iwai   [ALSA] Remove xxx...
63
64
65
  #define snd_seq_ev_timemode_type(ev)	((ev)->flags & SNDRV_SEQ_TIME_MODE_MASK)
  #define snd_seq_ev_is_abstime(ev)	(snd_seq_ev_timemode_type(ev) == SNDRV_SEQ_TIME_MODE_ABS)
  #define snd_seq_ev_is_reltime(ev)	(snd_seq_ev_timemode_type(ev) == SNDRV_SEQ_TIME_MODE_REL)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
66
67
  
  /* queue sync port */
c7e0b5bf9   Takashi Iwai   [ALSA] Remove xxx...
68
  #define snd_seq_queue_sync_port(q)	((q) + 16)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
69
  #endif /* __SOUND_ASEQUENCER_H */