00001
00028
#ifndef __ALSA_INSTR_H
00029
#define __ALSA_INSTR_H
00030
00031
#ifdef __cplusplus
00032
extern "C" {
00033
#endif
00034
00041
00042
00044 typedef struct _snd_instr_header
snd_instr_header_t;
00045
00046 size_t
snd_instr_header_sizeof(
void);
00047 #define snd_instr_header_alloca(ptr) \
00048
do {\
00049
assert(ptr);\
00050
*ptr = (snd_instr_header_t *)alloca(snd_instr_header_sizeof());\
00051
memset(*ptr, 0, snd_instr_header_sizeof());\
00052
} while (0)
00053
int snd_instr_header_malloc(snd_instr_header_t **ptr, size_t len);
00054
void snd_instr_header_free(snd_instr_header_t *ptr);
00055
void snd_instr_header_copy(snd_instr_header_t *dst,
const snd_instr_header_t *src);
00056
00057
const snd_seq_instr_t *
snd_instr_header_get_id(
const snd_instr_header_t *info);
00058
snd_seq_instr_cluster_t snd_instr_header_get_cluster(
const snd_instr_header_t *info);
00059
unsigned int snd_instr_header_get_cmd(
const snd_instr_header_t *info);
00060 size_t
snd_instr_header_get_len(
const snd_instr_header_t *info);
00061
const char *
snd_instr_header_get_name(
const snd_instr_header_t *info);
00062
int snd_instr_header_get_type(
const snd_instr_header_t *info);
00063
const char *
snd_instr_header_get_format(
const snd_instr_header_t *info);
00064
const snd_seq_instr_t *
snd_instr_header_get_alias(
const snd_instr_header_t *info);
00065
void *
snd_instr_header_get_data(
const snd_instr_header_t *info);
00066
int snd_instr_header_get_follow_alias(
const snd_instr_header_t *info);
00067
00068
void snd_instr_header_set_id(snd_instr_header_t *info,
const snd_seq_instr_t *
id);
00069
void snd_instr_header_set_cluster(snd_instr_header_t *info, snd_seq_instr_cluster_t cluster);
00070
void snd_instr_header_set_cmd(snd_instr_header_t *info,
unsigned int cmd);
00071
void snd_instr_header_set_len(snd_instr_header_t *info, size_t len);
00072
void snd_instr_header_set_name(snd_instr_header_t *info,
const char *name);
00073
void snd_instr_header_set_type(snd_instr_header_t *info,
int type);
00074
void snd_instr_header_set_format(snd_instr_header_t *info,
const char *format);
00075
void snd_instr_header_set_alias(snd_instr_header_t *info,
const snd_seq_instr_t *instr);
00076
void snd_instr_header_set_follow_alias(snd_instr_header_t *info,
int val);
00077
00084
#define SND_SEQ_INSTR_ATYPE_DATA 0
00085
#define SND_SEQ_INSTR_ATYPE_ALIAS 1
00088
#define SND_SEQ_INSTR_ID_DLS1 "DLS1"
00089 #define SND_SEQ_INSTR_ID_DLS2 "DLS2"
00090 #define SND_SEQ_INSTR_ID_SIMPLE "Simple Wave"
00091
#define SND_SEQ_INSTR_ID_SOUNDFONT "SoundFont"
00092
#define SND_SEQ_INSTR_ID_GUS_PATCH "GUS Patch"
00093 #define SND_SEQ_INSTR_ID_INTERWAVE "Interwave FFFF"
00094 #define SND_SEQ_INSTR_ID_OPL2_3 "OPL2/3 FM"
00095 #define SND_SEQ_INSTR_ID_OPL4 "OPL4"
00098 #define SND_SEQ_INSTR_TYPE0_DLS1 (1<<0)
00099 #define SND_SEQ_INSTR_TYPE0_DLS2 (1<<1)
00100 #define SND_SEQ_INSTR_TYPE1_SIMPLE (1<<0)
00101
#define SND_SEQ_INSTR_TYPE1_SOUNDFONT (1<<1)
00102
#define SND_SEQ_INSTR_TYPE1_GUS_PATCH (1<<2)
00103 #define SND_SEQ_INSTR_TYPE1_INTERWAVE (1<<3)
00104 #define SND_SEQ_INSTR_TYPE2_OPL2_3 (1<<0)
00105 #define SND_SEQ_INSTR_TYPE2_OPL4 (1<<1)
00108 #define SND_SEQ_INSTR_PUT_CMD_CREATE 0
00109 #define SND_SEQ_INSTR_PUT_CMD_REPLACE 1
00110 #define SND_SEQ_INSTR_PUT_CMD_MODIFY 2
00111
#define SND_SEQ_INSTR_PUT_CMD_ADD 3
00112
#define SND_SEQ_INSTR_PUT_CMD_REMOVE 4
00115 #define SND_SEQ_INSTR_GET_CMD_FULL 0
00116 #define SND_SEQ_INSTR_GET_CMD_PARTIAL 1
00118
00119
#define SND_SEQ_INSTR_QUERY_FOLLOW_ALIAS (1<<0)
00122
#define SND_SEQ_INSTR_FREE_CMD_ALL 0
00123
#define SND_SEQ_INSTR_FREE_CMD_PRIVATE 1
00124 #define SND_SEQ_INSTR_FREE_CMD_CLUSTER 2
00125
#define SND_SEQ_INSTR_FREE_CMD_SINGLE 3
00133
typedef void snd_instr_fm_t;
00134
00135
int snd_instr_fm_convert_to_stream(
snd_instr_fm_t *fm,
const char *name, snd_instr_header_t **put, size_t *size);
00136
int snd_instr_fm_convert_from_stream(snd_instr_header_t *data, size_t size, snd_instr_fm_t **fm);
00137
int snd_instr_fm_free(snd_instr_fm_t *fm);
00138
00139
00145
typedef void snd_instr_simple_t;
00146
00147
int snd_instr_simple_convert_to_stream(snd_instr_simple_t *simple,
const char *name, snd_instr_header_t **put, size_t *size);
00148
int snd_instr_simple_convert_from_stream(snd_instr_header_t *data, size_t size, snd_instr_simple_t **simple);
00149
int snd_instr_simple_free(snd_instr_simple_t *simple);
00150
00151
00157
typedef void snd_instr_iwffff_t;
00159
typedef struct _snd_iwffff_handle
snd_iwffff_handle_t;
00160
00161
int snd_instr_iwffff_open(snd_iwffff_handle_t **handle,
const char *name_fff,
const char *name_dta);
00162 int snd_instr_iwffff_open_rom(snd_iwffff_handle_t **handle,
int card,
int bank,
int file);
00163
int snd_instr_iwffff_open_rom_file(snd_iwffff_handle_t **handle,
const char *name,
int bank,
int file);
00164 int snd_instr_iwffff_close(snd_iwffff_handle_t *handle);
00165
int snd_instr_iwffff_load(snd_iwffff_handle_t *handle,
int bank,
int prg, snd_instr_iwffff_t **iwffff);
00166
int snd_instr_iwffff_convert_to_stream(snd_instr_iwffff_t *iwffff,
const char *name, snd_instr_header_t **data, size_t *size);
00167
int snd_instr_iwffff_convert_from_stream(snd_instr_header_t *data, size_t size, snd_instr_iwffff_t **iwffff);
00168
int snd_instr_iwffff_free(snd_instr_iwffff_t *iwffff);
00169
00172
#ifdef __cplusplus
00173
}
00174
#endif
00175
00176
#endif
00177