--- cui_midi.c- Fri Apr 25 22:00:00 2014 +++ cui_midi.c Sat Apr 26 23:00:00 2014 @@ -184,11 +184,9 @@ main(int ac, char **av) { int init_ret = cui_init(av); - cui root = cui_scpanel_new(NULL, 0, 0, 30, 10, "cui_midi"); - cui_scpanel scp = (cui_scpanel)root; - cui bs4 = cui_base_new(scp->view, 1, 1, 0, 0); + cui root = cui_scpanel_new(NULL, 0, 0, 45, 11, "cui_midi"); + cui bs4 = cui_scpanel_sheet_get(root); struct test4 t4; - cui obj; int div = 96; int i; @@ -198,38 +196,41 @@ t4.ch[i].prog = 0; t4.ch[i].vol = 0; t4.ch[i].velo = 64; - t4.ch[i].kbd = cui_kbd_new(bs4, 0, 8, 50); - cui_hide(t4.ch[i].kbd); - cui_bind(t4.ch[i].kbd, CUI_EVT_BUTTON, t4_btn_hdr, &t4); t4.ch[i].pmode = 0; t4.ch[i].msec = 200; t4.ch[i].arpe_note = -1; } - obj = cui_label_new(bs4, 0, 0, "midi ch : "); - t4.mn_ch = cui_menu_int_new(bs4, cui_x2(obj), obj->y, 2+1, 0, 0, 15); + t4.mn_ch = cui_menu_int_new(bs4, 0, 0, 2+1, 0, 0, 15); + cui_wlb_name_new(bs4, "ch ", NULL, NULL); cui_menu_int_vp_set(t4.mn_ch, &t4.midi_ch); - obj = cui_label_new(bs4, 2, cui_y2(t4.mn_ch)+1, "prog num "); - t4.prog = cui_num_new(bs4, cui_x2(obj), obj->y, 3+3, 0, 0, 127, 0); + t4.prog = cui_num_new(bs4, CUI_CHILD_X, CUI_CHILD_Y2+1, 3+3, 0, 0, 127, 0); + cui_wlb_name_new(bs4, "prog ", NULL, NULL); - obj = cui_label_new(bs4, 2, cui_y2(t4.prog)+1, "vol (msb) "); - t4.vol = cui_num_new(bs4, cui_x2(obj), obj->y, 3+3, 0, 0, 127, 0); + t4.vol = cui_num_new(bs4, CUI_CHILD_X2+2, CUI_CHILD_Y, 3+3, 0, 0, 127, 0); + cui_wlb_name_new(bs4, "vol (msb) ", NULL, NULL); - obj = cui_label_new(bs4, 2, cui_y2(t4.vol)+1, "velo "); - t4.velo = cui_num_new(bs4, cui_x2(obj), obj->y, 3+3, 0, 0, 127, 0); + t4.velo = cui_num_new(bs4, CUI_CHILD_X2+2, CUI_CHILD_Y, 3+3, 0, 0, 127, 0); + cui_wlb_name_new(bs4, "velo ", NULL, NULL); - t4.pmode = cui_menu_popup_new(bs4, 2, cui_y2(t4.ch[0].kbd)+1, 9+1, + for(i=0; i<16; i++){ + t4.ch[i].kbd = cui_kbd_new(bs4, 0, cui_y2(t4.velo->parent)+1, 40); + cui_hide(t4.ch[i].kbd); + cui_bind(t4.ch[i].kbd, CUI_EVT_BUTTON, t4_btn_hdr, &t4); + } + + t4.pmode = cui_menu_popup_new(bs4, 0, CUI_CHILD_Y2+1, 9+1, (char *[]){ "Immediate", "Chord", "Arpeggio", NULL}, 0); - t4.on = cui_ckbox_new(bs4, cui_x2(t4.pmode)+2, t4.pmode->y, "ON", FALSE); + t4.on = cui_ckbox_new(bs4, CUI_CHILD_X2+2, CUI_CHILD_Y, "ON", FALSE); cui_hide(t4.on); - t4.msec = cui_num_new(bs4, cui_x2(t4.pmode)+2, t4.pmode->y, 4+3, 200, 0, 1000, 0); + t4.msec = cui_num_new(bs4, CUI_CHILD_X, CUI_CHILD_Y, 4+3, 200, 0, 1000, 0); cui_hide(t4.msec); - t4.play = cui_button_new(bs4, cui_x2(t4.msec)+2, t4.msec->y, "play"); + t4.play = cui_button_new(bs4, CUI_CHILD_X2+2, CUI_CHILD_Y, "play"); cui_hide(t4.play); - t4.repeat = cui_ckbox_new(bs4, cui_x2(t4.play)+2, t4.play->y, "repeat", FALSE); + t4.repeat = cui_ckbox_new(bs4, CUI_CHILD_X2+2, CUI_CHILD_Y, "repeat", FALSE); cui_hide(t4.repeat); cui_wh_fit(bs4); @@ -245,11 +246,6 @@ cui_bind(t4.repeat, CUI_EVT_TIMER, repeat_hdr, &t4); cui_handler_call(t4.mn_ch, CUI_EVT_BUTTON, cui_menu_int_get(t4.mn_ch)); - - cui_wh_fit(scp->view); - - cui_wh_set(root, scp->view->w+3, scp->view->h+3); - cui_xy_set(scp->rszbox, root->w-1, root->h-1); fp = stdout;