[vlc-devel] [PATCH 11/11] intf: rc: handle angle

Francois Cartegnie fcvlcdev at free.fr
Tue May 5 17:57:09 CEST 2020


---
 modules/control/rc.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/modules/control/rc.c b/modules/control/rc.c
index 8f7161ecd6..a1c0a89716 100644
--- a/modules/control/rc.c
+++ b/modules/control/rc.c
@@ -527,6 +527,29 @@ static void Input(intf_thread_t *intf, char const *psz_cmd,
                     msg_print(intf, "No title selected.");
             }
     }
+    else if( !strcmp( psz_cmd, "angle" ) )
+    {
+        if ( *newval.psz_string )
+        {
+            /* Set. */
+            int idx = atoi(newval.psz_string);
+            if(idx >= 0)
+                vlc_player_SelectAngle(player, idx);
+        }
+        else
+        {
+            /* Get. */
+            const struct vlc_player_title *title =
+                    vlc_player_GetSelectedTitle(player);
+            unsigned angle = 0, count = 1;
+            if (title != NULL)
+            {
+                count += title->additional_angles;
+                angle = vlc_player_GetSelectedAngle(player);
+            }
+            msg_print(intf, "Selected Angle %u/%u", angle, count);
+        }
+    }
     else if(    !strcmp( psz_cmd, "atrack" )
              || !strcmp( psz_cmd, "vtrack" )
              || !strcmp( psz_cmd, "strack" ) )
@@ -1318,6 +1341,7 @@ static const struct
     { "seek", Input },
     { "title", Input },
     { "chapter", Input },
+    { "angle", Input },
 
     { "atrack", Input },
     { "vtrack", Input },
-- 
2.25.4



More information about the vlc-devel mailing list