[vlc-devel] [PATCH 1/2] Added hotkeys to increase/decrease subtitle fontsize

Subodh Shrestha forsubodh at gmail.com
Thu Mar 6 03:49:49 CET 2014


On Tue, Mar 4, 2014 at 8:17 AM, Subodh Shrestha <forsubodh at gmail.com> wrote:

> Please see patch 2 ( uploaded with patch 1) for the cleanup. I will upload
> a new clean patch as per Felix's suggestion.
>
>
> On Tuesday, March 4, 2014, Jean-Baptiste Kempf <jb at videolan.org> wrote:
>
>> On 04 Mar, Subodh Shrestha wrote :
>> > Ctrl+a increases subtitle fontsize
>> > Ctrl+Shift+a decreases subtitle fontsize
>>
>> Please don't use Ctrl. Use Alt.
>>
>> > -
>> > +
>>
>> Empty not-wanted change.
>>
>> > +        case ACTIONID_FONTSIZE_UP:
>> > +            if ( p_filter )
>> > +            {
>> > +                int rel_fontsize = var_InheritInteger( p_filter,
>> "freetype-rel-fontsize");
>> > +                msg_Err(p_filter, "Old Relative Fontsize:%i",
>> rel_fontsize);
>> > +                var_Create( p_filter, "freetype-rel-fontsize",
>> VLC_VAR_INTEGER);
>> > +                var_SetInteger( p_filter, "freetype-rel-fontsize",
>> --rel_fontsize);
>>
>> I really doubt this a correct way.
>> Create?
>>
>
> I don't understand your comment here. If I don't use var_create, I can't
> seem to update the freetype-rel-fontsize config variable. I will look to
> see if there's a better way.
>

I would like to clarify this a little more.  If you look at
/modules/text_renderer/freetype.c, GetFontSize() reads the
"freetype-rel-fontsize" config variable and uses the value obtained to set
the subtitle fontsize. I'm following a similar idea of using the same
config variable to set the fontsize.

However, I do not want to change the value of the "freetype-rel-fontsize"
in the config file permanently because then the config file will get out of
sync with the subtitle preference dialog which only has five size settings.
Hence I'm using var_Create to create a vlc variable of the same name which
will be used during the vlc session if subtitle fontsize is being changed
using hotkeys. And when vlc is restarted, config file settings will match
that of one of the subtitle preference sizes (since I'm not changing the
config file settings).

Please let me know if this doesn't sound right to you. I still don't
understand what you mean by the correct way.


>
>>
>> > +    //SS>>
>> > +    filter_t *p_filter = (filter_t *)libvlc;
>> > +    //SS<<
>>
>> What is that?
>>
>
> It's the module to associate with the freetype-rel-fontsize config
> variable when I retrieve it above.
>
>
>>
>> > -
>> > +
>>
>> See above.
>>
>> > +        //SS
>> > +        msg_Err(p_filter, "here");
>>
>> ...
>>
>>
>> This patch needs a lot of cleaning, I'm sorry...
>
>
>> With my kindest regards,
>>
>> --
>> Jean-Baptiste Kempf
>> http://www.jbkempf.com/ - +33 672 704 734
>> Sent from my Electronic Device
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20140305/5431800a/attachment.html>


More information about the vlc-devel mailing list