-->
Save your seat for Streaming Media NYC this May. Register Now!

Creating Custom Skins For RealOne, Part 2

Tutorial

This is the second part of an extensive tutorial -- To see Part 1 click here.

Contents

  • Creating the skin.ini file
  • Putting it together
  • Reference

    Creating the skin.ini file

    So far you've created, laid out and saved all the graphics that will compose the interface. Now it's time to create the skin.ini file, which will tell RealOne how to assemble all the pieces and what each piece does.

    Only a masochist would make a Real skin from scratch. Real has a free skinning tool called the RealOne Skins Toolkit, available at htt p://proforma.real.com/real/rjcentral/skins_upload/toolkit.html.

    Once you've downloaded the "Skins2Tooklit.exe file, double-click it to install the Skins2Toolkit on your Windows 95, 98, ME, 2000, NT or XP box. The installer creates a folder called Skins2Toolkit, containing help files and a Sample Files folder.

    The Sample Files folder has a premade skin.ini file that we'll use as our roadmap as we make our own custom version. Copy the skin.ini file from the Sample Files folder to a new folder on your desktop and open it in your text editor of choice.

    The file looks like this:

    Application=RealOneVersion=2.0RecordShow=0PlayShow=0StopShow=0PauseShow=0PreviousShow=0NextShow=0ContinueShow=0ShuffleShow=0EjectShow=0MenuShow=0ExitShow=0MinimizeShow=0FullModeShow=0RPLaunchShow=0MuteShow=0VolShow=0PosShow=0PlayStatusShow=0RecordStatusShow=0RealLogoShow=0...

    There are two kinds of lines in the file:

    1. Comments. These lines begin with a semicolon (";"). RealOne ignores these lines -- they're used by people like you and I to make notes to ourselves (";This is the play button")
    2. Declarations. These are lines where you declare that some property (i.e., Application) has some value (RealOne). A declaration takes the general form of property=value.

    You edit the file by changing, adding and deleting declarations.

    Commenting out

    Since RealOne ignores lines that begin with semicolons, you can use semicolons while troubleshooting your skin to "comment out" lines that you want to eliminate as possible culprits without deleting them altogether. Simply put a semicolon at the start of a line and RealOne will skip past it.

    Default button visibility

    RealOne has a number of default buttons with predefined names and behaviours:

    • Record
    • Play
    • Stop
    • Pause
    • Previous
    • Next
    • Continue
    • Shuffle
    • Eject
    • Menu
    • Exit
    • Minimize
    • FullMode
    • RPLaunch
    • Mute
    • Vol
    • Pos
    • PlayStatus
    • RecordStatus
    • RealLogo

    Each of these buttons has a corresponding .bmp or .jpg file in the skin's ZIP archive. Above, you learned how to make your own images and replace Real's graphics; in this section, you'll learn how to tell Real which buttons to show, and when.

    Right below the skin.ini file's version number there are a list of "Show" declarations that determine which buttons get shown and under what conditions. There's one line for each default button, taking the form Show=[0|1|conditional].

    Buttons whose show property is set to 0 are not shown; buttons whose show property is set to 1 are always shown.

    Conditional values -- like "Playing" and NotPlaying" -- are treated by the skin like 1's (true) when the condition they specify is met and like 0's when the condition they specify is not met. So a control whose Show property is set to Playing would be displayed during play and would be invisible while playing was stopped. A full glossary of conditionals is availble further down in this document.

    To make the Play control visible at all times:

    PlayShow=1

    To make the Play control hidden at all times:

    PlayShow=0

    To make the Play control visible only during play:

    PlayShow=Playing

    To make the Pause control visible when play has stopped:

    PauseShow=NotPlaying

    The last two examples show how a Play button can be replaced with a Pause button when playback is stopped, and vice versa.

    Here's a similar example for the Stop button:

    PlayShow=NotPlaying

    StopShow=Playing

    TopLeft

    Beneath the Show property definitions are the "xxxTopLeft" parameters. These specify the location, in pixels, of the top left corner of each button-image in relation to the background images own top left corner. This parameter is defined with a pair of positive integers separated by a comma. The first value is the x (horizontal) offset, and the second is the y (vertical) offset.

    For example:
    PlayTopLeft=52,20StopTopLeft=86,20PreviousTopLeft=120,20NextTopLeft=154,20MenuTopLeft=222,20ExitTopLeft=290,22FullModeTopLeft=231,60

    Notice that buttons can overlap -- in the above example, the Play and Stop buttons are placed in the same location, and are selectively hidden and shown based on conditional values in their Show properties.

    Custom controls

    Custom controls execute commands from a small vocabulary of available actions (see Real Custom Commands Glossary, below). These commands -- like EditTrackInfo -- have simple, self-explanatory names, and invoke screens, panels and windows that are available through Real's menus.

    Additionally, custom controls can open URLs in your default browser. A custom control can be used to spawn a new browser window that contains the home-page of the skin's author, or a message-board for discussing skins, or a music search-engine, or any other Web page on the Internet.

    Making "Buttons" out of your Custom Controls

    Custom controls can be used to take users to a website or perform custom actions. If you want your custom control to behave like a button, you'll have to design your art accordingly to correspond to the appropriate states.

    You'll also need to set your Control1Isbutton property to "1" in your skin.ini file, where you'll also specify the name of the image file containing the four states and the X,Y coordinates for its top left corner within your skin's layout.

    You'll also need to specify the functions you want the control to perform.

    Custom controls are set and specified with a block of four to five lines each:

    1. Control[1,2,3...n]Image=
      Specifies which image to use for the control
    2. Control[1,2,3...n]TopLeft=,
      Specifies location of control
    3. Control[1,2,3...n]Show=[0|1|conditional]
      Specifies control whether and when control is visible
    4. Control[1,2,3...n]ToolTip=
      A word or phrase that is displayed in a tooltip when the mouse hovers over the control.
    5. Control[1,2,3...n]URL=
      This one is more confusing -- you can either specify the URL of a web-page to be opened when the user clicks on the control, or you can specify a custom command as a pseudo-URL as described in the glossary. This line is optional -- if you omit it, the button will just sit there, and pop up a tooltip when the cursor is swiped over it. [TK - do custom controls have states?]

    Here are some code samples for custom controls:

    Control1Image=bubble.bmpControl1TopLeft=187,35Control1Show=PlayingControl1ToolTip=RealNetworksControl2Image=rjblogo.bmpControl2TopLeft=17,67Control2IsButton=0Control2URL=http://RealOne.real.comControl2ToolTip=Visit RealOne Central

    Status Fields

    Status fields are little text boxes that display information about the current or upcoming track. You define status fields in much the same way as you define a custom control, with a series of lines that describe the field, its format and its contents. Your skin can have as many as 30 customized status fields.

    The status section of the skin.ini file begins with a line that says: [STATUS], followed by lines defining the default sont size, style and color:
    DefaultFontName=Lucida ConsoleDefaultFontBold=1DefaultFontHeight=11

    After the defaults are defined, you create a block of text to describe each of your status fields. Here's the syntax for defining a status field:

    Status[1,2,3,..n]Type=
    For a complete listing of Status Types, see the
    status types glossary.

    Status[1,2,3,...n]Rect=,,,
    The four comma-separated integers after the equals-sign define both the size and position of the status-field

    Additionally, there are a number of optional flags for setting text color, background color, scrolling options and more. We've included a reference section that describes all of these flags.

    Here is the code in our skin.ini file that enables our Status Fields to be displayed:

    [STATUS]DefaultFontName=Lucida ConsoleDefaultFontBold=1DefaultFontHeight=11Status1Type=PlayTitleStatus1Rect=20,44,147,62;Status1TextColor=72,72,104;Status1BackgroundColor=26,169,193Status2Type=PlayTimeElapsedStatus2Rect=155,44,230,62;Status2Show=playingStatus3Type=PlayArtistStatus3Rect=20,64,159,77

    If we uncomment the last two lines in our PlayTitle, it will enable the formatting information to be applied:

    Status1TextColor=72,72,104Status1BackgroundColor=26,169,193

    Here is an example of our "PlayArtist" status field. Note the "FontHeight" and "Bold" values are explicitly-defined and will therefore override the default settings.

    If we uncomment the "Status2Show=playing" declaration, the Time Elapsed status window will only display when a selection is "playing."

    Putting it Together

    Let's review the steps we've taken so far:

    1. Laid out the skin in an image-editor, using different layers for each element, mapping in transparent regions with magenta
    2. Measured the offset of the top-left corner of each element relative to the background
    3. Created mutliple states for each of the predefined buttons
    4. Saved each object as a BMP or JPEG, taking care to name them appropriately
    5. Edited the skin.ini file so that it contains positional and behavioural data for all the elements

    We're almost home free; only two steps remain:

    1. Create a .rjs archive of the files
    2. Open the skin in RealOne

    Create the .rjs archive

    Make sure that all your graphics files and your skin.ini file are in the same directory. Give the directory a distinctive name -- this will be the name of your skin -- i.e., "El_Skin_Supremo."

    Troubleshooting images

    If your skin is showing up with default RealOne images for its buttons instead of your lovingly created graphics, don't panic. RealOne substitutes its default images when it can't find custom ones in your skin -- you've probably misspelled your filename when you saved the image.

    Use your favorite ZIP utility to ZIP the archive. Now you've got a single file called "El_Skin_Supremo.zip" (of course, if you named your skin folder something else, like "El_Skin_Horrible," the file will be called "El_Skin_Horrible.zip").

    Rename that file, changing the .zip extension to .rjs

    Open your skin

    To launch your skin, just double-click it -- RealOne will launch and with your skin as its controller.

    Reference

    Default RealOne buttons

    Control Name Description File name (may be .bmp or .jpg)
    Record Record Button record.bmp
    Play Play Button play.bmp
    Pause Pause Button pause.bmp
    Stop Stop Button stop.bmp
    Previous Previous Track Button previous.bmp
    Next Next Track Button next.bmp
    Continue Continuous Play Mode Button continue.bmp
    Shuffle Shuffle Play Mode Button shuffle.bmp
    Mute Mute Button mute.bmp
    Exit Exit Button exit.bmp
    Minimize Minimize Button minimize.bmp
    Menu Menu Button menu.bmp
    FullMode Full Mode Button fullmode.bmp
    Vol Volume Slider voltrack.bmp &volthumb.bmp
    Pos Track Position Slider (not shown by default) postrack.bmp &posthumb.bmp
    Eject Eject Button eject.bmp
    RealLogo Real Logo Button reallogo.bmp
    CDInfo Get CDInfo (not shown by default) cdinfo.bmp
    PlayStatus Standard Play Status Window N/A
    RecordStatus Standard Record Status Window N/A
    RPLaunch Launch RealOne Button rplaunch.bmp

    Real conditional settings glossary

    Condition Shows control when
    Playing a track is playing
    NotPlaying a track is not playing
    Paused playback is paused
    Not Paused playback is not paused
    Recording RealOne is recording from CD
    NotRecording RealOne is not recording from CD
    CDReady a CD is in the drive
    Not CDReady no CD is in the drive

    Real custom commands glossary

    RealOne 2.0 Skins extend the actions that may be carried out by custom controls. Additionally, hyperlinks within HTML browsers in Skins may also execute actions. Note: You can only define one action for each custom control.

    For example:

    Control1Action=ShowPreferences shows the preferences dialog.

    The HTML syntax for the same action in a hyperlink would be:

    Click To Show Preferences

    Description
    Command
    ShowTemplatesMenu Shows popup menu of Track Info Styles.
    EditTrackInfo Shows Track Info Editor for current track.
    ShowPreferences Shows Preferences dialog.
    ShowEqualizer Shows Equalizer settings dialog.
    BrowseML Shows popup track browser.
    ShowHideTrackInfo Shows Toggle to show or hide Track Info.
    ShowVizPreferences Shows Visualization preferences dialog.
    ShowVizMenu Shows popup menu of Visualizations.
    NextVisualization Switches Visualization window to next visualization.
    PrevVisualization Switches Visualization window to previous visualization.

    Real status-field types

    Status Field Type Commands Displays
    PlayTitle Name of currently playing or queued track.
    PlayArtist Artist of currently playing or queued track.
    PlayAlbum Album of currently playing or queued track.
    PlayGenre Genre of currently playing or queued track.
    PlayTimeElapsed Elapsed time of currently playing or queued track.
    PlayTimeRemaining Remaining time of currently playing or queued track.
    PlayTimeRatio Elapsed time/track time (example: "0:21 /3:20").
    PlayTimeTotal Total track time.
    PlayBitrate Bitrate (example: "64 Kbps").
    PlayFormat Media format (example: "RealAudio" or "MP3").
    PlayTrackNumber Index of the currently playing track.
    RecordTitle Title of currently recording track (blank if not recording).
    RecordArtist Artist of currently recording track (blank if not recording).
    RecordAlbum Album of currently recording track (blank if not recording).
    RecordGenre Genre of currently recording track (blank if not recording).
    RecordPercent Percent complete of currently recording track (blank if not recording).
    RecordIndex Index of currently recording track (example: "4 of 7").
    RecordSpeed Current record speed (blank if not recording).
    RecordFormat Media format of currently recording track.
    RecordBitrate Bitrate of currently recording track.

    Required and optional status commands

    Required Commands Description
    Status1Type Specifies type of data to display.
    Status1Rect Position of status field. Status fields require X,Y coordinates of the top-left and bottom-right corners of the field (example: 16,47,140,61).
    Optional Commands Description
    Status1TextColor RGB values for text color.
    Status1BackgroundColor RGB values for background color.
    Status1Justification Sets justification of text (left, right, or center).
    Status1FontName Defines font for window text.
    Status1FontHeight Sets font height for window text.
    Status1FontBold Specifies bold style for window text.
    Status1FontItalic Specifies italic style for window text.
    Status1FontUnderline Specifies underline style for window text.
    Status1Show Specifies whether and when to show the status field (example: Status1Show=Playing).
    Status1Transparent Specifies whether background is transparent (0=no, 1=yes)

    Default Skin Settings

    Standard Control Commands Description Default Value
    RealLogoShow RealNetworks logo On
    RecordShow Record Button On
    PlayShow Play Button On
    PauseShow Pause Button On
    StopShow Stop Button On
    PreviousShow Previous Track Button On
    NextShow Next Track Button On
    ContinueShow Continuous Play Mode Button On
    ShuffleShow Shuffle Play Mode Button On
    MuteShow Mute Button On
    VolShow Volume Slider On
    MenuShow Menu Button On
    ExitShow Exit Button On
    MinimizeShow Minimize Button On
    FullModeShow Full Mode Button On
    Status Field Commands Description Default Value
    PlayStatusShow Displays standard Play Status window. On
    RecordStatusShow Displays standard Record Status Window On
    Status1Justification Justification of text (left, right, or center). Left
    Status1TextColor RGB values for text color. Yellow
    Status1BackgroundColor RGB values for background color. Black
    Status1FontName Specifies font for window text. Arial
    Status1FontHeight Specifies font height for window text. 10 Point
    Status1Show Specifies conditional setting for showing the status field (Status1Show=Playing). Yes
    Status1Transparent Specifies whether background is transparent. Yes
    Status1MarqueeOffset Sets how many pixels to move characters at each interval (negative scrolls left, positive scrolls right). One pixel left (-1)
    Status1MarqueeInterval Sets how many milliseconds between character movements (minimum is 50). 90 milliseconds
    Status1MarqueeDelay Sets how many milliseconds before scrolling begins once it is activated. 2000 milliseconds (2 seconds)

    Sample skin.ini file

    ; StreamingMedia Magazine Skin; Created by Lisa Rein and Cory Doctorow[MAIN]Application=RealJukeboxVersion=1.0RecordShow=0PlayShow=1StopShow=1PauseShow=0PreviousShow=1NextShow=1ContinueShow=0ShuffleShow=0EjectShow=0MenuShow=1ExitShow=1MinimizeShow=0FullModeShow=1RPLaunchShow=0MuteShow=0VolShow=0PosShow=0PlayStatusShow=0PlayArtistShow=1RecordStatusShow=0PlayTitleShow=1PlayTimeElapsedShow=0RealLogoShow=0PlayTopLeft=52,20StopTopLeft=86,20PreviousTopLeft=120,20NextTopLeft=154,20MenuTopLeft=222,20ExitTopLeft=290,22FullModeTopLeft=231,60;NOTE: The custom control info below has been disabled. If you choose;to use it or edit it for use with your skin, remove the semi-colons (;);from the beginning of each line. ;Control1Image=bubble.bmp;Control1TopLeft=187,35;Control1Show=Playing;Control1ToolTip=RealNetworks;Control2Image=rjblogo.bmp;Control2TopLeft=17,67;Control2IsButton=0;Control2URL=http://realjukebox.real.com;Control2ToolTip=Visit RealJukebox Central;NOTE: The custom status info below has been disabled. If you choose;to use it or edit it for use with your skin, remove the semi-colons (;);from the beginning of each line. [STATUS]DefaultFontName=Lucida ConsoleDefaultFontBold=1DefaultFontHeight=11Status1Type=PlayTitleStatus1Rect=20,44,147,62;Status1TextColor=72,72,104;Status1BackgroundColor=26,169,193Status2Type=PlayTimeElapsedStatus2Rect=155,44,230,62;Status2TextColor=72,72,104;Status2BackgroundColor=26,169,193;Status2Justification=centerStatus2Show=playingStatus3Type=PlayArtistStatus3Rect=20,64,159,77;Status3TextColor=72,72,104;Status3BackgroundColor=26,169,193;Status3Justification=center;Status3FontName=Lucida Console;Status3FontHeight=10;Status3FontBold=1

  • Streaming Covers
    Free
    for qualified subscribers
    Subscribe Now Current Issue Past Issues