LiVES 2.4.6

- Main Page
- Namespaces
- Data Structures
- Files

- File List
- Globals

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
65 } lives_omc_macro_t;
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
101 } lives_omc_match_node_t;
102
103
104
105 typedef struct {
106 LiVESWidget *dialog;
107 LiVESWidget *clear_button;
108 LiVESWidget *del_all_button;
109
110 int tbl_rows;
111 int tbl_currow;
112 LiVESWidget *table;
113 LiVESWidget *top_vbox;
114 } omclearn_w;
115
116
117
118 enum {
119 TITLE_COLUMN,
120 VALUE_COLUMN,
121 FILTER_COLUMN,
122 RANGE_COLUMN,
123 OFFS1_COLUMN,
124 SCALE_COLUMN,
125 OFFS2_COLUMN,
126 NUM_COLUMNS
127 };
128
129
130 enum {
131 TITLE2_COLUMN,
132 VALUE2_COLUMN,
133 NUM2_COLUMNS
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
lives_omc_match_node_t::offs1
int * offs1
offs to add to params after scale
Definition: omc-learn.h:77
midi_mangle
char * midi_mangle(void)
lives_omc_macro_t
Definition: omc-learn.h:44
omc_learner_decode
OSCbuf * omc_learner_decode(int type, int index, const char *string)
decode learnt behaviours
NUM_COLUMNS
Definition: effects-data.c:2245
omclearn_w::table
LiVESWidget * table
Definition: omc-learn.h:112
lives_omc_match_node_t::max
int * max
max values of params
Definition: omc-learn.h:80
lives_omc_match_node_t::srch
char * srch
string to match
Definition: omc-learn.h:71
lives_omc_match_node_t::map
int * map
reverse mapping to params of OSC message
Definition: omc-learn.h:86
lives_omc_match_node_t::matchi
int * matchi
match value
Definition: omc-learn.h:83
NUM2_COLUMNS
Definition: omc-learn.h:133
VALUE2_COLUMN
Definition: omc-learn.h:132
lives_omc_macro_t::maxd
double * maxd
Definition: omc-learn.h:61
lives_omc_match_node_t::scale
double * scale
scale for params
Definition: omc-learn.h:76
omclearn_w::tbl_rows
int tbl_rows
Definition: omc-learn.h:110
TITLE2_COLUMN
Definition: omc-learn.h:131
lives_omc_match_node_t::treev2
LiVESWidget * treev2
Definition: omc-learn.h:94
lives_omc_match_node_t::fvali
int * fvali
mapping to fixed ints
Definition: omc-learn.h:87
lives_omc_match_node_t::min
int * min
min values of params
Definition: omc-learn.h:79
lives_omc_macro_t::ptypes
int * ptypes
Definition: omc-learn.h:54
omclearn_w::del_all_button
LiVESWidget * del_all_button
Definition: omc-learn.h:108
lives_omc_macro_t::stype_tags
char * stype_tags
setter type tags
Definition: omc-learn.h:48
get_midi_filename
const char * get_midi_filename(void)
FILTER_COLUMN
Definition: omc-learn.h:121
lives_omc_macro_t::mind
double * mind
Definition: omc-learn.h:60
lives_omc_match_node_t::treev1
LiVESWidget * treev1
Definition: omc-learn.h:93
on_midi_learn_activate
void on_midi_learn_activate(LiVESMenuItem *, livespointer)
start learning MIDI inputs
on_midi_save_activate
void on_midi_save_activate(LiVESMenuItem *, livespointer)
omclearn_w::dialog
LiVESWidget * dialog
Definition: omc-learn.h:106
lives_omc_match_node_t::nvars
int nvars
number of params
Definition: omc-learn.h:74
osc.h
midi_open
boolean midi_open(void)
lives_omc_macro_t::vali
int * vali
Definition: omc-learn.h:58
lives_omc_match_node_t::matchp
boolean * matchp
do we need to match this pval ?
Definition: omc-learn.h:82
RANGE_COLUMN
Definition: omc-learn.h:122
lives_omc_macro_t::maxi
int * maxi
Definition: omc-learn.h:57
lives_omc_macro_t::info_text
char * info_text
descriptive text
Definition: omc-learn.h:47
OFFS2_COLUMN
Definition: omc-learn.h:125
omclearn_w::top_vbox
LiVESWidget * top_vbox
Definition: omc-learn.h:113
lives_omc_macro_t::nparams
int nparams
Definition: omc-learn.h:50
lives_omc_match_node_t::gtkstore
LiVESTreeStore * gtkstore
Definition: omc-learn.h:96
on_midi_load_activate
void on_midi_load_activate(LiVESMenuItem *, livespointer)
OFFS1_COLUMN
Definition: omc-learn.h:123
lives_omc_match_node_t::gtkstore2
LiVESTreeStore * gtkstore2
Definition: omc-learn.h:97
lives_omc_match_node_t::tmpvals
int * tmpvals
Definition: omc-learn.h:99
omclearn_w::clear_button
LiVESWidget * clear_button
Definition: omc-learn.h:107
VALUE_COLUMN
Definition: events.c:4747
lives_omc_macro_t::macro_text
char * macro_text
macro text
Definition: omc-learn.h:46
lives_omc_match_node_t
Definition: omc-learn.h:70
SCALE_COLUMN
Definition: omc-learn.h:124
lives_omc_macro_t::pname
char ** pname
Definition: omc-learn.h:52
midi_close
void midi_close(void)
lives_omc_macro_t::msg
char * msg
OSC message.
Definition: omc-learn.h:45
omclearn_w::tbl_currow
int tbl_currow
Definition: omc-learn.h:111
lives_omc_macro_t::mini
int * mini
Definition: omc-learn.h:56
TITLE_COLUMN
Definition: events.c:4745
lives_omc_macro_t::vald
double * vald
Definition: omc-learn.h:62
omclearn_w
Definition: omc-learn.h:105
lives_omc_match_node_t::offs0
int * offs0
offs to add to params before scale
Definition: omc-learn.h:75
lives_omc_match_node_t::fvald
double * fvald
mapping to fixed doubles
Definition: omc-learn.h:88
lives_omc_match_node_t::macro
int macro
macro number this is linked to (or -1)
Definition: omc-learn.h:72
omc_process_string
boolean omc_process_string(int supertype, const char *string, boolean learn, omclearn_w *omclw)