comparison highlight.c @ 91:df9712507b30 src

Add a new API function, to allow for more flexible menu button control. The current menu button control code relies on wrong NAV PCI packet information which is out of sync with what is actually being displayed.
author jcdutton
date Wed, 04 Sep 2002 11:41:52 +0000
parents 129ac4af16a4
children 457f35f43ba6
comparison
equal deleted inserted replaced
90:eeabf5a51b2b 91:df9712507b30
408 } 408 }
409 pthread_mutex_unlock(&this->vm_lock); 409 pthread_mutex_unlock(&this->vm_lock);
410 return S_OK; 410 return S_OK;
411 } 411 }
412 412
413 dvdnav_status_t dvdnav_button_activate_cmd(dvdnav_t *this, int32_t button, vm_cmd_t *cmd)
414 {
415 if(!this || !this->vm)
416 return S_ERR;
417 pthread_mutex_lock(&this->vm_lock);
418 /* make the VM execute the appropriate code and
419 * schedule a jump */
420 #ifdef BUTTON_TESTING
421 fprintf(MSG_OUT, "libdvdnav:dvdnav_button_activate_cmd: Evaluating Button Activation commands.\n");
422 #endif
423 if(button > 0) {
424 printerrf("Select button number %i\n ",
425 button);
426 this->vm->state.HL_BTNN_REG = (button << 10);
427 if( (vm_eval_cmd(this->vm, cmd)) == 1) {
428 /* Command caused a jump */
429 this->vm->hop_channel++;
430 }
431 }
432 /* Always remove still, because some still menus have no buttons. */
433 this->position_current.still = 0;
434 pthread_mutex_unlock(&this->vm_lock);
435 return S_OK;
436 }
437
413 dvdnav_status_t dvdnav_button_select(dvdnav_t *this, int button) { 438 dvdnav_status_t dvdnav_button_select(dvdnav_t *this, int button) {
414 439
415 if(!this) { 440 if(!this) {
416 printerrf("Unable to select button number %i as this state bad", 441 printerrf("Unable to select button number %i as this state bad",
417 button); 442 button);