BEAST/BSE - Better Audio System and Sound Engine
0.8.2
|
00001 // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html 00002 #ifndef __BSE_GLOBALS_H__ 00003 #define __BSE_GLOBALS_H__ 00004 00005 #include <bse/bsedefs.hh> 00006 #include <bse/bsemath.hh> 00007 #include <bse/bsenote.hh> 00008 #include <bse/bseconstvalues.hh> 00009 00010 G_BEGIN_DECLS 00011 00012 /* --- time ranges --- */ // FIXME: BSE_TIME_RANGE is deprecated 00013 typedef enum 00014 { 00015 BSE_TIME_RANGE_SHORT = 1, 00016 BSE_TIME_RANGE_MEDIUM, 00017 BSE_TIME_RANGE_LONG 00018 } BseTimeRangeType; 00019 #define BSE_TIME_RANGE_SHORT_ms (1000.0 * 0.5) 00020 #define BSE_TIME_RANGE_MEDIUM_ms (1000.0 * 10.0) 00021 #define BSE_TIME_RANGE_LONG_ms (1000.0 * 200.0) 00022 glong bse_time_range_to_ms (BseTimeRangeType time_range); 00023 00024 00025 /* --- async handlers --- */ 00026 /* most important, used for immediate async execution */ 00027 #define BSE_PRIORITY_NOW (-G_MAXINT / 2) 00028 /* very important, used for io/engine handlers */ 00029 #define BSE_PRIORITY_HIGH (G_PRIORITY_HIGH - 10) 00030 /* still very important, used for need-to-be-async operations */ 00031 #define BSE_PRIORITY_NEXT (G_PRIORITY_HIGH - 5) 00032 /* important, delivers async signals */ 00033 #define BSE_PRIORITY_NOTIFY (G_PRIORITY_DEFAULT - 1) 00034 /* normal importantance, interfaces to glue layer */ 00035 #define BSE_PRIORITY_NORMAL (G_PRIORITY_DEFAULT) 00036 #define BSE_PRIORITY_GLUE (BSE_PRIORITY_NORMAL) 00037 /* mildly important, used for GUI updates or user information */ 00038 #define BSE_PRIORITY_UPDATE (G_PRIORITY_HIGH_IDLE + 5) 00039 /* unimportant, used when everything else done */ 00040 #define BSE_PRIORITY_BACKGROUND (G_PRIORITY_LOW + 500) 00041 guint bse_idle_now (GSourceFunc function, 00042 gpointer data); 00043 guint bse_idle_next (GSourceFunc function, 00044 gpointer data); 00045 guint bse_idle_notify (GSourceFunc function, 00046 gpointer data); 00047 guint bse_idle_normal (GSourceFunc function, 00048 gpointer data); 00049 guint bse_idle_update (GSourceFunc function, 00050 gpointer data); 00051 guint bse_idle_background (GSourceFunc function, 00052 gpointer data); 00053 gboolean bse_idle_remove (guint id); 00054 guint bse_idle_timed (guint64 usec_delay, 00055 GSourceFunc function, 00056 gpointer data); 00057 00058 00059 /* semitone factorization tables, i.e. 00060 * Index Factor 00061 * (SFI_KAMMER_NOTE - 12) -> 0.5 00062 * SFI_KAMMER_NOTE -> 1.0 00063 * (SFI_KAMMER_NOTE + 12) -> 2.0 00064 * etc... 00065 */ 00066 #define BSE_TRANSPOSE_FACTOR(st) (bse_transpose_factor (CLAMP (st, -132, +132))) /* BSE_MAX_TRANSPOSE */ 00067 00068 00069 /* --- prototypes --- */ 00070 void bse_globals_init (void); 00071 00072 /* --- decibel conversion --- */ 00073 gdouble bse_db_to_factor (gdouble dB); 00074 gdouble bse_db_from_factor (gdouble factor, 00075 gdouble min_dB); 00076 #define BSE_MINDB (-96) /* 32bit:-192 24bit:-144 16bit:-96 */ 00077 00078 G_END_DECLS 00079 00080 #endif /* __BSE_GLOBALS_H__ */