LiVES  2.8.9
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;
64 
65 
66 
67 
68 typedef struct {
69  char *srch;
70  int macro;
71 
72  int nvars;
73  int *offs0;
74  double *scale;
75  int *offs1;
76 
77  int *min;
78  int *max;
79 
80  boolean *matchp;
81  int *matchi;
82 
83  // enumerated by number of params in target macro
84  int *map;
85  int *fvali;
86  double *fvald;
87 
88 
90 
91  LiVESWidget *treev1;
92  LiVESWidget *treev2;
93 
94  LiVESTreeStore *gtkstore;
95  LiVESTreeStore *gtkstore2;
96 
97  int *tmpvals;
99 
100 
101 
102 typedef struct {
103  LiVESWidget *dialog;
104  LiVESWidget *clear_button;
105  LiVESWidget *del_all_button;
106 
107  int tbl_rows;
109  LiVESWidget *table;
110  LiVESWidget *top_vbox;
111 } omclearn_w;
112 
113 
114 
115 enum {
124 };
125 
126 
127 enum {
132 };
133 
134 
135 #define OMC_JS 1
136 #define OMC_JS_AXIS 2
137 #define OMC_JS_BUTTON 3
138 
139 
140 #define OMC_MIDI 128
141 #define OMC_MIDI_NOTE 129
142 #define OMC_MIDI_NOTE_OFF 130
143 #define OMC_MIDI_CONTROLLER 131
144 #define OMC_MIDI_PITCH_BEND 132
145 #define OMC_MIDI_PGM_CHANGE 133
146 
148 void on_midi_learn_activate(LiVESMenuItem *, livespointer);
149 
152 boolean omc_process_string(int supertype, const char *string, boolean learn, omclearn_w *omclw);
153 
154 
155 
156 #define OMC_FILE_VSTRING "LiVES OMC map version 1.0"
157 
158 void on_midi_save_activate(LiVESMenuItem *, livespointer);
159 void on_midi_load_activate(LiVESMenuItem *, livespointer);
160 
161 
162 #include "osc.h"
163 
164 
165 #define OSC_BUF_SIZE 1024
166 #define OSC_MAX_TYPETAGS 64
167 
169 OSCbuf *omc_learner_decode(int type, int index, const char *string);
170 
171 
172 #endif // HAS_LIVES_OMC_LEARN_H
173 
174 
175 
int * offs1
offs to add to params after scale
Definition: omc-learn.h:75
char * midi_mangle(void)
Definition: omc-learn.h:44
Definition: omc-learn.h:123
OSCbuf * omc_learner_decode(int type, int index, const char *string)
decode learnt behaviours
Definition: omc-learn.h:131
Definition: omc-learn.h:122
Definition: omc-learn.h:117
LiVESWidget * table
Definition: omc-learn.h:109
int * max
max values of params
Definition: omc-learn.h:78
char * srch
string to match
Definition: omc-learn.h:69
int * map
reverse mapping to params of OSC message
Definition: omc-learn.h:84
int * matchi
match value
Definition: omc-learn.h:81
Definition: omc-learn.h:128
double * maxd
Definition: omc-learn.h:61
double * scale
scale for params
Definition: omc-learn.h:74
int tbl_rows
Definition: omc-learn.h:107
LiVESWidget * treev2
Definition: omc-learn.h:92
int * fvali
mapping to fixed ints
Definition: omc-learn.h:85
int * min
min values of params
Definition: omc-learn.h:77
Definition: omc-learn.h:119
int * ptypes
Definition: omc-learn.h:54
LiVESWidget * del_all_button
Definition: omc-learn.h:105
char * stype_tags
setter type tags
Definition: omc-learn.h:48
const char * get_midi_filename(void)
double * mind
Definition: omc-learn.h:60
LiVESWidget * treev1
Definition: omc-learn.h:91
void on_midi_learn_activate(LiVESMenuItem *, livespointer)
start learning MIDI inputs
Definition: omc-learn.h:116
Definition: omc-learn.h:129
void on_midi_save_activate(LiVESMenuItem *, livespointer)
Definition: omc-learn.h:120
LiVESWidget * dialog
Definition: omc-learn.h:103
int nvars
number of params
Definition: omc-learn.h:72
Definition: omc-learn.h:118
boolean midi_open(void)
Definition: omc-learn.h:121
int * vali
Definition: omc-learn.h:58
boolean * matchp
do we need to match this pval ?
Definition: omc-learn.h:80
int * maxi
Definition: omc-learn.h:57
char * info_text
descriptive text
Definition: omc-learn.h:47
LiVESWidget * top_vbox
Definition: omc-learn.h:110
int nparams
Definition: omc-learn.h:50
LiVESTreeStore * gtkstore
Definition: omc-learn.h:94
void on_midi_load_activate(LiVESMenuItem *, livespointer)
LiVESTreeStore * gtkstore2
Definition: omc-learn.h:95
int * tmpvals
Definition: omc-learn.h:97
LiVESWidget * clear_button
Definition: omc-learn.h:104
char * macro_text
macro text
Definition: omc-learn.h:46
Definition: omc-learn.h:68
Definition: omc-learn.h:130
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:108
int * mini
Definition: omc-learn.h:56
double * vald
Definition: omc-learn.h:62
Definition: omc-learn.h:102
int * offs0
offs to add to params before scale
Definition: omc-learn.h:73
double * fvald
mapping to fixed doubles
Definition: omc-learn.h:86
int macro
macro number this is linked to (or -1)
Definition: omc-learn.h:70
boolean omc_process_string(int supertype, const char *string, boolean learn, omclearn_w *omclw)