Skins events

What is an event ?

Events are the dynamic part of the skins. It means that beyond visual aspect, the interface must react with the user actions. An event describes a simple interaction, in fact one simple action such as playing a file, hiding a window... So when designing a skin you will have to specify what those interactions are. For this you will use simple actions that are described in event tags and you would be able to add them and associate them to controls.

How to create an event ?

An event describes a simple action as seen above. All attributes are explained in the 'skins-howto.txt' file except the 'event' attribute wich is a bit special. In the 'event' attribute you will enter a simple script with the following syntax :

"EVENT(parameter1,parameter2,...)"

EVENT is the action to execute, it can be one of the followings

EVENT Description and parameters
VLC_NOTHING None, it executes nothing so don't use it !
VLC_SHOW Open all windows of the interface with a fading effect if selected.
VLC_HIDE Close all windows of the interface with a fading effect if selected.
Parameters:
  1. An EVENT to execute when all windows have been closed.
VLC_QUIT Quit the interface
VLC_OPEN Open an "open file dialog box" to open a file to play.
VLC_ON_TOP Toggle the "Always on top" status
VLC_LOAD_SKIN Open an "open file dialog box" to change the current skin.
VLC_LOG_SHOW Not supported yet
VLC_INTF_REFRESH Force refreshing of the interface.
VLC_CHANGE_TRAY If VLC is not visible in system tray, show it, else, hide it.
VLC_CHANGE_TASKBAR If VLC is not visible in taskbar, show it, else, hide it.
VLC_FULLSCREEN Switch current playing file to fullscreen mode.
VLC_PLAY Play stream.
VLC_STOP Stop playing stream.
VLC_PAUSE Pause the stream.
VLC_NEXT Go to next file in playlist.
VLC_PREV Go to previous file in playlist.
VLC_SLOWER Play a stream slower.
VLC_FASTER Play a stream faster.
VLC_STREAMPOS Not supported yet.
VLC_VOLUME_CHANGE Change sound volume.
Parameters:
  1. VLC_VOLUME_MUTE: switch to mute mode.
    VLC_VOLUME_UP: raise sounds volume.
    VLC_VOLUME_DOWN:
    VLC_VOLUME_SET: set sound volume to second parameter.
  2. If first parameter is VLC_VOLUME_SET only, an integer between 0 and 100.
VLC_PLAYLIST_ADD_FILE Open an "open file dialog box" to add files to playlist.
WINDOW_MOVE Initiate manual window movement.
Parameters:
  1. Must match the ID of a window. It should be used with image controls.
WINDOW_OPEN Open a window with a fading effect if selected.
Parameters:
  1. ID of the window to open.
  2. Describe what to do. Nothing is opening. 'TRUE' is the same. 'FALSE' is closing window. 'CHANGE' is switching between these two states.
WINDOW_CLOSE Close a window with a fading effect if selected.
Parameters:
  1. ID of the window to close.
  2. Describe what to do. Nothing is closing. 'TRUE' is the same. 'FALSE' is opening window. 'CHANGE' is switching between these two states.
CTRL_SET_SLIDER Not supported yet.
CTRL_SET_TEXT Not supported yet.
CTRL_ID_VISIBLE Hide/show a control.
Parameters:
  1. ID of the control to hide/show.
  2. Describe what to do. Nothing is showing control. 'TRUE' is the same. 'FALSE' is hiding control. 'CHANGE' is switching between these two states.
CTRL_ID_ENABLED Not supported yet.
CTRL_ID_MOVE Moves a control.
Parameters:
  1. ID of the control to move.
  2. Horizontal offset of movement.
  3. Vertical offset of movement.
PLAYLIST_ID_DEL Remove items from playlist.
Parameters:
  1. ID of the playlist.

What to do with event ?

When creating your event, you must assign an ID to each of them. Now you have to associate events with controls. Some attributes of some controls are supposed to be filled with those IDs. That is to say that when the action correspounding to the attribute will be done, the event associated will be executed. The best exemple is assigning an event to the 'onclick' attribute of a button control. The event will be executed when clicking on the button. You can execute several events. To do this you just have to separate them with semicolon.

Exemple:

<ButtonControl [...] onclick="event1;event2;event3"/>

Do I have to create every event for each skin ?

No, a set of predefined events are present. Here they are with their ID and shortcut.

ID Description Shortcut
tray Hide or show in the system tray.
taskbar Hide or show in the taskbar. CTRL+B
play Play. X
pause Pause. C
stop Stop. V
next Next file. B
prev Previous file. Z
slow Play slower.
fast Play faster.
fullscreen Switch to fullscreen mode. F
mute Mute the sound.
volume_up Volume up
volume_down Volume down
quit Quit VLC. CTRL+C
open Open a file. CTRL+O
add_file Add a file. CTRL+A
load_skin Change skin. CTRL+S
on_top Toggle the "Always on top" status. CTRL+T
show_prefs Show the Preferences dialog box.
show_info Show the FileInfo dialog box.
show_log Show the Messages dialog box.
hide_log Hide the Messages dialog box.