X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=doc%2Fskins%2Fskins2-howto.xml;h=20d05f4145d3527b0fe3dc8f655ff9c53209c56e;hb=c60652e38ac6afd74bd8225e9dae5406f13aaa4f;hp=0c4d78863e63f095ca9076708baf14489b27bd34;hpb=960f080a78066796a39feda428b49ee6f2348522;p=vlc diff --git a/doc/skins/skins2-howto.xml b/doc/skins/skins2-howto.xml index 0c4d78863e..20d05f4145 100644 --- a/doc/skins/skins2-howto.xml +++ b/doc/skins/skins2-howto.xml @@ -10,7 +10,7 @@ HowTo create your own skin -2004 +2004-2010 the VideoLAN project @@ -41,6 +41,7 @@ website. + VLC Skin XML Bezier @@ -65,33 +66,17 @@ difficulty to understand how VLC skins work. - -Bezier curves - -One cool thing with VLC sliders is that they are not necessarily rectilinear, but they can follow any Bezier curve. So if you want to have a slider moving on a half-circle, or even doing a loop, you can! - -This is not the place to explain how Bezier curves work (see http://astronomy.swin.edu.au/~pbourke/curves/bezier/ for a nice introduction), the main thing to know is that a Bezier curve can be characterized by a set of points. Once you have them (thanks to the CurveMaker utility for example), you just need to enter the list of points in the points attribute. Here is an example with 3 points: points="(2,50),(45,120),(88,50)". - -Bezier curves can be used with the Slider and Anchor tags: - - - For sliders, it defines the curve followed by the cursor of the slider. This curve is of course invisible, so if you want a visible background for your Slider you need to provide it yourself using the Image tag. - For anchors, the use of Bezier curves is more anecdotic. Its purpose is to have non-ponctual anchor, the whole curve becoming the anchor. In this case, a ponctual anchor (and only a ponctual one) can be attracted by any point of the curve, if it is in its range of action. In fact, you can consider the curve as an easy way to define at once many anchors that share the same properties (except their position, of course :)). - - -The coordinates are relative to the upper-left corner of the control (i.e. to its x and y attributes). - - - The bitmaps -Basically, you need one bitmap file (in PNG format) by state of control. For example, with a Image control you need 1 image, with a Button control you need 3 images (for the up, down and mouseover states). Of course, the same bitmap file can be used for many controls, provided you want to display the same image! +Basically, you need one bitmap file (in PNG format) by state of control. For example, with a Image control you need 1 image, with a Button control you need 3 images (for the up, down and mouseover states). The same bitmap file can be used for many controls, using sub-bitmaps. The PNG format allows setting a transparency mask, which will be used wherever the image needs to be displayed (only non-transparent parts will be drawn). In addition, you can also specify a transparency color in the XML file: the bitmap will be considered as transparent wherever this color appears in the bitmap file. Both the transparency mask and the transparent color will be taken into acount, so if the transparency mask is correctly set in the bitmap file you need to choose a unused color for the transparency color. +Starting from VLC 0.8.5, it is not anymore necessary to use PNG format for the bitmap files: most common formats are supported. Using PNG format is still recommended, for compatibility with older VLC versions. + @@ -99,559 +84,779 @@ difficulty to understand how VLC skins work. XML is a markup language, like HTML. It won't be explained here any further, please use Google if you don't know what XML is. You'll see, it is rather easy to understand. -The XML file used for the VLC skins follows a predefined DTD. You can find this DTD in VLC CVS, and its reading is strongly advised, since it contains the default values used for the parameters. A skin that does not follow the DTD with which VLC was compiled won't be loaded by VLC (and it might even crash it...). +The XML file used for the VLC skins follows a predefined DTD. You can find this DTD in VLC Git, and its reading is strongly advised, since it contains the default values used for the parameters. A skin that does not follow the DTD with which VLC was compiled won't be loaded by VLC (and it might even crash it...). For a better undestanding of what follows, you should have a look at the DTD and/or at an example of valid XML skin. OK, let's go for an enumeration of the different tags and their attributes: - + Theme Main tag, for global attributes - + version Version of the DTD used when making the skin, such as "2.0" (you can find the version in the DTD itself). This number might be used in the future to provide a better backward compatibility with older skins. Required. - - + + tooltipfont Identifiant of a Font or BitmapFont, used for the tooltips (beware that any character not present in a BitmapFont will be printed as a space, so will be invisible). The default value uses a font provided with VLC, so you don't need to provide it with your skin. Default value: defaultfont - - + + magnet Allows to select the range of action (in pixels) of magnetism with borders of the screen: when the distance between the border of the screen and an anchor of a window is less than this value, the window will stick to the border. 0 disables magnetism with the screen borders. Default value: 15 - - + + alpha Sets the alpha transparency of the windows. The value must be between 1 (nearly total transparency) and 255 (total opacity). Low values should be avoided. This only works if transparency is not disabled in the preferences of the skins2 module. Default value: 255 - - + + movealpha - Sets the alpha transparency of the windows when they are moving. Same range as alpha. + Sets the alpha transparency of the windows when they are moving. Same range as alpha. This only works if transparency is not disabled in the preferences of the skins2 module. Default value: 255 - - + + - + ThemeInfo You can enter here some information about you (but this information is currently unused by VLC...) - + name Skin name. Not supported yet. Implied. - - + + author Author of the skin. Not supported yet. Implied. - - + + email Email of the author. Not supported yet. Implied. - - + + webpage Web page in relation with the skin. Not supported yet. Default value: http://www.videolan.org/vlc/ - - + + - + Bitmap - Associates a bitmap file in PNG format with an identifiant (=name) that will be used by the various controls. Obviously, you need one Bitmap tag for each bitmap file you have. - - id - This is the identifiant of the bitmap that will be used with controls. Two bitmaps cannot have the same id. - Required. - - - file - This attribute is used to indicate the path and name of the bitmap file used. This path can be absolute (but you should definitely avoid it), or relative to the path of the XML file. - Required. - - - alphacolor - This is the transparency color of the bitmap. It must be indicated with the following format: "#RRGGBB" (where RR stands for the hexadecimal value of the red component, GG for the green one, and BB for the blue one). - If your PNG file specifies a transparency mask, it will be taken into account too. - Default value: #000000 - + Associates a bitmap file (usually in PNG format) with an identifiant (=name) that will be used by the various controls. Obviously, you need one Bitmap tag for each bitmap file you have. + + id + Identifiant of the bitmap that will be used with controls. Two bitmaps cannot have the same id. + Required. + + + file + Indicates the path and name of the bitmap file used. This path can be absolute (but you should definitely avoid it), or relative to the path of the XML file. + Required. + + + alphacolor + Transparency color of the bitmap. It must be indicated with the following format: "#RRGGBB", where RR stands for the hexadecimal value of the red component, GG for the green one, and BB for the blue one. + If your PNG file specifies a transparency mask, it will be taken into account too. + Default value: #000000 + + + nbframes + This attribute is needed to define animated bitmaps; it is the number of frames (images) contained in your animation. All the different frames are just images laid vertically in the bitmap. Animated GIFs are not supported at the moment. (since VLC 0.8.5) + Default value: 1 + + + fps + Only used in animated bitmaps; it is the number of frames (images) per seconds of the animation. (since VLC 0.8.5) + Default value: 0 + + + loop + Only used in animated bitmaps; it is the number of loops before animation stops. Default value 0 means animation doesn't stop. Otherwise, animation stops on the last frame after the number of loops has been reached (since VLC 1.1) + Default value: 0 + + + + + + SubBitmap + Declares a portion of bitmap, that will be used with controls in the same way as a regular Bitmap. A SubBitmap tag can only be placed inside a Bitmap tag, and references implicitly the same file. SubBitmaps are very convenient when a file contains images for several controls. (This tag was not available before VLC 0.8.5). + + id + Identifiant of the portion of bitmap that will be used with controls. It must be unique in the whole skin. + Required. + + x + Horizontal offset of the sub-bitmap (in pixels), relative to the "parent" bitmap. + Required. + + + y + Vertical offset of the sub-bitmap (in pixels), relative to the "parent" bitmap. + Required. + + + width + Width of the sub-bitmap, in pixels. + Required. + + + height + Height of the SubBitmap, in pixels. + Required. + + + nbframes + Same as in Bitmap tag. + Default value: 1 + + + fps + Same as in Bitmap tag. + + + loop + Same as in Bitmap tag. + + + - + Font - Declares a font to be used in a Text or Playlist. - - id - Identifiant of the font that will be used with controls. - Required. - - - file - This is the file containing a TrueType font. - Required. - - - size - This is the size of the font, in points. - Default value: 12 - + Declares a font to be used in a Text or Playtree. + + id + Identifiant of the font that will be used with controls. + Required. + + file + This is the file containing a TrueType font. + Required. + + + size + This is the size of the font, in points. + Default value: 12 + + - + BitmapFont - - id - Identifiant of the font that will be used with controls. - Required. - - - file - This is the file containing a bitmap font, à la Winamp. - Required. - - - type - Type of font, one of "digits" or "text". - Default value: digits - + + id + Identifiant of the font that will be used with controls. + Required. + + + file + This is the file containing a bitmap font, à la Winamp. + Required. + + type + Type of font, one of "digits" or "text". + Default value: digits + + - + Window A window that will appear on screen. - - id - Name of the window (it may be used for actions). Two windows cannot have the same id. - Default value: none - - - visible - Indicates whether the window should appear when VLC is started. Since VLC remembers the skin windows position and visibility, this attribute will only be used the first time the skin is started. - Default value: true - - - x - Initial left position of the window. - Default value: 0 - - - y - Initial top position of the window. - Default value: 0 - - - dragdrop - Indicates whether drag and drop of media files is allowed on this window. - Default value: true - - - playondrop - Indicates whether a dropped file is played directly (true) or only enqueued (false). This attribute has no effect if dragdrop is set to "false". - Default value: true - - - - + + id + Name of the window (it may be used for actions). Two windows cannot have the same id. + Default value: none + As of vlc1.1, a special id has been added to provide a skinnable fullscreen controller. This value id="fullscreenController" allows the window to be displayed only in fullscreen mode. Display is toggled by pressing the 'i' hotkey or clicking the mouse middle button + + + visible + Indicates whether the window should appear when VLC is started. Since VLC remembers the skin windows position and visibility, this attribute will only be used the first time the skin is started. + Default value: true + + + x + Initial left position of the window. + Default value: 0 + + + y + Initial top position of the window. + Default value: 0 + + + dragdrop + Indicates whether drag and drop of media files is allowed on this window. + Default value: true + + + playondrop + Indicates whether a dropped file is played directly (true) or only enqueued (false). This attribute has no effect if dragdrop is set to "false". + Default value: true + + + + Layout A layout is one aspect of a window, i.e. a set of controls and anchors. A window can have many layouts, but only one will be visible at any time. - - width - Width of the layout. this value is required since VLC is not (yet?) able to calculate it using the sizes and positions of the controls. - Required. - - - height - Height of the layout. this value is required since VLC is not (yet?) able to calculate it using the sizes and positions of the controls. - Required. - - - minwidth - Minimum width of the layout. This value is only used when resizing the layout. If this value is set to "-1", the initial width (as specified by the width attribute) will be used as minimum width. - Default value: -1 - - - maxwidth - Maximum width of the layout. This value is only used when resizing the layout. If this value is set to "-1", the initial width (as specified by the width attribute) will be used as maximum width. - Default value: -1 - - - minheight - Minimum height of the layout. This value is only used when resizing the layout. If this value is set to "-1", the initial height (as specified by the height attribute) will be used as minimum height. - Default value: -1 - - - maxheight - Maximum height of the layout. This value is only used when resizing the layout. If this value is set to "-1", the initial height (as specified by the height attribute) will be used as maximum height. - Default value: -1 - - - - + + id + Name of the layout (it may be used for actions). Two layouts cannot have the same id. + Default value: none + + + width + Initial width of the layout. This value is required since VLC is not (yet?) able to calculate it using the sizes and positions of the controls. + Required. + + + height + Initial height of the layout. This value is required since VLC is not (yet?) able to calculate it using the sizes and positions of the controls. + Required. + + + minwidth + Minimum width of the layout. This value is only used when resizing the layout. If this value is set to "-1", the initial width (as specified by the width attribute) will be used as minimum width. + Default value: -1 + + + maxwidth + Maximum width of the layout. This value is only used when resizing the layout. If this value is set to "-1", the initial width (as specified by the width attribute) will be used as maximum width. + Default value: -1 + + + minheight + Minimum height of the layout. This value is only used when resizing the layout. If this value is set to "-1", the initial height (as specified by the height attribute) will be used as minimum height. + Default value: -1 + + + maxheight + Maximum height of the layout. This value is only used when resizing the layout. If this value is set to "-1", the initial height (as specified by the height attribute) will be used as maximum height. + Default value: -1 + + + + Group - Adds an offset to the elements it contains. A Group is only supposed to ease the job of the skin designer, who can adjust the position of a group of controls without modifying all the coordinates, but you can ignore it if you want (only one Group is necessary, inside the Window tag). Group tags can be nested. - - x - Try and guess. - Default value: 0 - - - y - What do you think? - Default value: 0 - - - - + Add an offset to the elements it contains. A Group is only supposed to ease the job of the skin designer, who can adjust the position of a group of controls without modifying all the coordinates, but you can ignore it if you want (only one Group is necessary, inside the Layout tag). Group tags can be nested. Note that Group elements are deprecated, since Panel elements are more powerful. + + x + Horizontal offset, relative to the container box (see the Layout model for more details). + Default value: 0 + + + y + Vertical offset, relative to the container box (see the Layout model for more details). + Default value: 0 + + + + + Panel + A Panel can be seen as an enhanced Group. It also adds an offset to the elements it contains, but in addition it becomes their reference for the lefttop, rightbottom, xkeepratio and ykeepratio attributes. Panel tags can be nested. Since VLC 0.9.0. + See the common attributes. + + x + Same as the x attribute of the common attributes. + + + y + Same as the y attribute of the common attributes. + + + width + Initial width of this container box (see the Layout model for more details). + Required. + + + height + Initial height of this container box (see the Layout model for more details). + Required. + + + lefttop + Same as the lefttop attribute of the common attributes. + + + rightbottom + Same as the rightbottom attribute of the common attributes. + + + xkeepratio + Same as the xkeepratio attribute of the common attributes. + + + ykeepratio + Same as the ykeepratio attribute of the common attributes. + + + + Anchor - Create a "magnetic point" (or curve) in the current window. If an anchor of another window enters in the range of action of this anchor, the 2 anchors will automatically be on the same place, and the windows are "sticked". Each anchor has a priority (priority attribute), and the anchor with the highest priority is the winner, which means that when moving its window all the other anchored windows will move too. To break the effect of 2 anchored windows, you need to move the window whose anchor has the lower priority. - - x - Is it really necessary to explain ? - Default value: 0 - - - y - ... - Default value: 0 - - - priority - Priority of anchor (see the previous description). - Required. - - - points - Points defining the Bezier curve followed by the anchor. - You don't need to change this parameter if all you want is a ponctual anchor. - Default value: (0,0) - - - range - Range of action of the anchor, in pixels. Default is "10". - Default value: 10 - - - - - - Attributes common to all the controls - The following attributes are common to all the controls (Image, Button, Checkbox, Text, Slider, RadialSlider, Playlist, Video) - - id - Identifiant of the control. Currently unused. - Default value: none - - - visible - See Boolean expressions. - Default value: true - - - x - Horizontal offset of the control, relative to the parent tag (usually Group or Layout). - Default value: 0 - - - y - Vertical offset of the control, relative to the parent tag (usually Group or Layout). - Default value: 0 - - - lefttop - Indicate to which corner of the Layout the top-left-hand corner of this control is attached, in case of resizing. Possible values are 'lefttop', 'leftbottom', 'righttop' and 'rightbottom'. - Default value: lefttop - - - rightbottom - Indicate to which corner of the Layout the bottom-right-hand corner of this control is attached, in case of resizing. - Default value: lefttop - - - help - Help text for the current control. The variable '$H' will be expanded to this value when the mouse hovers the current control (see Text variables). - Default value: - - + Create a "magnetic point" (or curve) in the current window. If an anchor of another window enters in the range of action of this anchor, the 2 anchors will automatically be on the same place, and the windows are "sticked". Each anchor has a priority (priority attribute), and the anchor with the highest priority is the winner, which means that when moving its window all the other anchored windows will move too. To break the effect of 2 anchored windows, you need to move the window whose anchor has the lower priority. + + x + Is it really necessary to explain? + Default value: 0 + + + y + ... + Default value: 0 + + + lefttop + Indicate to which corner of the Layout the top-left-hand corner of this anchor is attached, in case of resizing. Possible values are 'lefttop', 'leftbottom', 'righttop' and 'rightbottom'. Available since VLC 0.8.6. + Note that there is no "rightbottom" attribute for the anchors (contrarily to normal controls), because an anchor is not resizable (even when the anchor is not ponctual and follows a Bezier curve). + Default value: lefttop + + + priority + Priority of anchor (see the previous description). + Required. + + + points + Points defining the Bezier curve followed by the anchor. + You don't need to change this parameter if all you want is a ponctual anchor. + Default value: (0,0) + + + range + Range of action of the anchor, in pixels. + Default value: 10 + + + + + + Common attributes + The following attributes are common to all the controls (Image, Button, Checkbox, Text, Slider, RadialSlider, Playlist, Playtree, Video) + + id + Identifiant of the control. Currently unused. + Default value: none + + + visible + See Boolean expressions. + Default value: true + + + x + Horizontal offset of the control, relative to the container box (see the Layout model) or to the parent Group. + Default value: 0 + + + y + Vertical offset of the control, relative to the container box (see the Layout model) or to the parent Group. + Default value: 0 + + + lefttop + Indicate to which corner of the container box the top-left-hand corner of this control is attached, in case of resizing. Possible values are 'lefttop', 'leftbottom', 'righttop' and 'rightbottom'. See the Layout model for more details. + Default value: lefttop + + + rightbottom + Indicate to which corner of the container box the bottom-right-hand corner of this control is attached, in case of resizing. See the Layout model for more details. + Default value: lefttop + + + xkeepratio + When set to true, the behaviour of the horizontal resizing is changed. Instead of taking into account the lefttop and rightbottom attributes to determine how the control will be moved/resized, only its initial position inside the container box matters. For example, if initially the space to the left of the control is twice as big as the one to its right, this will stay the same during any horizontal resizing. The width of the control stays constant. + This attribute can be particularly useful to keep a control centered in the container box, without resizing it (to resize it, you would rather use the lefttop/rightbottom attributes). See the Layout model for more details. Available since VLC 0.8.6. + Default value: false + + + ykeepratio + When set to true, the behaviour of the vertical resizing is changed. Instead of taking into account the lefttop and rightbottom attributes to determine how the control will be moved/resized, only its initial position inside the Layout matters. For example, if initially the space to the top of the control is twice as big as the one to its bottom, this will stay the same during any vertical resizing. The height of the control stays constant. + This attribute can be particularly useful to keep a control centered in the container box, without resizing it (to resize it, you would rather use the lefttop/rightbottom attributes). See the Layout model for more details. Available since VLC 0.8.6. + Default value: false + + + help + Help text for the current control. The variable '$H' will be expanded to this value when the mouse hovers the current control (see Text variables). + Default value: + + - + Image Create a simple image. Particularly useful for backgrounds. See the Common attributes. - - image - Identifiant of a Bitmap. - Required. - - - action - Action triggered by a click on the control. Possible values are "move", to move the window, or "resizeSE" (SE as in South-East ; other directions will be added in the future) to resize the window in the corresponding direction. - Default value: none - + + image + Identifiant of a Bitmap. + Required. + + + resize + Since VLC 0.8.2. Specify the behaviour of the image when it is resized. Possible values are 'mosaic' (the image is repeated as many times as necessary to reach the wanted dimensions) and 'scale' (the image is actually rescaled). Beware that the 'scale' behaviour is much slower than the 'mosaic' one, so make sure to use it only when it's really needed. + In future VLC 1.2. a third value 'scale2' is available to scale an image, yet preserving its aspect ratio. The image is centered and scaled either heightwise or widthwise to fill up as much area as possible. Extra borders are made transparent. + Default value: mosaic. + + + action + Action triggered by a click on the control. Possible values are 'move', to move the window, 'resizeE', to resize horizontally, 'resizeS' to resize vertically, and 'resizeSE' to resize both horizontally and vertically. Mnemonics: S, E and SE stand for South, East, and South-East. The 'resizeS' and 'resizeE' actions are available since VLC 0.8.5 only. + Default value: none + + + action2 + Action triggered by a double-click on the control. See Actions for a list of possible actions. (Since VLC 0.8.5). + Default value: none + + art + if set to true, the skin engine reuses the control to display the art file of the resource currently being played back. Usually, resize="scale2" is desirable, for art to be rendered in the best possible way. (in future VLC 1.2). + Default value: false + + - + Button Create a button. See the common attributes. - - up - Identifiant of a Bitmap, used when the button is up. - Required. - - - down - Identifiant of a Bitmap, used when the button is down. - Default value: none - - - over - Identifiant of a Bitmap, used when the mouse is over the button. - Default value: none - - - action - Action executed when the button is clicked. See Actions for a list of possible actions. - Default value: none - - - - + + up + Identifiant of a Bitmap, used when the button is up. + Required. + + + down + Identifiant of a Bitmap, used when the button is down. + Default value: none + + + over + Identifiant of a Bitmap, used when the mouse is over the button. + Default value: none + + + action + Action executed when the button is clicked. See Actions for a list of possible actions. + Default value: none + + + tooltiptext + Tooltip associated with the button. See also Text variables. + Default value: + + + + Checkbox Create a checkbox, i.e. a button with 2 states (checked/unchecked). So you need 6 images for a full-featured checkbox: each state has a basic image ('up' state), an image for the control being hovered by the mouse ('over' state) and an image corresponding to a click not yet released ('down' state). If you supply only the basic images, the other ones will be identical. See the common attributes. - - up1 - Identifiant of a Bitmap, used when the checkbox is up in the first state. - Required. - - - down1 - Identifiant of a Bitmap, used when the checkbox is down in the first state. - Default value: none - - - over1 - Identifiant of a Bitmap, used when the mouse is over the checkbox in the first state. - Default value: none - - - up2 - Identifiant of a Bitmap, used when the checkbox is up in the second state. - Required. - - - down2 - Identifiant of a Bitmap, used when the checkbox is down in the second state. - Default value: none - - - over2 - Identifiant of a Bitmap, used when the mouse is over the checkbox in the second state. - Default value: none - - - state - Boolean expression specifying the state of the checkbox: if the expression resolves to 'false', the first state will be used, and if it resolves to 'true' the second state will be used. Example for a checkbox showing/hiding a window whose id is "playlist_window": state="playlist_window.isVisible" (or state="not playlist_window.isVisible", depending on the states you chose). - Required. - - - action1 - Action executed when the checkbox is clicked (state 1 to state 2). See Actions for a list of possible actions. - Default value: none - - - action2 - Action executed when the checkbox is clicked (state 2 to state 1). See Actions for a list of possible actions. - Default value: none - - - tooltiptext1 - Tooltip associated with the checkbox in state 1. See also Text variables. - Default value: - - - tooltiptext2 - Tooltip associated with the checkbox in state 2. See also Text variables. - Default value: - - + + up1 + Identifiant of a Bitmap, used when the checkbox is up in the first state. + Required. + + + down1 + Identifiant of a Bitmap, used when the checkbox is down in the first state. + Default value: none + + + over1 + Identifiant of a Bitmap, used when the mouse is over the checkbox in the first state. + Default value: none + + + up2 + Identifiant of a Bitmap, used when the checkbox is up in the second state. + Required. + + + down2 + Identifiant of a Bitmap, used when the checkbox is down in the second state. + Default value: none + + + over2 + Identifiant of a Bitmap, used when the mouse is over the checkbox in the second state. + Default value: none + + + state + Boolean expression specifying the state of the checkbox: if the expression resolves to 'false', the first state will be used, and if it resolves to 'true' the second state will be used. Example for a checkbox showing/hiding a window whose id is "playlist_window": state="playlist_window.isVisible" (or state="not playlist_window.isVisible", depending on the states you chose). + Required. + + + action1 + Action executed when the checkbox is clicked (state 1 to state 2). See Actions for a list of possible actions. + Default value: none + + + action2 + Action executed when the checkbox is clicked (state 2 to state 1). See Actions for a list of possible actions. + Default value: none + + + tooltiptext1 + Tooltip associated with the checkbox in state 1. See also Text variables. + Default value: + + + tooltiptext2 + Tooltip associated with the checkbox in state 2. See also Text variables. + Default value: + + - + Text Control to display some text. See the common attributes. - - font - Identifiant of a Font or BitmapFont (beware that any character not present in the BitmapFont will be printed as a space, so will be invisible). - Required. - - - text - Text to display. See Text variables. - Default value: - - - color - Color of the text, using the #RRGGBB format. - Default value: #000000 - - - width - Width of the text in pixels. If set to "0", the width is automatically calculated to fit with the current text. - Default value: 0 - - - - + + font + Identifiant of a Font or BitmapFont (beware that any character not present in the BitmapFont will be printed as a space, so will be invisible). + Required. + + + text + Text to display. See also Text variables. + Default value: + + + color + Color of the text, using the #RRGGBB format. + Default value: #000000 + + + width + Width of the text in pixels. If set to "0", the width is automatically calculated to fit with the current text. + Default value: 0 + + + alignment + Alignment of the text inside the control. Possible values are 'left', 'center' and 'right'. The 'width' and 'center' alignments are computed using the width of the control (as given by the width attribute). Available since VLC 0.8.5. + Default value: left + + + scrolling + Scrolling behaviour of the text (only when it doesn't fit in the width of the control). Possible values are 'auto', 'manual' and 'none'. If this attribute is set to 'auto', the text automatically starts scrolling. The user can drag the text, and click on it to start/stop the scrolling. If this attribute is set to 'manual', the text only scrolls when dragged by the user. If this attribute is set to 'none', no scrolling is possible at all. Available since VLC 0.8.5. + Default value: auto + + + + Slider - Create a slider. + Create a slider. This element can be used alone, or can contain a SliderBackground element. See the common attributes. - - up - Identifiant of a Bitmap, used when the slider cursor is up. - Required. - - - down - Identifiant of a Bitmap, used when the slider cursor is down. - Default value: none - - - over - Identifiant of a Bitmap, used when the mouse is over the slider cursor. - Default value: none - - - points - Points defining the Bezier curve followed by the slider cursor. - Default value: none - - - thickness - Thickness of the slider curve. This attribute is used to determine whether the mouse is over the slider (hence whether a mouse click will have an effect on the cursor position). - Default value: 10 - - - value - Variable controlled by the slider. Recognized values are "volume" and "time" (only exception: the Slider defined inside the Playlist tag does not need to set this attribute). - Default value: none - - - tooltiptext - Tooltip associated with the slider. See also Text variables. - Default value: - - - - + + up + Identifiant of a Bitmap, used when the slider cursor is up. + Required. + + + down + Identifiant of a Bitmap, used when the slider cursor is down. + Default value: none + + + over + Identifiant of a Bitmap, used when the mouse is over the slider cursor. + Default value: none + + + points + Points defining the Bezier curve followed by the slider cursor. + Default value: none + + + thickness + Thickness of the slider curve. This attribute is used to determine whether the mouse is over the slider (hence whether a mouse click will have an effect on the cursor position). + Default value: 10 + + + value + Variable controlled by the slider. This must be a percentage variable, e.g "volume" or "time" (only exception: the Slider defined inside the Playtree tag does not need to set this attribute). + Default value: none + + + tooltiptext + Tooltip associated with the slider. See also Text variables. + Default value: + + + + + + SliderBackground + Set of background images associated to a slider (it must be a sub-element of a Slider). The displayed image depends on the value of the corresponding slider; if the SliderBackground contains n images, the image #m will be displayed, where m = n * (slider value). A SliderBackground actually contains a single image, which is divided into a grid to build all the sub-images. All the sub-images of the grid have the same size, and can be separated by unused pixel lines or rows if needed (this is called "padding"). + See the common attributes. + + image + Identifiant of a Bitmap; image containing the sub-images used to draw the background of the slider. + Required. + + + nbhoriz + Number of sub-images in the horizontal direction. + Default value: 1 + + + nbvert + Number of sub-images in the vertical direction. + Default value: 1 + + + padhoriz + Horizontal padding: number of unused pixel rows between two sub-images. + Default value: 0 + + + padvert + Vertical padding: number of unused pixel lines between two sub-images. + Default value: 0 + + + + RadialSlider Create a circular slider from a list of images with the different possible positions. See the common attributes. - - sequence - Identifiant of a Bitmap containing the list of images of the different positions of the slider, concatenated vertically. - Required. - - - nbimages - Number of elementary images contained in the sequence. - Required. - - - minangle - Minimum angle of the rotation, corresponging to 0%. - Default value: 0 - - - maxangle - Maximum angle of the rotation, corresponging to 100%. - Default value: 360 - - - value - Variable controlled by the slider. Recognized values are "volume" and "time". - Default value: none - - - tooltiptext - Tooltip associated with the slider. See also Text variables. - Default value: - - - - + + sequence + Identifiant of a Bitmap containing the list of images of the different positions of the slider, concatenated vertically. + Required. + + + nbimages + Number of elementary images contained in the sequence. + Required. + + + minangle + Minimum angle of the rotation, corresponding to 0%. + Default value: 0 + + + maxangle + Maximum angle of the rotation, corresponding to 100%. + Default value: 360 + + + value + Variable controlled by the slider. This must be a percentage variable, e.g "volume" or "time". + Default value: none + + + tooltiptext + Tooltip associated with the slider. See also Text variables. + Default value: + + + + Video Control containing a video. This allows skinable video outputs! - this control is still under development and its behaviour may change a lot in the future. - - width - Initial width of the control, in pixels. - Default value: 0 - - - height - Initial height of the control, in pixels. - Default value: 0 - - - - - Playlist + This control is still under development and its behaviour may change a lot in the future. + + width + Initial width of the control, in pixels. + Default value: 0 + + + height + Initial height of the control, in pixels. + Default value: 0 + + + autoresize + Indicate whether the layout should be automatically resized to fit the dimensions of the played video. + Default value: true + + + + + Playlist + This tag used to create a playlist. This tag is deprecated, you should now use Playtree + + + + Playtree Create a playlist. This tag must contain a Slider tag (to allow scrolling in the playlist). See the common attributes. - - width - Width of the playlist, in pixels. If playlist items are wider, the end of the name will be replaced with '...'. - Default value: 0 - - - height - Height of the playlist, in pixels. - Default value: 0 - - - font - Identifiant of a Font tag. - Required. - - - var - Type of playlist. Currently, only "playlist" is recognized, so don't bother with this attribute :) - Default value: playlist - - - fgcolor - Foreground color of the playlist items. - Default value: #000000 - - - playcolor - Foreground color of the item currently played. - Default value: #FF0000 - - - selcolor - Background color of selected items. - Default value: #0000FF - - - bgcolor1 - Background color for odd playlist items. - Default value: #FFFFFF - - - bgcolor2 - Background color for even playlist items. - Default value: #FFFFFF - - + + width + Width of the playlist, in pixels. If playlist items are wider, the end of the name will be replaced with '...'. + Default value: 0 + + + height + Height of the playlist, in pixels. + Default value: 0 + + + font + Identifiant of a Font tag. + Required. + + + var + Type of playlist. Currently, only "playlist" is recognized, so don't bother with this attribute :) + Default value: playlist + + + bgimage + Identifiant of a Bitmap, used as the background image. When no bitmap is specified, the background will be filled using the bgcolor1 and bgcolor2 attributes. + Default value: none + + + fgcolor + Foreground color of the playlist items. + Default value: #000000 + + + playcolor + Foreground color of the item currently played. + Default value: #FF0000 + + + selcolor + Background color of selected items. + Default value: #0000FF + + + bgcolor1 + Background color for odd playlist items. This attribute is ignored if the bgimage one is used. + Default value: #FFFFFF + + + bgcolor2 + Background color for even playlist items. This attribute is ignored if the bgimage one is used. + Default value: #FFFFFF + + + flat + Boolean to indicate whether the playlist should use the tree structure or be completely "flat" (only show the leafs of the tree). + A flat playtree will work like old-style playlists. + Default value: false + + + itemimage + Identifiant of a Bitmap shown to the left of a leaf (playlist item). + + + openimage + Identifiant of a Bitmap shown to the left of a node, when it is expanded. + + + closedimage + Identifiant of a Bitmap shown to the left of a node, when it is retracted. + + @@ -671,10 +876,13 @@ difficulty to understand how VLC skins work. dialogs.fileSimple(): Show the simple "Open File" dialog box. - dialog.file(): Show the "Open File" dialog box, with many options (stream output, subtitles, etc...). + dialogs.file(): Show the "Open File" dialog box, with many options (stream output, subtitles, etc...). - dialog.disc(): Show the "Open Disc" dialog box. + dialogs.directory(): Show the "Open Directory" dialog box (new after VLC 0.8.2). + + + dialogs.disc(): Show the "Open Disc" dialog box. dialogs.net(): Show the "Open Network Stream" dialog box. @@ -689,7 +897,28 @@ difficulty to understand how VLC skins work. dialogs.fileInfo(): Show the "File Info" dialog box. - dialogs.popup(): Show the popup menu, (already available with a right-click on a Image control). + dialogs.playlist(): Show the "standard" (not skinned) playlist dialog (since VLC 0.8.6). + + + dialogs.streamingWizard(): Show the "Streaming Wizard" dialog box (new after VLC 0.8.2). + + + dialogs.popup(): Show the full popup menu, (already available with a right-click on a Image control). + + + dialogs.audioPopup(): Show the audio settings popup menu (since VLC 0.8.6). + + + dialogs.videoPopup(): Show the video settings popup menu (since VLC 0.8.6). + + + dialogs.miscPopup(): Show a popup menu containing playback control and general options (since VLC 0.8.6). + + + equalizer.enable(): Enable the equalizer audio filter (since VLC 0.8.5). + + + equalizer.disable(): Disable the equalizer audio filter (since VLC 0.8.5). vlc.play(): Play the current playlist item. @@ -709,17 +938,30 @@ difficulty to understand how VLC skins work. vlc.mute(): Toggle mute/un-mute. + + vlc.volumeUp(): Increase the volume (since VLC 0.8.2). + + + vlc.volumeDown(): Reduce the volume (since VLC 0.8.2). + vlc.fullscreen(): Toggle the fullscreen mode. - vlc.quit(): Quit VLC. @@ -735,6 +977,9 @@ difficulty to understand how VLC skins work. playlist.previous(): Go to the previous playlist item. + + playlist.sort(): Sort the playlist alphabetically. + playlist.setRandom(true): Play the playlist items in random order. @@ -747,14 +992,33 @@ difficulty to understand how VLC skins work. playlist.setLoop(false): Do not loop at playlist end. - WindowID.show(): Show the Window whose id attribute is 'WindowID'. @@ -762,18 +1026,29 @@ difficulty to understand how VLC skins work. WindowID.hide(): Hide the Window whose id attribute is 'WindowID'. - WindowID.setLayout(LayoutID): Change the layout of the Window whose id attribute is 'WindowID', using the Layout whose id attribute is 'LayoutID'. + WindowID.maximize(): Maximize the Window whose id attribute is 'WindowID'. Since VLC 0.9.0. + + + WindowID.unmaximize(): Unmaximize the Window whose id attribute is 'WindowID'. Since VLC 0.9.0. + + + WindowID.setLayout(LayoutID): Change the layout of the Window whose id attribute is 'WindowID', using the Layout whose id attribute is 'LayoutID'. +It is possible to run several actions at once, by separating them with ';'. Example: action="playlist_id.hide(); main_window_id.setLayout(main_layout)" + Text variables -When specifying the text attribute of the Text control or any tooltip attribute, you can insert escape sequences which will be expanded dynamically. An escape sequence always starts with the '$' character, followed by one or more predefined letters. Here is the list of accepted escape sequences: +When specifying the text attribute of the Text control or any tooltip attribute, you can insert escape sequences which will be expanded dynamically. An escape sequence always starts with the '$' character, followed by one or more predefined letters. Here is the list of accepted escape sequences: + + $B: Get the audio stream bitrate (in kb/s). + $V: Value of the volume (from 0 to 100 --> useful for a percentage). @@ -786,6 +1061,9 @@ difficulty to understand how VLC skins work. $D: Duration of the stream, when available (the output format is H:MM:SS). + + $t, $l, $d: Same as $T, $L and $D, except that the hour in the format is displayed only if its value is different from 0. These text variables were needed to support Winamp2 skins, but it is advised to use the uppercase ones. (Since VLC 0.8.5). + $H: Value of the help attribute of the control that is under the mouse. The main use of this escape character is to create a kind of status bar, providing contextual help. Escape sequences in the help string are also transformed (except $H itself, it would generate an infinite loop!). @@ -796,6 +1074,9 @@ difficulty to understand how VLC skins work. $F: Full name (with path) of the stream that is being played. + + $S: Get the audio sample rate (in kHz). + Example of tooltiptext value for a slider controlling the volume: "Volume: $V%". @@ -810,6 +1091,18 @@ difficulty to understand how VLC skins work. Here is a list of all the dynamic statuses that can be used in boolean expressions: + + equalizer.isEnabled: True if the equalizer audio filter is enabled (since VLC 0.8.5). + + + vlc.hasVout: True if a video is being played (since VLC 0.8.5). + + + vlc.hasAudio: True if audio is being played (since VLC 0.8.5). + + + vlc.isFullscreen: True when the video is in fullscreen mode (since VLC 0.8.5). + vlc.isPlaying: True when VLC is playing, false otherwise. @@ -822,22 +1115,38 @@ difficulty to understand how VLC skins work. vlc.isSeekable: True when the stream is seekable, false otherwise. This one can be used if you want to display a slider only when seeking is allowed. + + vlc.canRecord: True if the stream can be recorded, false otherwise. (since vlc1.1) + + + vlc.isRecording: True if the stream is being recorded, false otherwise. (since vlc1.1) + vlc.isMute: True when the sound is mute (in VLC, not on your OS), false otherwise. + + vlc.isOnTop: True when the windows have the "Always on top" status (since VLC 0.8.0). + playlist.isRandom: True when the playlist items are played in a random order, false otherwise. playlist.isLoop: True when the playlist is looping, false otherwise. - - window_name.isVisible: True when the window whose id is "window_name" is visible, false otherwise. + WindowID.isVisible: True when the window whose id is "WindowID" is visible, false otherwise. + + + LayoutID.isVisible: True when the layout whose id is "LayoutID" is the active layout in its window (even if the window is hidden), false otherwise (since VLC 0.8.6). @@ -846,6 +1155,63 @@ difficulty to understand how VLC skins work. + +Percentage variables + +Every slider is associated to a percentage variable, which corresponds to the position of the cursor (between 0 and 100%) + +Here is a list of predefined percentage variables: + + + + equalizer.band(n): Where 'n' is an integer between 0 and 9. When the equalizer audio filter is enabled, this value corresponds to the amplification factor of the n'th frequency band: 0% means -20 dB, and 100% means +20 dB. The frequencies corresponding to the 10 bands are: 60Hz, 170Hz, 310Hz, 600Hz, 1kHz, 3kHz, 6kHz, 12kHz, 14kHz, 16kHz. (Since VLC 0.8.5) + + + equalizer.preamp: Preamplification value (if the equalizer audio filter is enabled). A value of 0% means -20 dB, and 100% means +20 dB. (Since VLC 0.8.5) + + + time: Position of the stream being played. + + + volume: Value of the volume. + + + + + + +Layout model + +Placing the controls on a window is easy, using their x and y attributes, but these positions become insufficient for a resizable window. Some controls (or groups of controls) should stay centered in the window, others should follow the right side of the window, others should change their size automatically, etc... To handle these various behaviours, the layout model followed by the skins engine is a model based on nested boxes. + +There are 2 kinds of boxes: + + + + simple boxes: These boxes cannot contain other boxes. All the visible controls are simple boxes: Image, Button, Checkbox, Text, Slider, RadialSlider, Playlist, Playtree, Video. + + + container boxes: These boxes can contain other boxes. Only two XML tags create container boxes: Panel and Layout. The Layout tag is necessarily the top-level box for the current layout, and cannot be contained, but Panel elements can be contained. + + + +A box inside a container box always defines how it should react when its container box is resized. Two different mechanisms are provided: corners anchoring (useful when resizing of the inner box is wanted, for example) and constant ratio (mainly useful to keep the inner box centered inside its parent): + + + corners anchoring: The top-left-hand corner (TL) and the bottom-right-hand corner (BR) of the inner box are "tied" to corners of the container box (TL, TR, BL or BR). When any resizing occurs, tied corners move together, which can move or resize the inner box. For example, if the TL corner of the inner box is tied to the TL corner of the container (let's write it TL/TL), and if the BR corner of the inner box is also tied to the TL corner of the container box (BR/TL), the inner box will not be resized, and will always stay at the same place (this is the default behaviour). If we have TL/TL and BR/BL, the inner box is resized vertically when its container is resized. If we have TL/TR and BR/TR, the inner box moves with the TR corner of its container. We could even define TL/BR and BR/TL, in which case increasing the size of the container box would shrink the size of the inner box... until it disappears completely! + + This mechanism is controlled by the lefttop and rightbottom attributes of the controls. + + + constant ratio: When a box doesn't fill completely its container box, there is space on the top, bottom, left and right of the inner box. It is possible to force the ratio between the space on the top and the space on the bottom (or the one on the left and the one on the right) to be constant. Any resizing of the container box will then move the inner box accordingly, and the size of the inner box will never change (it overrides the corners anchoring mechanism). The horizontal and vertical ratios being independent, it is for example possible to keep only the horizontal ratio constant, in which case the inner box can still resize vertically (depending on its attributes for the corners anchoring, of course). + + This mechanism is controlled by the xkeepratio and ykeepratio attributes of the controls. + + + + + + Compression @@ -856,15 +1222,35 @@ difficulty to understand how VLC skins work. On Linux, creating a .tar.gz archive is rather straight-forward using the 'tar' and 'gzip' commands. On Windows, it can be done using Winzip, UltimateZip, or any other (well, almost) compression software... -It is advised to rename your .tar.gz archive with the .vlt extention, for 2 main reasons: +Since VLC 0.8.5, it is also possible to archive your skin in a zip file. + +It is advised to rename your .tar.gz (or .zip) archive with the .vlt extension, for 2 main reasons: - on some systems, the "Change skin" dialog box only displays files which have a .vlt or .xml extention, + on some systems, the "Change skin" dialog box only displays files which have a .vlt or .xml extension, in the future, .vlt files could be associated to VLC in such a way that double-clicking a .vlt file would automatically load the skin in VLC. + +Bezier curves + +One cool thing with VLC sliders is that they are not necessarily rectilinear, but they can follow any Bezier curve. So if you want to have a slider moving on a half-circle, or even doing a loop, you can! + +This is not the place to explain how Bezier curves work (see http://astronomy.swin.edu.au/~pbourke/curves/bezier/ for a nice introduction), the main thing to know is that a Bezier curve can be characterized by a set of points. Once you have them (thanks to the CurveMaker utility for example), you just need to enter the list of points in the points attribute. Here is an example with 3 points: points="(2,50),(45,120),(88,50)". + +Bezier curves can be used with the Slider and Anchor tags: + + + For sliders, it defines the curve followed by the cursor of the slider. This curve is of course invisible, so if you want a visible background for your Slider you need to provide it yourself using a SliderBackground or Image tag. + For anchors, the use of Bezier curves is more anecdotic. Its purpose is to have non-ponctual anchor, the whole curve becoming the anchor. In this case, a ponctual anchor (and only a ponctual one) can be attracted by any point of the curve, if it is in its range of action. In fact, you can consider the curve as an easy way to define at once many anchors that share the same properties (except their position, of course :)). + + +The coordinates are relative to the upper-left corner of the control (i.e. to its x and y attributes). + + + Tools and advice @@ -872,7 +1258,7 @@ difficulty to understand how VLC skins work. Generating Bezier curves -To generate easily Bezier curves, you can use the curve-maker (sorry, this is for Windows users only). Basically, you add and remove points at will, and you can move them to see how the curve evolves. When you have reached the perfect curve, you just have to copy-paste the list of abscissas and ordinates to form the points attribute of your Slider or Playlist. The curve-maker also allows to load a .bmp file, this could be useful if you want to follow a specific pattern of a slider, for example. +To generate easily Bezier curves, you can use the CurveMaker utility (sorry, this is for Windows users only). Basically, you add and remove points at will, and you can move them to see how the curve evolves. When you have reached the perfect curve, you just have to copy-paste the list of abscissas and ordinates to form the points attribute of your Slider or Anchor. The curve-maker also allows to load a .bmp file, this could be useful if you want to follow a specific pattern of a slider, for example. This tool was made for the first version of the skins and has not been modified since then. This explains why it does not use PNG files and why it does not generate directly the value of the points attribute. @@ -893,28 +1279,20 @@ VLC is able to give warnings and error messages about a loaded skin if it finds Relative paths - - -For the Bitmap tags, do not use absolute paths but relative paths (they are relative to the XML file directory), so that your skin can be reused by anybody without a particular file structure. - + For the Bitmap tags, do not use absolute paths but relative paths (they are relative to the XML file directory), so that your skin can be reused by anybody without a particular file structure. Get inspiration - - -In order to use plainly the possibilities given, you should look at how existing skins are made, it may give you ideas for your own skins... - + In order to use plainly the possibilities given, you should look at how existing skins are made, it may give you ideas for your own skins... You can also consult on the wiki a list of features usually expected from a skin. Submit your skin! - - -Once your skin is finished, you can share it with other people. The easiest way is probably to send it by email to vlc -at- videolan -dot- org, so that we can put it on the website with the other ones. - + Once your skin is finished, you can share it with other people. The easiest way is probably to send it by email to vlc -at- videolan -dot- org, so that we can put it on the website with the other ones. You can also post it in the skins forum. Feel free to ask for support there if you have any problems... +