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 __BST_KEY_BINDINGS_H__ 00003 #define __BST_KEY_BINDINGS_H__ 00004 00005 #include "bstutils.hh" 00006 00007 G_BEGIN_DECLS 00008 00009 00010 /* --- typedefs & structures --- */ 00011 typedef enum /*< skip >*/ 00012 { 00013 BST_KEY_BINDING_PARAM_NONE = 0, 00014 BST_KEY_BINDING_PARAM_m1_p1, /* -1.0 - +1.0 */ 00015 BST_KEY_BINDING_PARAM_0_p1, /* +0.0 - +1.0 */ 00016 BST_KEY_BINDING_PARAM_m1_0, /* -1.0 - +0.0 */ 00017 BST_KEY_BINDING_PARAM_PERC, /* +0.0 - +100.0 */ 00018 BST_KEY_BINDING_PARAM_SHORT, /* -32 - +32 */ 00019 BST_KEY_BINDING_PARAM_USHORT, /* 0 - +32 */ 00020 BST_KEY_BINDING_PARAM_NOTE, /* midi note */ 00021 } BstKeyBindingParam; 00022 typedef struct { 00023 guint id; 00024 const char *function_name; 00025 BstKeyBindingParam ptype; 00026 const char *function_blurb; /* translated */ 00027 guint collision_group; 00028 } BstKeyBindingFunction; 00029 typedef struct { 00030 guint keyval; 00031 GdkModifierType modifier; 00032 guint func_index; 00033 gdouble param; 00034 } BstKeyBindingKey; 00035 struct _BstKeyBinding 00036 { 00037 gchar *binding_name; 00038 guint n_funcs; 00039 const BstKeyBindingFunction *funcs; 00040 guint n_keys; 00041 BstKeyBindingKey *keys; 00042 }; 00043 00044 00045 /* --- prototypes --- */ 00046 GtkWidget* bst_key_binding_box (const gchar *binding_name, 00047 guint n_funcs, 00048 const BstKeyBindingFunction *funcs, 00049 gboolean editable); 00050 void bst_key_binding_box_set (GtkWidget *self, 00051 BstKeyBindingItemSeq *kbseq); 00052 BstKeyBindingItemSeq* bst_key_binding_box_get (GtkWidget *self); 00053 BstKeyBindingKey* bst_key_binding_lookup_key (BstKeyBinding *kbinding, 00054 guint keyval, 00055 GdkModifierType modifier, 00056 guint collision_group); 00057 const BstKeyBindingFunction* bst_key_binding_lookup (BstKeyBinding *kbinding, 00058 guint keyval, 00059 GdkModifierType modifier, 00060 guint collision_group, 00061 gdouble *param); 00062 guint bst_key_binding_lookup_id (BstKeyBinding *kbinding, 00063 guint keyval, 00064 GdkModifierType modifier, 00065 guint collision_group, 00066 gdouble *param); 00067 void bst_key_binding_set_item_seq (BstKeyBinding *kbinding, 00068 BstKeyBindingItemSeq *seq); 00069 BstKeyBindingItemSeq* bst_key_binding_get_item_seq (BstKeyBinding *kbinding); 00070 const gchar* bst_key_binding_rcfile (void); 00071 BseErrorType bst_key_binding_dump (const gchar *file_name, 00072 GSList *kbindings); 00073 BseErrorType bst_key_binding_parse (const gchar *file_name, 00074 GSList *kbindings); 00075 GParamSpec* bst_key_binding_item_pspec (void); 00076 00077 G_END_DECLS 00078 00079 #endif /* __BST_KEY_BINDINGS_H__ */