<?xml version="1.0" encoding="ISO-8859-1"?>
<device image="MOON.gif">
 <information>
  <name>HQ Power Moon</name>
  <author>Arne Lüdtke</author>
 </information>
 <channels>
  <function channel="0" minvalue="0" maxvalue="255" name="Gobo" fade="no" action="GetGobo" />
  <function channel="1" minvalue="0" maxvalue="255" name="Rotation" fade="no" type="dimmer" action="GetRot" />
 </channels>
 <form width="200" height="310">
  <deviceimage top="0" left="0"/>
  <devicename top="0" left="40"/>
  <deviceadress top="16" left="40"/>
  <label top="32" left="8" caption="Gobo:"/>
  <dropdown top="48" left="8" width="177" action="SetGobo" name="gobo_gobo">
   <item caption="Geschlossen" value="0"/>
   <item caption="Strobo" value="6"/>
   <item caption="Offen" value="42"/>
   <item caption="Gobo 1" value="48"/>
   <item caption="Gobo 2" value="54"/>
   <item caption="Gobo 3" value="60"/>
   <item caption="Gobo 4" value="66"/>
   <item caption="Gobo 5" value="72"/>
   <item caption="Gobo 6" value="78"/>
   <item caption="Gobo 7" value="84"/>
   <item caption="Gobo 8" value="90"/>
   <item caption="Gobo 9" value="96"/>
   <item caption="Gobo 10" value="102"/>
   <item caption="Gobo 11" value="108"/>
   <item caption="Gobo 12" value="114"/>
   <item caption="Gobo 13" value="120"/>
   <item caption="Sound Active" value="220"/>
   <item caption="Rainbow" value="226"/>
  </dropdown>
  <label top="80" left="8" caption="Gobo Shake"/>
  <options channel="1" top="96" left="8" action="SetGobo" name="gobo_shake">
   <option value="0" caption="Aus" left="0" top="0" default="true"/>
   <option value="1" caption="Ein" left="40" top="0"/>
  </options>
  <label top="115" left="8" caption="Strobo Speed"/>
  <slider name="Strobo_Speed" startvalue="0" endvalue="33" top="130" tickfreq="11" left="0" height="30" width="177" default="0" action="SetGobo"/>
  <label top="160" left="8" caption="Rainbow Speed"/>
  <slider name="Rainbow_Speed" startvalue="0" endvalue="29" top="180" tickfreq="10" left="0" height="30" width="177" default="0" action="SetGobo"/>
  <label top="210" left="8" caption="Drehrichtung:"/>
  <dropdown top="230" left="8" width="177" action="SetRot" name="rot_rot">
   <item caption="Stop" value="0"/>
   <item caption="Drehung UZS" value="20"/>
   <item caption="Drehung GUZS" value="145"/>
  </dropdown>
  <label top="260" left="8" caption="Rotation Speed"/>
  <slider name="Rot_Speed" startvalue="0" endvalue="110" top="280" tickfreq="37" left="0" height="30" width="177" default="0" action="SetRot"/>
 </form>
<code>
 <procedure name='INITCONTROLS'>
   !call|GetRot$
   !call|GetGobo$

  </procedure>


<procedure name='GetRot'>
!if|({channel_1} &lt; 20)|
 !set_control|rot_rot|0$
 !set_control|Rot_Speed|0$
 |
!if|({channel_1} &gt; 19) and ({channel_1} &lt; 131)|
  !set_control|rot_rot|20$
  !set_control|Rot_Speed|({channel_1}-20)$
 $
!if|({channel_1} &gt; 144) and ({channel_1} &lt; 256)|
  !set_control|rot_rot|145$
  !set_control|Rot_Speed|({channel_1}-145)$
 $
$
</procedure>

  <procedure name='SetRot'>
 !if|{rot_rot}|eq|0|
  !set_channel|1|0$
 |
!if|{rot_rot}|eq|20|
  !set_channel|1|(20+{Rot_Speed})$
 $
!if|{rot_rot}|eq|145|
  !set_channel|1|(({Rot_Speed})+145)$
 $
$
  </procedure>

<procedure name='GetGobo'>
!if|{channel_0} &lt; 6|
 !set_control|gobo_gobo|0$
 !set_control|gobo_shake|0$
|
!if|({channel_0} &gt; 5) and ({channel_0} &lt; 40)|
  !set_control|gobo_gobo|6$
  !set_control|Strobo_Speed|({channel_0}-6)$
  !set_control|gobo_shake|0$
 $
!if|({channel_0} &gt; 39) and ({channel_0} &lt; 46)|
  !set_control|gobo_gobo|42$
  !set_control|gobo_shake|0$
 $
!if|({channel_0} &gt; 45) and ({channel_0} &lt; 124)|
  !set_control|gobo_gobo|{channel_0}$
  !set_control|gobo_shake|0$
 $
!if|({channel_0} &gt; 129) and ({channel_0} &lt; 208)|
  !set_control|gobo_gobo|({channel_0}-84)$
  !set_control|gobo_shake|1$
 $
!if|({channel_0} &gt; 213) and ({channel_0} &lt; 226)|
  !set_control|gobo_gobo|220$
  !set_control|gobo_shake|0$
 $
!if|({channel_0} &gt; 225) and ({channel_0} &lt; 256)|
  !set_control|gobo_gobo|226$
  !set_control|gobo_shake|0$
  !set_control|Rainbow_Speed|({channel_0}-226)$
 $
$
</procedure>

  <procedure name='SetGobo'>
!if|{gobo_gobo}|eq|0|
 !set_channel|0|0$
|
 !if|{gobo_gobo}|eq|6|
  !set_channel|0|(6+{Strobo_Speed})$
 $
 !if|{gobo_gobo}|eq|42|
  !set_channel|0|42$
 $
!if|({gobo_shake} = 0) and ({gobo_gobo} &gt; 42) and ({gobo_gobo} &lt; 125)|
 !set_channel|0|{gobo_gobo}$
 $
!if|({gobo_shake} = 1) and ({gobo_gobo} &gt; 42) and ({gobo_gobo} &lt; 125)|
 !set_channel|0|({gobo_gobo}+84)$
 $
 !if|{gobo_gobo}|eq|220|
  !set_channel|0|220$
 $
 !if|{gobo_gobo}|eq|226|
  !set_channel|0|(226+{Rainbow_Speed})$
 $
$
  </procedure>
</code>
</device>