2000-11-20 20:10:46 +00:00
|
|
|
/*
|
|
|
|
|
* Rawmidi interface - local header file
|
|
|
|
|
* Copyright (c) 2000 by Abramo Bagnara <abramo@alsa-project.org>
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* This library is free software; you can redistribute it and/or modify
|
2001-12-30 09:22:54 +00:00
|
|
|
* it under the terms of the GNU Lesser General Public License as
|
|
|
|
|
* published by the Free Software Foundation; either version 2.1 of
|
2000-11-20 20:10:46 +00:00
|
|
|
* 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
|
2001-12-30 09:22:54 +00:00
|
|
|
* GNU Lesser General Public License for more details.
|
2000-11-20 20:10:46 +00:00
|
|
|
*
|
2001-12-30 09:22:54 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2000-11-20 20:10:46 +00:00
|
|
|
* License along with this library; if not, write to the Free Software
|
2001-12-30 09:22:54 +00:00
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
2000-11-20 20:10:46 +00:00
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <limits.h>
|
2001-01-01 15:15:41 +00:00
|
|
|
#include "local.h"
|
2000-11-20 20:10:46 +00:00
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
int (*close)(snd_rawmidi_t *rawmidi);
|
|
|
|
|
int (*nonblock)(snd_rawmidi_t *rawmidi, int nonblock);
|
|
|
|
|
int (*info)(snd_rawmidi_t *rawmidi, snd_rawmidi_info_t *info);
|
|
|
|
|
int (*params)(snd_rawmidi_t *rawmidi, snd_rawmidi_params_t *params);
|
|
|
|
|
int (*status)(snd_rawmidi_t *rawmidi, snd_rawmidi_status_t *status);
|
2001-02-07 13:30:40 +00:00
|
|
|
int (*drop)(snd_rawmidi_t *rawmidi);
|
|
|
|
|
int (*drain)(snd_rawmidi_t *rawmidi);
|
2000-11-20 20:10:46 +00:00
|
|
|
ssize_t (*write)(snd_rawmidi_t *rawmidi, const void *buffer, size_t size);
|
|
|
|
|
ssize_t (*read)(snd_rawmidi_t *rawmidi, void *buffer, size_t size);
|
|
|
|
|
} snd_rawmidi_ops_t;
|
|
|
|
|
|
|
|
|
|
struct _snd_rawmidi {
|
2002-11-07 15:18:45 +00:00
|
|
|
void *dl_handle;
|
2000-11-20 20:10:46 +00:00
|
|
|
char *name;
|
|
|
|
|
snd_rawmidi_type_t type;
|
2001-02-07 13:30:40 +00:00
|
|
|
snd_rawmidi_stream_t stream;
|
2000-11-20 20:10:46 +00:00
|
|
|
int mode;
|
|
|
|
|
int poll_fd;
|
2008-11-21 20:26:12 +01:00
|
|
|
const snd_rawmidi_ops_t *ops;
|
2001-02-11 15:45:35 +00:00
|
|
|
void *private_data;
|
2001-02-07 13:30:40 +00:00
|
|
|
size_t buffer_size;
|
|
|
|
|
size_t avail_min;
|
|
|
|
|
unsigned int no_active_sensing: 1;
|
2000-11-20 20:10:46 +00:00
|
|
|
};
|
|
|
|
|
|
2001-02-07 13:30:40 +00:00
|
|
|
int snd_rawmidi_hw_open(snd_rawmidi_t **input, snd_rawmidi_t **output,
|
2001-02-11 15:45:35 +00:00
|
|
|
const char *name, int card, int device, int subdevice,
|
2001-02-07 13:30:40 +00:00
|
|
|
int mode);
|
2003-07-29 17:15:34 +00:00
|
|
|
|
2003-08-05 13:54:38 +00:00
|
|
|
int snd_rawmidi_virtual_open(snd_rawmidi_t **inputp, snd_rawmidi_t **outputp,
|
|
|
|
|
const char *name, snd_seq_t *seq_handle, int port,
|
|
|
|
|
int merge, int mode);
|
2006-10-27 10:54:08 +02:00
|
|
|
|
|
|
|
|
int snd_rawmidi_conf_generic_id(const char *id);
|