1#ifndef __SOUND_SEQ_KERNEL_H
2#define __SOUND_SEQ_KERNEL_H
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24#include <linux/time.h>
25#include "asequencer.h"
26
27typedef struct snd_seq_real_time snd_seq_real_time_t;
28typedef union snd_seq_timestamp snd_seq_timestamp_t;
29
30
31#define SNDRV_SEQ_MAX_DEQUEUE 50
32
33
34#define SNDRV_SEQ_MAX_QUEUES 8
35
36
37#define SNDRV_SEQ_MAX_CLIENTS 192
38
39
40#define SNDRV_SEQ_MAX_PORTS 254
41
42
43#define SNDRV_SEQ_MAX_EVENTS 2000
44
45
46#define SNDRV_SEQ_DEFAULT_CHUNK_EVENTS 64
47
48
49#define SNDRV_SEQ_DEFAULT_EVENTS 500
50
51
52#define SNDRV_SEQ_MAX_CLIENT_EVENTS 2000
53
54
55#define SNDRV_SEQ_DEFAULT_CLIENT_EVENTS 200
56
57
58#define SNDRV_SEQ_MAX_HOPS 10
59
60
61#define SNDRV_SEQ_MAX_EVENT_LEN 0x3fffffff
62
63
64struct snd_seq_port_callback {
65 struct module *owner;
66 void *private_data;
67 int (*subscribe)(void *private_data, struct snd_seq_port_subscribe *info);
68 int (*unsubscribe)(void *private_data, struct snd_seq_port_subscribe *info);
69 int (*use)(void *private_data, struct snd_seq_port_subscribe *info);
70 int (*unuse)(void *private_data, struct snd_seq_port_subscribe *info);
71 int (*event_input)(struct snd_seq_event *ev, int direct, void *private_data, int atomic, int hop);
72 void (*private_free)(void *private_data);
73 unsigned int callback_all;
74
75};
76
77
78__printf(3, 4)
79int snd_seq_create_kernel_client(struct snd_card *card, int client_index,
80 const char *name_fmt, ...);
81int snd_seq_delete_kernel_client(int client);
82int snd_seq_kernel_client_enqueue(int client, struct snd_seq_event *ev, int atomic, int hop);
83int snd_seq_kernel_client_dispatch(int client, struct snd_seq_event *ev, int atomic, int hop);
84int snd_seq_kernel_client_ctl(int client, unsigned int cmd, void *arg);
85
86#define SNDRV_SEQ_EXT_MASK 0xc0000000
87#define SNDRV_SEQ_EXT_USRPTR 0x80000000
88#define SNDRV_SEQ_EXT_CHAINED 0x40000000
89
90typedef int (*snd_seq_dump_func_t)(void *ptr, void *buf, int count);
91int snd_seq_expand_var_event(const struct snd_seq_event *event, int count, char *buf,
92 int in_kernel, int size_aligned);
93int snd_seq_dump_var_event(const struct snd_seq_event *event,
94 snd_seq_dump_func_t func, void *private_data);
95
96
97int snd_seq_set_queue_tempo(int client, struct snd_seq_queue_tempo *tempo);
98
99
100void snd_port_init_callback(struct snd_seq_port_callback *p);
101struct snd_seq_port_callback *snd_port_alloc_callback(void);
102
103
104int snd_seq_event_port_attach(int client, struct snd_seq_port_callback *pcbp,
105 int cap, int type, int midi_channels, int midi_voices, char *portname);
106int snd_seq_event_port_detach(int client, int port);
107
108#ifdef CONFIG_MODULES
109void snd_seq_autoload_lock(void);
110void snd_seq_autoload_unlock(void);
111#else
112#define snd_seq_autoload_lock()
113#define snd_seq_autoload_unlock()
114#endif
115
116#endif
117