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 {
00075 void* data;
00076 int (*free)(fluid_sfloader_t* loader);
00077 fluid_sfont_t* (*load)(fluid_sfloader_t* loader, const char* filename);
00078 };
00079
00080
00081
00082
00083
00084
00085 struct _fluid_sfont_t {
00086 void* data;
00087 unsigned int id;
00088
00092 int (*free)(fluid_sfont_t* sfont);
00093
00094 char* (*get_name)(fluid_sfont_t* sfont);
00095 fluid_preset_t* (*get_preset)(fluid_sfont_t* sfont, unsigned int bank, unsigned int prenum);
00096 void (*iteration_start)(fluid_sfont_t* sfont);
00097
00098
00099 int (*iteration_next)(fluid_sfont_t* sfont, fluid_preset_t* preset);
00100 };
00101
00102 #define fluid_sfont_get_id(_sf) ((_sf)->id)
00103
00104
00105
00106
00107
00108
00109 struct _fluid_preset_t {
00110 void* data;
00111 fluid_sfont_t* sfont;
00112 int (*free)(fluid_preset_t* preset);
00113 char* (*get_name)(fluid_preset_t* preset);
00114 int (*get_banknum)(fluid_preset_t* preset);
00115 int (*get_num)(fluid_preset_t* preset);
00116
00118 int (*noteon)(fluid_preset_t* preset, fluid_synth_t* synth, int chan, int key, int vel);
00119
00122 int (*notify)(fluid_preset_t* preset, int reason, int chan);
00123 };
00124
00125
00126
00127
00128
00129
00130 struct _fluid_sample_t
00131 {
00132 char name[21];
00133 unsigned int start;
00134 unsigned int end;
00135 unsigned int loopstart;
00136 unsigned int loopend;
00137 unsigned int samplerate;
00138 int origpitch;
00139 int pitchadj;
00140 int sampletype;
00141 int valid;
00142 short* data;
00143
00147
00148 int amplitude_that_reaches_noise_floor_is_valid;
00149 double amplitude_that_reaches_noise_floor;
00150
00152 unsigned int refcount;
00153
00156 int (*notify)(fluid_sample_t* sample, int reason);
00157
00159 void* userdata;
00160 };
00161
00162
00163 #define fluid_sample_refcount(_sample) ((_sample)->refcount)
00164
00165
00168 #define FLUID_SAMPLETYPE_MONO 1
00169 #define FLUID_SAMPLETYPE_RIGHT 2
00170 #define FLUID_SAMPLETYPE_LEFT 4
00171 #define FLUID_SAMPLETYPE_LINKED 8
00172 #define FLUID_SAMPLETYPE_ROM 0x8000
00173
00174
00175
00176 #ifdef __cplusplus
00177 }
00178 #endif
00179
00180 #endif