<!DOCTYPE html>
<html><head>
<title></title>
</head><body><div class="gmail_quote">Le 10 août 2017 11:19:08 GMT+03:00, Jean-Baptiste Kempf <jb@videolan.org> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div style="font-family:helvetica, arial, sans-serif;">Hello,<br /></div>
<div><br /></div>
<div>On Thu, 10 Aug 2017, at 10:15, Rémi Denis-Courmont wrote:<br /></div>
<blockquote type="cite"><div defang_data-gmailquote="yes"><div style="font-family:helvetica, arial, sans-serif;">Le 10 août 2017 10:05:39 GMT+03:00, "Hugo Beauzée-Luyssen" <hugo@beauzee.fr> a écrit :<br /></div>
<blockquote defang_data-gmailquote="yes" style="margin-top:0pt;margin-right:0pt;margin-bottom:0pt;margin-left:0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204, 204, 204);padding-left:1ex;"><pre><div style="font-family:helvetica, arial, sans-serif;">On Wed, Aug 9, 2017, at 09:48 PM, Rémi Denis-Courmont wrote:<br /></div>
<blockquote defang_data-gmailquote="yes" style="margin-top:0pt;margin-right:0pt;margin-bottom:1ex;margin-left:0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(114, 159, 207);padding-left:1ex;"><div style="font-family:helvetica, arial, sans-serif;"> Le keskiviikkona 9. elokuuta 2017, 18.16.32 EEST Hugo Beauzée-Luyssen a <br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> écrit :<br /></div>
<blockquote defang_data-gmailquote="yes" style="margin-top:0pt;margin-right:0pt;margin-bottom:1ex;margin-left:0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(173, 127, 168);padding-left:1ex;"><div style="font-family:helvetica, arial, sans-serif;"> From: Thomas Guillem <thomas@gllm.fr><br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> <br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> ---<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> modules/control/oldrc.c | 23 +++++++++++------------<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> 1 file changed, 11 insertions(+), 12 deletions(-)<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> <br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> diff --git a/modules/control/oldrc.c b/modules/control/oldrc.c<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> index 66402293a5..f71f0278af 100644<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> --- a/modules/control/oldrc.c<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> +++ b/modules/control/oldrc.c<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> @@ -714,8 +714,7 @@ static void *Run( void *data )<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> }<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> else if( !strcmp( psz_cmd, "key" ) || !strcmp( psz_cmd, "hotkey" )<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> ) {<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> - var_SetInteger( p_intf->obj.libvlc, "key-action",<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> - vlc_actions_get_id( psz_arg ) );<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> + vlc_actions_do( p_intf, vlc_actions_get_id( psz_arg ), true, 0<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> ); }<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> else switch( psz_cmd[0] )<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> {<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> @@ -959,7 +958,7 @@ static int Input( vlc_object_t *p_this, char const<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> *psz_cmd, /* Parse commands that only require an input */<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> if( !strcmp( psz_cmd, "pause" ) )<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> {<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> - playlist_TogglePause( p_intf->p_sys->p_playlist );<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> + vlc_actions_do( p_intf, ACTIONID_PLAY_PAUSE, true, 0 );<br /></div>
</blockquote><div style="font-family:helvetica, arial, sans-serif;"> <br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> Why oh why? What is the point in doing this?<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> <br /></div>
<blockquote defang_data-gmailquote="yes" style="margin-top:0pt;margin-right:0pt;margin-bottom:1ex;margin-left:0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(173, 127, 168);padding-left:1ex;"><div style="font-family:helvetica, arial, sans-serif;"> i_error = VLC_SUCCESS;<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> }<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> else if( !strcmp( psz_cmd, "seek" ) )<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> @@ -1001,18 +1000,18 @@ static int Input( vlc_object_t *p_this, char const<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> *psz_cmd, }<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> else<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> {<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> - var_SetInteger( p_intf->obj.libvlc, "key-action",<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> ACTIONID_JUMP_BACKWARD_EXTRASHORT ); + vlc_actions_do( p_intf,<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> ACTIONID_JUMP_BACKWARD_EXTRASHORT, true, 0 ); }<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> i_error = VLC_SUCCESS;<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> }<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> else if ( !strcmp( psz_cmd, "faster" ) )<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> {<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> - var_TriggerCallback( p_intf->p_sys->p_playlist, "rate-faster" );<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> + vlc_actions_do( p_intf, ACTIONID_FASTER, true, 0 );<br /></div>
</blockquote><div style="font-family:helvetica, arial, sans-serif;"> <br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> Ditto.<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> <br /></div>
<blockquote defang_data-gmailquote="yes" style="margin-top:0pt;margin-right:0pt;margin-bottom:1ex;margin-left:0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(173, 127, 168);padding-left:1ex;"><div style="font-family:helvetica, arial, sans-serif;"> i_error = VLC_SUCCESS;<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> }<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> else if ( !strcmp( psz_cmd, "slower" ) )<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> {<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> - var_TriggerCallback( p_intf->p_sys->p_playlist, "rate-slower" );<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> + vlc_actions_do( p_intf, ACTIONID_SLOWER, true, 0 );<br /></div>
</blockquote><div style="font-family:helvetica, arial, sans-serif;"> <br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> Ditto.<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> <br /></div>
<blockquote defang_data-gmailquote="yes" style="margin-top:0pt;margin-right:0pt;margin-bottom:1ex;margin-left:0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(173, 127, 168);padding-left:1ex;"><div style="font-family:helvetica, arial, sans-serif;"> i_error = VLC_SUCCESS;<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> }<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> else if ( !strcmp( psz_cmd, "normal" ) )<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> @@ -1022,7 +1021,7 @@ static int Input( vlc_object_t *p_this, char const<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> *psz_cmd, }<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> else if ( !strcmp( psz_cmd, "frame" ) )<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> {<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> - var_TriggerCallback( p_input, "frame-next" );<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> + vlc_actions_do( p_intf, ACTIONID_RATE_NORMAL, true, 0 );<br /></div>
</blockquote><div style="font-family:helvetica, arial, sans-serif;"> <br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> Ditto.<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> <br /></div>
<blockquote defang_data-gmailquote="yes" style="margin-top:0pt;margin-right:0pt;margin-bottom:1ex;margin-left:0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(173, 127, 168);padding-left:1ex;"><div style="font-family:helvetica, arial, sans-serif;"> i_error = VLC_SUCCESS;<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> }<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> else if( !strcmp( psz_cmd, "chapter" ) ||<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> @@ -1046,9 +1045,9 @@ static int Input( vlc_object_t *p_this, char const<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> *psz_cmd, }<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> }<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> else if( !strcmp( psz_cmd, "chapter_n" ) )<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> - var_TriggerCallback( p_input, "next-chapter" );<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> + vlc_actions_do( p_intf, ACTIONID_CHAPTER_NEXT, true, 1, p_input<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> ); else if( !strcmp( psz_cmd, "chapter_p" ) )<br /></div>
</blockquote><div style="font-family:helvetica, arial, sans-serif;"> <br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> Ditto.<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> <br /></div>
<blockquote defang_data-gmailquote="yes" style="margin-top:0pt;margin-right:0pt;margin-bottom:1ex;margin-left:0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(173, 127, 168);padding-left:1ex;"><div style="font-family:helvetica, arial, sans-serif;"> - var_TriggerCallback( p_input, "prev-chapter" );<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> + vlc_actions_do( p_intf, ACTIONID_CHAPTER_PREV, true, 1, p_input<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> ); i_error = VLC_SUCCESS;<br /></div>
</blockquote><div style="font-family:helvetica, arial, sans-serif;"> <br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> Ditto.<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> <br /></div>
<blockquote defang_data-gmailquote="yes" style="margin-top:0pt;margin-right:0pt;margin-bottom:1ex;margin-left:0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(173, 127, 168);padding-left:1ex;"><div style="font-family:helvetica, arial, sans-serif;"> }<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> else if( !strcmp( psz_cmd, "title" ) ||<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> @@ -1070,9 +1069,9 @@ static int Input( vlc_object_t *p_this, char const<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> *psz_cmd, }<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> }<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> else if( !strcmp( psz_cmd, "title_n" ) )<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> - var_TriggerCallback( p_input, "next-title" );<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> + vlc_actions_do( p_intf, ACTIONID_TITLE_NEXT, true, 1, p_input<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> ); else if( !strcmp( psz_cmd, "title_p" ) )<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> - var_TriggerCallback( p_input, "prev-title" );<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> + vlc_actions_do( p_intf, ACTIONID_TITLE_PREV, true, 1, p_input<br /></div>
</blockquote><div style="font-family:helvetica, arial, sans-serif;"> <br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> Both ditto.<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> <br /></div>
<blockquote defang_data-gmailquote="yes" style="margin-top:0pt;margin-right:0pt;margin-bottom:1ex;margin-left:0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(173, 127, 168);padding-left:1ex;"><div style="font-family:helvetica, arial, sans-serif;"> );<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> <br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> i_error = VLC_SUCCESS;<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> }<br /></div>
</blockquote><div style="font-family:helvetica, arial, sans-serif;"> <br /></div>
<div style="font-family:helvetica, arial, sans-serif;"> <br /></div>
</blockquote><div style="font-family:helvetica, arial, sans-serif;"><br /></div>
<div style="font-family:helvetica, arial, sans-serif;">To avoid spreading handling of actions in multiple modules and<br /></div>
<div style="font-family:helvetica, arial, sans-serif;">centralize the "key" -> "response" in a single place, as opposed to<br /></div>
<div style="font-family:helvetica, arial, sans-serif;">having the same code being spread out in various modules.<br /></div>
<div style="font-family:helvetica, arial, sans-serif;">Granted some of those are one liners, but when some logic is necessary<br /></div>
<div style="font-family:helvetica, arial, sans-serif;">to handle the action, it shouldn't be duplicated IMHO.<br /></div>
</pre></blockquote></div>
<div style="font-family:helvetica, arial, sans-serif;"><br /></div>
<div style="font-family:helvetica, arial, sans-serif;">I was _not_ referring to existing actions, but to every other cases, where they are neither keys nor actions to demultiplex as yet. <br /></div>
</blockquote><div style="font-family:helvetica, arial, sans-serif;"><br /></div>
<div style="font-family:helvetica, arial, sans-serif;">Fair enough, but we have proven, in the past, as we can see in most of the interfaces and controls module, that the more intf touch variables directly, the worse it is.<br /></div>
<div style="font-family:helvetica, arial, sans-serif;"><br /></div>
<div id="sig60240713"><div class="signature">--<br /></div>
<div class="signature">Jean-Baptiste Kempf - President<br /></div>
<div class="signature">+33 672 704 734<br /></div>
<div class="signature"> <br /></div>
<div class="signature"><br /></div>
</div>
<div style="font-family:helvetica, arial, sans-serif;"><br /></div>
</blockquote></div><br clear="all">I dislike the VLC variables subsystem too. But replacing a variable setting with a multiplexed call to the same variable setting, does not look like an improvement to me. Did I miss something?<br>
-- <br>
Rémi Denis-Courmont<br>
Typed on an inconvenient virtual keyboard</body></html>