<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<?xml-stylesheet href="./_c74_ref.xsl" type="text/xsl"?>

<c74object name="ossia.model" module="Ossia" category="Ossia">

	<digest>
		Declare patcher as an Ossia model
	</digest>

	<description>
		Create a node under which several <o>ossia.parameter</o> or <o>ossia.model</o> can subscribe. Allows to create complex and nested address hierarchies describing your patcher's features as a namespace
	</description>

	
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">Ossia</metadata>
		<metadata name="tag">Ossia</metadata>
		<metadata name="tag">Network</metadata>
	</metadatalist>

	
	<!--INLETS-->
	<inletlist>
			<inlet id="0" name="Message input" type="any">
			<digest>Messages to ossia.model</digest>
			<description>Messages to the node</description>
		</inlet>
	</inletlist>


	<!--OUTLETS-->
	<outletlist>
			<outlet id="0" name="Info outlet" type="any">
			<digest>Various information messages</digest>
			<description>Messages and information in reply to various messages</description>
		</outlet>
	</outletlist>

	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="Name" optional="0" type="symbol">
			<digest>
				Name in ossia namespace
			</digest>
			<description>
				<o>ossia.model</o> requires an argument defining a node name in the ossia namespace.  This is mandatory, and each <o>ossia.model</o> within a upper-level model or a device must have a unique name - if several  nodes are named similarly, instances (such as name.1, name.2, etc...) will be created.
			</description>
		</objarg>
	</objarglist>	

	<!--METHODS-->	
	<methodlist>
		
		<method name="address">
			<arglist>
				<arg name="node address" type="symbol" optional="0"/>
			</arglist>
			<digest>
				Set node name
			</digest>
			<description>
				The message <m>address</m> followed by a symbol sets the name of the node. This temporary replaces the name provided initially as an argument to the object and allows to address nodes dynamically. Without any argument, <m>address</m> message will set the node address back to as defined as argument to the object
			</description>
		</method> 
		
		<method name="namespace">
			<arglist/>
			<digest>
				Output list of all parameters and their current values
			</digest>
			<description>
				The <m>namespace</m> message to the leftmost inlet outputs the list of all parameters registered under this node, and their current values
			</description>
		</method>

		<method name="preset">
			<arglist/>
			<digest>Preset Management
			</digest>
			<description>
				Sending the <m>preset save /path/to/file.txt</m> message to the leftmost inlet will write a list of all parameters and their values to the the disk, under the file /path/to/file.txt <!-- - The preset can also be saved under a json format, by replacing the extension by .json -->
				Sending the <m>preset load /path/to/file.txt</m> message to the leftmost inlet will load a list of all parameters and their values from the the file /path/to/file.txt, and recall the values to the parameters
			</description>
		</method>
		
		<method name="reset">
			<arglist/>
			<digest>Reset to default value
			</digest>
			<description>
				Sending the <m>reset</m> message to the leftmost inlet will recall the model's parameters to their default state
			</description>
		</method>
		
	</methodlist>	
	
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="description" get="1" set="1" type="atom" size="1">
			<digest>
				Set description to node
			</digest>
			<description>
				The <at>description</at> attribute allows to set a description to a node
			</description>
		</attribute>
		
		<attribute name="invisible" get="1" set="1" type="int" size="1">
			<digest>
				Hide node from remote client
			</digest>
			<description>
				The <at>invisible</at> attribute allows to hide a model from remote clients - this can be useful e.g. for "internal" that we don't want to give access to.
			</description>
		</attribute>
		
		<attribute name="priority" get="1" set="1" type="int" size="1">
			<digest>
				Set priority
			</digest>
			<description>
				The <at>priority</at> attribute allows to order how several values of a same hierarchical level can be recalled 
			</description>
		</attribute>

		<attribute name="recall_safe" get="1" set="1" type="boolean" size="1">
			<digest>
				Enable or disable value update when recalling preset
			</digest>
			<description>
				The <a>recall_safe</a> attribute (default: off) allows to prevent value update when recalling a preset. This can be handy for example in live situation to prevent a model or parameter state to be recalled while being controlled by some processes (manual control, mapping, etc.)
			</description>
		</attribute>
		
		<attribute name="tags" get="1" set="1" type="atom" size="1">
			<digest>
				Tags associated with this node
			</digest>
			<description>
				The <at>tags</at> attribute allows to associate a variable number of tags for this node. This helps documenting the parameter.
			</description>
		</attribute>

		<attribute name="trim_address" get="1" set="1" type="boolean" size="1">
			<digest>
				Output absolute or relative address path
			</digest>
			<description>
				The <a>trim_address</a> attribute sets whether the address is output as a relative or absolute path
			</description>
		</attribute>
		
	</attributelist>					

	<!--SEEALSO-->
	<seealsolist>
		<seealso name="ossia.parameter" type="refpage"/>
		<seealso name="ossia.view" type="refpage"/>
		<seealso name="ossia.device" type="refpage"/>		
	</seealsolist>

	
</c74object>
