LiVES  2.4.1-svn
 All Data Structures Namespaces 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 char *js_mangle(void);
27 boolean js_open(void);
28 void js_close(void);
29 const char *get_js_filename(void);
30 #endif
31 
32 #ifdef OMC_MIDI_IMPL
33 char *midi_mangle(void);
34 const char *get_midi_filename(void);
35 boolean 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  char *msg;
46  char *macro_text;
47  char *info_text;
48  char *stype_tags;
49 
50  int nparams;
51 
52  char **pname;
53 
54  int *ptypes;
55 
56  int *mini;
57  int *maxi;
58  int *vali;
59 
60  double *mind;
61  double *maxd;
62  double *vald;
63 
64 
66 
67 
68 
69 
70 typedef struct {
71  char *srch;
72  int macro;
73 
74  int nvars;
75  int *offs0;
76  double *scale;
77  int *offs1;
78 
79  int *min;
80  int *max;
81 
82  boolean *matchp;
83  int *matchi;
84 
85  // enumerated by number of params in target macro
86  int *map;
87  int *fvali;
88  double *fvald;
89 
90 
92 
93  LiVESWidget *treev1;
94  LiVESWidget *treev2;
95 
96  LiVESTreeStore *gtkstore;
97  LiVESTreeStore *gtkstore2;
98 
99  int *tmpvals;
100 
102 
103 
104 
105 typedef struct {
106  LiVESWidget *dialog;
107  LiVESWidget *clear_button;
108  LiVESWidget *del_all_button;
109 
110  int tbl_rows;
112  LiVESWidget *table;
113  LiVESWidget *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(LiVESMenuItem *, livespointer);
151 
154 boolean omc_process_string(int supertype, const char *string, boolean 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(LiVESMenuItem *, livespointer);
161 void on_midi_load_activate(LiVESMenuItem *, livespointer);
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(int type, int index, const char *string);
172 
173 
174 #endif // HAS_LIVES_OMC_LEARN_H
175 
176 
177 
Definition: omc-learn.h:119
int * offs1
offs to add to params after scale
Definition: omc-learn.h:77
char * midi_mangle(void)
Definition: omc-learn.h:44
OSCbuf * omc_learner_decode(int type, int index, const char *string)
decode learnt behaviours
LiVESWidget * table
Definition: omc-learn.h:112
int * max
max values of params
Definition: omc-learn.h:80
char * srch
string to match
Definition: omc-learn.h:71
int * map
reverse mapping to params of OSC message
Definition: omc-learn.h:86
int * matchi
match value
Definition: omc-learn.h:83
Definition: omc-learn.h:133
Definition: omc-learn.h:132
double * maxd
Definition: omc-learn.h:61
double * scale
scale for params
Definition: omc-learn.h:76
int tbl_rows
Definition: omc-learn.h:110
Definition: omc-learn.h:131
LiVESWidget * treev2
Definition: omc-learn.h:94
int * fvali
mapping to fixed ints
Definition: omc-learn.h:87
int * min
min values of params
Definition: omc-learn.h:79
int * ptypes
Definition: omc-learn.h:54
LiVESWidget * del_all_button
Definition: omc-learn.h:108
char * stype_tags
setter type tags
Definition: omc-learn.h:48
const char * get_midi_filename(void)
Definition: omc-learn.h:121
double * mind
Definition: omc-learn.h:60
LiVESWidget * treev1
Definition: omc-learn.h:93
void on_midi_learn_activate(LiVESMenuItem *, livespointer)
start learning MIDI inputs
void on_midi_save_activate(LiVESMenuItem *, livespointer)
LiVESWidget * dialog
Definition: omc-learn.h:106
int nvars
number of params
Definition: omc-learn.h:74
boolean midi_open(void)
int * vali
Definition: omc-learn.h:58
boolean * matchp
do we need to match this pval ?
Definition: omc-learn.h:82
Definition: omc-learn.h:122
int * maxi
Definition: omc-learn.h:57
char * info_text
descriptive text
Definition: omc-learn.h:47
Definition: omc-learn.h:125
LiVESWidget * top_vbox
Definition: omc-learn.h:113
int nparams
Definition: omc-learn.h:50
LiVESTreeStore * gtkstore
Definition: omc-learn.h:96
void on_midi_load_activate(LiVESMenuItem *, livespointer)
Definition: omc-learn.h:123
LiVESTreeStore * gtkstore2
Definition: omc-learn.h:97
int * tmpvals
Definition: omc-learn.h:99
Definition: omc-learn.h:126
LiVESWidget * clear_button
Definition: omc-learn.h:107
char * macro_text
macro text
Definition: omc-learn.h:46
Definition: omc-learn.h:70
Definition: omc-learn.h:124
char ** pname
Definition: omc-learn.h:52
void midi_close(void)
char * msg
OSC message.
Definition: omc-learn.h:45
int tbl_currow
Definition: omc-learn.h:111
int * mini
Definition: omc-learn.h:56
double * vald
Definition: omc-learn.h:62
Definition: omc-learn.h:120
Definition: omc-learn.h:105
int * offs0
offs to add to params before scale
Definition: omc-learn.h:75
double * fvald
mapping to fixed doubles
Definition: omc-learn.h:88
int macro
macro number this is linked to (or -1)
Definition: omc-learn.h:72
boolean omc_process_string(int supertype, const char *string, boolean learn, omclearn_w *omclw)