[vlc-commits] Added 'Boss Key' support to the core.

Laurent Aimar git at videolan.org
Mon Sep 5 23:13:12 CEST 2011


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Mon Sep  5 21:58:50 2011 +0200| [1fde8b5a14cc72dbbc433b64471940fd99ef3e07] | committer: Laurent Aimar

Added 'Boss Key' support to the core.

The interfaces that want to implement it can now add a callback on
libvlc::intf-boss.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1fde8b5a14cc72dbbc433b64471940fd99ef3e07
---

 include/vlc_keys.h        |    1 +
 modules/control/hotkeys.c |    4 ++++
 src/config/keys.c         |    1 +
 src/libvlc-module.c       |    6 ++++++
 src/libvlc.c              |    3 +++
 5 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/include/vlc_keys.h b/include/vlc_keys.h
index ca394fd..b95b8c8 100644
--- a/include/vlc_keys.h
+++ b/include/vlc_keys.h
@@ -149,6 +149,7 @@ typedef enum vlc_action {
     ACTIONID_SUBTITLE_TRACK,
     ACTIONID_INTF_SHOW,
     ACTIONID_INTF_HIDE,
+    ACTIONID_INTF_BOSS,
     /* chapter and title navigation */
     ACTIONID_TITLE_PREV,
     ACTIONID_TITLE_NEXT,
diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c
index b7d1725..9919bba 100644
--- a/modules/control/hotkeys.c
+++ b/modules/control/hotkeys.c
@@ -226,6 +226,10 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
             var_SetBool( p_intf->p_libvlc, "intf-show", false );
             break;
 
+        case ACTIONID_INTF_BOSS:
+            var_TriggerCallback( p_intf->p_libvlc, "intf-boss" );
+            break;
+
         /* Video Output actions */
         case ACTIONID_SNAPSHOT:
             if( p_vout )
diff --git a/src/config/keys.c b/src/config/keys.c
index a03ff46..dd91d51 100644
--- a/src/config/keys.c
+++ b/src/config/keys.c
@@ -254,6 +254,7 @@ static const struct action actions[] =
     { "faster", ACTIONID_FASTER, },
     { "frame-next", ACTIONID_FRAME_NEXT, },
     { "incr-scalefactor", ACTIONID_SCALE_UP, },
+    { "intf-boss", ACTIONID_INTF_BOSS, },
     { "intf-hide", ACTIONID_INTF_HIDE, },
     { "intf-show", ACTIONID_INTF_SHOW, },
     { "jump+extrashort", ACTIONID_JUMP_FORWARD_EXTRASHORT, },
diff --git a/src/libvlc-module.c b/src/libvlc-module.c
index f454e1d..b104b62 100644
--- a/src/libvlc-module.c
+++ b/src/libvlc-module.c
@@ -1474,6 +1474,8 @@ static const char *const ppsz_albumart_descriptions[] =
 #define INTF_SHOW_KEY_LONGTEXT N_("Raise the interface above all other windows.")
 #define INTF_HIDE_KEY_TEXT N_("Hide interface")
 #define INTF_HIDE_KEY_LONGTEXT N_("Lower the interface below all other windows.")
+#define INTF_BOSS_KEY_TEXT N_("Boss key")
+#define INTF_BOSS_KEY_LONGTEXT N_("Hide the interface and pause playback.")
 #define SNAP_KEY_TEXT N_("Take video snapshot")
 #define SNAP_KEY_LONGTEXT N_("Takes a video snapshot and writes it to disk.")
 
@@ -2277,6 +2279,7 @@ vlc_module_begin ()
 #   define KEY_DEINTERLACE        "d"
 #   define KEY_INTF_SHOW          "i"
 #   define KEY_INTF_HIDE          "Shift+i"
+#   define KEY_INTF_BOSS          NULL
 #   define KEY_DISC_MENU          "Ctrl+m"
 #   define KEY_TITLE_PREV         "Ctrl+p"
 #   define KEY_TITLE_NEXT         "Ctrl+n"
@@ -2394,6 +2397,7 @@ vlc_module_begin ()
 #   define KEY_DEINTERLACE        "d"
 #   define KEY_INTF_SHOW          "i"
 #   define KEY_INTF_HIDE          "Shift+i"
+#   define KEY_INTF_BOSS          NULL
 #   define KEY_DISC_MENU          "Shift+m"
 #   define KEY_TITLE_PREV         "Shift+o"
 #   define KEY_TITLE_NEXT         "Shift+b"
@@ -2567,6 +2571,8 @@ vlc_module_begin ()
              INTF_SHOW_KEY_TEXT, INTF_SHOW_KEY_LONGTEXT, true )
     add_key( "key-intf-hide", KEY_INTF_HIDE,
              INTF_HIDE_KEY_TEXT, INTF_HIDE_KEY_LONGTEXT, true )
+    add_key( "key-intf-boss", KEY_INTF_BOSS,
+             INTF_BOSS_KEY_TEXT, INTF_BOSS_KEY_LONGTEXT, true )
     add_key( "key-snapshot", KEY_SNAPSHOT,
         SNAP_KEY_TEXT, SNAP_KEY_LONGTEXT, true )
     add_key( "key-record", KEY_RECORD,
diff --git a/src/libvlc.c b/src/libvlc.c
index b8e02bb..fc0e65c 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -533,6 +533,9 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
     var_Create( p_libvlc, "intf-show", VLC_VAR_BOOL );
     var_SetBool( p_libvlc, "intf-show", true );
 
+    /* Create a variable for the Boss Key */
+    var_Create( p_libvlc, "intf-boss", VLC_VAR_VOID );
+
     /* Create a variable for showing the right click menu */
     var_Create( p_libvlc, "intf-popupmenu", VLC_VAR_BOOL );
 



More information about the vlc-commits mailing list