File: skin-file.html

package info (click to toggle)
mplayer 1.0~rc1-12etch7
  • links: PTS
  • area: main
  • in suites: etch
  • size: 47,324 kB
  • ctags: 86,269
  • sloc: ansic: 580,415; xml: 107,529; sh: 7,643; makefile: 2,860; asm: 2,206; cpp: 1,034; objc: 865; awk: 234; perl: 82
file content (258 lines) | stat: -rw-r--r-- 21,093 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>C.2.The skin file</title><link rel="stylesheet" href="default.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="MPlayer - The Movie Player"><link rel="up" href="skin.html" title="AppendixC.MPlayer skin format"><link rel="prev" href="skin-overview.html" title="C.1.Overview"><link rel="next" href="skin-fonts.html" title="C.3.Fonts"><link rel="preface" href="howtoread.html" title="How to read this documentation"><link rel="chapter" href="intro.html" title="Chapter1.Introduction"><link rel="chapter" href="install.html" title="Chapter2.Installation"><link rel="chapter" href="usage.html" title="Chapter3.Usage"><link rel="chapter" href="cd-dvd.html" title="Chapter4.CD/DVD usage"><link rel="chapter" href="faq.html" title="Chapter5.Frequently Asked Questions"><link rel="chapter" href="containers.html" title="Chapter6.Containers"><link rel="chapter" href="codecs.html" title="Chapter7.Codecs"><link rel="chapter" href="video.html" title="Chapter8.Video output devices"><link rel="chapter" href="audio.html" title="Chapter9.Audio output devices"><link rel="chapter" href="tv.html" title="Chapter10.TV"><link rel="chapter" href="radio.html" title="Chapter11.Radio"><link rel="chapter" href="ports.html" title="Chapter12.Ports"><link rel="chapter" href="mencoder.html" title="Chapter13.Basic usage of MEncoder"><link rel="chapter" href="encoding-guide.html" title="Chapter14.Encoding with MEncoder"><link rel="appendix" href="bugreports.html" title="AppendixA.How to report bugs"><link rel="appendix" href="bugs.html" title="AppendixB.Known bugs"><link rel="appendix" href="skin.html" title="AppendixC.MPlayer skin format"><link rel="appendix" href="history.html" title="AppendixD.History"><link rel="subsection" href="skin-file.html#skin-file-main" title="C.2.1.Main window and playbar"><link rel="subsection" href="skin-file.html#skin-file-subwindow" title="C.2.2.Subwindow"><link rel="subsection" href="skin-file.html#skin-file-menu" title="C.2.3.Skin menu"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">C.2.The skin file</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="skin-overview.html">Prev</a></td><th width="60%" align="center">AppendixC.<span class="application">MPlayer</span> skin format</th><td width="20%" align="right"><a accesskey="n" href="skin-fonts.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="skin-file"></a>C.2.The skin file</h2></div></div></div><p>
As mentioned above, this is the skin configuration file. It is line oriented;
comment lines start with a '<code class="literal">;</code>' character at the beginning
of the line (only spaces and tabs are allowed before the '<code class="literal">;</code>').
</p><p>
The file is made up of sections. Each section describes the skin for an
application and has the following form:
</p><pre class="programlisting">
section = <em class="replaceable"><code>section name</code></em>
.
.
.
end
</pre><p>
</p><p>
Currently there is only one application, so you need only one section: its name is
<span class="bold"><strong>movieplayer</strong></span>.
</p><p>
Within this section each window is described by a block of the following form:
</p><pre class="programlisting">
window = <em class="replaceable"><code>window name</code></em>
.
.
.
end
</pre><p>
</p><p>
where <em class="replaceable"><code>window name</code></em> can be one of these strings:
</p><div class="itemizedlist"><ul type="disc"><li><p><span class="bold"><strong>main</strong></span> - for the main window</p></li><li><p><span class="bold"><strong>sub</strong></span> - for the subwindow</p></li><li><p><span class="bold"><strong>menu</strong></span> - for the skin menu</p></li><li><p><span class="bold"><strong>playbar</strong></span> - playbar</p></li></ul></div><p>
</p><p>
(The sub and menu blocks are optional - you do not need to create a menu or
decorate the subwindow.)
</p><p>
Within a window block, you can define each item for the window by a line in
this form:
</p><pre class="programlisting">item = parameter</pre><p>
Where <code class="literal">item</code> is a string that identifies the type of the GUI
item, <code class="literal">parameter</code> is a numeric or textual value (or a list of
values separated by commas).
</p><p>
Putting the above together, the whole file looks something like this:
</p><pre class="programlisting">
section = movieplayer
  window = main
  ; ... items for main window ...
  end

  window = sub
  ; ... items for subwindow ...
  end

  window = menu
  ; ... items for menu ...
  end

  window = playbar
  ; ... items for playbar ...
  end
end
</pre><p>
</p><p>
The name of an image file must be given without leading directories - images
are searched for in the <tt class="filename">skins</tt> directory.
You may (but you need not) specify the extension of the file. If the file does
not exist, <span class="application">MPlayer</span> tries to load the file
<tt class="filename">&lt;filename&gt;.&lt;ext&gt;</tt>, where <code class="literal">png</code>
and <code class="literal">PNG</code> are tried for <tt class="filename">&lt;ext&gt;</tt>
(in this order). The first matching file will be used.
</p><p>
Finally some words about positioning. The main window and the subwindow can
be placed in the different corners of the screen by giving <code class="literal">X</code> and
<code class="literal">Y</code> coordinates. <code class="literal">0</code> is top or left,
<code class="literal">-1</code> is center and <code class="literal">-2</code> is right or bottom, as
shown in this illustration:
</p><div class="informalfigure"><pre class="screen">
(0, 0)----(-1, 0)----(-2, 0)
  |          |          |
  |          |          |
(0,-1)----(-1,-1)----(-2,-1)
  |          |          |
  |          |          |
(0,-2)----(-1,-2)----(-2,-2)
</pre></div><p>
Here is an example to make this clear. Suppose that you have an image called
<tt class="filename">main.png</tt> that you use for the main window:
</p><pre class="programlisting">base = main, -1, -1</pre><p>
<span class="application">MPlayer</span> tries to load <tt class="filename">main</tt>,
<tt class="filename">main.png</tt>, <tt class="filename">main.PNG</tt> files.
</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="skin-file-main"></a>C.2.1.Main window and playbar</h3></div></div></div><p>
Below is the list of entries that can be used in the
'<code class="literal">window = main</code>' ... '<code class="literal">end</code>',
and the '<code class="literal">window = playbar</code>' ... '<code class="literal">end</code>'
blocks.
</p><div class="variablelist"><dl><dt><span class="term"><code class="literal">
  <a name="skin-main-base"></a>base = image, X, Y
  </code></span></dt><dd><p>
Lets you specify the background image to be used for the main window.
The window will appear at the given <code class="literal">X,Y</code> position on
the screen The window will have the size of the image.
    </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>These coordinates do not currently work for the display window.</p></div><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>Transparent regions in the image (colored #FF00FF) appear black
    on X servers without the XShape extension. The image's width must be dividable
    by 8.</p></div></dd><dt><span class="term"><code class="literal">
  <a name="skin-button"></a>button = image, X, Y, width, height, message
  </code></span></dt><dd><p>
Place a button of <code class="literal">width</code> * <code class="literal">height</code> size at
position <code class="literal">X,Y</code>. The specified <code class="literal">message</code> is
generated when the button is clicked. The image given by <code class="literal">image</code>
must have three parts below each other (according to the possible states of the
button), like this:
</p><div class="informalfigure"><pre class="screen">
+------------+
|  pressed   |
+------------+
|  released  |
+------------+
|  disabled  |
+------------+
</pre></div></dd><dt><span class="term"><code class="literal">
  <a name="skin-decoration"></a>decoration = enable|disable
  </code></span></dt><dd><p>
Enable or disable window manager decoration of the main window. Default is
<span class="bold"><strong>disable</strong></span>.
    </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This doesn't work for the display window, there is no need to.</p></div></dd><dt><span class="term"><code class="literal">
  <a name="skin-hpotmeter"></a>hpotmeter = button, bwidth, bheight, phases, numphases, default, X, Y, width, height, message
  </code></span></dt><dd><p>

    </p></dd><dt><span class="term"><code class="literal">
  <a name="skin-vpotmeter"></a>vpotmeter = button, bwidth, bheight, phases, numphases, default, X, Y, width, height, message
  </code></span></dt><dd><p>
Place a horizontal (hpotmeter) or vertical (vpotmeter) potmeter of
<code class="literal">width</code> * <code class="literal">height</code> size at position
<code class="literal">X,Y</code>. The image can be divided into different parts for the
different phases of the potmeter (for example, you can have a pot for volume
control that turns from green to red while its value changes from the minimum
to the maximum.). <code class="literal">hpotmeter</code> can have a button that can be
dragged horizontally. The parameters are:
    </p><div class="itemizedlist"><ul type="disc"><li><p><code class="literal">button</code> - the image to be used for the
    button (must have three parts below each other, like in case of
    <a href="skin-file.html#skin-button">button</a>)
    </p></li><li><p><code class="literal">bwidth</code>, <code class="literal">bheight</code> - size
    of the button
    </p></li><li><p><code class="literal">phases</code> - the image to be used for the
   different phases of the hpotmeter. A special value of <code class="literal">NULL</code>
   can be used if you want no such image. The image must be divided into
   <code class="literal">numphases</code> parts vertically like this:
    </p><div class="informalfigure"><pre class="screen">
+------------+
|  phase #1  |
+------------+
|  phase #2  |
+------------+
     ...
+------------+
|  phase #n  |
+------------+
</pre></div></li><li><p><code class="literal">numphases</code> - number of phases stored in the
    <code class="literal">phases</code> image
    </p></li><li><p><code class="literal">default</code> - default value for hpotmeter
    (in the range <code class="literal">0</code> to <code class="literal">100</code>)
    </p></li><li><p><code class="literal">X</code>, <code class="literal">Y</code> - position for the hpotmeter
    </p></li><li><p><code class="literal">width</code>, <code class="literal">height</code> - width and height
    of the <code class="literal">hpotmeter</code>
    </p></li><li><p><code class="literal">message</code> - the message to be generated when the
    value of <code class="literal">hpotmeter</code> is changed
    </p></li></ul></div></dd><dt><span class="term"><code class="literal">
  <a name="skin-potmeter"></a>potmeter = phases, numphases, default, X, Y, width, height, message
  </code></span></dt><dd><p>
A <code class="literal">hpotmeter</code> without a button. (I guess it is meant to be
turned around, but it reacts to horizontal dragging only.) For the description
of the parameters see <a href="skin-file.html#skin-hpotmeter">hpotmeter</a>.
<code class="literal">phases</code> can be <code class="literal">NULL</code>, but it is quite useless,
since you cannot see where the <code class="literal">potmeter</code> is set.
    </p></dd><dt><span class="term"><code class="literal">
  <a name="skin-font"></a>font = fontfile, fontid
  </code></span></dt><dd><p>
Defines a font. <code class="literal">fontfile</code> is the name of a font description file
with a <tt class="filename">.fnt</tt> extension (do not specify the extension here).
<code class="literal">fontid</code> is used to refer to the font (see <a href="skin-file.html#skin-dlabel">dlabel</a>
and <a href="skin-file.html#skin-slabel">slabel</a>). Up to 25 fonts can be defined.
    </p></dd><dt><span class="term"><code class="literal">
  <a name="skin-slabel"></a>slabel = X, Y, fontid, "text"
  </code></span></dt><dd><p>
Place a static label at the position <code class="literal">X,Y</code>. <code class="literal">text</code>
is displayed using the font identified by <code class="literal">fontid</code>. The text is
just a raw string (<code class="literal">$x</code> variables do not work) that must be enclosed
between double quotes (but the " character cannot be part of the text). The
label is displayed using the font identified by <code class="literal">fontid</code>.
    </p></dd><dt><span class="term"><code class="literal">
  <a name="skin-dlabel"></a>dlabel = X, Y, length, align, fontid, "text"
  </code></span></dt><dd><p>
Place a dynamic label at the position <code class="literal">X,Y</code>. The label is called
dynamic because its text is refreshed periodically. The maximum length of the
label is given by <code class="literal">length</code> (its height is the height of a
character). If the text to be displayed is wider than that, it will be scrolled,
otherwise it is aligned within the specified space by the value of the
<code class="literal">align</code> parameter: <code class="literal">0</code> is for right,
<code class="literal">1</code> is for center, <code class="literal">2</code> is for left.
</p><p>
The text to be displayed is given by <code class="literal">text</code>: It must be written
between double quotes (but the " character cannot be part of the text). The
label is displayed using the font identified by <code class="literal">fontid</code>. You
can use the following variables in the text:
</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Variable</th><th>Meaning</th></tr></thead><tbody><tr><td>$1</td><td>play time in <span class="emphasis"><em>hh:mm:ss</em></span> format</td></tr><tr><td>$2</td><td>play time in <span class="emphasis"><em>mmmm:ss</em></span> format</td></tr><tr><td>$3</td><td>play time in <span class="emphasis"><em>hh</em></span> format (hours)</td></tr><tr><td>$4</td><td>play time in <span class="emphasis"><em>mm</em></span> format (minutes)</td></tr><tr><td>$5</td><td>play time in <span class="emphasis"><em>ss</em></span> format (seconds)</td></tr><tr><td>$6</td><td>movie length in <span class="emphasis"><em>hh:mm:ss</em></span> format</td></tr><tr><td>$7</td><td>movie length in <span class="emphasis"><em>mmmm:ss</em></span> format</td></tr><tr><td>$8</td><td>play time in <span class="emphasis"><em>h:mm:ss</em></span> format</td></tr><tr><td>$v</td><td>volume in <span class="emphasis"><em>xxx.xx</em></span>% format</td></tr><tr><td>$V</td><td>volume in <span class="emphasis"><em>xxx.xx</em></span> format</td></tr><tr><td>$b</td><td>balance in <span class="emphasis"><em>xxx.xx</em></span>% format</td></tr><tr><td>$B</td><td>balance in <span class="emphasis"><em>xxx.xx</em></span> format</td></tr><tr><td>$$</td><td>the $ character</td></tr><tr><td>$a</td><td>a character according to the audio type (none: <code class="literal">n</code>,
mono: <code class="literal">m</code>, stereo: <code class="literal">t</code>)</td></tr><tr><td>$t</td><td>track number (in playlist)</td></tr><tr><td>$o</td><td>filename</td></tr><tr><td>$f</td><td>filename in lower case</td></tr><tr><td>$F</td><td>filename in upper case</td></tr><tr><td>$T</td><td>a character according to the stream type (file: <code class="literal">f</code>,
Video CD: <code class="literal">v</code>, DVD: <code class="literal">d</code>, URL: <code class="literal">u</code>)</td></tr><tr><td>$p</td><td>the <span class="keycap"><b>p</b></span> character (if a movie is playing and the font has
the <span class="keycap"><b>p</b></span> character)</td></tr><tr><td>$s</td><td>the <span class="keycap"><b>s</b></span> character (if the movie is stopped and the font has
the <span class="keycap"><b>s</b></span> character)</td></tr><tr><td>$e</td><td>the <span class="keycap"><b>e</b></span> character (if playback is paused and the font has
the <span class="keycap"><b>e</b></span> character)</td></tr><tr><td>$x</td><td>movie width</td></tr><tr><td>$y</td><td>movie height</td></tr><tr><td>$C</td><td>name of the codec used</td></tr></tbody></table></div></dd></dl></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
The <code class="literal">$a, $T, $p, $s</code> and <code class="literal">$e</code>
variables all return characters that should be displayed as special symbols (for
example, <span class="keycap"><b>e</b></span> is for the pause symbol that usually looks something
like ||). You should have a font for normal characters and a different font for
symbols. See the section about <a href="skin-fonts.html#skin-fonts-symbols" title="C.3.1.Symbols">symbols</a>
for more information.
</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="skin-file-subwindow"></a>C.2.2.Subwindow</h3></div></div></div><p>
The following entries can be used in the
'<code class="literal">window = sub</code>' . . . '<code class="literal">end</code>' block.
</p><div class="variablelist"><dl><dt><span class="term"><code class="literal">
  <a name="skin-sub-base"></a>base = image, X, Y, width, height
  </code></span></dt><dd><p>
The image to be displayed in the window. The window will appear at the given
<code class="literal">X,Y</code> position on the screen (<code class="literal">0,0</code> is the
top left corner). You can specify <code class="literal">-1</code> for center and <code class="literal">-2</code>
for right (<code class="literal">X</code>) and bottom (<code class="literal">Y</code>). The window
will be as large as the image. <code class="literal">width</code> and <code class="literal">height</code>
denote the size of the window; they are optional (if they are missing, the
window is the same size as the image).
    </p></dd><dt><span class="term"><code class="literal">
  <a name="skin-background"></a>background = R, G, B
  </code></span></dt><dd><p>
Lets you set the background color. It is useful if the image is smaller than
the window. <code class="literal">R</code>, <code class="literal">G</code> and <code class="literal">B</code>
specifies the red, green and blue component of the color (each of them is a
decimal number from 0 to 255).
    </p></dd></dl></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="skin-file-menu"></a>C.2.3.Skin menu</h3></div></div></div><p>
As mentioned earlier, the menu is displayed using two images. Normal menu
entries are taken from the image specified by the <code class="literal">base</code> item,
while the currently selected entry is taken from the image specified by the
<code class="literal">selected</code> item. You must define the position and size of each
menu entry through the menu item.
</p><p>
The following entries can be used in the
'<code class="literal">window = menu</code>'. . .'<code class="literal">end</code>' block.
</p><div class="variablelist"><dl><dt><span class="term"><code class="literal">
  <a name="skin-menu-base"></a>base = image
  </code></span></dt><dd><p>
The image for normal menu entries.
    </p></dd><dt><span class="term"><code class="literal">
  <a name="skin-selected"></a>selected = image
  </code></span></dt><dd><p>
The image showing the menu with all entries selected.
    </p></dd><dt><span class="term"><code class="literal">
  <a name="skin-menu"></a>menu = X, Y, width, height, message
  </code></span></dt><dd><p>
Defines the <code class="literal">X,Y</code> position and the size of a menu entry in
the image. <code class="literal">message</code> is the message to be generated when the
mouse button is released over the entry.
    </p></dd></dl></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="skin-overview.html">Prev</a></td><td width="20%" align="center"><a accesskey="u" href="skin.html">Up</a></td><td width="40%" align="right"><a accesskey="n" href="skin-fonts.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">C.1.Overview</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">C.3.Fonts</td></tr></table></div></body></html>