libxputty  0.1
A damn tiny abstraction Layer to create X11 window/widgets with cairo surfaces
xmidi_keyboard.c File Reference
#include "xmidi_keyboard.h"
Include dependency graph for xmidi_keyboard.c:

Go to the source code of this file.

Functions

void keysym_azerty_to_midi_key (long inkey, float *midi_key)
 
void keysym_qwertz_to_midi_key (long inkey, float *midi_key)
 
void keysym_qwerty_to_midi_key (unsigned int inkey, float *midi_key)
 
bool is_key_in_matrix (unsigned long *key_matrix, int key)
 
bool have_key_in_matrix (unsigned long *key_matrix)
 
void clear_key_matrix (unsigned long *key_matrix)
 
void mk_draw_knob (void *w_, void *user_data)
 
Widget_tadd_keyboard_knob (Widget_t *parent, const char *label, int x, int y, int width, int height)
 
Widget_topen_midi_keyboard (Widget_t *w)
 

Function Documentation

◆ add_keyboard_knob()

Widget_t* add_keyboard_knob ( Widget_t parent,
const char *  label,
int  x,
int  y,
int  width,
int  height 
)

Definition at line 782 of file xmidi_keyboard.c.

783  {
784  Widget_t *wid = add_knob(parent,label, x, y, width, height);
785  wid->flags |= NO_AUTOREPEAT;
786  set_adjustment(wid->adj,64.0, 64.0, 0.0, 127.0, 1.0, CL_CONTINUOS);
788  wid->func.key_press_callback = wheel_key_press;
789  wid->func.key_release_callback = wheel_key_release;
790  return wid;
791 }

References add_knob(), Widget_t::adj, CL_CONTINUOS, Func_t::expose_callback, Widget_t::flags, Widget_t::func, Func_t::key_press_callback, mk_draw_knob(), NO_AUTOREPEAT, and set_adjustment().

◆ clear_key_matrix()

void clear_key_matrix ( unsigned long *  key_matrix)

Definition at line 221 of file xmidi_keyboard.c.

221  {
222  int i = 0;
223  int j = 0;
224  for(;j<4;j++) {
225  for(;i<32;i++) {
226  key_matrix[j] &= (~(1 << i));
227  }
228  i = 0;
229  }
230 }

◆ have_key_in_matrix()

bool have_key_in_matrix ( unsigned long *  key_matrix)

Definition at line 204 of file xmidi_keyboard.c.

204  {
205 
206  bool ret = false;
207  int i = 0;
208  int j = 0;
209  for(;j<4;j++) {
210  for(;i<32;i++) {
211  if(key_matrix[j] & (1<<i)) {
212  ret = true;
213  break;
214  }
215  }
216  i = 0;
217  }
218  return ret;
219 }

◆ is_key_in_matrix()

bool is_key_in_matrix ( unsigned long *  key_matrix,
int  key 
)

Definition at line 183 of file xmidi_keyboard.c.

183  {
184  unsigned long *use_matrix = &key_matrix[0];
185 
186 
187  if(key>94) {
188  use_matrix = &key_matrix[3];
189  key -=94;
190  } else if(key>62) {
191  use_matrix = &key_matrix[2];
192  key -=62;
193  } else if(key>31) {
194  use_matrix = &key_matrix[1];
195  key -= 31;
196  }
197  bool ret = false;
198  if((*use_matrix) & (1<<key)) {
199  ret = true;
200  }
201  return ret;
202 }

◆ keysym_azerty_to_midi_key()

void keysym_azerty_to_midi_key ( long  inkey,
float *  midi_key 
)

Definition at line 24 of file xmidi_keyboard.c.

24  {
25  switch(inkey) {
26  case(XK_w) : (*midi_key) = 12.0; /* w = C0 */
27  break;
28  case(XK_s) : (*midi_key) = 13.0; /* s */
29  break;
30  case(XK_x) : (*midi_key) = 14.0; /* x */
31  break;
32  case(XK_d) : (*midi_key) = 15.0; /* d */
33  break;
34  case(XK_c) : (*midi_key) = 16.0; /* c */
35  break;
36  case(XK_v) : (*midi_key) = 17.0; /* v */
37  break;
38  case(XK_g) : (*midi_key) = 18.0; /* g */
39  break;
40  case(XK_b) : (*midi_key) = 19.0; /* b */
41  break;
42  case(XK_h) : (*midi_key) = 20.0; /* h */
43  break;
44  case(XK_n) : (*midi_key) = 21.0; /* n */
45  break;
46  case(XK_j) : (*midi_key) = 22.0; /* j */
47  break;
48  case(XK_comma) : (*midi_key) = 23.0; /* , */
49  break;
50  case(XK_a) : (*midi_key) = 24.0; /* a */
51  break;
52  case(XK_eacute) : (*midi_key) = 25.0; /* eacute */
53  break;
54  case(XK_z) : (*midi_key) = 26.0; /* z */
55  break;
56  case(XK_quotedbl) : (*midi_key) = 27.0; /* quotedbl */
57  break;
58  case(XK_e) : (*midi_key) = 28.0; /* e */
59  break;
60  case(XK_r) : (*midi_key) = 29.0; /* r */
61  break;
62  case(XK_parenleft) : (*midi_key) = 30.0; /* parenleft */
63  break;
64  case(XK_t) : (*midi_key) = 31.0; /* t */
65  break;
66  case(XK_minus) : (*midi_key) = 32.0; /* minus */
67  break;
68  case(XK_y) : (*midi_key) = 33.0; /* y */
69  break;
70  case(XK_egrave) : (*midi_key) = 34.0; /* egrave */
71  break;
72  case(XK_u) : (*midi_key) = 35.0; /* u */
73  break;
74  case(XK_i) : (*midi_key) = 36.0; /* i */
75  break;
76  case(XK_ccedilla) : (*midi_key) = 37.0; /* ccedilla */
77  break;
78  case(XK_o) : (*midi_key) = 38.0; /* o */
79  break;
80  case(XK_agrave) : (*midi_key) = 39.0; /* agrave */
81  break;
82  case(XK_p) : (*midi_key) = 40.0; /* p */
83  break;
84  case(XK_dead_diaeresis) :
85  case(XK_dead_circumflex) : (*midi_key) = 41.0; /* dead circumflex */
86  break;
87  }
88 }

◆ keysym_qwerty_to_midi_key()

void keysym_qwerty_to_midi_key ( unsigned int  inkey,
float *  midi_key 
)

Definition at line 157 of file xmidi_keyboard.c.

157  {
158  keysym_qwertz_to_midi_key(inkey,midi_key);
159  if ((*midi_key) == 12) (*midi_key) = 33;
160  else if ((*midi_key) == 33) (*midi_key) = 12;
161 }

References keysym_qwertz_to_midi_key().

◆ keysym_qwertz_to_midi_key()

void keysym_qwertz_to_midi_key ( long  inkey,
float *  midi_key 
)

Definition at line 90 of file xmidi_keyboard.c.

90  {
91  switch(inkey) {
92  case(XK_y) : (*midi_key) = 12.0; /* y = C0 */
93  break;
94  case(XK_s) : (*midi_key) = 13.0; /* s */
95  break;
96  case(XK_x) : (*midi_key) = 14.0; /* x */
97  break;
98  case(XK_d) : (*midi_key) = 15.0; /* d */
99  break;
100  case(XK_c) : (*midi_key) = 16.0; /* c */
101  break;
102  case(XK_v) : (*midi_key) = 17.0; /* v */
103  break;
104  case(XK_g) : (*midi_key) = 18.0; /* g */
105  break;
106  case(XK_b) : (*midi_key) = 19.0; /* b */
107  break;
108  case(XK_h) : (*midi_key) = 20.0; /* h */
109  break;
110  case(XK_n) : (*midi_key) = 21.0; /* n */
111  break;
112  case(XK_j) : (*midi_key) = 22.0; /* j */
113  break;
114  case(XK_m) : (*midi_key) = 23.0; /* m */
115  break;
116  case(XK_q) : (*midi_key) = 24.0; /* q */
117  break;
118  case(XK_2) : (*midi_key) = 25.0; /* 2 */
119  break;
120  case(XK_w) : (*midi_key) = 26.0; /* w */
121  break;
122  case(XK_3) : (*midi_key) = 27.0; /* 3 */
123  break;
124  case(XK_e) : (*midi_key) = 28.0; /* e */
125  break;
126  case(XK_r) : (*midi_key) = 29.0; /* r */
127  break;
128  case(XK_5) : (*midi_key) = 30.0; /* 5 */
129  break;
130  case(XK_t) : (*midi_key) = 31.0; /* t */
131  break;
132  case(XK_6) : (*midi_key) = 32.0; /* 6 */
133  break;
134  case(XK_z) : (*midi_key) = 33.0; /* z */
135  break;
136  case(XK_7) : (*midi_key) = 34.0; /* 7 */
137  break;
138  case(XK_u) : (*midi_key) = 35.0; /* u */
139  break;
140  case(XK_i) : (*midi_key) = 36.0; /* i */
141  break;
142  case(XK_9) : (*midi_key) = 37.0; /* 9 */
143  break;
144  case(XK_o) : (*midi_key) = 38.0; /* o */
145  break;
146  case(XK_0) : (*midi_key) = 39.0; /* 0 */
147  break;
148  case(XK_p) : (*midi_key) = 40.0; /* p */
149  break;
150  case(XK_udiaeresis) : (*midi_key) = 41.0; /* ΓΌ */
151  break;
152  case(XK_plus) : (*midi_key) = 42.0; /* + */
153  break;
154  }
155 }

◆ mk_draw_knob()

void mk_draw_knob ( void *  w_,
void *  user_data 
)

get values for the knob

create a rotating pointer on the kob

show value on the kob

show label below the knob

Definition at line 231 of file xmidi_keyboard.c.

231  {
232  Widget_t *w = (Widget_t*)w_;
233  XWindowAttributes attrs;
234  XGetWindowAttributes(w->app->dpy, (Window)w->widget, &attrs);
235  int width = attrs.width-2;
236  int height = attrs.height-2;
237 
238  const double scale_zero = 20 * (M_PI/180); // defines "dead zone" for knobs
239  int arc_offset = 2;
240  int knob_x = 0;
241  int knob_y = 0;
242 
243  int grow = (width > height) ? height:width;
244  knob_x = grow-1;
245  knob_y = grow-1;
246  /** get values for the knob **/
247 
248  int knobx = (width - knob_x) * 0.5;
249  int knobx1 = width* 0.5;
250 
251  int knoby = (height - knob_y) * 0.5;
252  int knoby1 = height * 0.5;
253 
254  double knobstate = adj_get_state(w->adj_y);
255  double angle = scale_zero + knobstate * 2 * (M_PI - scale_zero);
256 
257  double pointer_off =knob_x/3.5;
258  double radius = min(knob_x-pointer_off, knob_y-pointer_off) / 2;
259  double lengh_x = (knobx+radius+pointer_off/2) - radius * sin(angle);
260  double lengh_y = (knoby+radius+pointer_off/2) + radius * cos(angle);
261  double radius_x = (knobx+radius+pointer_off/2) - radius/ 1.18 * sin(angle);
262  double radius_y = (knoby+radius+pointer_off/2) + radius/ 1.18 * cos(angle);
263  cairo_pattern_t* pat;
264  cairo_new_path (w->crb);
265 
266  pat = cairo_pattern_create_linear (0, 0, 0, knob_y);
267  cairo_pattern_add_color_stop_rgba (pat, 1, 0.3, 0.3, 0.3, 1.0);
268  cairo_pattern_add_color_stop_rgba (pat, 0.75, 0.2, 0.2, 0.2, 1.0);
269  cairo_pattern_add_color_stop_rgba (pat, 0.5, 0.15, 0.15, 0.15, 1.0);
270  cairo_pattern_add_color_stop_rgba (pat, 0.25, 0.1, 0.1, 0.1, 1.0);
271  cairo_pattern_add_color_stop_rgba (pat, 0, 0.05, 0.05, 0.05, 1.0);
272 
273  cairo_scale (w->crb, 0.95, 1.05);
274  cairo_arc(w->crb,knobx1+arc_offset/2, knoby1-arc_offset, knob_x/2.2, 0, 2 * M_PI );
275  cairo_set_source (w->crb, pat);
276  cairo_fill_preserve (w->crb);
277  cairo_set_source_rgb (w->crb, 0.1, 0.1, 0.1);
278  cairo_set_line_width(w->crb,1);
279  cairo_stroke(w->crb);
280  cairo_scale (w->crb, 1.05, 0.95);
281  cairo_new_path (w->crb);
282  cairo_pattern_destroy (pat);
283  pat = NULL;
284 
285  pat = cairo_pattern_create_linear (0, 0, 0, knob_y);
286  cairo_pattern_add_color_stop_rgba (pat, 0, 0.3, 0.3, 0.3, 1.0);
287  cairo_pattern_add_color_stop_rgba (pat, 0.25, 0.2, 0.2, 0.2, 1.0);
288  cairo_pattern_add_color_stop_rgba (pat, 0.5, 0.15, 0.15, 0.15, 1.0);
289  cairo_pattern_add_color_stop_rgba (pat, 0.75, 0.1, 0.1, 0.1, 1.0);
290  cairo_pattern_add_color_stop_rgba (pat, 1, 0.05, 0.05, 0.05, 1.0);
291 
292  cairo_arc(w->crb,knobx1, knoby1, knob_x/2.6, 0, 2 * M_PI );
293  cairo_set_source (w->crb, pat);
294  cairo_fill_preserve (w->crb);
295  cairo_set_source_rgb (w->crb, 0.1, 0.1, 0.1);
296  cairo_set_line_width(w->crb,1);
297  cairo_stroke(w->crb);
298  cairo_new_path (w->crb);
299  cairo_pattern_destroy (pat);
300 
301  /** create a rotating pointer on the kob**/
302  cairo_set_line_cap(w->crb, CAIRO_LINE_CAP_ROUND);
303  cairo_set_line_join(w->crb, CAIRO_LINE_JOIN_BEVEL);
304  cairo_move_to(w->crb, radius_x, radius_y);
305  cairo_line_to(w->crb,lengh_x,lengh_y);
306  cairo_set_line_width(w->crb,3);
307  cairo_set_source_rgb (w->crb,0.63,0.63,0.63);
308  cairo_stroke(w->crb);
309  cairo_new_path (w->crb);
310 
311  cairo_text_extents_t extents;
312  /** show value on the kob**/
313  if (w->state) {
314  char s[64];
315  snprintf(s, 63,"%d", (int) w->adj_y->value);
316  cairo_set_source_rgb (w->crb, 0.6, 0.6, 0.6);
317  cairo_set_font_size (w->crb, knobx1/3);
318  cairo_text_extents(w->crb, s, &extents);
319  cairo_move_to (w->crb, knobx1-extents.width/2, knoby1+extents.height/2);
320  cairo_show_text(w->crb, s);
321  cairo_new_path (w->crb);
322  }
323 
324  /** show label below the knob**/
326  float font_size = ((height/2.2 < (width*0.5)/3) ? height/2.2 : (width*0.5)/3);
327  cairo_set_font_size (w->crb, font_size);
328  cairo_text_extents(w->crb,w->label , &extents);
329 
330  cairo_move_to (w->crb, knobx1-extents.width/2, height );
331  cairo_show_text(w->crb, w->label);
332  cairo_new_path (w->crb);
333 }

References adj_get_state(), Widget_t::adj_y, Widget_t::app, Widget_t::crb, Xputty::dpy, get_color_state(), Widget_t::label, min, Widget_t::state, use_text_color_scheme(), Adjustment_t::value, and Widget_t::widget.

◆ open_midi_keyboard()

Widget_t* open_midi_keyboard ( Widget_t w)

Definition at line 793 of file xmidi_keyboard.c.

793  {
794  Widget_t *wid = create_window(w->app, DefaultRootWindow(w->app->dpy), 0, 0, 700, 200);
795  XSelectInput(wid->app->dpy, wid->widget,StructureNotifyMask|ExposureMask|KeyPressMask
796  |EnterWindowMask|LeaveWindowMask|ButtonReleaseMask|KeyReleaseMask
797  |ButtonPressMask|Button1MotionMask|PointerMotionMask);
798  MidiKeyboard *keys = (MidiKeyboard*)malloc(sizeof(MidiKeyboard));
799  wid->parent_struct = keys;
800  wid->parent = w;
801  wid->flags |= HAS_MEM | NO_AUTOREPEAT;
802  keys->prelight_key = -1;
803  keys->active_key = -1;
804  keys->send_key = -1;
805  keys->octave = 12*2;
806  keys->layout = 0;
807  keys->icon = NULL;
808  int j = 0;
809  for(;j<4;j++) {
810  keys->key_matrix[j] = 0;
811  }
812 
813  wid->func.expose_callback = draw_keyboard;
814  wid->func.motion_callback = keyboard_motion;
815  wid->func.leave_callback = leave_keyboard;
816  wid->func.button_press_callback = button_pressed_keyboard;
817  wid->func.button_release_callback = button_released_keyboard;
818  wid->func.key_press_callback = key_press;
819  wid->func.key_release_callback = key_release;
820  wid->func.mem_free_callback = keyboard_mem_free;
821  wid->func.map_notify_callback = map_keyboard;
822  widget_set_icon_from_png(wid,keys->icon,LDVAR(midikeyboard_png));
823  widget_set_title(wid, "Midi Keyboard");
824  keys->mk_send_note = key_dummy;
825  keys->mk_send_pitch = wheel_dummy;
826  keys->mk_send_pitchsensity = wheel_dummy;
827  keys->mk_send_mod = wheel_dummy;
828  keys->mk_send_detune = wheel_dummy;
829  keys->mk_send_attack = wheel_dummy;
830  keys->mk_send_sustain = wheel_dummy;
831  keys->mk_send_release = wheel_dummy;
832  keys->mk_send_volume = wheel_dummy;
833  keys->mk_send_velocity = wheel_dummy;
834  keys->mk_send_all_sound_off = wheel_dummy;
835 
836  Widget_t *p = add_keyboard_knob(wid, "PitchBend", 5, 0, 60, 75);
837  p->func.value_changed_callback = pitchwheel_callback;
838  keys->pitchwheel = (int)adj_get_value(p->adj);
839 
840  Widget_t *s = add_keyboard_knob(wid, "P.Sensity", 65, 0, 60, 75);
841  s->func.value_changed_callback = pitchsensity_callback;
842  keys->pitchsensity = (int)adj_get_value(s->adj);
843 
844  Widget_t *m = add_keyboard_knob(wid, "ModWheel", 125, 0, 60, 75);
845  m->func.value_changed_callback = modwheel_callback;
846  keys->modwheel = (int)adj_get_value(m->adj);
847 
848  Widget_t *de = add_keyboard_knob(wid, "Detune", 185, 0, 60, 75);
849  de->func.value_changed_callback = detune_callback;
850  keys->detune = (int)adj_get_value(de->adj);
851 
852  Widget_t *at = add_keyboard_knob(wid, "Attack", 245, 0, 60, 75);
853  at->func.value_changed_callback = attack_callback;
854  keys->attack = (int)adj_get_value(at->adj);
855 
856  Widget_t *su = add_keyboard_knob(wid, "Sustain", 305, 0, 60, 75);
857  su->func.value_changed_callback = sustain_callback;
858  keys->sustain = (int)adj_get_value(su->adj);
859 
860  Widget_t *re = add_keyboard_knob(wid, "Release", 365, 0, 60, 75);
861  re->func.value_changed_callback = release_callback;
862  keys->release = (int)adj_get_value(re->adj);
863 
864  Widget_t *v = add_keyboard_knob(wid, "Volume", 425, 0, 60, 75);
865  v->func.value_changed_callback = volume_callback;
866  keys->volume = (int)adj_get_value(v->adj);
867 
868  Widget_t *ve = add_keyboard_knob(wid, "Velocity", 485, 0, 60, 75);
869  set_adjustment(ve->adj,127.0, 127.0, 0.0, 127.0, 1.0, CL_CONTINUOS);
870  ve->func.value_changed_callback = velocity_callback;
871  keys->velocity = (int)adj_get_value(ve->adj);
872 
873  Widget_t *b = add_hslider(wid, "Keyboard mapping", 540, 40, 160, 35);
874  b->flags |= NO_AUTOREPEAT;
875  set_adjustment(b->adj,2.0, 2.0, 0.0, 4.0, 1.0, CL_CONTINUOS);
876  adj_set_scale(b->adj, 0.05);
877  b->func.value_changed_callback = octave_callback;
878 
879  Widget_t *layout = add_combobox(wid, "", 550, 2, 130, 30);
880  layout->flags |= NO_AUTOREPEAT;
881  layout->scale.gravity = ASPECT;
882  combobox_add_entry(layout,"qwertz");
883  combobox_add_entry(layout,"qwerty");
884  combobox_add_entry(layout,"azerty");
885  combobox_set_active_entry(layout, 0);
886  set_adjustment(layout->adj,0.0, 0.0, 0.0, 2.0, 1.0, CL_ENUM);
887  layout->func.value_changed_callback = layout_callback;
888 
889  return wid;
890 }

References MidiKeyboard::active_key, Widget_t::app, create_window(), Xputty::dpy, Func_t::expose_callback, Widget_t::flags, Widget_t::func, HAS_MEM, MidiKeyboard::icon, MidiKeyboard::key_matrix, MidiKeyboard::layout, NO_AUTOREPEAT, MidiKeyboard::octave, Widget_t::parent, Widget_t::parent_struct, MidiKeyboard::prelight_key, MidiKeyboard::send_key, and Widget_t::widget.

use_text_color_scheme
void use_text_color_scheme(Widget_t *w, Color_state st)
use_text_color_scheme - use text Colors to paint on Widget_t
Definition: xcolor.c:199
Func_t::leave_callback
xevfunc leave_callback
Definition: xwidget.h:83
MidiKeyboard::mk_send_volume
midiwheelfunc mk_send_volume
Definition: xmidi_keyboard.h:62
MidiKeyboard::mk_send_detune
midiwheelfunc mk_send_detune
Definition: xmidi_keyboard.h:58
MidiKeyboard::icon
Pixmap * icon
Definition: xmidi_keyboard.h:36
Resize_t::gravity
Gravity gravity
Definition: xwidget.h:192
MidiKeyboard::velocity
int velocity
Definition: xmidi_keyboard.h:46
widget_set_title
void widget_set_title(Widget_t *w, const char *title)
widget_set_title - set window title for a Widget_t
Definition: xwidget.c:387
MidiKeyboard::modwheel
int modwheel
Definition: xmidi_keyboard.h:40
adj_get_state
float adj_get_state(Adjustment_t *adj)
adj_get_state - get the current state of the Adjustment_t
Definition: xadjustment.c:148
Adjustment_t::value
float value
Definition: xadjustment.h:86
MidiKeyboard::mk_send_velocity
midiwheelfunc mk_send_velocity
Definition: xmidi_keyboard.h:63
Widget_t::parent_struct
void * parent_struct
Definition: xwidget.h:306
min
#define min(x, y)
min - set a maximal value (x) as return value
Definition: xputty.h:78
get_color_state
Color_state get_color_state(Widget_t *wid)
get_color_state - get the Color_state to use in relation to the Widget_t state
Definition: xcolor.c:155
combobox_add_entry
Widget_t * combobox_add_entry(Widget_t *wid, const char *label)
combobox_add_entry - add a entry to the combobox
Definition: xcombobox.c:56
CL_ENUM
@ CL_ENUM
Definition: xadjustment.h:55
add_hslider
Widget_t * add_hslider(Widget_t *parent, const char *label, int x, int y, int width, int height)
add_hslider - add a horizontal slider to a Widget_t connect to func.value_changed_callback to impleme...
Definition: xslider.c:41
MidiKeyboard::attack
int attack
Definition: xmidi_keyboard.h:42
MidiKeyboard::detune
int detune
Definition: xmidi_keyboard.h:41
Func_t::key_release_callback
evfunc key_release_callback
Definition: xwidget.h:97
NO_AUTOREPEAT
@ NO_AUTOREPEAT
Definition: xwidget.h:253
Func_t::expose_callback
xevfunc expose_callback
Definition: xwidget.h:80
adj_get_value
float adj_get_value(Adjustment_t *adj)
adj_get_value - get the current value of the Adjustment_t
Definition: xadjustment.c:154
MidiKeyboard::mk_send_all_sound_off
midiwheelfunc mk_send_all_sound_off
Definition: xmidi_keyboard.h:64
keysym_qwertz_to_midi_key
void keysym_qwertz_to_midi_key(long inkey, float *midi_key)
Definition: xmidi_keyboard.c:90
MidiKeyboard::send_key
int send_key
Definition: xmidi_keyboard.h:51
Widget_t::crb
cairo_t * crb
Definition: xwidget.h:318
adj_set_scale
void adj_set_scale(Adjustment_t *adj, float value)
adj_set_scale - internal use to scale the pointer movement (0.1 -1.0)
Definition: xadjustment.c:179
MidiKeyboard::mk_send_release
midiwheelfunc mk_send_release
Definition: xmidi_keyboard.h:61
MidiKeyboard::octave
int octave
Definition: xmidi_keyboard.h:38
Func_t::motion_callback
evfunc motion_callback
Definition: xwidget.h:95
Widget_t::flags
long long flags
Definition: xwidget.h:324
Widget_t::adj
Adjustment_t * adj
Definition: xwidget.h:334
MidiKeyboard::pitchsensity
int pitchsensity
Definition: xmidi_keyboard.h:48
Widget_t::scale
Resize_t scale
Definition: xwidget.h:356
mk_draw_knob
void mk_draw_knob(void *w_, void *user_data)
Definition: xmidi_keyboard.c:231
Func_t::key_press_callback
evfunc key_press_callback
Definition: xwidget.h:96
MidiKeyboard::mk_send_mod
midiwheelfunc mk_send_mod
Definition: xmidi_keyboard.h:57
MidiKeyboard::key_matrix
unsigned long key_matrix[4]
Definition: xmidi_keyboard.h:52
MidiKeyboard
Definition: xmidi_keyboard.h:35
HAS_MEM
@ HAS_MEM
Definition: xwidget.h:251
Widget_t::app
Xputty * app
Definition: xwidget.h:300
MidiKeyboard::mk_send_attack
midiwheelfunc mk_send_attack
Definition: xmidi_keyboard.h:59
Func_t::button_press_callback
evfunc button_press_callback
Definition: xwidget.h:93
Xputty::dpy
Display * dpy
Definition: xputty.h:181
add_keyboard_knob
Widget_t * add_keyboard_knob(Widget_t *parent, const char *label, int x, int y, int width, int height)
Definition: xmidi_keyboard.c:782
MidiKeyboard::sustain
int sustain
Definition: xmidi_keyboard.h:43
Widget_t::state
int state
Definition: xwidget.h:342
MidiKeyboard::release
int release
Definition: xmidi_keyboard.h:44
combobox_set_active_entry
void combobox_set_active_entry(Widget_t *w, int active)
combobox_set_active_entry - set the active combobox entry
Definition: xcombobox.c:25
Func_t::map_notify_callback
xevfunc map_notify_callback
Definition: xwidget.h:89
MidiKeyboard::mk_send_pitchsensity
midiwheelfunc mk_send_pitchsensity
Definition: xmidi_keyboard.h:56
Widget_t::widget
Window widget
Definition: xwidget.h:302
Widget_t
Widget_t - struct to hold the basic Widget_t info.
Definition: xwidget.h:298
ASPECT
@ ASPECT
Definition: xwidget.h:167
LDVAR
#define LDVAR(NAME)
Definition: xpngloader.h:71
Func_t::mem_free_callback
xevfunc mem_free_callback
Definition: xwidget.h:87
MidiKeyboard::mk_send_note
midikeyfunc mk_send_note
Definition: xmidi_keyboard.h:54
Func_t::button_release_callback
evfunc button_release_callback
Definition: xwidget.h:94
create_window
Widget_t * create_window(Xputty *app, Window win, int x, int y, int width, int height)
*create_window - create a Window You need to create as least minimun one Window to get started....
Definition: xwidget.c:145
MidiKeyboard::volume
int volume
Definition: xmidi_keyboard.h:45
set_adjustment
void set_adjustment(Adjustment_t *adj, float std_value, float value, float min_value, float max_value, float step, CL_type type)
*set_adjustment - set a new range to a existing Adjustment_t it will be created if it not exsits yet
Definition: xadjustment.c:80
add_knob
Widget_t * add_knob(Widget_t *parent, const char *label, int x, int y, int width, int height)
add_knob - add a knob to a Widget_t connect to func.value_changed_callback to implement your actions ...
Definition: xknob.c:26
MidiKeyboard::mk_send_sustain
midiwheelfunc mk_send_sustain
Definition: xmidi_keyboard.h:60
MidiKeyboard::prelight_key
int prelight_key
Definition: xmidi_keyboard.h:49
MidiKeyboard::pitchwheel
int pitchwheel
Definition: xmidi_keyboard.h:47
Widget_t::adj_y
Adjustment_t * adj_y
Definition: xwidget.h:332
Widget_t::func
Func_t func
Definition: xwidget.h:310
MidiKeyboard::mk_send_pitch
midiwheelfunc mk_send_pitch
Definition: xmidi_keyboard.h:55
widget_set_icon_from_png
void widget_set_icon_from_png(Widget_t *w, Pixmap *icon_, const unsigned char *name)
widget_set_icon_from_png - set icon image from png binary to Widget_t those icon will be used in the ...
Definition: xpngloader.c:124
MidiKeyboard::layout
int layout
Definition: xmidi_keyboard.h:39
add_combobox
Widget_t * add_combobox(Widget_t *parent, const char *label, int x, int y, int width, int height)
add_combobox - add a combobox
Definition: xcombobox.c:32
MidiKeyboard::active_key
int active_key
Definition: xmidi_keyboard.h:50
Widget_t::parent
void * parent
Definition: xwidget.h:304
Widget_t::label
const char * label
Definition: xwidget.h:326
Func_t::value_changed_callback
xevfunc value_changed_callback
Definition: xwidget.h:85
CL_CONTINUOS
@ CL_CONTINUOS
Definition: xadjustment.h:49