# TCP & UPD Control

## Configuration

Go to the Settngs menu and choose the `Comm` tab.

<figure><img src="https://2196782366-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsCDusk0UPrmELvhRqYpD%2Fuploads%2FV8vEIQgff8bfuTh0ePvZ%2Fimage.png?alt=media&#x26;token=9f5229a8-e277-4b4a-83e1-fd34ac8c96d3" alt=""><figcaption></figcaption></figure>

#### TCP Listen

This field contains all the ip addresses and ports the TCP command module will be listening to, each line represents an ethernet IP followed by a port, separated by a colon `:`.

Use an asterisk `*` as a wildcard to specify all Ips in the host.&#x20;

Examples:

* Listen to adapter with IP 192.168.1.229 on port 7000: `192.168.1.229:7000`&#x20;
* Listen to all local adapters on port 2500: `*:2500`

## TCP

Once configured, Exaplay can be controlled via TCP, and can send commands via TCP as well.

### TCP IN (Receive)

Exaplay will listen for TCP text line messages, ending with a `CR`. The return messages are sent ending with `CRLF`.&#x20;

Each section of the message, as well as the parameters, should be separated by commas `,`. The main format structure should be as follows:

<table data-header-hidden><thead><tr><th width="153"></th><th width="99"></th><th width="115"></th><th width="101"></th><th></th></tr></thead><tbody><tr><td><code>Command</code></td><td><code>,</code></td><td><code>address</code></td><td><code>,</code></td><td><code>Parameters (,,,)</code></td></tr></tbody></table>

Many commands are adressed to a specific composition (playlist or timeline). In Exaplay, compositions are represented as a tab, and they are adressed by an unique ID:\ <br>

<figure><img src="https://2196782366-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsCDusk0UPrmELvhRqYpD%2Fuploads%2FOiqqk2AnfacFjWV17Mky%2Fimage.png?alt=media&#x26;token=dafb40e0-7741-4712-a076-64665568023b" alt=""><figcaption></figcaption></figure>

When using TCP-commands, the addressing of compostions follows this keyword scheme

```
comp[ID] // e,g, comp1 for composition with ID 1
```

Available commands

<table><thead><tr><th width="260">Command</th><th width="401">Description</th><th>Return</th></tr></thead><tbody><tr><td><code>hello</code></td><td>Echo test</td><td><code>hallo</code></td></tr><tr><td><code>get:ver</code></td><td>Returns the current Exaplay version. </td><td>e.g. <code>2.21.0.0</code></td></tr><tr><td><code>play,comp[ID]</code></td><td>Starts the playback of the addressed composition. <br>Example: <code>play,comp1</code></td><td> <code>OK</code> or <code>ERR</code></td></tr><tr><td><code>stop,comp[ID]</code></td><td>Stops the playback of the addressed composition.<br>Example: <code>stop,comp1</code></td><td><code>OK</code> or <code>ERR</code></td></tr><tr><td><code>pause,comp[ID]</code></td><td>Pauses the playback of the addressed composition. <br>Example: <code>pause,comp1</code></td><td><code>OK</code> or <code>ERR</code></td></tr><tr><td><code>set:cuetime,comp[ID],[s.s]</code></td><td>Moves the play cue to a given time for a timeline composition. <br>Parameter: Time in seconds (seconds.fractions)<br>Example: <code>set:cuetime,comp1,2.0</code></td><td><code>OK</code> or <code>ERR</code></td></tr><tr><td><code>set:cue,comp[ID],[i]</code></td><td>Moves to a given index, in case of a timeline composition will be a cue, in case of a cuelist composition, it will be a clip index. <br>Parameter: Index, starting from 1<br>Example: <code>set:cue,cuelist1,2</code></td><td><code>OK</code> or <code>ERR</code></td></tr><tr><td><code>set:vol,comp[ID],[i]</code></td><td>Sets the volume of a composition<br>Parameter: Volume value from 0 to 100<br>Example: <code>set:vol,comp1,60</code></td><td><code>OK</code> or <code>ERR</code></td></tr><tr><td><code>get:vol,comp[ID]</code></td><td>Returns the current volume of a composition.<br>Example: <code>get:vol,comp1</code></td><td>e.g. <code>60</code></td></tr><tr><td><code>get:status,comp[ID]</code></td><td>Retrieves the current status values for a composition object. Return values:<br>1. Current playback status. 0=stop, 1=playing, 2=pause<br>2. Current time in seconds<br>3. Current frame index<br>4. Current clip index (valid for cuelist compositions)<br>5. Total composition duration in seconds<br>Example: <code>get:status,comp1</code></td><td>e.g <code>1,15.65,939,-1,300</code></td></tr></tbody></table>

### TCP OUT (Send)

It is possible to send arbitrary TCP text line messages at certain events, configured as cue commands in Exaplay.The format structure is as follows:

<table data-header-hidden><thead><tr><th width="113"></th><th width="83"></th><th width="237"></th><th width="77"></th><th></th></tr></thead><tbody><tr><td><code>TCP</code></td><td><code>></code></td><td><code>IP Address : Port</code></td><td><code>,</code></td><td><code>Message</code></td></tr></tbody></table>

Example:

* To send the message ‘hello’ to the address 192.68.50.10 listening at port 5000: `TCP>192.168.50.10:5000,hello`

## UDP

### UDP Out

It is possible to send arbitrary UDP text messages at certain events, configured as cue commands in Exaplay. The format structure is as follows:

<table data-header-hidden><thead><tr><th width="108"></th><th width="82"></th><th></th><th width="79"></th><th></th></tr></thead><tbody><tr><td><code>UDP</code></td><td><code>></code></td><td><code>IP Address : Port</code></td><td><code>,</code></td><td><code>Message</code></td></tr></tbody></table>

Example:

* To send the message ‘hello’ to the address 192.68.50.10 listening at port 5000: UD`P>192.168.50.10:5000,hello`\ <br>
