Blame src/seq/seq_local.h

Packit 4a16fb
/*
Packit 4a16fb
 *  Sequencer Interface - definition of sequencer event handler
Packit 4a16fb
 *  Copyright (c) 2000 by Jaroslav Kysela <perex@perex.cz>
Packit 4a16fb
 *                        Abramo Bagnara <abramo@alsa-project.org>
Packit 4a16fb
 *
Packit 4a16fb
 *
Packit 4a16fb
 *   This library is free software; you can redistribute it and/or modify
Packit 4a16fb
 *   it under the terms of the GNU Lesser General Public License as
Packit 4a16fb
 *   published by the Free Software Foundation; either version 2.1 of
Packit 4a16fb
 *   the License, or (at your option) any later version.
Packit 4a16fb
 *
Packit 4a16fb
 *   This program is distributed in the hope that it will be useful,
Packit 4a16fb
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 4a16fb
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 4a16fb
 *   GNU Lesser General Public License for more details.
Packit 4a16fb
 *
Packit 4a16fb
 *   You should have received a copy of the GNU Lesser General Public
Packit 4a16fb
 *   License along with this library; if not, write to the Free Software
Packit 4a16fb
 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
Packit 4a16fb
 *
Packit 4a16fb
 */
Packit 4a16fb
Packit 4a16fb
#ifndef __SEQ_LOCAL_H
Packit 4a16fb
#define __SEQ_LOCAL_H
Packit 4a16fb
Packit 4a16fb
#include <stdio.h>
Packit 4a16fb
#include <stdlib.h>
Packit 4a16fb
#include <limits.h>
Packit 4a16fb
#include "local.h"
Packit 4a16fb
Packit 4a16fb
#define SND_SEQ_OBUF_SIZE	(16*1024)	/* default size */
Packit 4a16fb
#define SND_SEQ_IBUF_SIZE	500		/* in event_size aligned */
Packit 4a16fb
#define DEFAULT_TMPBUF_SIZE	20
Packit 4a16fb
Packit 4a16fb
typedef struct snd_seq_queue_client snd_seq_queue_client_t;
Packit 4a16fb
Packit 4a16fb
Packit 4a16fb
typedef struct {
Packit 4a16fb
	int (*close)(snd_seq_t *seq);
Packit 4a16fb
	int (*nonblock)(snd_seq_t *seq, int nonblock);
Packit 4a16fb
	int (*system_info)(snd_seq_t *seq, snd_seq_system_info_t * info);
Packit 4a16fb
	int (*get_client_info)(snd_seq_t *seq, snd_seq_client_info_t * info);
Packit 4a16fb
	int (*set_client_info)(snd_seq_t *seq, snd_seq_client_info_t * info);
Packit 4a16fb
	int (*create_port)(snd_seq_t *seq, snd_seq_port_info_t * port);
Packit 4a16fb
	int (*delete_port)(snd_seq_t *seq, snd_seq_port_info_t * port);
Packit 4a16fb
	int (*get_port_info)(snd_seq_t *seq, snd_seq_port_info_t * info);
Packit 4a16fb
	int (*set_port_info)(snd_seq_t *seq, snd_seq_port_info_t * info);
Packit 4a16fb
	int (*get_port_subscription)(snd_seq_t *seq, snd_seq_port_subscribe_t * sub);
Packit 4a16fb
	int (*subscribe_port)(snd_seq_t *seq, snd_seq_port_subscribe_t * sub);
Packit 4a16fb
	int (*unsubscribe_port)(snd_seq_t *seq, snd_seq_port_subscribe_t * sub);
Packit 4a16fb
	int (*query_port_subscribers)(snd_seq_t *seq, snd_seq_query_subscribe_t * subs);
Packit 4a16fb
	int (*get_queue_status)(snd_seq_t *seq, snd_seq_queue_status_t * status);
Packit 4a16fb
	int (*get_queue_tempo)(snd_seq_t *seq, snd_seq_queue_tempo_t * tempo);
Packit 4a16fb
	int (*set_queue_tempo)(snd_seq_t *seq, snd_seq_queue_tempo_t * tempo);
Packit 4a16fb
	int (*get_queue_timer)(snd_seq_t *seq, snd_seq_queue_timer_t * timer);
Packit 4a16fb
	int (*set_queue_timer)(snd_seq_t *seq, snd_seq_queue_timer_t * timer);
Packit 4a16fb
	int (*get_queue_client)(snd_seq_t *seq, snd_seq_queue_client_t * client);
Packit 4a16fb
	int (*set_queue_client)(snd_seq_t *seq, snd_seq_queue_client_t * client);
Packit 4a16fb
	int (*create_queue)(snd_seq_t *seq, snd_seq_queue_info_t *info);
Packit 4a16fb
	int (*delete_queue)(snd_seq_t *seq, snd_seq_queue_info_t *info);
Packit 4a16fb
	int (*get_queue_info)(snd_seq_t *seq, snd_seq_queue_info_t *info);
Packit 4a16fb
	int (*set_queue_info)(snd_seq_t *seq, snd_seq_queue_info_t *info);
Packit 4a16fb
	int (*get_named_queue)(snd_seq_t *seq, snd_seq_queue_info_t *info);
Packit 4a16fb
	ssize_t (*write)(snd_seq_t *seq, void *buf, size_t len);
Packit 4a16fb
	ssize_t (*read)(snd_seq_t *seq, void *buf, size_t len);
Packit 4a16fb
	int (*remove_events)(snd_seq_t *seq, snd_seq_remove_events_t *rmp);
Packit 4a16fb
	int (*get_client_pool)(snd_seq_t *seq, snd_seq_client_pool_t *info);
Packit 4a16fb
	int (*set_client_pool)(snd_seq_t *seq, snd_seq_client_pool_t *info);
Packit 4a16fb
	int (*query_next_client)(snd_seq_t *seq, snd_seq_client_info_t *info);
Packit 4a16fb
	int (*query_next_port)(snd_seq_t *seq, snd_seq_port_info_t *info);
Packit 4a16fb
} snd_seq_ops_t;
Packit 4a16fb
Packit 4a16fb
struct _snd_seq {
Packit 4a16fb
	char *name;
Packit 4a16fb
	snd_seq_type_t type;
Packit 4a16fb
	int streams;
Packit 4a16fb
	int mode;
Packit 4a16fb
	int poll_fd;
Packit 4a16fb
	void *dl_handle;
Packit 4a16fb
	const snd_seq_ops_t *ops;
Packit 4a16fb
	void *private_data;
Packit 4a16fb
	int client;		/* client number */
Packit 4a16fb
	/* buffers */
Packit 4a16fb
	char *obuf;		/* output buffer */
Packit 4a16fb
	size_t obufsize;		/* output buffer size */
Packit 4a16fb
	size_t obufused;		/* output buffer used size */
Packit 4a16fb
	snd_seq_event_t *ibuf;	/* input buffer */
Packit 4a16fb
	size_t ibufptr;		/* current pointer of input buffer */
Packit 4a16fb
	size_t ibuflen;		/* queued length */
Packit 4a16fb
	size_t ibufsize;		/* input buffer size */
Packit 4a16fb
	snd_seq_event_t *tmpbuf;	/* temporary event for extracted event */
Packit 4a16fb
	size_t tmpbufsize;		/* size of errbuf */
Packit 4a16fb
};
Packit 4a16fb
Packit 4a16fb
int snd_seq_hw_open(snd_seq_t **handle, const char *name, int streams, int mode);
Packit 4a16fb
Packit 4a16fb
#endif