<?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 turns all outlets off, switch, while the middle inlet turns all outlets on. The right inlet overrides the middle inlet, and the middle inlet overrides numnbers sent to the left inlet that turn individual outlets on or off.
	</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: An index (starting with 0 for the left outlet) that specifies an outlet out to turn on, turning off all other outlets.
			</description>
		</method>
		<method name="in1">
			<arglist>
				<arg name="secondary" optional="0" type="int" />
			</arglist>
			<digest>
				Turn on all outlets
			</digest>
			<description>
				In middle inlet: If a 1 was last received in the right inlet, any number received in the middle outlet will send a 0 out all outlets. Otherwise, a number greater than 0 received in the middle inlet sends a 1 out all outlets. If 0 is received in the middle inlet, decode sends a 1 out the last outlet decoded by a number received in the left inlet, and 0 out all other outlets.
			</description>
		</method>
		<method name="in2">
			<arglist>
				<arg name="primary" optional="0" type="int" />
			</arglist>
			<digest>
				Turn off all outlets
			</digest>
			<description>
				In right inlet: Any positive number other than 0 sends a 0 out all outlets. When <o>decode</o> receives a 0 in its right inlet, it outputs 0 or 1 out its outlets based on the values last received in the middle and left inlets.
			</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, a <m>1</m> is sent out that outlet. When an outlet is disabled, a <m>0</m> is sent out that outlet. The left outlet is initially enabled.
			</description>
		</entry>
	</misc>
</c74object>
