diff -ru dvdauthor-338/src/ifogen.c dvdauthor-338-MAR-patches/src/ifogen.c --- dvdauthor-338/src/ifogen.c Thu Jun 5 22:02:18 2003 +++ dvdauthor-338-MAR-patches/src/ifogen.c Wed Aug 20 13:49:17 2003 @@ -113,6 +113,7 @@ struct button { int x1,y1,x2,y2; + int up,down,left,right; struct commandset cs; }; @@ -779,10 +780,10 @@ buf[0xbb+j*18+3]=(b->y1>>4); buf[0xbb+j*18+4]=(b->y1<<4)|(b->y2>>8); buf[0xbb+j*18+5]=b->y2; - buf[0xbb+j*18+6]=(j==0)?pg->numbuttons:j; - buf[0xbb+j*18+7]=(j+1==pg->numbuttons)?1:j+2; - buf[0xbb+j*18+8]=(j==0)?pg->numbuttons:j; - buf[0xbb+j*18+9]=(j+1==pg->numbuttons)?1:j+2; + buf[0xbb+j*18+6]=(b->up)?b->up:((j==0)?pg->numbuttons:j); + buf[0xbb+j*18+7]=(b->down)?b->down:((j+1==pg->numbuttons)?1:j+2); + buf[0xbb+j*18+8]=(b->left)?b->left:((j==0)?pg->numbuttons:j); + buf[0xbb+j*18+9]=(b->right)?b->right:((j+1==pg->numbuttons)?1:j+2); buf[0xbb+j*18+10]=0x71; // g[0]=j && linktailpgc buf[0xbb+j*18+11]=0x01; buf[0xbb+j*18+15]=j; @@ -2146,12 +2147,45 @@ va->buttons=(struct button *)realloc(va->buttons,(va->numbuttons+1)*sizeof(struct button)); bs=&va->buttons[va->numbuttons++]; + + bs->left=0; + bs->right=0; + bs->up=0; + bs->down=0; + if( 4!=sscanf(b,"%dx%d-%dx%d,",&bs->x1,&bs->y1,&bs->x2,&bs->y2) ) { fprintf(stderr,"ERR: Cannot parse button coordinates: %s\n",b); exit(1); } strsep(&b,","); parsecommandset(&bs->cs,b,ismenu); + while (strsep(&b,","),b) { + switch(b[0]) { + case 'l': + case 'L': + bs->left=strtoul(1+b,NULL,0); + fprintf(stderr,"Set left to %d\n",bs->left); + break; + case 'r': + case 'R': + bs->right=strtoul(1+b,NULL,0); + fprintf(stderr,"Set right to %d\n",bs->right); + break; + case 'u': + case 'U': + bs->up=strtoul(1+b,NULL,0); + fprintf(stderr,"Set up to %d\n",bs->up); + break; + case 'd': + case 'D': + bs->down=strtoul(1+b,NULL,0); + fprintf(stderr,"Set down to %d\n",bs->down); + break; + default: + fprintf(stderr,"ERR: Parsing button [lrud] navigation: %s\n",b); + exit(1); + } + } } void parseinstructions(struct chain *va,char *b,int ismenu) @@ -2370,6 +2404,11 @@ "\t\tfor VTS menus: root, ptt, audio, subtitle, angle\n" "\n\t" BLONG "-b X1xY1-X2xY2,DEST creates a button of the specified size.\n" "\t See " ILONG "-i for a description of DEST.\n" + "\t (Optionally) \n" + "\t\t" BLONG "-b X1xY1-X2xY2,DEST,lL,rR,uU,dD specifies the\n" + "\t\t button that should be selected when the user uses up, down,\n" + "\t\t left, and right controls. No error checking is done. \n" + "\t\t Button numbering starts at 1.\n" "\n\t" ILONG "-i post=DEST executes the DEST instructions at the\n" "\t end of the title. DEST is a plus separated list of the following:\n" "\t\tvtsm[X][.Y] - jump to titleset X, menu Y. Note that currently\n"