<?xml version="1.0" encoding="ISO-8859-1"?>
<device image="Light.gif" initsequence="set 0 0; set 1 0; set 2 0; set 3 0; set 4 0">

	<information>
		<name>Eurolite RGB PAR</name>
		<author>Franky B</author>
	</information>

	<channels>
		<function channel="0" minvalue="0" maxvalue="255" name="Modus" action="GetMode" />
		<function channel="1" minvalue="0" maxvalue="255" name="Helligkeit R" fade="yes" type="colorpicker" />
		<function channel="2" minvalue="0" maxvalue="255" name="Helligkeit G" fade="yes" type="colorpicker" />
		<function channel="3" minvalue="0" maxvalue="255" name="Helligkeit B" fade="yes" type="colorpicker" />
		<function channel="4" minvalue="0" maxvalue="255" name="Musiksteuerung" action="GetMusic" />
	</channels>

	<form width="440" height="250">

		<deviceimage top="0" left="0"/>
		<devicename top="0" left="40"/>
		<deviceadress top="16" left="40"/>
		<label top="32" left="40" caption="Eurolite RGB PAR"/>

		<label top="70" left="15" caption="Modus:"/>
		<dropdown top="70" left="65" width="130" name="color_mode" action="SetMode">
			<item caption="RGB Mischung" value="-1"/>
			<item caption="7-Farben überblenden" value="-2"/>
			<item caption="7-Farben umschalten" value="-3"/>
			<item caption="3-Farben umschalten" value="-4"/>
		</dropdown>

		<colorpicker channel1="1" channel2="2" channel3="3" mode="rgb" layout="2" startvalue="0" endvalue="255" top="110" left="5" width="200" default="0"/>

		<line x1="220" y1="10" x2="220" y2="240"/>

		<label top="10" left="230" caption="Geschwindigkeit"/>
		<label top="30" left="230" caption="der Farbwechsel"/>
		<slider top="50" left="230" height="30" width="200" startvalue="0" endvalue="255" tickfreq="32" smallchange="1" largechange="16" name="color_speed" action="SetColorSpeed"/>
		<label top="80" left="235" caption="langsam"/>
		<label top="80" left="380" caption="schnell"/>

		<line x1="230" y1="105" x2="430" y2="105"/>

		<label top="120" left="230" caption="Musiksteuerung"/>

		<options top="145" left="230" name="music_mode" action="SetMusicMode">
			<option caption="aus" value="-5" top="0" left="0"/>
			<option caption="auto" value="-6" top="0" left="50"/>
			<option caption="manuell" value="-7" top="0" left="100"/>
		</options>
		<label top="170" left="230" caption="Emfpindlichkeit"/>
		<slider top="200" left="230" height="30" width="200" startvalue="151" endvalue="255" tickfreq="26" smallchange="1" largechange="26" name="music_speed" action="SetMusicSpeed"/>
		<label top="230" left="235" caption="langsam"/>
		<label top="230" left="380" caption="schnell"/>

	</form>

	<code>
		<procedure name='INITCONTROLS'>
			!call|GetMusic$
			!call|GetColor$
		</procedure>

		<procedure name='GetColor'>

!if|{channel_0} &lt; 64|
 !set_control|color_mode|(-1)$
 !set_channel|0|(0)$
 !set_control|color_speed|(0)$
$
!if|({channel_0} &gt; 63) and ({channel_0} &lt; 128)|
 !set_control|color_mode|(-2)$
 !set_channel|0|(64)$
 !set_control|color_speed|{channel_1}$
$
!if|({channel_0} &gt; 127) and ({channel_0} &lt; 192)|
 !set_control|color_mode|(-3)$
 !set_channel|0|(128)$
 !set_control|color_speed|{channel_1}$
$
!if|({channel_0} &gt; 191)|
 !set_control|color_mode|(-4)$
 !set_control|color_speed|{channel_1}$
$
		</procedure>

		<procedure name='GetMusic'>
!if|{channel_4} &lt; 11|
 !set_control|music_mode|(-5)$
$
!if|({channel_4} &gt; 10) and ({channel_4} &lt; 101)|
 !set_control|music_mode|(-6)$
$
!if|({channel_4} &gt; 100) and ({channel_4} &lt; 151)|
 !set_control|music_mode|(-5)$
$
!if|({channel_4} &gt; 150)|
 !set_control|music_mode|(-7)$
 !set_control|music_speed|{channel_4}$
$
		</procedure>

		<procedure name='SetMode'>
!if|{color_mode}|eq|(-1)|
 !set_channel|4|0$
 !set_channel|0|10$
$
!if|{color_mode}|eq|(-2)|
 !set_channel|0|74$
 !set_channel|1|{color_speed}$
$
!if|{color_mode}|eq|(-3)|
 !set_channel|0|138$
 !set_channel|1|{color_speed}$
$
!if|{color_mode}|eq|(-4)|
 !set_channel|0|202$
 !set_channel|1|{color_speed}$
$
		</procedure>

		<procedure name='SetColorSpeed'>
!if|{color_mode} &lt; (-1) |
 !set_channel|1|{color_speed}$
$
		</procedure>

		<procedure name='SetMusicMode'>
!if|{music_mode}|eq|(-5)|
 !set_channel|4|0$
$
!if|{music_mode}|eq|(-6)|
 !set_channel|4|11$
$
!if|{music_mode}|eq|(-7)|
 !set_channel|4|{music_speed}$
$
		</procedure>

		<procedure name='SetMusicSpeed'>
!if|{music_mode}|eq|(-7) |
 !set_channel|4|{music_speed}$
$
		</procedure>

	</code>


</device>

