Create and manipulate variables in VLC objects, which are Lua userdata of the type “vlc_object”.

Availability

Script Types
All Types

get()

Get a specific value of a variable in a VLC object

Usage

local vo = vlc.object.vout()
if vo then
	local autoscale = vlc.var.get(vo, "autoscale")
	if autoscale then
		vlc.msg.info("Auto-scale is on!")
	else
		vlc.msg.info("Auto-scale is off!")
	end
end 

Parameters

Return value

Value of name in object or nil


get_list()

Get the value list (values the variable can be set to) and text list (display text for values) from a variable in a VLC object.

Usage

local vo = vlc.object.vout()
if vo then
	local vals, texts = vlc.var.get_list(vo, "deinterlace-mode")
	vlc.msg.info(vals[11]) -- "ivtc"
	vlc.msg.info(texts[11]) -- "Film NTSC (IVTC)"
end 

Parameters

Return value

Returns two values:

  1. Value list or error code (negative number)
  2. Text list or error string

set()

Set the value of a variable in a VLC object

Parameters

Return value

Two values that indicate how the set operation went:


create()

Create a variable in a VLC object.

Parameters

Return value

Two values that indicate how the create operation went:

Can also return nil in case of nil assignment


inherit()

Determine the value inherited by a given variable in a VLC object.

Parameters

Return value

Value inherited by the VLC object or nil


trigger_callback()

Trigger the callbacks associated with a variable in a VLC object.

Parameters

Return value

Two values that indicate how the create operation went:


libvlc_command()

Issue a libvlc command.

Parameters

Return value

Two values that indicate how the create operation went:


inc_integer()

Increment a given integer variable in a VLC object.

Parameters

Return value

New value of name


dec_integer()

Decrement a given integer.

Parameters

Return value

New value of name


count_choices()

Get number of choices for a variable in a VLC object.

Parameters

Return value

Number of choices for given variable


toggle_bool()

Toggle a boolean variable in a VLC object.

Parameters

Return value

New value of name