Main Page   Data Structures   File List   Data Fields   Globals  

settings.h

Go to the documentation of this file.
00001 /* FluidSynth - A Software Synthesizer
00002  *
00003  * Copyright (C) 2003  Peter Hanappe and others.
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Library General Public License
00007  * as published by the Free Software Foundation; either version 2 of
00008  * the License, or (at your option) any later version.
00009  *
00010  * This library is distributed in the hope that it will be useful, but
00011  * WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Library General Public License for more details.
00014  *  
00015  * You should have received a copy of the GNU Library General Public
00016  * License along with this library; if not, write to the Free
00017  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00018  * 02111-1307, USA
00019  */
00020 
00021 #ifndef _FLUIDSYNTH_SETTINGS_H
00022 #define _FLUIDSYNTH_SETTINGS_H
00023 
00024 #ifdef __cplusplus
00025 extern "C" {
00026 #endif
00027 
00059 /* Hint FLUID_HINT_BOUNDED_BELOW indicates that the LowerBound field
00060    of the FLUID_PortRangeHint should be considered meaningful. The
00061    value in this field should be considered the (inclusive) lower
00062    bound of the valid range. If FLUID_HINT_SAMPLE_RATE is also
00063    specified then the value of LowerBound should be multiplied by the
00064    sample rate. */
00065 #define FLUID_HINT_BOUNDED_BELOW   0x1
00066 
00067 /* Hint FLUID_HINT_BOUNDED_ABOVE indicates that the UpperBound field
00068    of the FLUID_PortRangeHint should be considered meaningful. The
00069    value in this field should be considered the (inclusive) upper
00070    bound of the valid range. If FLUID_HINT_SAMPLE_RATE is also
00071    specified then the value of UpperBound should be multiplied by the
00072    sample rate. */
00073 #define FLUID_HINT_BOUNDED_ABOVE   0x2
00074 
00075 /* Hint FLUID_HINT_TOGGLED indicates that the data item should be
00076    considered a Boolean toggle. Data less than or equal to zero should
00077    be considered `off' or `false,' and data above zero should be
00078    considered `on' or `true.' FLUID_HINT_TOGGLED may not be used in
00079    conjunction with any other hint except FLUID_HINT_DEFAULT_0 or
00080    FLUID_HINT_DEFAULT_1. */
00081 #define FLUID_HINT_TOGGLED         0x4
00082 
00083 /* Hint FLUID_HINT_SAMPLE_RATE indicates that any bounds specified
00084    should be interpreted as multiples of the sample rate. For
00085    instance, a frequency range from 0Hz to the Nyquist frequency (half
00086    the sample rate) could be requested by this hint in conjunction
00087    with LowerBound = 0 and UpperBound = 0.5. Hosts that support bounds
00088    at all must support this hint to retain meaning. */
00089 #define FLUID_HINT_SAMPLE_RATE     0x8
00090 
00091 /* Hint FLUID_HINT_LOGARITHMIC indicates that it is likely that the
00092    user will find it more intuitive to view values using a logarithmic
00093    scale. This is particularly useful for frequencies and gains. */
00094 #define FLUID_HINT_LOGARITHMIC     0x10
00095 
00096 /* Hint FLUID_HINT_INTEGER indicates that a user interface would
00097    probably wish to provide a stepped control taking only integer
00098    values. Any bounds set should be slightly wider than the actual
00099    integer range required to avoid floating point rounding errors. For
00100    instance, the integer set {0,1,2,3} might be described as [-0.1,
00101    3.1]. */
00102 #define FLUID_HINT_INTEGER         0x20
00103 
00104 
00105 #define FLUID_HINT_FILENAME        0x01
00106 #define FLUID_HINT_OPTIONLIST      0x02
00107 
00108 
00109 
00110 enum fluid_types_enum {
00111   FLUID_NO_TYPE = -1,
00112   FLUID_NUM_TYPE,
00113   FLUID_INT_TYPE,
00114   FLUID_STR_TYPE,
00115   FLUID_SET_TYPE
00116 };
00117 
00118 
00119 FLUIDSYNTH_API fluid_settings_t* new_fluid_settings(void);
00120 FLUIDSYNTH_API void delete_fluid_settings(fluid_settings_t* settings);
00121 
00122 
00123 
00124 FLUIDSYNTH_API 
00125 int fluid_settings_get_type(fluid_settings_t* settings, char* name);
00126 
00127 FLUIDSYNTH_API 
00128 int fluid_settings_get_hints(fluid_settings_t* settings, char* name);
00129 
00131 FLUIDSYNTH_API int fluid_settings_is_realtime(fluid_settings_t* settings, char* name);
00132 
00133 
00135 FLUIDSYNTH_API 
00136 int fluid_settings_setstr(fluid_settings_t* settings, char* name, char* str);
00137 
00147 FLUIDSYNTH_API 
00148 int fluid_settings_getstr(fluid_settings_t* settings, char* name, char** str);
00149 
00151 FLUIDSYNTH_API 
00152 char* fluid_settings_getstr_default(fluid_settings_t* settings, char* name);
00153 
00159 FLUIDSYNTH_API 
00160 int fluid_settings_str_equal(fluid_settings_t* settings, char* name, char* value);
00161 
00162 
00164 FLUIDSYNTH_API 
00165 int fluid_settings_setnum(fluid_settings_t* settings, char* name, double val);
00166 
00168 FLUIDSYNTH_API 
00169 int fluid_settings_getnum(fluid_settings_t* settings, char* name, double* val);
00170 
00172 FLUIDSYNTH_API 
00173 double fluid_settings_getnum_default(fluid_settings_t* settings, char* name);
00174   
00176 FLUIDSYNTH_API 
00177 void fluid_settings_getnum_range(fluid_settings_t* settings, char* name, 
00178                                 double* min, double* max);
00179 
00180 
00182 FLUIDSYNTH_API 
00183 int fluid_settings_setint(fluid_settings_t* settings, char* name, int val);
00184 
00186 FLUIDSYNTH_API 
00187 int fluid_settings_getint(fluid_settings_t* settings, char* name, int* val);
00188 
00190 FLUIDSYNTH_API 
00191 int fluid_settings_getint_default(fluid_settings_t* settings, char* name);
00192   
00194 FLUIDSYNTH_API 
00195 void fluid_settings_getint_range(fluid_settings_t* settings, char* name, 
00196                                 int* min, int* max);
00197 
00198 
00199 
00200 typedef void (*fluid_settings_foreach_option_t)(void* data, char* name, char* option);
00201 
00202 
00203 
00204 FLUIDSYNTH_API 
00205 void fluid_settings_foreach_option(fluid_settings_t* settings, 
00206                                   char* name, void* data, 
00207                                   fluid_settings_foreach_option_t func);
00208 
00209 
00210 typedef void (*fluid_settings_foreach_t)(void* data, char* s, int type);
00211 
00212 FLUIDSYNTH_API
00213 void fluid_settings_foreach(fluid_settings_t* settings, void* data, 
00214                            fluid_settings_foreach_t func);
00215 
00216 
00217 
00218 
00219 #ifdef __cplusplus
00220 }
00221 #endif
00222 
00223 #endif /* _FLUIDSYNTH_SETTINGS_H */

Generated on Thu Mar 13 19:09:34 2003 for libfluidsynth by doxygen1.2.15