Programmer Guide/Shell Items/Value/SET VALUE: Difference between revisions

From STX Wiki
Jump to navigationJump to search
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
==SET VALUE==
{{Value Item}}


You can modify the value item's data using the following SET VALUE commands. For a list of value item attributes, see [[Programmer_Guide/Shell_Items/Value/VALUE_Item_Attributes|VALUE Item Attributes]] and for a list of item messages see [[Programmer_Guide/Shell_Items/Value/VALUE_Item_Messages|VALUE Item Messages]].
You can modify the value item's data using the following SET VALUE commands.


====TIMER====
====TIMER====
Line 8: Line 8:
<code>SET <var>value</var> TIMER <var>mode</var> [<var>step</var>=100 <var>stop</var>=0]</code>
<code>SET <var>value</var> TIMER <var>mode</var> [<var>step</var>=100 <var>stop</var>=0]</code>


Configure the timer of a value item. The timer can be started and stopped (<var>mode</var> = <code>ON</code>|<code>OFF</code>). The incremental value (<var>step</var> in ms) and the time when the timer should be stopped automatically (<var>stop</var> in ms, <= 0 for endless) can be set. If a timer is active, it sends a <code>[[???|TIMER]]</code>[[???| message]] for each <var>step</var> to the shell.
Configure the timer of a value item. The timer can be started and stopped (<var>mode</var> = <code>ON</code>|<code>OFF</code>). The incremental value (<var>step</var> in ms) and the time when the timer should be stopped automatically (<var>stop</var> in ms, <= 0 for endless) can be set. If a timer is active, it sends a <code>[[Programmer_Guide/Shell_Items/Value/VALUE_Item_Messages#Timer|TIMER]]</code>[[???| message]] for each <var>step</var> to the shell.


====INPUT====
====INPUT====
Line 34: Line 34:
</pre>
</pre>


 
=====Creation and initialisation of an output=====
=====Create and initialisation of an output=====


If you want to connect a value item to another value item (or SPU etc) the output must be activated. Any data assignment will activate the output. Changing the value item's data will not, however, write it to the output. You must use the <code>OUTPUT</code> command with the /Write option to write data to the output.
If you want to connect a value item to another value item (or SPU etc) the output must be activated. Any data assignment will activate the output. Changing the value item's data will not, however, write it to the output. You must use the <code>OUTPUT</code> command with the /Write option to write data to the output.
Line 57: Line 56:
Create a vector array output. The output has <var>count</var> vectors where each vector has length elements. If the option /Double is used, values are stored in 64-bit floating-point numbers, otherwise they are stored in 32-bit floating-point numbers.
Create a vector array output. The output has <var>count</var> vectors where each vector has length elements. If the option /Double is used, values are stored in 64-bit floating-point numbers, otherwise they are stored in 32-bit floating-point numbers.


You can change the data type of a value item with this command.=====Updating an output=====
You can change the data type of a value item with this command.
 
=====Updating an output=====


Update the value item's data and write it to it's output.
Update the value item's data and write it to it's output.

Latest revision as of 09:41, 29 October 2015

Value Item
NEW SET ATTRIBUTES MESSAGES

You can modify the value item's data using the following SET VALUE commands.

TIMER

SET value TIMER mode [step=100 stop=0]

Configure the timer of a value item. The timer can be started and stopped (mode = ON|OFF). The incremental value (step in ms) and the time when the timer should be stopped automatically (stop in ms, <= 0 for endless) can be set. If a timer is active, it sends a TIMER message for each step to the shell.

INPUT

SET value INPUT itemOutput|* [ /R ]

Connect the input of the value item value to the output of an SPU, graph (e.g. cursors) or other value item. If the option /R is used, an asynchronous data transfer is performed. To read data without changing the connection use '*' for itemOutput.

itemOutput
The output of a value, SPU or graph. If an input has already been specified by a previous command, you can use an asterisk in association with the /Read option to transfer the data.

The output of an item is addressed using the syntax itemname.outputname (e.g. $#graphitem.cursors).SET value INPUT

Disconnect the input of a value item. The input is disconnected automatically when the connected item or the value item itself is deleted.

OUTPUT

The OUTPUT command is used to change a value item's data and optionally write it to any connected item (see INPUT). Since the extension of the STx macro syntax in version 3.7.0, value item assignment has become much easier and therefore the use of the OUTPUT command as the primary means of assigning data is probably no longer the case.

A simple way to assign the value of one item to another is:

$#v1 := $#v2 // assign the contents of #v2 to #v1
Creation and initialisation of an output

If you want to connect a value item to another value item (or SPU etc) the output must be activated. Any data assignment will activate the output. Changing the value item's data will not, however, write it to the output. You must use the OUTPUT command with the /Write option to write data to the output.

The output data must be created before another item can be connected to the output and before it can be updated or written.

SET value OUTPUT /String nCharacters

Create a string output with nCharacters characters.

SET value OUTPUT /Number numericValue [/Double]

Create a numeric value output with the initial value numericValue. If the flag /Double is used, values are stored in 64-bit floating-point numbers, otherwise they are stored in 32-big floating-point numbers.

SET value OUTPUT /Vector nElements [/Double]

Create a vector output with nElements elements. If the flag /Double is used, values are stored in 64-bit floating-point numbers, otherwise they are stored in 32-big floating-point numbers.

SET value OUTPUT /Array length count [/Double]

Create a vector array output. The output has count vectors where each vector has length elements. If the option /Double is used, values are stored in 64-bit floating-point numbers, otherwise they are stored in 32-bit floating-point numbers.

You can change the data type of a value item with this command.

Updating an output

Update the value item's data and write it to it's output.

If the option /Write is used, the data is sent to the connected input (if any). The output data type is defined during creation (see above). The connection of a value item to an output is performed via the input connect function of another value item, or during SPU item creation if the value item is used as an argument (input) for the SPU.

The value item output can be used, for example, to control SPU items performing real-time processing.

The following option is valid for all four commands below.

/Write
If the new value to the item's output.

SET value OUTPUT string [/Write]

Set the value item's content to the value of string.

string
Any character string.

Another way to assign data to a value item is by using the assignment operator. E.g. if you value item is stored in the variable #v and you want to assign the string 'hello', the following command will work: $#v := 'hello'SET value OUTPUT numericValue [/Write]

Initialize a numerical output with the value numericValue.

SET value OUTPUT index1 number1 [index2 number2 coef] [/Write]

Initialize a vector output in the following way:

elementindex1 = number1 elementi = number1 + (number2 – number1) . ((i – index1) / (index2 – index1))coef

with: 0 <= index1 < index2 < nElements and coef > 0

SET value OUTPUT number [index count row] [/Write]

Update the element index and the next count elements of the vector row with the value number.

number
The numerical value

Navigation menu

Personal tools