Commit 4b43c232 authored by Hanspeter Portner's avatar Hanspeter Portner

manual: document forge OSC containers.

parent ce4095f5
Pipeline #4297684 passed with stages
in 16 minutes and 51 seconds
......@@ -121,7 +121,6 @@
<li><a href="#forge-object">Object</a>
<ul>
<li><a href="#forge-key">Key</a></li>
<li><a href="#forge-property">Property</a></li>
</ul>
</li>
<li><a href="#forge-tuple">Tuple</a></li>
......@@ -2225,7 +2224,7 @@ local urn = HashMap('urn:moony:xyz')
-- serialize
local io = Stash()
local obj = io:sequence() -- create derived container forge object
local obj = io:object(nil, urn.FooBar) -- create derived container forge object
obj:key(urn.foo):int(12) -- without context
obj:key(urn.bar, urn.ctx):long(13) -- with context
obj:pop() -- finalize container</code></pre>
......@@ -2309,6 +2308,94 @@ io:vector(Atom.Int, 1, 2, 3, 4, 5) -- vector items as individual arguments
io:vector(Atom.Bool, {true, false, true}) --vector items as table</code></pre>
</div></div>
<!-- Forge Pop -->
<div class="api-section"><div class="api-content">
<h3 id="forge-pop">Pop</h3>
<p>Finalize any derived container forge object.</p>
<dl>
<dt class="func">forge:pop()</dt>
</dl>
</div></div>
<!-- Forge OSC -->
<div class="api-section"><div class="api-content">
<h2 id="forge-osc">OSC</h2>
<p>Atom types that contain Open Sound Control bundles or messages as part of their body.</p>
</div></div>
<!-- Forge Bundle -->
<div class="api-section"><div class="api-content">
<h3 id="forge-bundle">Bundle</h3>
<p>Forge a OSC bundle atom, e.g. an atom object of type OSC.Bundle.</p>
<dl>
<dt class="func">forge:bundle(timestamp=1)</dt>
<dt>timestamp (integer | number)</dt>
<dd>absolute timestamp in frames (integer) or relative timestamp (number) in seconds, defaults to 1 aka immediate</dd>
<dt class="ret">(forge)</dt>
<dd>derived container forge object, needs to be finalized with <a href="Pop">Pop</a></dd>
</dl>
<a class="api-snippet" href="#snippet-forge-bundle" data-snippet="snippet-forge-bundle">&rArr; show snippet</a>
<pre class="api-hidden"><code id="snippet-forge-bundle">-- Forge Bundle
-- serialize
local io = Stash()
-- schedule bundle for immediate dispatch
local bndl = io:bundle() -- create derived container forge object
bndl:message('/hello', 's', 'world')
bndl:pop() -- finalize container
-- schedule bundle for dispatch @ Sep 19, 2016 02.09.16.015811000 UTC
bndl = io:bundle(0xdb89c74c040c3199)
bndl:message('/hello', 's', 'world')
bndl:pop()
-- schedule bundle for dispatch in 0.1s
bndl = io:bundle(0.1)
bndl:message('/hello', 's', 'world')
bndl:pop()</code></pre>
</div></div>
<!-- Forge Message -->
<div class="api-section"><div class="api-content">
<h3 id="forge-message">Message</h3>
<p>Forge a OSC message atom, e.g. an atom object of type OSC.Message.
Supported OSC argument types are: 'i', 'f', 's', 'b', 'h', 'd', 't',
'm', 'S', 'c', 'r', 'T', 'F', 'N', 'I'</p>
<dl>
<dt class="func">forge:message(path, format, ...)</dt>
<dt>path (string)</dt>
<dd>OSC path as string</dd>
<dt>format (string)</dt>
<dd>OSC format as string</dd>
<dt>... (integer | number | string)</dt>
<dd>variable arguments according to format</dd>
<dt class="ret">(forge)</dt>
<dd>self forge object</dd>
</dl>
<a class="api-snippet" href="#snippet-forge-message" data-snippet="snippet-forge-message">&rArr; show snippet</a>
<pre class="api-hidden"><code id="snippet-forge-message">-- Forge Message
-- serialize
local io = Stash()
-- schedule bundle for immediate dispatch
local bndl = io:bundle() -- create derived container forge object
bndl:message('/hello', 'ifs', 2016, 12.5, 'hello')
bndl:message('/hello', 'b', string.char(0x1, 0x2, 0x3))
bndl:message('/hello', 'hdS', 2017, 13.5, 'world')
bndl:message('/hello', 't', 0xdb89c74c040c3199)
bndl:message('/hello', 'TFNI')
bndl:message('/hello', 'm', string.char(MIDI.NoteOn, 69, 0x7f))
bndl:message('/hello', 'cr', string.byte('s'), 0xff00ff00)
bndl:pop() -- finalize container)</code></pre>
</div></div>
<!-- FIXME -->
<!-- Stash -->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment