[vlc-devel] Re: CVS Commit (sam)

Samuel Hocevar sam at zoy.org
Mon Oct 28 14:35:25 CET 2002

On Mon, Oct 28, 2002, cvs at videolan.org wrote:
>   * ./src/misc/variables.c: implemented min/max and steps for integer and
>     float variables.

   Use it like this:

    vlc_value_t val;
    var_Create( p_this, "honk", VLC_VAR_FLOAT );
    val.f_float = 3.141593;
    var_Set( p_this, "honk", val );

   Now "honk" has value 3.141593.

    val.f_float = 0.2;
    var_Change( p_this, "honk", VLC_VAR_SETSTEP, &val );

   And now "honk" has value 3.2 due to the 0.2 step; all subsequent
var_Set calls will round the value so that it complies with the step.

   Another example:

    vlc_value_t val;
    var_Create( p_this, "neep", VLC_VAR_INTEGER );
    val.i_int = 2;
    var_Set( p_this, "neep", val );

   Now "neep" has value 2.

    val.i_int = 12;
    var_Change( p_this, "neep", VLC_VAR_SETMIN, &val );

   And now "neep" has value 12. Similarly, VLC_VAR_SETMAX sets the
maximal value for a variable, and vlc_Set does the cropping.

This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://www.videolan.org/lists.html
If you are in trouble, please contact <postmaster at videolan.org>

More information about the vlc-devel mailing list