Kommunikation med grafikcomputer
Jeg skal kommunikere med et grafikprogram, via UDP så vidt jeg kan læse mig til i nedenstående tekst.Jeg har dog ikke kommunikeret via UDP tidligere, så jeg har ikke forstand på den slags.
Jeg har lavet en lignende kommunikation, med at andet grafikprogram. Men det kunne styres via VBscript.
Jeg har fået flg. API:
TitleBox API v.1.6
The connection uses text messages, UDP broadcast (to all machines in the LAN only) or direct (to a specified IP address anywhere in the internet).
Command format:
A must to insert in the beginning of each command:
#PLBOX_CMD
CHANNEL_ID=x /1..16/ - this is 16-bit mask to specify which TitleBox channel will be controlled. Thus, if you have many TitleBox machines in the network, you can send the command to some of them.
Then insert the commands
...
...
COMMANDS LIST:
// TitleBox Control - general commands
PROJECT LOAD=filename
PROJECT MERGE=filename - to append objects from (project filename) to the currently open TitleBox project
PROJECT SAVEAS=filename - to save the current project as… specify its name here
PROJECT START
PROJECT RESET - stops all objects right away, without applying their transition effects.
PROJECT STOP
PROJECT CLEAR - the same as STOPALL
PROJECT NEW - use this one to clear all currently existing objects as well.
PROJECT STATUS - return TB status // play/stop ... See Notes (2)
TBCLOSE - Close TitleBox.
OBJECTSLIST - to see the list of all objects currently existing in the TitleBox project. See Notes (2)
DRAWMODEMIX=0..1 - to disable/enable the Mix-Draw mode operation (see the manual for details).
STOPALL - stops all objects, executing their transition effects (see PROJECT RESET)
GROUPPLAY=ObjName,ObjName,ObjName,ObjName,ObjName .... - to Group and play simultaneously all objects in this list. The objects' order here will affect their Z-order: the first in the list will be in the bottom, the last in the list will be on top.
Example: GROUPPLAY=Text 1,Picture 3,Roll 2
OBJECT=ObjName - to Select an Object
OSV...
---
Jeg har fundet denne PHP kode, som jeg mener burde kunne bruges:
$fp = fsockopen("udp://".$ipaddress, $destinationport, $errno, $errstr);
if (!$fp) {
echo "ERROR: $errno - $errstr<br />\n";
} else {
fwrite($fp, "DATA");
fclose($fp);
}
---
Men jeg har ingen anelse om hvordan jeg starter hele kommunikationen op.
Er der nogen der kan lede mig lidt på rette spor?
