Beast - Music Synthesizer and Composer  0.11.1+10.g2da35
bseglobals.hh
Go to the documentation of this file.
1  // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html
2 #ifndef __BSE_GLOBALS_H__
3 #define __BSE_GLOBALS_H__
4 
5 #include <bse/bsedefs.hh>
6 #include <bse/bsemath.hh>
7 #include <bse/bsenote.hh>
8 #include <bse/bseconstvalues.hh>
9 
10 /* --- time ranges --- */ // FIXME: BSE_TIME_RANGE is deprecated
11 typedef enum
12 {
13  BSE_TIME_RANGE_SHORT = 1,
14  BSE_TIME_RANGE_MEDIUM,
15  BSE_TIME_RANGE_LONG
16 } BseTimeRangeType;
17 #define BSE_TIME_RANGE_SHORT_ms (1000.0 * 0.5)
18 #define BSE_TIME_RANGE_MEDIUM_ms (1000.0 * 10.0)
19 #define BSE_TIME_RANGE_LONG_ms (1000.0 * 200.0)
20 glong bse_time_range_to_ms (BseTimeRangeType time_range);
21 
22 
23 /* --- async handlers --- */
24 /* most important, used for immediate async execution */
25 #define BSE_PRIORITY_NOW (-G_MAXINT / 2)
26 /* very important, used for io/engine handlers */
27 #define BSE_PRIORITY_HIGH (G_PRIORITY_HIGH - 10)
28 /* still very important, used for need-to-be-async operations */
29 #define BSE_PRIORITY_NEXT (G_PRIORITY_HIGH - 5)
30 /* important, delivers async signals */
31 #define BSE_PRIORITY_NOTIFY (G_PRIORITY_DEFAULT - 1)
32 /* normal importantance, interfaces to glue layer */
33 #define BSE_PRIORITY_NORMAL (G_PRIORITY_DEFAULT)
34 #define BSE_PRIORITY_GLUE (BSE_PRIORITY_NORMAL)
35 /* mildly important, used for GUI updates or user information */
36 #define BSE_PRIORITY_UPDATE (G_PRIORITY_HIGH_IDLE + 5)
37 /* unimportant, used when everything else done */
38 #define BSE_PRIORITY_BACKGROUND (G_PRIORITY_LOW + 500)
39 guint bse_idle_now (GSourceFunc function,
40  gpointer data);
41 guint bse_idle_next (GSourceFunc function,
42  gpointer data);
43 guint bse_idle_notify (GSourceFunc function,
44  gpointer data);
45 guint bse_idle_normal (GSourceFunc function,
46  gpointer data);
47 guint bse_idle_update (GSourceFunc function,
48  gpointer data);
49 guint bse_idle_background (GSourceFunc function,
50  gpointer data);
51 gboolean bse_idle_remove (guint id);
52 guint bse_idle_timed (guint64 usec_delay,
53  GSourceFunc function,
54  gpointer data);
55 
56 
57 /* semitone factorization tables, i.e.
58  * Index Factor
59  * (SFI_KAMMER_NOTE - 12) -> 0.5
60  * SFI_KAMMER_NOTE -> 1.0
61  * (SFI_KAMMER_NOTE + 12) -> 2.0
62  * etc...
63  */
64 #define BSE_TRANSPOSE_FACTOR(st) (bse_transpose_factor (CLAMP (st, -132, +132))) /* BSE_MAX_TRANSPOSE */
65 
66 
67 /* --- prototypes --- */
68 void bse_globals_init (void);
69 
70 /* --- decibel conversion --- */
71 gdouble bse_db_to_factor (gdouble dB);
72 gdouble bse_db_from_factor (gdouble factor,
73  gdouble min_dB);
74 #define BSE_MINDB (-96) /* 32bit:-192 24bit:-144 16bit:-96 */
75 
76 #endif /* __BSE_GLOBALS_H__ */
uint bse_idle_next(GSourceFunc function, void *data)
Definition: bseglobals.cc:99
gboolean bse_idle_remove(uint id)
Definition: bseglobals.cc:203
uint bse_idle_timed(guint64 usec_delay, GSourceFunc function, void *data)
Definition: bseglobals.cc:183
uint bse_idle_notify(GSourceFunc function, void *data)
Definition: bseglobals.cc:122
uint bse_idle_now(GSourceFunc function, void *data)
Definition: bseglobals.cc:77