next up previous contents
Next: Including Themes in Your Up: Peep Themes Previous: What Are Themes?   Contents

Theme File Syntax

Theme files are encoded in XML for ease of parsing and maximum interoperability. They follow the XML encoding guidelines set out by the W3C standard at: http://www.w3.org/XML. If that sounds scary, don't worry, because after looking at a few examples, it's easy to get into the groove.

An XML theme file uses the following layout and general sections:

<?xml version='1.0' encoding='UTF-8' standalone='no'?>

<theme name="THEME NAME">
  <sounds>
    <!-- Sound entries fo here -->
    <sound>
      <name>SOUND NAME</name>
      <category>CATEGORY DESCRIPTION</category>
      <type>TYPE OF SOUND DESCRIPTION</type>
      <format>FORMAT OF SOUND FILE</format>
      <description>DESCRIPTION OF SOUND ROLE</description>
      <path>PATH IN REPOSITORY</path>
    </sound>
    ...
  </sounds>
  <events>
    <!-- Event entries as in peep.conf with added description -->
    <event>
      <name>EVENT NAME</name>
      <sound>SOUND INDENTIFIER</sound>
      <description>EVENT DESCRIPTION</description>
    </event>
    ...
  </events>
  <states>
    <!-- State entries as in peep.conf with added description -->
    <state>
      <name>STATE NAME</name>
      <description>STATE DESCRIPTION</description>
      <threshold>
        <level>LEVEL PERCENTAGE</level>
        <fade>LINEAR FADING SECONDS</fade>
        <sound>SOUND INDENTIFIER</sound>
      </threshold>
      ...
    </state>
    ...
  </states>
  <clients>
    <!-- Description of client configurations goes here.
         Same format as peep.conf essentially -->
    <client name="CLIENT NAME">
       <!-- Client specific stuff goes here -->
       ...
    </client>
    ...
  </clients>
</theme>

All theme files begin with a standard XML header of

<?xml version='1.0' encoding='UTF-8' standalone='no'?>

Comments are enclosed in the usual XML style of $<!-- \;\;\; -->$. Not all sections are required to create a theme file. If the aim of the theme file is to categorize sound files, then only the sounds section would be required. To share a portable server configuration, the sounds section and events and states sections are required. The clients section can also be included for a more specific description.

The function of each section closely models the format used in peep.conf. Thus, transforming an existing configuration file to a Peep theme should be relatively straight-forward. The only noticeable different is the name attribute that is used in both the theme and client tag. These provide additional descriptors that qualify the tag and are used for indentification purposes for the servers and clients parsing the theme. For example, the tag:

<client name="logparser">
  ...
</client>

creates a client entry for the logparser client. When parsing the theme file, logparser will look for client entries that have its name set in the name attribute of the client tag. For more information on creating theme files and embedding client configuration, please refer to the client documentation (perldoc Net::Peep::Data).


next up previous contents
Next: Including Themes in Your Up: Peep Themes Previous: What Are Themes?   Contents
Collin Starkweather 2002-11-03