![]() |
![]() |
This Active-X control allows you to receive OSC data in applications which support ActiveX controls on Microsoft Windows.
An Active-X control is represented by it's properties, methods and events. Properties are settings you can check and change. In the case of the OSC Active-X, the most relevant property is the port number. It has to be the same setting you are using in Eyecon. Eyecon and the OSC Active-X use port 7000 as a default. Methods are function calls made to the control. In our case the most important methods are 'Open' and 'Close', which will start and stop the OSC function. A good place to call OPen and Close are the startmovie and endmovie scripts of your Director program. Have a look at the sample program i provide.
An event is an externally triggered moment, where you want your program to respond to. In case of the OSC control it would be the moment a message is received. You have to define an event handler in your program, which defines, how the message is treated. The name of the receiver event is OnOSCInput
Each OSC message consists at least out of one address string, which tells the application which subfunction is addressed. In the simplest case the address string is the only part of the whole message. Often you will have other parameters following though. The OSC active-X currently supports integer, floating point and string parameters.
1. Set the Listeningport to the desired port setting
2. OSCX.Open starts the OSC receiver
3. Define an even hander for the OnOscInput event
//a single OnOscInput event could deliver more than one message, it is recommended to process them in a loop.
for i := 1 to OSCX.MsgCnt do
begin
address := OSCX.Address;
//depending on Addressstring you implement the functionality
if address = ....
//access the messageparameters
if OSCX.MsgParamCnt > 0 then param1 = OSCX.Data1
//release current message
OSCX.Next
end
4. When closing your application, don't forget to call the OSCX.Close method
A bunch of properties are defined to determine how the control is visually represented.
The only functionally important setting is the Listeningport.
Listeningport | The port number the control is listening to. Has to match with settings in sending program |
Visible | turns visualization of the control on or off. Default On |
BevelInner BevelOuter COlor Font Cursor |
design, how the control looks in your application |
Indicator | size of the progress indicator bar. This bar moves when there is OSC input activity. |
Version | read only; returns an identifying string for the control |
Open | Iinitializes the OSC controls function. |
Close | Ends the OSC controls function. |
MsgCount | Indicates, how many OSC messages are ready and waiting for being processed in the controls buffer. |
Address | Returns the address string for the current OSC message |
MsgParamCnt | Returns how many parameters the current OSC message is carrying |
Data1 | Returns the first OSC parameter of the current message |
Data2, Data3, Data4 | Returns more OSC parameters. |
Data(n:integer) | returns the OSCparameter with index n, more universal form of the preceding methods , n runs from 0 to MsgParamCnt-1 |
Next | Release the current message, make the next one current. Mandatory use after accessing elements of the message |
TimeStamp | Bundled OSC messages carry a timestamp which is supposed to allow better synchronization. |
Typetag | Returns the typetag of the current OSC message, only necessary for special applications. |
BundleID | A running number created by the control. If multiple messages are bundled, they all share the same BundleID. Only needed for special applications. 0 if message is not bundled |
AboutBox | Opens an identifying Copyright dialog |
OnOscInput | called whenever a new OSC message is received |
OSC Active Help, this file last changed on 03. Jan 2006