Skip to content

Commit

Permalink
[xbmc][dvdnav] expose dvdnav_get_vm, dvdnav_get_button_info, dvdnav_free
Browse files Browse the repository at this point in the history
  • Loading branch information
Voyager1 committed Feb 14, 2016
1 parent 918471a commit 8305696
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
52 changes: 52 additions & 0 deletions src/dvdnav.c
Expand Up @@ -1273,3 +1273,55 @@ user_ops_t dvdnav_get_restrictions(dvdnav_t* this) {

return ops.ops_struct;
}

#ifdef _XBMC

vm_t* dvdnav_get_vm(dvdnav_t *this) {
if (!this) return 0;
return this->vm;
}

/* return the alpha and color for the current active button
* color, alpha [0][] = selection
* color, alpha = color
*
* argsize = [2][4]
*/
int dvdnav_get_button_info(dvdnav_t* this, int alpha[2][4], int color[2][4])
{
int current_button, current_button_color, i;
pci_t* pci;

if (!this) return -1;

pci = dvdnav_get_current_nav_pci(this);
if (!pci) return -1;

dvdnav_get_current_highlight(this, &current_button);
current_button_color = pci->hli.btnit[current_button - 1].btn_coln;

for (i = 0; i < 2; i++)
{
alpha[i][0] = pci->hli.btn_colit.btn_coli[current_button_color - 1][i] >> 0 & 0xf;
alpha[i][1] = pci->hli.btn_colit.btn_coli[current_button_color - 1][i] >> 4 & 0xf;
alpha[i][2] = pci->hli.btn_colit.btn_coli[current_button_color - 1][i] >> 8 & 0xf;
alpha[i][3] = pci->hli.btn_colit.btn_coli[current_button_color - 1][i] >> 12 & 0xf;

color[i][0] = pci->hli.btn_colit.btn_coli[current_button_color - 1][i] >> 16 & 0xf;
color[i][1] = pci->hli.btn_colit.btn_coli[current_button_color - 1][i] >> 20 & 0xf;
color[i][2] = pci->hli.btn_colit.btn_coli[current_button_color - 1][i] >> 24 & 0xf;
color[i][3] = pci->hli.btn_colit.btn_coli[current_button_color - 1][i] >> 28 & 0xf;
}

return 0;
}

void dvdnav_free(void* pdata)
{
free(pdata);
}

#undef printerr
#define printerr(str) strncpy(self->err_str, str, MAX_ERR_LEN);

#endif // _XBMC
1 change: 1 addition & 0 deletions src/dvdnav/dvdnav.h
Expand Up @@ -699,6 +699,7 @@ int8_t dvdnav_is_domain_vtsm(dvdnav_t *self);
*/
int8_t dvdnav_is_domain_vts(dvdnav_t *self);

void dvdnav_free(void* pdata);

#ifdef __cplusplus
}
Expand Down

0 comments on commit 8305696

Please sign in to comment.