Share via


MediaDisplay Layout XML Files

Each MediaDisplay layout is represented by an XML file in the resources folder, which must exist in the same folder as the MediaDisplay executable. For example, the "music-play" layout is represented by this music-play.xml file:

    <?xml version="1.0" encoding="utf-8" ?>
    <!-- audio-play.xml: for playing cd-based or disk-based audio-->
    <layout background="background.png">
        <music-track x="46" y="5" width="100" height="55"/>
        <image>music-play.png</image>
        <music-song x="69" y="7" width="187" height="20"/>
        <sequence x="69" y="29" repeat="forever">
            <music-artist duration = "2000" x="69" y="29"
                width="187" height="20"/>
            <music-title duration = "2000" x="69" y="29"
                width="187" height="20"/>
        </sequence>
        <music-transport x="0" y="0" width="256" height="64"/>
        <music-elapsed x="82" y="44" width="46" height="20"/>
        <music-progress x="115" y="47" width="103" height="10"
                background="progress-background.png"
                foreground="progress-foreground.png"/>
        <music-duration x="227" y="44" width="46" height="20"/>
    </layout>

Like all layouts, "music-play" consists of a series of regions, each representing a (possibly-overlapping) rectangle of the display. The "music-play" layout starts with a "music-track" region overlaying the background supplied by an attribute on the layout itself. The next region, an "image" region, displays a single bitmap (music-play.png) at the specified location.

The next region, a "sequence" region, indicates that two separate subregions (the "music-artist" and "music-title" regions) should be alternately displayed for 2000 milliseconds each.

Unlike the generic "image" and "sequence" regions, the remaining regions used in this layout are specific to music playback. These regions automatically query the session objects to display the relevant information.

You can customize these layout files to display different information for a given situation. To change the layouts, simply edit the XML file associated with the layout. The easiest customization is to modify the bitmaps associated with many regions. Also, you can easily add additional generic "image" or "text" regions to add new information, such as a vendor logo.

You can also move or modify the session-specific regions, like the "music-title" region shown above. A full list of all region types available for inclusion are found in the .cs files.

See Also