00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
#ifndef _FLUIDSYNTH_SFONT_H
00022
#define _FLUIDSYNTH_SFONT_H
00023
00024
#ifdef __cplusplus
00025
extern "C" {
00026
#endif
00027
00028
00029
00063
enum {
00064
FLUID_PRESET_SELECTED,
00065
FLUID_PRESET_UNSELECTED,
00066
FLUID_SAMPLE_DONE
00067 };
00068
00069
00070
00071
00072
00073
00074 struct _fluid_sfloader_t {
00076 void*
data;
00077
00081 int (*free)(
fluid_sfloader_t* loader);
00082
00084
fluid_sfont_t* (*load)(
fluid_sfloader_t* loader,
const char* filename);
00085 };
00086
00087
00088
00089
00090
00091
00092 struct _fluid_sfont_t {
00093 void*
data;
00094 unsigned int id;
00095
00099 int (*free)(
fluid_sfont_t* sfont);
00100
00102
char* (*get_name)(
fluid_sfont_t* sfont);
00103
00107
fluid_preset_t* (*get_preset)(
fluid_sfont_t* sfont,
unsigned int bank,
unsigned int prenum);
00108
00109 void (*iteration_start)(
fluid_sfont_t* sfont);
00110
00111
00112 int (*iteration_next)(
fluid_sfont_t* sfont,
fluid_preset_t* preset);
00113 };
00114
00115 #define fluid_sfont_get_id(_sf) ((_sf)->id)
00116
00117
00118
00119
00120
00121
00122 struct _fluid_preset_t {
00123 void*
data;
00124 fluid_sfont_t*
sfont;
00125 int (*free)(
fluid_preset_t* preset);
00126
char* (*get_name)(
fluid_preset_t* preset);
00127 int (*get_banknum)(
fluid_preset_t* preset);
00128 int (*get_num)(
fluid_preset_t* preset);
00129
00131 int (*noteon)(
fluid_preset_t* preset,
fluid_synth_t* synth,
int chan,
int key,
int vel);
00132
00135 int (*notify)(
fluid_preset_t* preset,
int reason,
int chan);
00136 };
00137
00138
00139
00140
00141
00142
00143 struct _fluid_sample_t
00144 {
00145 char name[21];
00146 unsigned int start;
00147 unsigned int end;
00148 unsigned int loopstart;
00149 unsigned int loopend;
00150 unsigned int samplerate;
00151 int origpitch;
00152 int pitchadj;
00153 int sampletype;
00154 int valid;
00155 short*
data;
00156
00160
00161 int amplitude_that_reaches_noise_floor_is_valid;
00162 double amplitude_that_reaches_noise_floor;
00163
00165 unsigned int refcount;
00166
00169 int (*notify)(
fluid_sample_t* sample,
int reason);
00170
00172 void*
userdata;
00173 };
00174
00175
00176 #define fluid_sample_refcount(_sample) ((_sample)->refcount)
00177
00178
00181 #define FLUID_SAMPLETYPE_MONO 1
00182 #define FLUID_SAMPLETYPE_RIGHT 2
00183 #define FLUID_SAMPLETYPE_LEFT 4
00184 #define FLUID_SAMPLETYPE_LINKED 8
00185 #define FLUID_SAMPLETYPE_ROM 0x8000
00186
00187
00188
00189
#ifdef __cplusplus
00190
}
00191
#endif
00192
00193
#endif