<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<?xml-stylesheet href="_c74_vig.xsl" type="text/xsl"?>
<vignette name="The PolyBuffer Object" package="Max">
	<h1>The PolyBuffer Object</h1>
	<p>
		The PolyBuffer object in JS is a companion to the <o>polybuffer~</o> object you create in a Max patcher.
		It provides the ability to access a group of buffer~ objects associated with a name.
	</p>


	<h2>PolyBuffer Constructor</h2>

	<code language="javascript">var d = new PolyBuffer("name");</code>
	<p>
		If no name is provided as an argument then instantiation will fail.
	</p>


	<h2>PolyBuffer Properties Overview</h2>

	<p>The following properties mirror the attributes of the same name from the Max <o>polybuffer~</o> object.
	See the <o>polybuffer~</o> reference for more details.</p>

	<jsproperty_list name="Polybuffer">
    	<jsproperty name="name" get="1" set="0" type="symbol">
    	</jsproperty>

    	<jsproperty name="count" get="1" set="0" type="symbol">
    	</jsproperty>

    	<jsproperty name="size" get="1" set="0" type="Number">
    	</jsproperty>
	</jsproperty_list>

	<h2>PolyBuffer Methods Overview</h2>

	<p>The following methods mirror the messages of the same name from the Max <o>polybuffer~</o> object.
	See the <o>polybuffer~</o> reference for more details.</p>

	<jsmethod_list name="Polybuffer">
  		<jsmethod name="open">
  		</jsmethod>
  		<jsmethod name="wclose">
  		</jsmethod>
  		<jsmethod name="readfolder">
  			<arglist>
		    	<arg name="folder path" type="String" />
		    </arglist>
  		</jsmethod>
		<jsmethod name="writefolder">
  			<arglist>
		    	<arg name="folder path" type="String" />
		    </arglist>
  		</jsmethod>
		<jsmethod name="append">
  			<arglist>
		    	<arg name="soundfile path" type="String" />
		    </arglist>
  		</jsmethod>
		<jsmethod name="appendempty">
  			<arglist>
		    	<arg name="duration" type="Number" />
		    	<arg name="channels" type="Number" />
		    </arglist>
  		</jsmethod>
  		<jsmethod name="clear">
  		</jsmethod>
  		<jsmethod name="print">
  		</jsmethod>
  		<jsmethod name="send">
  			<arglist>
		    	<arg name="index" type="Number" />
		    	<arg name="message" type="Anything" />
		    </arglist>
  		</jsmethod>
  	</jsmethod_list>

  	The following methods are unique to the JS Polybuffer object.
	<jsmethod_list name="Unique Polybuffer">
		<jsmethod name="dump">
		    <description>
		    	Return an array containing index, name, path, duration, channel, and sample rate.
		    </description>
  		</jsmethod>

  		<jsmethod name="getshortname">
		    <arglist>
		    	<arg name="filename" type="symbol" />
		    </arglist>
		    <description>
		    	Return an array containing names of the buffer~ objects and file names.
		    </description>
  		</jsmethod>
  		<jsmethod name="getbufferlist">
		    <arglist>
		    	<arg name="filename" type="symbol" />
		    </arglist>
		    <description>
		    	Return an array containing names of all the buffer~ objects.
		    </description>
  		</jsmethod>
	</jsmethod_list>
	<h2>Examples</h2>

	<p>Example code can be found in the "JavaScript" tab of the <o>polybuffer~</o> help patcher.</p>

</vignette>
