LiVES  1.6.4-svn
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
omc-learn.h
Go to the documentation of this file.
1 // omc-learn.h
2 // LiVES (lives-exe)
3 // (c) G. Finch 2003 - 2012
4 // Released under the GPL 3 or later
5 // see file ../COPYING for licensing details
6 
7 
8 #ifndef HAS_LIVES_OMC_LEARN_H
9 #define HAS_LIVES_OMC_LEARN_H
10 
12 #define N_OMC_MACROS 32
13 
15 #define OMC_FP_FIX 4
16 
17 // OMC device interfaces
18 #if HAVE_LINUX_JOYSTICK_H
19 #define OMC_JS_IMPL
20 #endif
21 
22 #define OMC_MIDI_IMPL
23 
24 
25 #ifdef OMC_JS_IMPL
26 gchar *js_mangle(void);
27 gboolean js_open(void);
28 void js_close(void);
29 const gchar *get_js_filename(void);
30 #endif
31 
32 #ifdef OMC_MIDI_IMPL
33 gchar *midi_mangle(void);
34 const gchar *get_midi_filename(void);
35 gboolean midi_open(void);
36 void midi_close(void);
37 #endif
38 
39 /* parameter types */
40 #define OMC_PARAM_INT 1
41 #define OMC_PARAM_DOUBLE 2
42 #define OMC_PARAM_SPECIAL 128
43 
44 typedef struct {
45  gchar *msg;
46  gchar *macro_text;
47  gchar *info_text;
48  gchar *stype_tags;
49 
50  gint nparams;
51 
52  gchar **pname;
53 
54  gint *ptypes;
55 
56  gint *mini;
57  gint *maxi;
58  gint *vali;
59 
60  gdouble *mind;
61  gdouble *maxd;
62  gdouble *vald;
63 
64 
66 
67 
68 
69 
70 typedef struct {
71  gchar *srch;
72  gint macro;
73 
74  gint nvars;
75  gint *offs0;
76  gdouble *scale;
77  gint *offs1;
78 
79  gint *min;
80  gint *max;
81 
82  gboolean *matchp;
83  gint *matchi;
84 
85  // enumerated by number of params in target macro
86  gint *map;
87  gint *fvali;
88  gdouble *fvald;
89 
90 
92 
93  GtkWidget *treev1;
94  GtkWidget *treev2;
95 
96  GtkTreeStore *gtkstore;
97  GtkTreeStore *gtkstore2;
98 
99  int *tmpvals;
100 
102 
103 
104 
105 typedef struct {
106  GtkWidget *dialog;
107  GtkWidget *clear_button;
108  GtkWidget *del_all_button;
109 
110  gint tbl_rows;
112  GtkWidget *table;
113  GtkWidget *top_vbox;
114 } omclearn_w;
115 
116 
117 
118 enum {
127 };
128 
129 
130 enum {
134 };
135 
136 
137 #define OMC_JS 1
138 #define OMC_JS_AXIS 2
139 #define OMC_JS_BUTTON 3
140 
141 
142 #define OMC_MIDI 128
143 #define OMC_MIDI_NOTE 129
144 #define OMC_MIDI_NOTE_OFF 130
145 #define OMC_MIDI_CONTROLLER 131
146 #define OMC_MIDI_PITCH_BEND 132
147 #define OMC_MIDI_PGM_CHANGE 133
148 
150 void on_midi_learn_activate (GtkMenuItem *, gpointer);
151 
154 gboolean omc_process_string(gint supertype, const gchar *string, gboolean learn, omclearn_w *omclw);
155 
156 
157 
158 #define OMC_FILE_VSTRING "LiVES OMC map version 1.0"
159 
160 void on_midi_save_activate (GtkMenuItem *, gpointer);
161 void on_midi_load_activate (GtkMenuItem *, gpointer);
162 
163 
164 #include "osc.h"
165 
166 
167 #define OSC_BUF_SIZE 1024
168 #define OSC_MAX_TYPETAGS 64
169 
171 OSCbuf *omc_learner_decode(gint type, gint index, const gchar *string);
172 
173 
174 #endif // HAS_LIVES_OMC_LEARN_H
175 
176 
177