[vlc-devel] [PATCH] Cycle video tracks keyboard shortcut

Rémi Denis-Courmont remi at remlab.net
Wed Apr 3 10:23:25 CEST 2019


IMO this is too fringe to get a key assigned by default. Furthermore, semi-colon does not exist as a key on most European layouts, so that is not going to work.

Le 3 avril 2019 11:10:55 GMT+03:00, Antoine Huchet <antoine+vlc at huchet.me> a écrit :
>This is an attempt to fix https://trac.videolan.org/vlc/ticket/5708.
>This is based on https://github.com/tguillem/vlc branch qml/38.
>
>---
> include/vlc_actions.h     | 4 +++-
> modules/control/hotkeys.c | 3 +++
> src/libvlc-module.c       | 7 +++++++
> src/misc/actions.c        | 2 ++
> 4 files changed, 15 insertions(+), 1 deletion(-)
>
>diff --git a/include/vlc_actions.h b/include/vlc_actions.h
>index 62f0afae53..15a836b338 100644
>--- a/include/vlc_actions.h
>+++ b/include/vlc_actions.h
>@@ -109,6 +109,7 @@ libvlc_InternalActionsClean(libvlc_int_t
>*p_libvlc);
> #define KEY_ZOOM_OUT         0x00610000
> #define KEY_BRIGHTNESS_UP    0x00620000
> #define KEY_BRIGHTNESS_DOWN  0x00630000
>+#define KEY_MEDIA_VIDEO      0x00640000
> 
> #define KEY_MOUSEWHEELUP     0x00F00000
> #define KEY_MOUSEWHEELDOWN   0x00F10000
>@@ -180,8 +181,9 @@ typedef enum vlc_action_id {
>     ACTIONID_CHAPTER_PREV,
>     ACTIONID_CHAPTER_NEXT,
>     ACTIONID_DISC_MENU,
>-    /* audio / subtitle track */
>+    /* audio / video / subtitle track */
>     ACTIONID_AUDIO_TRACK,
>+    ACTIONID_VIDEO_TRACK,
>     ACTIONID_SUBTITLE_REVERSE_TRACK,
>     ACTIONID_SUBTITLE_TRACK,
>     /* audio / subtitle delay */
>diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c
>index aa2a075934..e416fc24b3 100644
>--- a/modules/control/hotkeys.c
>+++ b/modules/control/hotkeys.c
>@@ -351,6 +351,9 @@ PLAYER_ACTION_HANDLER(Track)
>         case ACTIONID_AUDIO_TRACK:
>             vlc_player_SelectNextTrack(player, AUDIO_ES);
>             break;
>+        case ACTIONID_VIDEO_TRACK:
>+            vlc_player_SelectNextTrack(player, VIDEO_ES);
>+            break;
>         case ACTIONID_SUBTITLE_REVERSE_TRACK:
>             vlc_player_SelectPrevTrack(player, SPU_ES);
>             break;
>diff --git a/src/libvlc-module.c b/src/libvlc-module.c
>index b6c119668e..61c5d3d1c6 100644
>--- a/src/libvlc-module.c
>+++ b/src/libvlc-module.c
>@@ -1430,6 +1430,9 @@ static const char *const mouse_wheel_texts[] = {
> 
> #define AUDIO_TRACK_KEY_TEXT N_("Cycle audio track")
>#define AUDIO_TRACK_KEY_LONGTEXT N_("Cycle through the available audio
>tracks(languages).")
>+#define VIDEO_TRACK_KEY_TEXT N_("Cycle video track")
>+#define VIDEO_TRACK_KEY_LONGTEXT N_("Cycle through the available video
>tracks.")
>+
>#define SUBTITLE_REVERSE_TRACK_KEY_TEXT N_("Cycle subtitle track in
>reverse order")
>#define SUBTITLE_REVERSE_TRACK_KEY_LONGTEXT N_("Cycle through the
>available subtitle tracks in reverse order.")
> #define SUBTITLE_TRACK_KEY_TEXT N_("Cycle subtitle track")
>@@ -2322,6 +2325,7 @@ vlc_module_begin ()
> #   define KEY_AUDIODELAY_UP      "g"
> #   define KEY_AUDIODELAY_DOWN    "f"
> #   define KEY_AUDIO_TRACK        "l"
>+#   define KEY_VIDEO_TRACK        ";"
> #   define KEY_SUBTITLE_TRACK     "s"
> #   define KEY_SUBTITLE_TOGGLE    "Shift+s"
> #   define KEY_SUBTITLE_REVTRACK  "Alt+s"
>@@ -2465,6 +2469,7 @@ vlc_module_begin ()
> #   define KEY_LOOP               "l"
> 
> #   define KEY_AUDIO_TRACK        "b"
>+#   define KEY_VIDEO_TRACK        ";"
> #   define KEY_SUBTITLE_TRACK     "v"
> #   define KEY_SUBTITLE_TOGGLE    "Shift+v"
> #   define KEY_SUBTITLE_REVTRACK  "Alt+v"
>@@ -2627,6 +2632,8 @@ vlc_module_begin ()
>             AUDIODELAY_DOWN_KEY_TEXT, AUDIODELAY_DOWN_KEY_LONGTEXT)
>     add_key("key-audio-track", KEY_AUDIO_TRACK, AUDIO_TRACK_KEY_TEXT,
>             AUDIO_TRACK_KEY_LONGTEXT)
>+   add_key( "key-video-track", KEY_VIDEO_TRACK, VIDEO_TRACK_KEY_TEXT,
>+            VIDEO_TRACK_KEY_LONGTEXT)
>     add_key("key-audiodevice-cycle", KEY_AUDIODEVICE_CYCLE,
>             AUDIO_DEVICE_CYCLE_KEY_TEXT,
>             AUDIO_DEVICE_CYCLE_KEY_LONGTEXT)
>diff --git a/src/misc/actions.c b/src/misc/actions.c
>index e10eb94790..e028152404 100644
>--- a/src/misc/actions.c
>+++ b/src/misc/actions.c
>@@ -81,6 +81,7 @@ static const struct key_descriptor
>     { N_("Left"),              KEY_LEFT              },
>     { N_("Media Angle"),       KEY_MEDIA_ANGLE       },
>     { N_("Media Audio Track"), KEY_MEDIA_AUDIO       },
>+    { N_("Media Video Track"), KEY_MEDIA_VIDEO       },
>     { N_("Media Forward"),     KEY_MEDIA_FORWARD     },
>     { N_("Media Menu"),        KEY_MEDIA_MENU        },
>     { N_("Media Next Frame"),  KEY_MEDIA_FRAME_NEXT  },
>@@ -362,6 +363,7 @@ static const struct name2action
>     { "uncrop-right", ACTIONID_UNCROP_RIGHT, },
>     { "uncrop-top", ACTIONID_UNCROP_TOP, },
>     { "unzoom", ACTIONID_UNZOOM, },
>+    { "video-track", ACTIONID_VIDEO_TRACK, },
>     { "viewpoint-fov-in", ACTIONID_VIEWPOINT_FOV_IN, },
>     { "viewpoint-fov-out", ACTIONID_VIEWPOINT_FOV_OUT, },
>    { "viewpoint-roll-anticlock", ACTIONID_VIEWPOINT_ROLL_ANTICLOCK, },
>-- 
>2.19.1
>
>
>-- 
>Antoine Huchet
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20190403/9fc7204f/attachment.html>


More information about the vlc-devel mailing list