Thanks to Zoltán Ponekker for his help.
András Mohari <mayday@freemail.hu>
/usr/local/share/mplayer/Skin/ ~/.mplayer/Skin/
Note that the first path may vary according to the way MPlayer was configured
(see the --datadir
argument of the configure
script).
Every skin is installed into its own directory under one of the directories listed above, for example:
/usr/local/share/mplayer/Skin/default/
In the main window (see below) you can use images with `transparency': regions filled with the color #FF00FF (magenta) are fully transparent when viewed by MPlayer. This means that you can even have shaped windows if your X server has the XShape extension.
Currently there are three windows to be decorated: the main window, the subwindow and the skin menu (which can be activated by a right click).
A button has three states (pressed, released, disabled), so its image must be divided into three parts vertically. See the button item for details.
A potmeter (mainly used for the seek bar and volume/balance control) can have any number of phases by dividing its image into different parts below each other. See hpotmeter and potmeter for details.
Labels are a bit special: the characters needed to draw them are taken from an image file, and the characters in the image are described by a font description file. The latter is a plain text file which specifies the x,y position and size of each character in the image. (So the image file and its font description file form a font together.) See dlabel and slabel for details.
Note: all images can have full transparency as described in the section about image formats.
A menu entry is defined by its position and size in the image (see the section about the skin menu for details).
There is an important thing not mentioned yet: for buttons, potmeters and menu entries to work, MPlayer must know what to do if they are clicked. This is done by messages (events). For these items you must define the messages to be genereated when they are clicked.
skin
file
As mentioned above, this is the skin configuration file.
It is line oriented; comment lines start with a ';
' character
at the beginning of the line (only spaces and tabs are allowed before the
';
').
The file is made up of sections. Each section describes the skin for an application and has the following form:
section = section name . . . end |
Currently there is only one application, so you need only one section: its name is movieplayer.
Within this section each window is described by a block in the following form:
window = window name . . . end |
(The sub and menu block is optional---you do not need to create a menu or to decorate the subwindow.)
Within a window block, you can define each item for the window by a line in this form:
item = parameter
where item is a string that identifies the type of the GUI item, parameter is a numeric or textual value (or a list of values separated by commas).
Putting the above together, the whole file looks something like this:
section = movieplayer window = main ; ... items for main window ... end window = sub ; ... items for subwindow ... end window = menu ; ... items for skin menu ... end end |
Finally some words about specifying images for the various items.
The name of an image file must be given without leading directories---
images are searched in the directory of the skins. You may (but you need not)
specify the file's extension. If the file doesn't exist, MPlayer tries to
load the file <filename>.<ext>, where tga,
TGA, bmp, BMP, png and PNG is tried
for <ext> (in this order). The first matching file will be used.
Here is an example to make this clear. Suppose that you have an image called
main.png that you use for the main window:
MPlayer tries to load main, main.tga, main.TGA, main.bmp etc, so main.png will be found.base = main, -1, -1 If (by accident) you wrote then main.bmp, main.bmp.tga, main.bmp.TGA, main.bmp.bmp would be searched and MPlayer would finally give up because there is no main.bmp in the directory, but main.png.base = main.bmp, -1, -1 |
window = main
' . . . 'end
' block.
Warning: transparent regions in the image (colored #FF00FF) appear black on X servers without the XShape extension.
+------------+ | pressed | +------------+ | released | +------------+ | disabled | +------------+ |
+------------+ | phase #1 | +------------+ | phase #2 | +------------+ ... +------------+ | phase #n | +------------+ |
NULL
, but its quite useless, since you can not see where
the potmeter is set.
.fnt
extension (no need to specify the extension
here).
fontid is used to refer to the font
(see dlabel and slabel).
Up to 25 fonts can be defined.
"
) (but the "
cannot be part of the
text). The label is displayed using the font identified by fontid.
You can use the following variables in the text.
Variable | Meaning |
---|---|
$1 | play time in hh:mm:ss format |
$2 | play time in mmmm:ss format |
$3 | play time in hh format (hours) |
$4 | play time in mm format (minutes) |
$5 | play time in ss format (seconds) |
$6 | movie's length in hh:mm:ss format |
$7 | movie's length in mmmm:ss format |
$8 | play time in h:mm:ss format |
$v | volume in xxx.xx% format |
$V | volume in xxx.x format |
$b | balance in xxx.xx% format |
$B | balance in xxx.x format |
$$ | the $ character |
$a | a character according to the audio type (none: n ,
mono: m , stereo: t ) |
$t | track number (in playlist) |
$o | filename |
$f | filename in lower case |
$F | filename in upper case |
$T | a character according to the stream type (file: f ,
video CD: v , DVD: d , URL: u )
|
$p | the "p" character (if a movie is playing and the font has the "p" character) |
$s | the "s" character (if the movie is stopped and the font has the "s" character) |
$e | the "e" character (if playback is paused and the font has the "e" character) |
Note: The $a, $T, $p, $s
and $e variables all return characters that should be displayed
as special symbols (for example, "e" 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 symbols for more information.
"
cannot be part of the text).
The label is displayed using the font identified by fontid.
window = sub
' . . . 'end
' block.
These are the items that can be used in the 'window = menu
'
. . . 'end
' block.
The font description file (with .fnt extension) can have comment
lines starting with ';
'.
The file must have a line in the form
image = image
where image is the name of the image file to be used for the font (you do not have to specify the extension). The above line is followed by character definition lines of the form:
"char" = x, y, w, h
Here x and y specifies the position of the char character in the image (0,0 is the upper left corner). w and h is the width and height of the character (in pixels, of course).
Here is an example that defines the A, B, C characters using font.png.
; can be "font" instead of "font.png" image = font.png ; Three characters are enough for demonstration only. :-) "A" = 0,0, 7,13 "B" = 7,0, 7,13 "C" = 14,0, 7,13 |
The following table lists all the characters that can be used to display symbols (and thus require a different font).
Character | Symbol |
---|---|
p | play |
s | stop |
e | pause |
n | no sound |
m | mono sound |
t | stereo sound |
f | stream is a file |
v | stream is a video CD |
d | stream is a DVD |
u | stream is a URL |
Note: currently only 'p', 's', 'e', 'n', 'm' and 't' is used.
Note: some of the messages might not work as expected (or not work at all). As you know, the GUI is under development.
Playback control:
- evNext
- Jump to next track in the playlist.
- evPause
- Pause playing.
- evPauseSwitchToPlay
- Forms a switch together with evPlaySwitchToPause. They can be used to have a common play/pause button. Both messages should be assigned to buttons displayed at the very same position in the window. This message pauses playing and the image for the evPlaySwitchToPause button is displayed (to indicate that the button can be pressed to continue playing).
- evPlay
- Start playing.
- evPlaySwitchToPause
- The opposite of evPauseSwitchToPlay. This message starts playing and the image for the evPauseSwitchToPlay button is displayed (to indicate that the button can be pressed to pause playing).
- evPrev
- Jump to previous track in the playlist.
- evStop
- Stop playing.
Seeking in the stream:
- evBackward10sec
- evBackward1min
- evBackward10min
- Seek backward 10 seconds / 1 minute / 10 minutes.
- evForward10sec
- evForward1min
- evForward10min
- Seek forward 10 seconds / 1 minute / 10 minutes.
- evSetMoviePosition
- Seek to position (can be used by a potmeter; the relative value (0-100%) of the potmeter is used).
Video control:
- evDoubleSize
- Set the movie window to double size.
- evFullScreen
- Switch fullscreen mode on/off.
- evNormalSize
- Set the movie window to its normal size.
Audio control:
- evDecAudioBufDelay
- Decrease audio buffer delay.
- evDecBalance
- Decrease balance.
- evDecVolume
- Decrease volume.
- evIncAudioBufDelay
- Increase audio buffer delay.
- evIncBalance
- Increase balance.
- evIncVolume
- Increase volume.
- evMute
- Mute/unmute the sound.
- evSetBalance
- Set balance (can be used by a potmeter; the relative value (0-100%) of the potmeter is used).
- evSetVolume
- Set volume (can be used by a potmeter; the relative value (0-100%) of the potmeter is used).
Miscellaneous:
- evAbout
- Open the about window.
- evEqualeaser
- Turn the equalizer on/off.
- evExit
- Quit from the program.
- evIconify
- Iconify the window.
- evLoad
- Load a file (by opening a file browser window, where you can choose a file).
- evLoadPlay
- Does the same as evLoad, but it automatically starts playing after the file is loaded.
- evNone
- Empty message, it has no effect. (Except maybe in CVS versions. :-))
- evPlayList
- Open/close the playlist window.
- evPreferences
- Open the preferences window.
- evSkinBrowser
- Open the skin browser window.