xraydemo: isolate avi/text

pull/217/head
nick black 5 years ago
parent 53efe2bd1f
commit ca5e14cdad
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -22,8 +22,7 @@ perframecb(struct notcurses* nc, struct ncvisual* ncv __attribute__ ((unused))){
int dimx, dimy;
struct ncplane* n = notcurses_stdplane(nc);
ncplane_dim_yx(n, &dimy, &dimx);
ncplane_putsimple_yx(n, 0, 0, 'a');
int y = dimy - sizeof(leg) / sizeof(*leg) - 3;
int y = dimy - sizeof(leg) / sizeof(*leg);
int x = dimx - frameno;
for(size_t l = 0 ; l < sizeof(leg) / sizeof(*leg) ; ++l, ++y){
int r = startr;
@ -71,7 +70,14 @@ perframecb(struct notcurses* nc, struct ncvisual* ncv __attribute__ ((unused))){
}
int xray_demo(struct notcurses* nc){
struct ncplane* n = notcurses_stdplane(nc);
int dimx, dimy;
struct ncplane* nstd = notcurses_stdplane(nc);
ncplane_dim_yx(nstd, &dimy, &dimx);
dimy -= sizeof(leg) / sizeof(*leg);
struct ncplane* n = notcurses_newplane(nc, dimy, dimx, 0, 0, NULL);
if(n == NULL){
return -1;
}
char* path = find_data("notcursesI.avi");
int averr;
struct ncvisual* ncv = ncplane_visual_open(n, path, &averr);
@ -83,5 +89,6 @@ int xray_demo(struct notcurses* nc){
}
ncvisual_stream(nc, ncv, &averr, perframecb);
ncvisual_destroy(ncv);
ncplane_destroy(n);
return 0;
}

@ -1586,7 +1586,7 @@ ncplane* ncplane_below(ncplane* n){
#define SET_SGR_MODE_MOUSE "1006"
int notcurses_mouse_enable(notcurses* n){
return term_emit("mouse", ESC "[?" SET_BTN_EVENT_MOUSE ";"
SET_FOCUS_EVENT_MOUSE ";" SET_SGR_MODE_MOUSE "h",
/*SET_FOCUS_EVENT_MOUSE ";" */SET_SGR_MODE_MOUSE "h",
n->ttyfp, true);
}
@ -1594,6 +1594,6 @@ int notcurses_mouse_enable(notcurses* n){
// the sequences 1000 etc?
int notcurses_mouse_disable(notcurses* n){
return term_emit("mouse", ESC "[?" SET_BTN_EVENT_MOUSE ";"
SET_FOCUS_EVENT_MOUSE ";" SET_SGR_MODE_MOUSE "l",
/*SET_FOCUS_EVENT_MOUSE ";" */SET_SGR_MODE_MOUSE "l",
n->ttyfp, true);
}

Loading…
Cancel
Save