OggPlay:
home
Help forums
Skin gallery
Skin design
Credits
History


Ports:
UIQ
Series 60
Series 60 MMF
Series 60 V3
Series 80
Series 90


SourceForge.net Logo

Symbian OggPlay

Designing Skins for OggPlay

Introduction

This document describes how to implement a new skin for OggPlay. OggPlay has two canvases, one for flip-open and one for flip-closed mode. The flip-closed canvas is optional (i.e. not required for devices which have only one screen mode). The canvases contain controls. The skin is defined by a multiple bitmap file and a skin definition file. Here is an outline of what you need to do:
  1. Create a background bitmap for each canvas (flip-open: 208x254 pixels; flip-closed: 208x144 pixels) 
  2. Create bitmaps for each control you are going to use (see below for a list of supported controls and their bitmaps)
  3. Combine all bitmaps in a multiple bitmap file and name it MySkin.mbm, where MySkin is the name of your new skin.
  4. Write a skin definition file. This is a simple ascii text file (use an arbitrary text editor to create it) with extension .skn. This file contains all the information that is needed to dynamically create controls and place them on the canvas. As an example look at the file OggPlay.skn (the default skin). Name the file MySkin.skn, where MySkin is the name of your new skin.
  5. Copy the skin definition file and the multiple bitmap file to your device (to the application directory, usually c:\system\apps\OggPlay). If you are a M$ Windows user you may need to copy the files elsewhere and then move them with the P800 file manager to their final destination.
  6. Start OggPlay and select the new skin using the menu item <Skins>.
To create the multiple bitmap file (step 3) you will need the utility BMCONV.EXE. It is part of the free Symbian SDKs from the developer world at www.ericsson.com. Install the SDK and look for the file BMCONV.EXE (btw: if you have a wine installation you can run this tool flawlessly with linux). The SDK is rather big for downloading. I have found alternative places where you can find this utility (some of these may be older version which support only gray scale images, I have not tested this!!!) :
  • http://www.pison.de/mbm2bmp/1.html
  • http://www.pscience5.net/freeware/BMCONV.zip
  • http://aikon.webplaza.ch/bmconv.exe
  • http://www.prosoft.force9.co.uk/oplzone/bmconv.zip
  • http://homepages.nildram.co.uk/~nicko/zips/bmconv.exe
  • http://www.millican.info/files/bmconv.zip
  • http://www.opl32.com/Trucs/PRG/BWar/Download/Bmconv.exe
Now let's have a look at the details.

The multiple bitmap file

There is one multiple bitmap file (mbm) for each skin. It contains all bitmaps needed to display the skin. The first 20 bitmaps in the file have a special meaning. The playlist listbox uses images (one bitmap + mask bitmap each) of fixed size 20x16 as follows:

index
remark
0 icon for a track title
2 icon for an album
4 icon for an artist
6 icon for a genre
8 icon for a folder
10 icon for a file
12 icon representing the action "go back"
14 icon representing the state "playing"
16 icon representing the state "paused"
18
background image for flip-close mode
19
background image for flip-open mode

The index in the above table is the ordinal position of the bitmap in the multiple bitmap file. It is used later in the skin definition file to refer to specific bitmaps. The remaining bitmaps can be assigned freely. The skin defintion file defines how the remaining bitmaps are used. All bitmaps are combined into one multiple bitmap file as follows:
  BMCONV.EXE MySkin.mbm /c12title.bmp /1titlem.bmp /c12cdicon.bmp /1cdiconm.bmp
This example will create a multiple bitmap file called MySkin.mbm with four bitmaps. The 1st bitmap is the color bitmap (2^12 colors) title.bmp, the 2nd one is the monochrome bitmap titlem.bmp (the mask), and so on. You get the idea. You will end up with a rather long "bmconv.exe ..." statement. I recommend to put it in a batch file which can be executed easily again whenever the bitmaps have been modified.

The skin definition file

The dault skin of OggPlay is defined in OggPlay.skn. When designing a new skin it makes sense to take this file and modify it. This file looks something like this:
OggPlay 1 {
FlipOpen {
Clock {
Position 73 3 59 14
}
Alarm {
Position 134 3 59 14
}
...
}
FlipClosed {
...
}
}
It always starts with the keyword OggPlay followed by a version number for the file format (currently always 1). This is followed by the definition of the FlipOpen canvas, and later the FlipClosed if available. Each canvas section then defines the controls that belong to it and their position and further attributes of each control. In the above example the clock is displayed at position (x=73,y=3) with a width of 59 and a height of 14 pixels. The following control objects are defined:

Object Control type
Remark
Alarm Text
The alarm time (if an alarm is set)
AlarmIcon Icon
Icon indicating that an alarm is set (will be hidden if unset)
Album Text
The name of the album currently playing.
Analyzer
Analyzer
The spectrum analyzer.
Animation
Animation
Plays a sequence of bitmaps, it's similar to an animated gif file.
Artist Text
The name of the artist currently playing.
Clock Text
The current time.
Genre Text
The genre of the song currently playing.
Listbox ListBox
The listbox with the playlist etc.
Logo
Animation
Plays a sequence of bitmaps, it's similar to an animated gif file. This is only visible while _no_ song is playing!
NextSongButton
Button
A button which plays the next song in the playlist.
PauseButton
Button
A button which pauses the plackback. It is visible only if a song is currenlty playing. Please see also the comments for PlayButton!
PauseButton2
Button
Just like PauseButton, but it will always be visible. See comments for PlayButton.
PausedIcon Icon
A icon indicating that the playback is paused.
PlayButton
Button
A button which play the selected song, or resumes the paused song. Will be hidden if player is in paused mode. Will be dimmed if no playable song is selected in the listbox. This button can be used in conjunction with the PauseButton, overlaying the two buttons at the same place - only one will be visible at a time.
PlayButton2
Button
Just like PlayButton, but it will always be visible. See comments for PlayButton.
Played Text
Time played and total time in the format "00:00 / 00:00".
PlayedDigits
Digits Time played displayed with bitmapped digits (see description of Digits control below).
TotalDigits
Digits
Total song time displayed with bitmapped digits (see description of Digits control below).
PlayingIcon Icon
An icon indicating that a song is playing.
Position Slider
The song position slider. Will be inactive/dimmed if no song is playing.
PrevSongButton
Button
A button which plays the previous song in the playlist.
RepeatButton
Button
A two state button which is used for enabling/disabling repeat mode.
RepeatIcon
Icon
An icon indicating that the repeat mode is on (will be hidden if repeat is off).
Scrollbar ScrollBar
The scrollbar associated with the listbox.
StopButton
Button
A button that stops playback. Will be dimmed if no song is playing.
Title Text
The title of the song currently playing.
TrackNumber Text
The tracknumber of the song currently playing.
Volume Slider
The volume slider.

The attributes that each control can have are defined by the control type:
  • Common to all objects is the attribute Position followed by four numbers, representing the x,y pixel position and the width and height.  The position (x=0,y=0) corresponds to the top left of the screen.
  • Icon
    Uses two bitmaps of the same size. The size is arbitrary. The 1st one is the actual icon bitmap and the 2nd one is a monochrom mask which defines the transparent pixels of the icon: All white parts will be transparent (the background bitmap shines through). One can use one and the same bitmap for the image and its mask. The attribute name is Icon followed by the index of the image and the mask bitmap. An icon can blink with a given frequency. Use the attribute BlinkFrequency followed by a number (I think it's in units of 1/10th second or so).
  • Slider
    This currently takes just one bitmap plus a mask: For the knob of the slider. The slider "background" is assumed to be visible in the background image of the canvas. The size of the knob icon can be choosen arbitrarily. The attribute name is KnobIcon followed by the index of the image bitmap and the mask bitmap. There are severl slider styles (use the attribute Style): 0= part of bitmap is drawn, opened from left to right; 1= like 0 but opening from bottom to top; 2= a knob bitmap is moved from left to right; 3= same as 2, but moving from bottom to top. Styles 0 and 2 work, the others are not really tested.
  • Button
    This one takes several bitmaps and masks. All of them are optional though (one could draw the button as part of the background canvas image, and therefore does not need to supply any additional images). These images are for the several states of the button: Normal/Pressed/Dimmed. The latter three bitmaps also require a mask bitmap each. In addition one can assign a monochrom bitmap which defines the active areas of the button, i.e. the areas where a stylus tip will trigger the button (the attribute name is ActiveMask, followed by the index of the mask bitmap). Black areas are active, white areas are inactive. The attribute names are NormalIcon,PressedIcon, DimmedIcon, each followed by the index of the image and the mask bitmaps.
  • Analyzer
    Takes one bitmap which represents one bar in the analyzer. It should be something like 3 pixels wide to be usable and the height can be choosen arbitrarily. The atrribute name is BarIcon, followed by the indices of the image and the mask bitmaps.
  • ScrollBar
    This currently takes only one bitmap (plus mask): The knob. The attribute name is KnobIcon, followed by the indices of the image and the mask bitmaps. The style attribute defines if the scrollbar is vertical (0) or horizintal (1). The step attribute defines the number of lines that are scrolled if the scrollbar arrows are pressed. The page attribute defines the number of lines that are scrolled when the scrollbar shaft is klicked. The ScrollerSize attribute defined the sizte in pixels of the scroll bar arrows (i.e. the height in case of a vertical scrollbar and the width in case of a horizontal scroll bar).
  • ListBox:
    The listbox takes the images from the multiple bitmap file as described earlier. The font color is set by the FontColor attribute, followed by three numbers ranging from 0 to 255 for the red, green, and blue part. The color of the selected song is set by the attribute FontColorSelected in the same way. The attribute Font is followed by the font name, the font size in twips, and the font style (0= normal; 1= bold). See the table below for available font names and sizes.
  • Text:
    The font color is set by the FontColor attribute, followed by three numbers ranging from 0 to 255 for the red, green, and blue part. The attribute Font is followed by the font name, the font size in twips, and the font style (0= normal; 1= bold). The following fonts are available: 
    SwissA
    4 sizes in the range 10-19
    Courier
    only size 8
    Symbol
    2 sizes in the range 11-16
    Eikon
    only size 15
  • Animation:
    The attributes FirstBitmap and NumBitmaps define the bitmap indices used for the animation. The attribute Frequency defines the animation speed (default is 2), and Pause defines the amount of time inbetween two animation cycles. Style defines how the animation is played (0= pause, then from beginning to end; 1= pause, from beginning to end and reverse to beginning).
  • Digits:
    This control takes bitmaps and mask bitamps for the numbers 0,1,2, ..., 9 and for the characters : - / . in this order. The attribute Bitmaps is followed by the index of the "0" bitmap. The attribute Masks is followed by the index of the "0" mask bitmap. The masks are optional.



(c) 2003-2008 by OggPlay Team