2 * ALSA sequencer Client Manager
3 * Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef __SND_SEQ_CLIENTMGR_H
22 #define __SND_SEQ_CLIENTMGR_H
24 #include <sound/seq_kernel.h>
25 #include <linux/bitops.h>
27 #include "seq_ports.h"
33 struct _snd_seq_user_client
{
34 struct file
*file
; /* file struct of client */
38 fifo_t
*fifo
; /* queue for incoming events */
42 struct _snd_seq_kernel_client
{
44 /* pointer to client functions */
45 void *private_data
; /* private data for client */
50 struct _snd_seq_client
{
51 snd_seq_client_type_t type
;
52 unsigned int accept_input
: 1,
54 char name
[64]; /* client name */
55 int number
; /* client number */
56 unsigned int filter
; /* filter flags */
57 DECLARE_BITMAP(event_filter
, 256);
58 snd_use_lock_t use_lock
;
61 int num_ports
; /* number of ports */
62 struct list_head ports_list_head
;
64 struct semaphore ports_mutex
;
65 int convert32
; /* convert 32->64bit */
68 pool_t
*pool
; /* memory pool for this client */
72 kernel_client_t kernel
;
76 /* usage statistics */
83 extern int client_init_data(void);
84 extern int snd_sequencer_device_init(void);
85 extern void snd_sequencer_device_done(void);
87 /* get locked pointer to client */
88 extern client_t
*snd_seq_client_use_ptr(int clientid
);
90 /* unlock pointer to client */
91 #define snd_seq_client_unlock(client) snd_use_lock_free(&(client)->use_lock)
93 /* dispatch event to client(s) */
94 extern int snd_seq_dispatch_event(snd_seq_event_cell_t
*cell
, int atomic
, int hop
);
96 /* exported to other modules */
97 extern int snd_seq_register_kernel_client(snd_seq_client_callback_t
*callback
, void *private_data
);
98 extern int snd_seq_unregister_kernel_client(int client
);
99 extern int snd_seq_kernel_client_enqueue(int client
, snd_seq_event_t
*ev
, int atomic
, int hop
);
100 int snd_seq_kernel_client_enqueue_blocking(int client
, snd_seq_event_t
* ev
, struct file
*file
, int atomic
, int hop
);
101 int snd_seq_kernel_client_write_poll(int clientid
, struct file
*file
, poll_table
*wait
);
102 int snd_seq_client_notify_subscription(int client
, int port
, snd_seq_port_subscribe_t
*info
, int evtype
);