Commit d71fb09f authored by hpi1's avatar hpi1

Added return value for bd_user_input() and bd_mouse_select()

parent e93aa914
......@@ -1986,18 +1986,22 @@ int bd_menu_call(BLURAY *bd, int64_t pts)
return _play_title(bd, BLURAY_TITLE_TOP_MENU);
}
static void _run_gc(BLURAY *bd, gc_ctrl_e msg, uint32_t param)
static int _run_gc(BLURAY *bd, gc_ctrl_e msg, uint32_t param)
{
int result = -1;
if (bd && bd->graphics_controller && bd->hdmv_vm) {
GC_NAV_CMDS cmds = {-1, NULL, -1};
gc_run(bd->graphics_controller, msg, param, &cmds);
result = gc_run(bd->graphics_controller, msg, param, &cmds);
if (cmds.num_nav_cmds > 0) {
hdmv_vm_set_object(bd->hdmv_vm, cmds.num_nav_cmds, cmds.nav_cmds);
bd->hdmv_suspended = !hdmv_vm_running(bd->hdmv_vm);
}
}
return result;
}
static void _process_hdmv_vm_event(BLURAY *bd, HDMV_EVENT *hev)
......@@ -2148,22 +2152,22 @@ int bd_get_event(BLURAY *bd, BD_EVENT *event)
* user interaction
*/
void bd_mouse_select(BLURAY *bd, int64_t pts, uint16_t x, uint16_t y)
int bd_mouse_select(BLURAY *bd, int64_t pts, uint16_t x, uint16_t y)
{
if (pts >= 0) {
bd_psr_write(bd->regs, PSR_TIME, (uint32_t)(((uint64_t)pts) >> 1));
}
_run_gc(bd, GC_CTRL_MOUSE_MOVE, (x << 16) | y);
return _run_gc(bd, GC_CTRL_MOUSE_MOVE, (x << 16) | y);
}
void bd_user_input(BLURAY *bd, int64_t pts, uint32_t key)
int bd_user_input(BLURAY *bd, int64_t pts, uint32_t key)
{
if (pts >= 0) {
bd_psr_write(bd->regs, PSR_TIME, (uint32_t)(((uint64_t)pts) >> 1));
}
_run_gc(bd, GC_CTRL_VK_KEY, key);
return _run_gc(bd, GC_CTRL_VK_KEY, key);
}
void bd_register_overlay_proc(BLURAY *bd, void *handle, bd_overlay_proc_f func)
......@@ -2179,6 +2183,10 @@ void bd_register_overlay_proc(BLURAY *bd, void *handle, bd_overlay_proc_f func)
}
}
/*
*
*/
struct meta_dl *bd_get_meta(BLURAY *bd)
{
if (!bd) {
......
......@@ -523,7 +523,7 @@ int bd_get_event(BLURAY *bd, BD_EVENT *event);
/**
*
* Start playing disc in navigation mode.
* Start playing disc in navigation mode (using on-disc menus).
*
* Playback is started from "First Play" title.
*
......@@ -599,9 +599,9 @@ void bd_register_overlay_proc(BLURAY *bd, void *handle, bd_overlay_proc_f func);
* @param bd BLURAY object
* @param pts current playback position (1/90000s) or -1
* @param key input key
* @return 1 on success, 0 if error
* @return <0 on error, 0 on success, >0 if selection/activation changed
*/
void bd_user_input(BLURAY *bd, int64_t pts, uint32_t key);
int bd_user_input(BLURAY *bd, int64_t pts, uint32_t key);
/**
*
......@@ -611,9 +611,13 @@ void bd_user_input(BLURAY *bd, int64_t pts, uint32_t key);
* @param pts current playback position (1/90000s) or -1
* @param x mouse pointer x-position
* @param y mouse pointer y-position
* @return none
* @return <0 on error, 0 when mouse is outside of buttons, 1 when mouse is inside button
*/
int bd_mouse_select(BLURAY *bd, int64_t pts, uint16_t x, uint16_t y);
/*
*
*/
void bd_mouse_select(BLURAY *bd, int64_t pts, uint16_t x, uint16_t y);
struct meta_dl;
/**
......
......@@ -821,7 +821,7 @@ static int _mouse_move(GRAPHICS_CONTROLLER *gc, unsigned x, unsigned y, GC_NAV_C
/* is button already selected? */
if (button->id == cur_btn_id) {
return 0;
return 1;
}
new_btn_id = button->id;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment