[vlc-devel] [PATCH 2/2] hotkeys: Added OSD messages for toggle loop tri-state playlist action.

Zoran Turalija zoran.turalija at gmail.com
Tue Apr 23 12:15:51 CEST 2013


Closes ticket #7933

Based on "loop" part of John French patch:

    http://patches.videolan.org/patch/1071/
---
 modules/control/hotkeys.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c
index cfec996..5961acf 100644
--- a/modules/control/hotkeys.c
+++ b/modules/control/hotkeys.c
@@ -172,18 +172,29 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
 
         /* Playlist actions (including audio) */
         case ACTIONID_LOOP:
+        {
             /* Toggle Normal -> Loop -> Repeat -> Normal ... */
+            const char *mode;
             if( var_GetBool( p_playlist, "repeat" ) )
+            {
                 var_SetBool( p_playlist, "repeat", false );
+                mode = "Off";
+            }
             else
             if( var_GetBool( p_playlist, "loop" ) )
             { /* FIXME: this is not atomic, we should use a real tristate */
                 var_SetBool( p_playlist, "loop", false );
                 var_SetBool( p_playlist, "repeat", true );
+                mode = "One";
             }
             else
+            {
                 var_SetBool( p_playlist, "loop", true );
+                mode = "All";
+            }
+            DisplayMessage( p_vout, _("Loop: %s"), mode );
             break;
+        }
 
         case ACTIONID_RANDOM:
         {
-- 
1.7.10.4


-- 
Kind regards,
Zoran Turalija



More information about the vlc-devel mailing list