Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef __SOUND_SEQ_KERNEL_H |
| 2 | #define __SOUND_SEQ_KERNEL_H |
| 3 | |
| 4 | /* |
| 5 | * Main kernel header file for the ALSA sequencer |
| 6 | * Copyright (c) 1998 by Frank van de Pol <fvdpol@coil.demon.nl> |
| 7 | * |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU General Public License as published by |
| 11 | * the Free Software Foundation; either version 2 of the License, or |
| 12 | * (at your option) any later version. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | * GNU General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License |
| 20 | * along with this program; if not, write to the Free Software |
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 22 | * |
| 23 | */ |
| 24 | #include <linux/time.h> |
David Howells | a1ce392 | 2012-10-02 18:01:25 +0100 | [diff] [blame] | 25 | #include <sound/asequencer.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | |
Takashi Iwai | c7e0b5b | 2005-11-17 14:04:02 +0100 | [diff] [blame] | 27 | typedef struct snd_seq_real_time snd_seq_real_time_t; |
| 28 | typedef union snd_seq_timestamp snd_seq_timestamp_t; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | /* maximum number of queues */ |
Clemens Ladisch | 1001fb8 | 2015-01-25 14:36:46 +0100 | [diff] [blame] | 31 | #define SNDRV_SEQ_MAX_QUEUES 32 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | |
| 33 | /* max number of concurrent clients */ |
| 34 | #define SNDRV_SEQ_MAX_CLIENTS 192 |
| 35 | |
| 36 | /* max number of concurrent ports */ |
| 37 | #define SNDRV_SEQ_MAX_PORTS 254 |
| 38 | |
| 39 | /* max number of events in memory pool */ |
| 40 | #define SNDRV_SEQ_MAX_EVENTS 2000 |
| 41 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 42 | /* default number of events in memory pool */ |
| 43 | #define SNDRV_SEQ_DEFAULT_EVENTS 500 |
| 44 | |
| 45 | /* max number of events in memory pool for one client (outqueue) */ |
| 46 | #define SNDRV_SEQ_MAX_CLIENT_EVENTS 2000 |
| 47 | |
| 48 | /* default number of events in memory pool for one client (outqueue) */ |
| 49 | #define SNDRV_SEQ_DEFAULT_CLIENT_EVENTS 200 |
| 50 | |
| 51 | /* max delivery path length */ |
| 52 | #define SNDRV_SEQ_MAX_HOPS 10 |
| 53 | |
| 54 | /* max size of event size */ |
| 55 | #define SNDRV_SEQ_MAX_EVENT_LEN 0x3fffffff |
| 56 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 57 | /* call-backs for kernel port */ |
Takashi Iwai | c7e0b5b | 2005-11-17 14:04:02 +0100 | [diff] [blame] | 58 | struct snd_seq_port_callback { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | struct module *owner; |
| 60 | void *private_data; |
Takashi Iwai | c7e0b5b | 2005-11-17 14:04:02 +0100 | [diff] [blame] | 61 | int (*subscribe)(void *private_data, struct snd_seq_port_subscribe *info); |
| 62 | int (*unsubscribe)(void *private_data, struct snd_seq_port_subscribe *info); |
| 63 | int (*use)(void *private_data, struct snd_seq_port_subscribe *info); |
| 64 | int (*unuse)(void *private_data, struct snd_seq_port_subscribe *info); |
| 65 | int (*event_input)(struct snd_seq_event *ev, int direct, void *private_data, int atomic, int hop); |
| 66 | void (*private_free)(void *private_data); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 67 | /*...*/ |
Takashi Iwai | c7e0b5b | 2005-11-17 14:04:02 +0100 | [diff] [blame] | 68 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 69 | |
| 70 | /* interface for kernel client */ |
Joe Perches | b9075fa | 2011-10-31 17:11:33 -0700 | [diff] [blame] | 71 | __printf(3, 4) |
Clemens Ladisch | 7b6d924 | 2005-12-12 09:33:37 +0100 | [diff] [blame] | 72 | int snd_seq_create_kernel_client(struct snd_card *card, int client_index, |
Joe Perches | b9075fa | 2011-10-31 17:11:33 -0700 | [diff] [blame] | 73 | const char *name_fmt, ...); |
Takashi Iwai | c7e0b5b | 2005-11-17 14:04:02 +0100 | [diff] [blame] | 74 | int snd_seq_delete_kernel_client(int client); |
| 75 | int snd_seq_kernel_client_enqueue(int client, struct snd_seq_event *ev, int atomic, int hop); |
| 76 | int snd_seq_kernel_client_dispatch(int client, struct snd_seq_event *ev, int atomic, int hop); |
| 77 | int snd_seq_kernel_client_ctl(int client, unsigned int cmd, void *arg); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 78 | |
| 79 | #define SNDRV_SEQ_EXT_MASK 0xc0000000 |
| 80 | #define SNDRV_SEQ_EXT_USRPTR 0x80000000 |
| 81 | #define SNDRV_SEQ_EXT_CHAINED 0x40000000 |
| 82 | |
| 83 | typedef int (*snd_seq_dump_func_t)(void *ptr, void *buf, int count); |
Takashi Iwai | c7e0b5b | 2005-11-17 14:04:02 +0100 | [diff] [blame] | 84 | int snd_seq_expand_var_event(const struct snd_seq_event *event, int count, char *buf, |
| 85 | int in_kernel, int size_aligned); |
| 86 | int snd_seq_dump_var_event(const struct snd_seq_event *event, |
| 87 | snd_seq_dump_func_t func, void *private_data); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 88 | |
| 89 | /* interface for OSS emulation */ |
Takashi Iwai | c7e0b5b | 2005-11-17 14:04:02 +0100 | [diff] [blame] | 90 | int snd_seq_set_queue_tempo(int client, struct snd_seq_queue_tempo *tempo); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 91 | |
| 92 | /* port callback routines */ |
Takashi Iwai | c7e0b5b | 2005-11-17 14:04:02 +0100 | [diff] [blame] | 93 | void snd_port_init_callback(struct snd_seq_port_callback *p); |
| 94 | struct snd_seq_port_callback *snd_port_alloc_callback(void); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 95 | |
| 96 | /* port attach/detach */ |
Takashi Iwai | c7e0b5b | 2005-11-17 14:04:02 +0100 | [diff] [blame] | 97 | int snd_seq_event_port_attach(int client, struct snd_seq_port_callback *pcbp, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 98 | int cap, int type, int midi_channels, int midi_voices, char *portname); |
| 99 | int snd_seq_event_port_detach(int client, int port); |
| 100 | |
Johannes Berg | ee2da99 | 2008-07-09 10:28:41 +0200 | [diff] [blame] | 101 | #ifdef CONFIG_MODULES |
Takashi Iwai | 68ab610 | 2014-10-15 14:06:25 +0200 | [diff] [blame] | 102 | void snd_seq_autoload_init(void); |
Takashi Iwai | 54a721a | 2015-02-12 14:20:24 +0100 | [diff] [blame] | 103 | void snd_seq_autoload_exit(void); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 104 | #else |
Takashi Iwai | 68ab610 | 2014-10-15 14:06:25 +0200 | [diff] [blame] | 105 | #define snd_seq_autoload_init() |
| 106 | #define snd_seq_autoload_exit() |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 107 | #endif |
| 108 | |
| 109 | #endif /* __SOUND_SEQ_KERNEL_H */ |