<?xml version="1.0" encoding="utf-8" standalone="yes"?>

<?xml-stylesheet href="./_c74_ref.xsl" type="text/xsl"?>

<!--This is an automatically generated file. DO NOT EDIT THIS FILE DIRECTLY. Rather, use the _ref.xml files found in the 'edits' folder.-->
<c74object name="decode" module="max" category="Data">
	<digest>
		Send 1 or 0 out a specific outlet
	</digest>
	<description>
		Provides hierarchical switching. The right inlet is the master disable switch, while the middle inlet is a submaster enable. The left inlet can turn on a single outlet provided neither the submaster switch nor the master switch is active.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			Max
		</metadata>
		<metadata name="tag">
			Data
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="INLET_TYPE">
			<digest>
				Number to decode (lowest priority)
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="INLET_TYPE">
			<digest>
				Enable (medium priority)
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="2" type="INLET_TYPE">
			<digest>
				Disable All (highest priority)
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="OUTLET_TYPE">
			<digest>
				Decode 0 (high if input = 0)
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="outlets" optional="1" type="int">
			<digest>
				The number of outlets
			</digest>
			<description>
				Sets the number of outlets. The default is one outlet.
			</description>
		</objarg>
		<objarg name="outlets" optional="1" type="float">
			<digest>
				The number of outlets
			</digest>
			<description>
				Converted to <m>int</m>.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="bang">
			<arglist />
			<digest>
				Output current state
			</digest>
			<description>
				The message <m>bang</m> causes <o>decode</o> to output its current state.
			</description>
		</method>
		<method name="int">
			<arglist>
				<arg name="outlet" optional="0" type="int" />
			</arglist>
			<digest>
				Select an outlet to turn on
			</digest>
			<description>
				In left inlet: The number specifies an outlet out to turn on, turning off all other outlets. (Whenever an outlet is turned on that was previously turned off, a <m>1</m> is sent out. Conversely, whenever an enabled outlet is disabled, a <m>0</m> is sent out.) The outlets are referred to by number, beginning with 0 on the left, and numbers received in the left inlet are automatically limited between 0 and the number of outlets minus 1.
			</description>
		</method>
		<method name="in2">
			<arglist>
				<arg name="master" optional="0" type="int" />
			</arglist>
			<digest>
				Turn off all outlets
			</digest>
			<description>
				In right inlet: Any positive number other than 0 disables all enabled outlets (sends a <m>0</m> out them). Once all outlets have been disabled in this manner, no outlet can be enabled until a <m>0</m> is received in the right inlet. When a <m>0</m> is received, <o>decode</o> re-enables all outlets that it had just disabled.
			</description>
		</method>
		<method name="in1">
			<arglist>
				<arg name="submaster" optional="0" type="int" />
			</arglist>
			<digest>
				Turn on all outlets
			</digest>
			<description>
				In middle inlet: Any positive number other than 0 enables all disabled outlets (sends a <m>1</m> out them), unless all outlets are disabled. When <m>0</m> is received, <o>decode</o> turns off all outlets except the one that had previously been on.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<!--EXAMPLE-->
	<examplelist>
		<example img="decode.png" caption="decode is a hierarchical on/off switch" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="bucket" />
		<seealso name="gate" />
		<seealso name="toggle" />
	</seealsolist>
	<misc name="Output">
		<entry name="int">
			<description>
				When an outlet is enabled that was previously disabled, a <m>1</m> is sent out that outlet. When an outlet is disabled that was previously enabled, a <m>0</m> is sent out that outlet. The left outlet is initially enabled.
			</description>
		</entry>
	</misc>
</c74object>
