[MPlayer-cvslog] r19857 - in trunk: mplayer.c stream/stream_dvdnav.c stream/stream_dvdnav.h

nicodvb subversion at mplayerhq.hu
Sat Sep 16 17:25:31 CEST 2006


Author: nicodvb
Date: Sat Sep 16 17:25:31 2006
New Revision: 19857

Modified:
   trunk/mplayer.c
   trunk/stream/stream_dvdnav.c
   trunk/stream/stream_dvdnav.h

Log:
report mouse coordinates after movement to dvdnav; this permits to enable button selection using the mouse; patch by Jonas Jermann and me

Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	(original)
+++ trunk/mplayer.c	Sat Sep 16 17:25:31 2006
@@ -5157,6 +5157,13 @@
         pointer_x = cmd->args[0].v.i;
         pointer_y = cmd->args[1].v.i;
         rescale_input_coordinates(pointer_x, pointer_y, &dx, &dy);
+#ifdef USE_DVDNAV
+        if(stream->type == STREAMTYPE_DVDNAV && dx > 0.0 && dy > 0.0) {
+            pointer_x = (int) (dx * (double) sh_video->disp_w);
+            pointer_y = (int) (dy * (double) sh_video->disp_h);
+            mp_dvdnav_update_mouse_pos(stream, pointer_x, pointer_y, &button);
+        }
+#endif
         break;
     }
 #ifdef USE_DVDNAV

Modified: trunk/stream/stream_dvdnav.c
==============================================================================
--- trunk/stream/stream_dvdnav.c	(original)
+++ trunk/stream/stream_dvdnav.c	Sat Sep 16 17:25:31 2006
@@ -481,6 +481,20 @@
   return reset;
 }
 
+void mp_dvdnav_update_mouse_pos(stream_t *stream, int32_t x, int32_t y, int* button) {
+  dvdnav_priv_t * dvdnav_priv=(dvdnav_priv_t*)stream->priv;
+  dvdnav_t *nav = dvdnav_priv->dvdnav;
+  dvdnav_status_t status;
+  pci_t *pci = dvdnav_get_current_nav_pci(nav);
+
+  if(!pci) return;
+
+  status = dvdnav_mouse_select(nav, pci, x, y);
+  if(status == DVDNAV_STATUS_OK) dvdnav_get_current_highlight(nav, button);
+  else *button = -1;
+}
+
+
 stream_info_t stream_info_dvdnav = {
   "DVDNAV stream",
   "null",

Modified: trunk/stream/stream_dvdnav.h
==============================================================================
--- trunk/stream/stream_dvdnav.h	(original)
+++ trunk/stream/stream_dvdnav.h	Sat Sep 16 17:25:31 2006
@@ -44,5 +44,6 @@
 void dvdnav_stream_fullstart(dvdnav_priv_t *dvdnav_priv);
 unsigned int * dvdnav_stream_get_palette(dvdnav_priv_t * dvdnav_priv);
 int mp_dvdnav_handle_input(stream_t *stream, int cmd, int *button);
+void mp_dvdnav_update_mouse_pos(stream_t *stream, int32_t x, int32_t y, int* button);
 
 #endif



More information about the MPlayer-cvslog mailing list