[vlc-devel] [PATCH] hotkeys: added OSD messages for loop and random toggle

John French jdaviesf7 at gmail.com
Sun Feb 17 21:25:43 CET 2013


I do not think it breaks atomicity compared to what was already there. The
existing comments already note that using two booleans instead of a
tristate should be fixed, and checking and setting the toggles was already
a two-step process. All I did was add sending messages to the OSD, which
(to the best of my knowledge) shouldn't make things any worse than they
already are.


On Sat, Feb 16, 2013 at 6:13 AM, Rémi Denis-Courmont <remi at remlab.net>wrote:

> This patch breaks atomicity of toggle.
>
> Le vendredi 15 février 2013 20:35:27, John French a écrit :
> > Resolves ticket #7933
> > ---
> >  modules/control/hotkeys.c | 31 ++++++++++++++++++++++++++++---
> >  1 file changed, 28 insertions(+), 3 deletions(-)
> >
> > diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c
> > index 42e3ba0..4bb5047 100644
> > --- a/modules/control/hotkeys.c
> > +++ b/modules/control/hotkeys.c
> > @@ -163,22 +163,47 @@ static int PutAction( intf_thread_t *p_intf, int
> > i_action )
> >
> >          /* Playlist actions (including audio) */
> >          case ACTIONID_LOOP:
> > +        {
> >              /* Toggle Normal -> Loop -> Repeat -> Normal ... */
> > +            char *mode;
> >              if( var_GetBool( p_playlist, "repeat" ) )
> > +            {
> >                  var_SetBool( p_playlist, "repeat", false );
> > -            else
> > -            if( var_GetBool( p_playlist, "loop" ) )
> > +                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, SPU_DEFAULT_CHANNEL,
> > +                            _("Loop %s"), _(mode) );
> >              break;
> > +        }
> >
> >          case ACTIONID_RANDOM:
> > -            var_ToggleBool( p_playlist, "random" );
> > +        {
> > +            char *state;
> > +            if( var_GetBool( p_playlist, "random" ) )
> > +            {
> > +                var_SetBool( p_playlist, "random", false );
> > +                state = "On";
> > +            }
> > +            else
> > +            {
> > +                var_SetBool( p_playlist, "random", true );
> > +                state = "Off";
> > +            }
> > +            DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
> > +                            _("Random %s"), _(state) );
> >              break;
> > +        }
> >
> >          case ACTIONID_NEXT:
> >              DisplayMessage( p_vout, _("Next") );
>
> --
> Rémi Denis-Courmont
> http://www.remlab.net/
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20130217/9bd2d463/attachment.html>


More information about the vlc-devel mailing list