alsa-lib/src/seq/seq_local.h
Jaroslav Kysela 88e5e45151 Major change to sequencer API.
The sequencer API is totally recoded with the style of "encapsulation"
in other api.
The structure becomes opaque and accessed only via functions.

Other changes:
- There is no longer group in client and port info.
- snd_seq_query_subs_t is renamed to snd_seq_query_subscribe_t.
- snd_seq_delete_port takes only the port id argument instead of
  port_info structure.
- snd_seq_input/output_buffer_size are renamed
  as snd_seq_get_input/output_buffer_size.
  Similarly snd_seq_resize_input/output_buffer are renamed as
  snd_seq_set_input/output_buffer_size.
- snd_seq_get_named_queue is renamed to snd_seq_query_named_queue.
- Sync codes are removed temporarily from API.
- Subscription conditions are accessed via the corresponding functions.
  convert_time is named now as time_update.
- snd_seq_get/set_queue_owner are removed.
  Use snd_seq_get/set_queue_info instead.
- Instrument put/get/remove structure is unified as snd_instr_header_t.
2001-07-04 13:54:13 +00:00

96 lines
4.1 KiB
C

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