Ticket #11291: 0001-Use-the-right-highlight-area-in-DVD-menus-when-wide-.patch
File 0001-Use-the-right-highlight-area-in-DVD-menus-when-wide-.patch, 5.2 KB (added by , 11 years ago) |
---|
-
mythtv/libs/libmythdvdnav/dvdnav/dvd_types.h
From e01f8ca44e63c4958c4424c0ac758d5ead1cd889 Mon Sep 17 00:00:00 2001 From: Richard <peper03@yahoo.com> Date: Fri, 14 Dec 2012 20:59:53 +0100 Subject: [PATCH] Use the right highlight area in DVD menus when 'wide' is not the first in the list. --- mythtv/libs/libmythdvdnav/dvdnav/dvd_types.h | 11 +++++ mythtv/libs/libmythdvdnav/dvdnav/dvdnav.h | 7 +++ mythtv/libs/libmythdvdnav/dvdnav/highlight.c | 60 ++++++++++++++++++++++++++ mythtv/libs/libmythtv/DVD/dvdringbuffer.cpp | 2 +- 4 files changed, 79 insertions(+), 1 deletion(-) diff --git a/mythtv/libs/libmythdvdnav/dvdnav/dvd_types.h b/mythtv/libs/libmythdvdnav/dvdnav/dvd_types.h index 08b46d3..abef8e6 100644
a b typedef struct { 57 57 uint32_t buttonN; 58 58 } dvdnav_highlight_area_t; 59 59 60 /* 61 * Button groups to identify the correct highlight areas 62 * (see dvdnav_get_highlight_area_with_group()) 63 */ 64 typedef enum { 65 DVD_BTN_GRP_Normal = 0x00, 66 DVD_BTN_GRP_Wide = 0x01, 67 DVD_BTN_GRP_Letterbox = 0x02, 68 DVD_BTN_GRP_PanScan = 0x04 69 } DVDBtnGrp_t; 70 60 71 61 72 /* the following types are currently unused */ 62 73 -
mythtv/libs/libmythdvdnav/dvdnav/dvdnav.h
diff --git a/mythtv/libs/libmythdvdnav/dvdnav/dvdnav.h b/mythtv/libs/libmythdvdnav/dvdnav/dvdnav.h index f45f895..bcc1d48 100644
a b dvdnav_status_t dvdnav_get_highlight_area(pci_t *nav_pci , int32_t button, int32 481 481 dvdnav_highlight_area_t *highlight); 482 482 483 483 /* 484 * Get the area associated with a certain button in the given 485 * button group. 486 */ 487 dvdnav_status_t dvdnav_get_highlight_area_from_group(pci_t *nav_pci, DVDBtnGrp_t group, 488 int32_t button, int32_t mode, dvdnav_highlight_area_t *highlight); 489 490 /* 484 491 * Move button highlight around as suggested by function name (e.g. with arrow keys). 485 492 */ 486 493 dvdnav_status_t dvdnav_upper_button_select(dvdnav_t *self, pci_t *pci); -
mythtv/libs/libmythdvdnav/dvdnav/highlight.c
diff --git a/mythtv/libs/libmythdvdnav/dvdnav/highlight.c b/mythtv/libs/libmythdvdnav/dvdnav/highlight.c index f484357..0f2efd2 100644
a b dvdnav_status_t dvdnav_get_highlight_area(pci_t *nav_pci , int32_t button, int32 325 325 return DVDNAV_STATUS_OK; 326 326 } 327 327 328 dvdnav_status_t dvdnav_get_highlight_area_from_group(pci_t *nav_pci, DVDBtnGrp_t group, 329 int32_t button, int32_t mode, dvdnav_highlight_area_t *highlight) { 330 btni_t *button_ptr; 331 unsigned int mask = (unsigned int)group; 332 int grpstart; 333 int maxbtns; 334 335 #ifdef BUTTON_TESTING 336 fprintf(MSG_OUT, "libdvdnav: Button dvdnav_get_highlight_area_from_group %i,%i\n", button, group); 337 #endif 338 339 if(!nav_pci->hli.hl_gi.hli_ss) 340 return DVDNAV_STATUS_ERR; 341 if((button <= 0) || (button > nav_pci->hli.hl_gi.btn_ns) || (nav_pci->hli.hl_gi.btngr_ns <= 0)) 342 return DVDNAV_STATUS_ERR; 343 344 if(group == DVD_BTN_GRP_Normal) { 345 mask = 0xFFFFFFFF; 346 } 347 348 /* 36 buttons in total are spread over the number 349 * of button groups. Find out how many buttons we 350 * have in each group 351 */ 352 maxbtns = (36 / nav_pci->hli.hl_gi.btngr_ns); 353 354 if((nav_pci->hli.hl_gi.btngr1_dsp_ty & mask) == group) { 355 grpstart = 0; 356 } else if((nav_pci->hli.hl_gi.btngr_ns > 1) && ((nav_pci->hli.hl_gi.btngr2_dsp_ty & mask) == group)) { 357 grpstart = maxbtns; 358 } else if((nav_pci->hli.hl_gi.btngr_ns > 2) && ((nav_pci->hli.hl_gi.btngr3_dsp_ty & mask) == group)) { 359 grpstart = maxbtns * 2; 360 } else { 361 grpstart = 0; 362 } 363 364 button_ptr = &nav_pci->hli.btnit[grpstart+button-1]; 365 366 highlight->sx = button_ptr->x_start; 367 highlight->sy = button_ptr->y_start; 368 highlight->ex = button_ptr->x_end; 369 highlight->ey = button_ptr->y_end; 370 if(button_ptr->btn_coln != 0) { 371 highlight->palette = nav_pci->hli.btn_colit.btn_coli[button_ptr->btn_coln-1][mode]; 372 } else { 373 highlight->palette = 0; 374 } 375 highlight->pts = nav_pci->hli.hl_gi.hli_s_ptm; 376 highlight->buttonN = button; 377 #ifdef BUTTON_TESTING 378 fprintf(MSG_OUT, "libdvdnav: highlight: Highlight area is (%u,%u)-(%u,%u), display = %i, button = %u, groupmask = %i\n", 379 button_ptr->x_start, button_ptr->y_start, 380 button_ptr->x_end, button_ptr->y_end, 381 1, group, 382 button); 383 #endif 384 385 return DVDNAV_STATUS_OK; 386 } 387 328 388 dvdnav_status_t dvdnav_button_activate(dvdnav_t *this, pci_t *pci) { 329 389 int32_t button; 330 390 btni_t *button_ptr = NULL; -
mythtv/libs/libmythtv/DVD/dvdringbuffer.cpp
diff --git a/mythtv/libs/libmythtv/DVD/dvdringbuffer.cpp b/mythtv/libs/libmythtv/DVD/dvdringbuffer.cpp index e14296a..8e4a7ca 100644
a b bool DVDRingBuffer::DVDButtonUpdate(bool b_mode) 1476 1476 dvdnav_highlight_area_t hl; 1477 1477 dvdnav_get_current_highlight(m_dvdnav, &button); 1478 1478 pci = dvdnav_get_current_nav_pci(m_dvdnav); 1479 dvdRet = dvdnav_get_highlight_area (pci, button, b_mode, &hl);1479 dvdRet = dvdnav_get_highlight_area_from_group(pci, DVD_BTN_GRP_Wide, button, b_mode, &hl); 1480 1480 1481 1481 if (dvdRet == DVDNAV_STATUS_ERR) 1482 1482 return false;