Linux Audio

Check our new training course

Loading...
v4.10.11
 
  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 <sound/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/* maximum number of queues */
 31#define SNDRV_SEQ_MAX_QUEUES		32
 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
 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
 57/* call-backs for kernel port */
 58struct snd_seq_port_callback {
 59	struct module *owner;
 60	void *private_data;
 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);
 67	/*...*/
 68};
 69
 70/* interface for kernel client */
 71__printf(3, 4)
 72int snd_seq_create_kernel_client(struct snd_card *card, int client_index,
 73				 const char *name_fmt, ...);
 74int snd_seq_delete_kernel_client(int client);
 75int snd_seq_kernel_client_enqueue(int client, struct snd_seq_event *ev, int atomic, int hop);
 
 76int snd_seq_kernel_client_dispatch(int client, struct snd_seq_event *ev, int atomic, int hop);
 77int snd_seq_kernel_client_ctl(int client, unsigned int cmd, void *arg);
 78
 79#define SNDRV_SEQ_EXT_MASK	0xc0000000
 80#define SNDRV_SEQ_EXT_USRPTR	0x80000000
 81#define SNDRV_SEQ_EXT_CHAINED	0x40000000
 82
 83typedef int (*snd_seq_dump_func_t)(void *ptr, void *buf, int count);
 84int snd_seq_expand_var_event(const struct snd_seq_event *event, int count, char *buf,
 85			     int in_kernel, int size_aligned);
 
 
 86int snd_seq_dump_var_event(const struct snd_seq_event *event,
 87			   snd_seq_dump_func_t func, void *private_data);
 
 
 
 
 
 
 
 
 88
 89/* interface for OSS emulation */
 90int snd_seq_set_queue_tempo(int client, struct snd_seq_queue_tempo *tempo);
 91
 92/* port callback routines */
 93void snd_port_init_callback(struct snd_seq_port_callback *p);
 94struct snd_seq_port_callback *snd_port_alloc_callback(void);
 95
 96/* port attach/detach */
 97int snd_seq_event_port_attach(int client, struct snd_seq_port_callback *pcbp,
 98			      int cap, int type, int midi_channels, int midi_voices, char *portname);
 99int snd_seq_event_port_detach(int client, int port);
100
101#ifdef CONFIG_MODULES
102void snd_seq_autoload_init(void);
103void snd_seq_autoload_exit(void);
104#else
105#define snd_seq_autoload_init()
106#define snd_seq_autoload_exit()
107#endif
108
109#endif /* __SOUND_SEQ_KERNEL_H */
v6.9.4
  1/* SPDX-License-Identifier: GPL-2.0-or-later */
  2#ifndef __SOUND_SEQ_KERNEL_H
  3#define __SOUND_SEQ_KERNEL_H
  4
  5/*
  6 *  Main kernel header file for the ALSA sequencer
  7 *  Copyright (c) 1998 by Frank van de Pol <fvdpol@coil.demon.nl>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  8 */
  9#include <linux/time.h>
 10#include <sound/asequencer.h>
 11
 12typedef struct snd_seq_real_time snd_seq_real_time_t;
 13typedef union snd_seq_timestamp snd_seq_timestamp_t;
 14
 15/* maximum number of queues */
 16#define SNDRV_SEQ_MAX_QUEUES		32
 17
 18/* max number of concurrent clients */
 19#define SNDRV_SEQ_MAX_CLIENTS 		192
 20
 21/* max number of concurrent ports */
 22#define SNDRV_SEQ_MAX_PORTS 		254
 23
 24/* max number of events in memory pool */
 25#define SNDRV_SEQ_MAX_EVENTS		2000
 26
 27/* default number of events in memory pool */
 28#define SNDRV_SEQ_DEFAULT_EVENTS	500
 29
 30/* max number of events in memory pool for one client (outqueue) */
 31#define SNDRV_SEQ_MAX_CLIENT_EVENTS	2000
 32
 33/* default number of events in memory pool for one client (outqueue) */
 34#define SNDRV_SEQ_DEFAULT_CLIENT_EVENTS	200
 35
 36/* max delivery path length */
 37/* NOTE: this shouldn't be greater than MAX_LOCKDEP_SUBCLASSES */
 38#define SNDRV_SEQ_MAX_HOPS		8
 39
 40/* max size of event size */
 41#define SNDRV_SEQ_MAX_EVENT_LEN		0x3fffffff
 42
 43/* call-backs for kernel port */
 44struct snd_seq_port_callback {
 45	struct module *owner;
 46	void *private_data;
 47	int (*subscribe)(void *private_data, struct snd_seq_port_subscribe *info);
 48	int (*unsubscribe)(void *private_data, struct snd_seq_port_subscribe *info);
 49	int (*use)(void *private_data, struct snd_seq_port_subscribe *info);
 50	int (*unuse)(void *private_data, struct snd_seq_port_subscribe *info);
 51	int (*event_input)(struct snd_seq_event *ev, int direct, void *private_data, int atomic, int hop);
 52	void (*private_free)(void *private_data);
 53	/*...*/
 54};
 55
 56/* interface for kernel client */
 57__printf(3, 4)
 58int snd_seq_create_kernel_client(struct snd_card *card, int client_index,
 59				 const char *name_fmt, ...);
 60int snd_seq_delete_kernel_client(int client);
 61int snd_seq_kernel_client_enqueue(int client, struct snd_seq_event *ev,
 62				  struct file *file, bool blocking);
 63int snd_seq_kernel_client_dispatch(int client, struct snd_seq_event *ev, int atomic, int hop);
 64int snd_seq_kernel_client_ctl(int client, unsigned int cmd, void *arg);
 65
 66#define SNDRV_SEQ_EXT_MASK	0xc0000000
 67#define SNDRV_SEQ_EXT_USRPTR	0x80000000
 68#define SNDRV_SEQ_EXT_CHAINED	0x40000000
 69
 70typedef int (*snd_seq_dump_func_t)(void *ptr, void *buf, int count);
 71int snd_seq_expand_var_event(const struct snd_seq_event *event, int count, char *buf,
 72			     int in_kernel, int size_aligned);
 73int snd_seq_expand_var_event_at(const struct snd_seq_event *event, int count,
 74				char *buf, int offset);
 75int snd_seq_dump_var_event(const struct snd_seq_event *event,
 76			   snd_seq_dump_func_t func, void *private_data);
 77
 78/* size of the event packet; it can be greater than snd_seq_event size */
 79static inline size_t snd_seq_event_packet_size(struct snd_seq_event *ev)
 80{
 81	if (snd_seq_ev_is_ump(ev))
 82		return sizeof(struct snd_seq_ump_event);
 83	return sizeof(struct snd_seq_event);
 84}
 85
 86/* interface for OSS emulation */
 87int snd_seq_set_queue_tempo(int client, struct snd_seq_queue_tempo *tempo);
 88
 89/* port callback routines */
 90void snd_port_init_callback(struct snd_seq_port_callback *p);
 91struct snd_seq_port_callback *snd_port_alloc_callback(void);
 92
 93/* port attach/detach */
 94int snd_seq_event_port_attach(int client, struct snd_seq_port_callback *pcbp,
 95			      int cap, int type, int midi_channels, int midi_voices, char *portname);
 96int snd_seq_event_port_detach(int client, int port);
 97
 98#ifdef CONFIG_MODULES
 99void snd_seq_autoload_init(void);
100void snd_seq_autoload_exit(void);
101#else
102#define snd_seq_autoload_init()
103#define snd_seq_autoload_exit()
104#endif
105
106#endif /* __SOUND_SEQ_KERNEL_H */