Commit | Line | Data |
---|---|---|
1da177e4 LT |
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> | |
25 | #include "asequencer.h" | |
26 | ||
c7e0b5bf TI |
27 | typedef struct snd_seq_real_time snd_seq_real_time_t; |
28 | typedef union snd_seq_timestamp snd_seq_timestamp_t; | |
1da177e4 LT |
29 | |
30 | /* maximum number of events dequeued per schedule interval */ | |
31 | #define SNDRV_SEQ_MAX_DEQUEUE 50 | |
32 | ||
33 | /* maximum number of queues */ | |
34 | #define SNDRV_SEQ_MAX_QUEUES 8 | |
35 | ||
36 | /* max number of concurrent clients */ | |
37 | #define SNDRV_SEQ_MAX_CLIENTS 192 | |
38 | ||
39 | /* max number of concurrent ports */ | |
40 | #define SNDRV_SEQ_MAX_PORTS 254 | |
41 | ||
42 | /* max number of events in memory pool */ | |
43 | #define SNDRV_SEQ_MAX_EVENTS 2000 | |
44 | ||
45 | /* default number of events in memory chunk */ | |
46 | #define SNDRV_SEQ_DEFAULT_CHUNK_EVENTS 64 | |
47 | ||
48 | /* default number of events in memory pool */ | |
49 | #define SNDRV_SEQ_DEFAULT_EVENTS 500 | |
50 | ||
51 | /* max number of events in memory pool for one client (outqueue) */ | |
52 | #define SNDRV_SEQ_MAX_CLIENT_EVENTS 2000 | |
53 | ||
54 | /* default number of events in memory pool for one client (outqueue) */ | |
55 | #define SNDRV_SEQ_DEFAULT_CLIENT_EVENTS 200 | |
56 | ||
57 | /* max delivery path length */ | |
58 | #define SNDRV_SEQ_MAX_HOPS 10 | |
59 | ||
60 | /* max size of event size */ | |
61 | #define SNDRV_SEQ_MAX_EVENT_LEN 0x3fffffff | |
62 | ||
1da177e4 LT |
63 | /* call-backs for kernel client */ |
64 | ||
c7e0b5bf | 65 | struct snd_seq_client_callback { |
1da177e4 LT |
66 | void *private_data; |
67 | unsigned allow_input: 1, | |
68 | allow_output: 1; | |
69 | /*...*/ | |
c7e0b5bf | 70 | }; |
1da177e4 LT |
71 | |
72 | /* call-backs for kernel port */ | |
c7e0b5bf | 73 | struct snd_seq_port_callback { |
1da177e4 LT |
74 | struct module *owner; |
75 | void *private_data; | |
c7e0b5bf TI |
76 | int (*subscribe)(void *private_data, struct snd_seq_port_subscribe *info); |
77 | int (*unsubscribe)(void *private_data, struct snd_seq_port_subscribe *info); | |
78 | int (*use)(void *private_data, struct snd_seq_port_subscribe *info); | |
79 | int (*unuse)(void *private_data, struct snd_seq_port_subscribe *info); | |
80 | int (*event_input)(struct snd_seq_event *ev, int direct, void *private_data, int atomic, int hop); | |
81 | void (*private_free)(void *private_data); | |
1da177e4 LT |
82 | unsigned int callback_all; /* call subscribe callbacks at each connection/disconnection */ |
83 | /*...*/ | |
c7e0b5bf | 84 | }; |
1da177e4 LT |
85 | |
86 | /* interface for kernel client */ | |
c7e0b5bf TI |
87 | int snd_seq_create_kernel_client(struct snd_card *card, int client_index, |
88 | struct snd_seq_client_callback *callback); | |
89 | int snd_seq_delete_kernel_client(int client); | |
90 | int snd_seq_kernel_client_enqueue(int client, struct snd_seq_event *ev, int atomic, int hop); | |
91 | int snd_seq_kernel_client_dispatch(int client, struct snd_seq_event *ev, int atomic, int hop); | |
92 | int snd_seq_kernel_client_ctl(int client, unsigned int cmd, void *arg); | |
1da177e4 LT |
93 | |
94 | #define SNDRV_SEQ_EXT_MASK 0xc0000000 | |
95 | #define SNDRV_SEQ_EXT_USRPTR 0x80000000 | |
96 | #define SNDRV_SEQ_EXT_CHAINED 0x40000000 | |
97 | ||
98 | typedef int (*snd_seq_dump_func_t)(void *ptr, void *buf, int count); | |
c7e0b5bf TI |
99 | int snd_seq_expand_var_event(const struct snd_seq_event *event, int count, char *buf, |
100 | int in_kernel, int size_aligned); | |
101 | int snd_seq_dump_var_event(const struct snd_seq_event *event, | |
102 | snd_seq_dump_func_t func, void *private_data); | |
1da177e4 LT |
103 | |
104 | /* interface for OSS emulation */ | |
c7e0b5bf | 105 | int snd_seq_set_queue_tempo(int client, struct snd_seq_queue_tempo *tempo); |
1da177e4 LT |
106 | |
107 | /* port callback routines */ | |
c7e0b5bf TI |
108 | void snd_port_init_callback(struct snd_seq_port_callback *p); |
109 | struct snd_seq_port_callback *snd_port_alloc_callback(void); | |
1da177e4 LT |
110 | |
111 | /* port attach/detach */ | |
c7e0b5bf | 112 | int snd_seq_event_port_attach(int client, struct snd_seq_port_callback *pcbp, |
1da177e4 LT |
113 | int cap, int type, int midi_channels, int midi_voices, char *portname); |
114 | int snd_seq_event_port_detach(int client, int port); | |
115 | ||
116 | #ifdef CONFIG_KMOD | |
117 | void snd_seq_autoload_lock(void); | |
118 | void snd_seq_autoload_unlock(void); | |
119 | #else | |
120 | #define snd_seq_autoload_lock() | |
121 | #define snd_seq_autoload_unlock() | |
122 | #endif | |
123 | ||
124 | #endif /* __SOUND_SEQ_KERNEL_H */ |