summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorxylosper <darklin20@gmail.com>2015-04-21 00:50:43 +0900
committerxylosper <darklin20@gmail.com>2015-04-21 00:54:29 +0900
commitc64e4e48d97b9af2b241179ee87765e5d17fff95 (patch)
treec6df7a6ef5f2f8955ae14e0956dbd6fa96d5a41a /stream
parentebe2c2b6d19357f73b9fc82de2a47a2aa321e44a (diff)
downloadmpv-c64e4e48d97b9af2b241179ee87765e5d17fff95.tar.bz2
mpv-c64e4e48d97b9af2b241179ee87765e5d17fff95.tar.xz
command: disc-mouse-on-button property
This property indicates whether mouse cursor is located on button or not for disc naviation.
Diffstat (limited to 'stream')
-rw-r--r--stream/discnav.h1
-rw-r--r--stream/stream_bluray.c8
-rw-r--r--stream/stream_dvdnav.c9
3 files changed, 12 insertions, 6 deletions
diff --git a/stream/discnav.h b/stream/discnav.h
index e6a063f8e1..b40998d3cb 100644
--- a/stream/discnav.h
+++ b/stream/discnav.h
@@ -80,6 +80,7 @@ struct mp_nav_cmd {
int x, y;
} mouse_pos;
} u;
+ bool mouse_on_button;
};
#endif /* MPLAYER_STREAM_DVDNAV_H */
diff --git a/stream/stream_bluray.c b/stream/stream_bluray.c
index 1718531ecc..adc2e5828b 100644
--- a/stream/stream_bluray.c
+++ b/stream/stream_bluray.c
@@ -455,7 +455,9 @@ static void handle_nav_command(stream_t *s, struct mp_nav_cmd *ev)
bd_vk_key_e key = translate_nav_menu_action(action);
if (key != BD_VK_NONE) {
if (key == BD_VK_MOUSE_ACTIVATE)
- bd_mouse_select(priv->bd, pts, priv->mousex, priv->mousey);
+ ev->mouse_on_button = bd_mouse_select(priv->bd, pts,
+ priv->mousex,
+ priv->mousey);
bd_user_input(priv->bd, pts, key);
} else if (strcmp(action, "menu") == 0) {
if (priv->popup_enabled)
@@ -467,7 +469,9 @@ static void handle_nav_command(stream_t *s, struct mp_nav_cmd *ev)
} case MP_NAV_CMD_MOUSE_POS:
priv->mousex = ev->u.mouse_pos.x;
priv->mousey = ev->u.mouse_pos.y;
- bd_mouse_select(priv->bd, mp_time_us(), priv->mousex, priv->mousey);
+ ev->mouse_on_button = bd_mouse_select(priv->bd, mp_time_us(),
+ priv->mousex,
+ priv->mousey);
break;
case MP_NAV_CMD_SKIP_STILL:
bd_read_skip_still(priv->bd);
diff --git a/stream/stream_dvdnav.c b/stream/stream_dvdnav.c
index b94187b3ff..095ba98ddf 100644
--- a/stream/stream_dvdnav.c
+++ b/stream/stream_dvdnav.c
@@ -202,18 +202,19 @@ static void handle_menu_input(stream_t *stream, const char *cmd)
}
}
-static void handle_mouse_pos(stream_t *stream, int x, int y)
+static dvdnav_status_t handle_mouse_pos(stream_t *stream, int x, int y)
{
struct priv *priv = stream->priv;
dvdnav_t *nav = priv->dvdnav;
pci_t *pci = dvdnav_get_current_nav_pci(nav);
if (!pci)
- return;
+ return DVDNAV_STATUS_ERR;
- dvdnav_mouse_select(nav, pci, x, y);
+ dvdnav_status_t status = dvdnav_mouse_select(nav, pci, x, y);
priv->mousex = x;
priv->mousey = y;
+ return status;
}
/**
@@ -305,7 +306,7 @@ static void handle_cmd(stream_t *s, struct mp_nav_cmd *ev)
handle_menu_input(s, ev->u.menu.action);
break;
case MP_NAV_CMD_MOUSE_POS:
- handle_mouse_pos(s, ev->u.mouse_pos.x, ev->u.mouse_pos.y);
+ ev->mouse_on_button = handle_mouse_pos(s, ev->u.mouse_pos.x, ev->u.mouse_pos.y);
break;
}