<?xml version="1.0" encoding="UTF-8"?>
<!--
	UI socket description (based on ISO/IEC 24752-2) for a Satellite Box. 
	The socket description is not tailored to a specific defice, but aims
	to reflect functions that are common for all satellite boxes.
-->

<uiSocket about="http://res.myurc.org/upnp/demo/satelliteBox/socket" 
	id="socket" 
	xmlns="http://myurc.org/ns/uisocketdesc" 
	xmlns:uis="http://myurc.org/ns/uisocketdesc" 
	xmlns:dc="http://purl.org/dc/elements/1.1/" 
	xmlns:dcterms="http://purl.org/dc/terms/" 
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xsi:schemaLocation="http://myurc.org/ns/uisocketdesc http://myurc.org/ns/uisocketdesc 
		http://purl.org/dc/elements/1.1/ http://dublincore.org/schemas/xmls/qdc/2006/01/06/dc.xsd 
		http://purl.org/dc/terms/ http://dublincore.org/schemas/xmls/qdc/2006/01/06/dcterms.xsd">
	<dc:creator>Jon Hardin</dc:creator>
	<dc:contributor>Gottfried Zimmermann</dc:contributor>
	<dc:publisher>Intelli-Computing Consulting</dc:publisher>
	<dc:rights>Copyright 2008 The Board of Regents of the University of Wisconsin System</dc:rights>
	<dcterms:conformsTo>http://myurc.org/iso24752-2/2007</dcterms:conformsTo>
	<dcterms:modified>2008-05-02</dcterms:modified>
	
	<!-- Part 1 of Satellite Box socket - power on/off -->
	
	<variable id="powerMode" type="powerModeType" includesRes="true">
		<dc:description xml:lang="en">
			This socket element allows to adjust the power mode of the device. 
			The powerModeType is a string enumeration 'ON', 'STANDBY':
			- 'ON' corresponds to an activated Satellite Box device.
			- 'STANDBY' corresponds to a deactivated Satellite Box that may still be awaken from the network.
		</dc:description>
	</variable>

	<!-- Part 2 of Satellite Box socket - channel selection -->
	
	<variable id="activeChannel" type="channelType">
		<dc:description xml:lang="en">
			This variable may be used to set the active channel shown by the Satellite.  
			A channel is identified by a unique integer between 1 and 12.  Channel number 0 is used if
			the device is on standby mode.
			The variable may only be written if the power mode of the device is 'ON'. 
			Before switching the channel, the target adaptor saves the current channel to 'previousChannel'
			in order to allow to return to the previously active channel.
			The integer value may be used to fetch long labels and icons from a resource sheet.
		</dc:description>
		<dependency>
			<relevant>value('powerMode') eq 'ON'</relevant>
			<write>value('powerMode') eq 'ON'</write> 
		</dependency>
	</variable>
	
	<variable id="previousChannel" type="channelType">
		<dc:description xml:lang="en">
			Specifies the channel number of the previously selected channel.
			This variable is read-only (i.e. it cannot be changed by the user).
		</dc:description>
		<dependency>
			<relevant>value('powerMode') eq 'ON'</relevant>
			<write>false()</write>
		</dependency>	
	</variable>
	
	<command id="selectPreviousChannel" type="uis:basicCommand">
		<dc:description xml:lang="en">
			Command for switching back to the previously selected channel.
			It can only be activated if the device is on.
			This command switches the values of activeChannel and previousChannel socket variables.
		</dc:description>
		<param idref="activeChannel" dir="inout"/>
		<param idref="previousChannel" dir="inout"/>
		<dependency>
			<relevant>value('powerMode') eq 'ON'</relevant>
			<write>value('powerMode') eq 'ON'</write>
		</dependency>
	</command> 

	<!-- Part 3 of Satellite Box socket - volume control (volume level, mute) -->
	
	<variable id="volume" type="volumeType">
		<dc:description xml:lang="en">
			Volume of the Satellite audio output may be set in range 0 to 100 (inclusive bounds), stepsize 1. 
			May only be set if the device is 'ON'.
			When the volume is changed, the mute is deactivated (if it was on).
		</dc:description>
		<dependency>
			<relevant>value('powerMode') eq 'ON'</relevant>
			<write>value('powerMode') eq 'ON'</write>
		</dependency>
	</variable>
	
	<variable id="mute" type="xsd:boolean">
		<dc:description xml:lang="en">
			Activates and deactivates the mute function. 
			Can only be changed if the device is on.
		</dc:description>
		<dependency>
			<relevant>value('powerMode') eq 'ON'</relevant>
			<write>value('powerMode') eq 'ON'</write>
		</dependency>
	</variable> 
	
	<schema xmlns="http://www.w3.org/2001/XMLSchema">

		<simpleType name="channelType" id="channelTypeId">
			<restriction base="xsd:unsignedInt">
				<minInclusive value="0"/>
				<maxInclusive value="12"/>
			</restriction>
		</simpleType>
		
		<simpleType name="powerModeType" id="powerModeTypeId">
			<restriction base="xsd:string">
				<enumeration value="ON"/>
				<enumeration value="STANDBY"/>
			</restriction>
		</simpleType>

		<simpleType name="volumeType" id="volumeTypeId">
			<restriction base="xsd:unsignedInt">
				<minInclusive value="0"/>
				<maxInclusive value="100"/>
			</restriction>
		</simpleType>
		
	</schema>	
	
</uiSocket>

