[vlc-devel] [PATCH] lib: add libvlc_media_player_set_mouse_hide_timeout

Mark Lee mark.lee at capricasoftware.co.uk
Fri Mar 6 20:09:18 CET 2015


This API sets the timeout period when hiding the mouse pointer for
a media player.
---
 NEWS                              | 2 ++
 include/vlc/libvlc_media_player.h | 9 +++++++++
 lib/libvlc.sym                    | 1 +
 lib/media_player.c                | 7 +++++++
 4 files changed, 19 insertions(+)

diff --git a/NEWS b/NEWS
index d4ab982..15fdcaa 100644
--- a/NEWS
+++ b/NEWS
@@ -95,6 +95,8 @@ libVLC:
  * Add libvlc_media_parse_with_options that uses a flag to specify parse options
  * Add libvlc_audio_output_device_get to get the currently selected audio output device
    identifier (if there is one available)
+ * Add libvlc_media_player_set_mouse_hide_timeout to set the delay before auto-hiding the
+   mouse pointer
 
 Logging
  * Support for the SystemD Journal
diff --git a/include/vlc/libvlc_media_player.h b/include/vlc/libvlc_media_player.h
index 3f9441c..b7fc7be 100644
--- a/include/vlc/libvlc_media_player.h
+++ b/include/vlc/libvlc_media_player.h
@@ -1896,6 +1896,15 @@ LIBVLC_API int libvlc_media_player_set_equalizer( libvlc_media_player_t *p_mi, l
 
 /** @} audio */
 
+/**
+ * Set the timeout before hiding the mouse pointer when video is playing.
+ *
+ * \param p_mi opaque media player handle
+ * \param u_timeout timeout value in milliseconds
+ * \version LibVLC 3.0.0 or later
+ */
+LIBVLC_API void libvlc_media_player_set_mouse_hide_timeout( libvlc_media_player_t *p_mi, unsigned u_timeout );
+
 /** @} media_player */
 
 # ifdef __cplusplus
diff --git a/lib/libvlc.sym b/lib/libvlc.sym
index 4fd2378..a6f72ba 100644
--- a/lib/libvlc.sym
+++ b/lib/libvlc.sym
@@ -164,6 +164,7 @@ libvlc_media_player_is_playing
 libvlc_media_player_new
 libvlc_media_player_new_from_media
 libvlc_media_player_next_chapter
+libvlc_media_player_set_mouse_hide_timeout
 libvlc_media_player_set_pause
 libvlc_media_player_pause
 libvlc_media_player_play
diff --git a/lib/media_player.c b/lib/media_player.c
index b41d6f3..64416a4 100644
--- a/lib/media_player.c
+++ b/lib/media_player.c
@@ -521,6 +521,8 @@ libvlc_media_player_new( libvlc_instance_t *instance )
     var_Create (mp, "mouse-events", VLC_VAR_BOOL);
     var_SetBool (mp, "mouse-events", true);
 
+    var_Create (mp, "mouse-hide-timeout", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT);
+
     var_Create (mp, "fullscreen", VLC_VAR_BOOL);
     var_Create (mp, "autoscale", VLC_VAR_BOOL | VLC_VAR_DOINHERIT);
     var_Create (mp, "zoom", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT);
@@ -1637,3 +1639,8 @@ int libvlc_media_player_set_equalizer( libvlc_media_player_t *p_mi, libvlc_equal
 
     return 0;
 }
+
+libvlc_media_player_set_mouse_hide_timeout( libvlc_media_player_t *p_mi, unsigned u_timeout )
+{
+    var_SetInteger( p_mi, "mouse-hide-timeout", u_timeout );
+}
-- 
2.1.0




More information about the vlc-devel mailing list