Bundle
An OSC Bundle consist of a Timetag and one or many Bundle Elements. The elements are either OSC Messages or more OSC Bundles
Test:
Constructor Summary
Public Constructor | ||
public |
constructor(args: ...*) Create a Bundle instance |
Method Summary
Public Methods | ||
public |
Add a Message or Bundle to the list of elements |
|
public |
pack(): Uint8Array Interpret the Bundle as packed binary data |
|
public |
Take a JavaScript timestamp to set the Bundle's timetag |
|
public |
Unpack binary data to read a Bundle |
Public Constructors
public constructor(args: ...*) source
Create a Bundle instance
Params:
Name | Type | Attribute | Description |
args | ...* | Timetag and elements. See examples for options |
Example:
const bundle = new Bundle(new Date() + 500)
const message = new Message('/test/path', 51.2)
const anotherBundle = new Bundle([message], Date.now() + 1500)
const message = new Message('/test/path', 51.2)
const anotherMessage = new Message('/test/message', 'test', 12)
const anotherBundle = new Bundle(message, anotherMessage)
Public Members
public bundleElements: array source
public timetag: AtomicTimetag source
Private Members
Public Methods
public timestamp(ms: number) source
Take a JavaScript timestamp to set the Bundle's timetag
Params:
Name | Type | Attribute | Description |
ms | number | JS timestamp in milliseconds |
Example:
const bundle = new Bundle()
bundle.timestamp(Date.now() + 5000) // in 5 seconds