You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

221 lines
12 KiB

<?xml version='1.0' encoding='utf-8' standalone='yes'?>
<c74object name='tc.preset' category='jsui, preset, pattrstorage'>
<digest>
A jsui replacement for the preset object.
</digest>
<description>
tc.preset is a jsui clone of the preset object, but loaded with more features, such as preset organization through drag and drop, display as a scrollable list, auto-rewrite the saved JSON/XML file after any change.
Contrary to the preset object, tc.preset doesn't work alone and has to be used in conjonction with a pattrstorage object.<modification class=""></modification>
</description>
<!--METADATA-->
<metadatalist>
<metadata name='author'>Théophile Clet</metadata>
<metadata name='tag'>preset</metadata>
<metadata name='tag'>pattrstorage</metadata>
<metadata name='tag'>jsui</metadata>
</metadatalist>
<!--ARGUMENTS-->
5 months ago
<!-- <objarglist>
<objarg name='pattrstorage' optional='0' type='symbol'>
<digest>Name of the pattrstorage to control</digest>
<description>Name of the pattrstorage this object should be linked to.</description>
</objarg>
5 months ago
</objarglist> -->
<!--MESSAGES-->
<methodlist>
5 months ago
<method name="int">
<digest>Recall numbered preset</digest>
<description>Sending any integer will trigger the preset of the same number</description>
</method>
<method name="float">
5 months ago
<digest>Interpolate between presets</digest>
<description>Recalls the data from the preset specified by float. If the number falls between two whole numbers (e.g. 1.5), the pattrstorage object will interpolate between the data stored in the preset corresponding to the integer portion of the float and the data stored at the preset numbered one higher (e.g. 1.5 will cause pattrstorage to interpolate 50% between presets 1 and 2). See the interp message for more information about interpolation modes.</description>
</method>
<method name="bang">
5 months ago
<digest>Recall last recalled preset</digest>
<description>When a bang is received, the last triggered preset is triggered again.</description>
</method>
5 months ago
<!-- <method name="list">
<digest>Function depends on inlet</digest>
<description>Function depends on inlet</description>
</method> -->
<method name="color_wheel">
<digest>Define color wheel colors</digest>
<description>The message "color_wheel", followed by an integer and four float, defines one of the 6 available slot colors when color_mode is enabled.
The integer argument, between 1 and 6, defines which color in being modified, and next the four floats define the color in the RGBA format.
The message "color_wheel" without argument resets the six colors to their default values.
</description>
</method>
<method name="setcolor">
<digest>Set the preset colors</digest>
<description>The message "setcolor" allows to set the color of a preset as shown when in color_mode 2 (select) or 3 (custom).
With 1 or 2 integer arguments, it allows to set a preset color as seen in color mode 2. With 4 float arguments or 1 integer followed by 4 floats, it allows to set a preset color for the color mode 3.
With 1 integer argument, the currently selected preset color wheel's color is set to the argument's value.
With two integer arguments, the preset number defined by first argument is set to color wheel's color defined by the second argument.
With 4 float arguments, the currently selected preset is set to a custom color defined by the four arguments (in RGBA format).
With 1 integer followed by 4 float arguments, the preset number defined by first argument is set to a custom color defined by the four arguments (in RGBA format).
The integer argument, between 1 and 6, defines which color in being modifier, and next the four floats define the color in the RGBA format.
3 months ago
With no argument, it resets colors for the select preset to default values.
</description>
</method>
<method name="pattrstorage">
<digest>Link to named pattrstorage object</digest>
<description>The word 'pattrstorage' followed by the name of an existing pattrstorage links the jsui to that pattrstorage.
Make sure that pattrstorage outlet is connected to the jsui left inlet prior to send the message.
If the word `pattrstorage`is sent alone, the jsui is unlinked from any pattrstorage.
</description>
</method>
<method name="resync">
<digest>Resync the jsui to the pattrstorage</digest>
<description>The word 'resync' will repopulate the jsui with the current preset list from the pattrstorage. It is usefull in case you add/remove/edit presets without using the jsui.
</description>
</method>
<method name="setlock">
<digest>Lock or unlock selected preset</digest>
<description>The word 'setlock' followed by a 0 or a 1 respectively unlocks or locks the currently selected preset in the jsui.
Note that if select_mode is set to 1, the selected preset is not necessarily the last recalled one.
</description>
</method>
<method name="setslotname">
<digest>Set the name of the selected preset</digest>
<description>The word 'setslotname' followed by a symbol sets that symbol as the name of the currently selected preset in the jsui.
Note that if select_mode is set to 1, the selected preset is not necessarily the last recalled one.
</description>
</method>
<method name="text">
<digest>Set the name of the selected preset</digest>
<description>Same as setslotname. Allows to connect the leftmost outlet of a textedit to the jsui and use it as an interface to rename the selected presets.
</description>
</method>
</methodlist>
<!--ATTRIBUTES-->
<attributelist>
5 months ago
<attribute name='active_slot_color' get='1' set='1' type='list' size='4' >
<digest>Active slot color</digest>
<description>Color of the last recalled preset</description>
</attribute>
<attribute name='autowriteagain' get='1' set='1' type='int' size='1' >
<digest>Automatic writeagain</digest>
<description>When set to 1, the jsui will automatically send a "writeagain" message to its linked pattrstorage anytime a preset have been stored, moved, renamed, (un)locked or deleted, saving any change into the preset file immediately.</description>
</attribute>
<attribute name='bgcolor' get='1' set='1' type='list' size='4' >
<digest>Background color</digest>
<description>Sets the background color of the object in RGBA format</description>
</attribute>
<attribute name='bubblesize' get='1' set='1' type='float' size='1' >
<digest>Slot size</digest>
<description>Size of the preset slots</description>
</attribute>
<attribute name='color_mode' get='1' set='1' type='int' size='1' >
<digest>Color mode</digest>
<description>When set to 0, all preset slots have the same color (same as the preset object) defined by the stored_slot_color attribute.
When set to 1, stored preset slots are colored according to one of the six colors of the color wheel, in a repeating pattern.
In mode 2, stored preset colors can be freely set to one of the six colors of the color wheel.
In mode 3, stored preset color can be set to any color in RGBA format.
To define colors of the color wheel for modes 1 and 2, see color_1 to color_6 as well as the color_wheel message.
To define preset color as in mode 2 or 3, see the setcolor message. Modes 2 and 3 require a pattr object named 'preset_color' to be at the same patcher level as the tc.preset object.
</description>
</attribute>
<attribute name='color_1' get='1' set='1' type='list' size='4' >
<digest>Slot color 1</digest>
<description>Slot color 1 in RGBA format. Sending this message without arguments resets the color to its default value. Has an effect only when color_mode is enabled.</description>
</attribute>
<attribute name='color_2' get='1' set='1' type='list' size='4' >
<digest>Slot color 2</digest>
<description>Slot color 2 in RGBA format. Sending this message without arguments resets the color to its default value. Has an effect only when color_mode is enabled.</description>
</attribute>
<attribute name='color_3' get='1' set='1' type='list' size='4' >
<digest>Slot color 3</digest>
<description>Slot color 3 in RGBA format. Sending this message without arguments resets the color to its default value. Has an effect only when color_mode is enabled.</description>
</attribute>
<attribute name='color_4' get='1' set='1' type='list' size='4' >
<digest>Slot color 4</digest>
<description>Slot color 4 in RGBA format. Sending this message without arguments resets the color to its default value. Has an effect only when color_mode is enabled.</description>
</attribute>
<attribute name='color_5' get='1' set='1' type='list' size='4' >
<digest>Slot color 5</digest>
<description>Slot color 5 in RGBA format. Sending this message without arguments resets the color to its default value. Has an effect only when color_mode is enabled.</description>
</attribute>
<attribute name='color_6' get='1' set='1' type='list' size='4' >
<digest>Slot color 6</digest>
<description>Slot color 6 in RGBA format. Sending this message without arguments resets the color to its default value. Has an effect only when color_mode is enabled.</description>
</attribute>
<attribute name='display_interp' get='1' set='1' type='int' size='1' >
<digest>Display interpolation</digest>
<description>When set to 1, the jsui will display the ongoing interpolation between presets when a recall message with three arguments or a recallmulti message with at least one argument are sent to the linked pattrstorage.
Notice that the recallmutli message needs to be sent both the pattrstorage and the jsui.</description>
</attribute>
<attribute name='empty_slot_color' get='1' set='1' type='list' size='4' >
<digest>Empty slot color</digest>
<description>Sets the empty slot color of the object in RGBA format</description>
</attribute>
<attribute name='layout' get='1' set='1' type='int' size='1' >
<digest>How presets are displayed</digest>
<description>When set to 0, the jsui mimics the default preset object: slots are displayed in a grid. When set to 1, they are displayed as a vertical list, with the preset slots on the left and their name on the right.</description>
</attribute>
<attribute name='margin' get='1' set='1' type='float' size='1' >
<digest>Object margin</digest>
<description>Defines the size, in pixels, of the margin between the jsui border and the preset slots.</description>
</attribute>
<attribute name='min_rows' get='1' set='1' type='int' size='1' >
<digest>Minimum number of rows to display</digest>
<description>Defines the minimum number of rows to display if scrollable is enabled and layout is set to 1.
If a preset is stored in a slot with a higher value than min_row, then min_row is ignored and presets are displayed up to the highest stored one.
</description>
</attribute>
<attribute name='scrollable' get='1' set='1' type='int' size='1' >
<digest>Scroll through your presets</digest>
<description>When set to 1, you can through the jsui to see all your presets, or at least up to the slot number defined by the min_rows attributes. Currently only works with the list layout.
</description>
</attribute>
<attribute name='select_mode' get='1' set='1' type='int' size='1' >
<digest>Preset selection mode</digest>
<description>When set to 1, a single click on a stored preset selects it without recalling it. It allows to drag it, set its name and lock state while keeping the last recalled preset active.
You need to double-click on a stored preset to recall it. If set to 0, stored presets are recalled by a single click (default preset object behavior).
</description>
</attribute>
<attribute name='slot_round' get='1' set='1' type='float' size='1' >
<digest>Slot corner rounding</digest>
<description>Defines the rounding of the slots corners. A value of zero means square corners. A value equal or superior to half the bubblesize makes the slots as a circle.
</description>
</attribute>
<attribute name='spacing' get='1' set='1' type='float' size='1' >
<digest>Slot spacing</digest>
<description>Defines the spacing, in pixels, between slot bubbles.
</description>
</attribute>
<attribute name='stored_slot_color' get='1' set='1' type='list' size='4' >
<digest>Stored slot color</digest>
<description>Sets the stored preset color of the object in RGBA format</description>
</attribute>
</attributelist>
<!--RELATED-->
<seealsolist>
<seealso name='pattrstorage' />
<seealso name='preset' />
<seealso name='jsui' />
</seealsolist>
</c74object>