/some/object/property
h3. set properties
To *set* the value of a proprety, simply call the url with an argument matching the type discovered during the *get* query:
/some/object/property
What we show here with @/.reply "/some/object/property"
All replies to queries are sent to the "/.reply" url.
Return values are sent to the calling application and to all observers (see @/.register@ below).
h3. root
The url for the root node is @""@, not @"/"@. This is because the slash ("/") is a _separator_ between names meaning "parent of".
@/foo/bar@ means: object 'bar' is a child of 'foo' which is a child of object '' (empty string)
/.reply "/.info" "/some/url" "Blah blah blah, this and that."
The query */.info ""* (info on root) returns information on the application itself.
h3. /.list "/some/url"
Returns an array strings listing the names of the children nodes under the given url. Should return nil if there are no children. Reply example:
/.reply "/.list" "/some/url" "foo" "bar" ...
h3. /.tree "/some/url"
Return an array of strings listing all nodes under the given parameter. For each node, the path _under the called url_ is listed. For example here is a description of a tree with the osc reply:
/animals
/animals/mammals
/animals/mammals/tiger
/animals/mammals/tiger/Siberian
/animals/mammals/tiger/Bengal
/animals/mammals/mice
/animals/insects
/animals/insects/bee
/.reply "/.tree" "/animals/mammals" "tiger" "tiger/Siberian" "tiger/Bengal" "mice"
Note that the urls don't end with a "/" even if they have children because the information on these children is given by the list. Note also that the part of the calling url @/animals/mammals@ with the separator "/" is removed from the urls.
Calling "/.tree" on the root node would give:
/.reply "/.tree" "" ".error" ".info" ... "animals" "animals/mammals" ... "animals/insects" "animals/insects/bee"
h3. /.type "/some/url"
Returns the type of a property in the following format:
/.reply "/.type" "/some/url"
The @/.reply "/.schema" "" "/oscit/some_name"
Multiple schemas:
/.reply "/.schema" "/foo" "/oscit/foo_protocol"
/.reply "/.schema" "/bar" "/oscit/bar_protocol"
/osc/error 404 "/the/bad/url"
h3. 2. bad arguments
When a method is called with the wrong type tags, the reply contains the "bad request" error code along with the same info string as the "/.info" query (human readable information).
/osc/error 400 "/called/url" "info string"
/osc/attributes "/some/url"
Reply:
/osc/reply "/osc/attributes" "/some/url" { hash with attributes }
h3. set
/osc/attributes "/some/url" { some attributes to set }
Reply:
/osc/reply "/osc/attributes" "/some/url" { changed attributes }
Note that missing attributes in the hash are not removed or set to null: they are just ignored.
h3. attributes schema
Here is the list of attributes currently used by oscit (note that "root" attributes that could be confused with methods in a serialized object have an "@" sign):
* *@info*: human readable information describing the method
* *@type*: contains type information
** *name*: type name such as "float", "midi", "range" (used to create default widgets)
** *signature*: string containing the type tags signature like "f", "m" (used for slot/call compatibility)
** *min*: minimal value (optional, used by "float" type)
** *max*: maximal value (optional, used by "float" type)
* *@source*: information to subscribe to a data source (can be a Hash or simply "true")
** *uri*: resource identifier to get data like "rtp://10.0.0.8:3488/stream1"
** *...*: other attributes to describe the data stream (depends on protocol)
* *@view*: information to display the object on a view or patch (an object/method without this information is not displayed in a view or patch)
** *widget*: view widget to use in patch or view such as "Slider", "Button", "Script", etc.
** *x *: x position in patch or view
** *y *: y position in patch or view
** *width*: widget width
** *height*: widget height
** *hue*: widget color
* *@targets*: Hash containing the list of subscribed targets
* *@class*: class url to create Node ("/class/Metro" for example)
If the @source parameter is just "true", this means that the subscription location is the object's path, the protocol is "OSC" and the data stream will be encoded with OSC packets.
/views/base {"view":{"widget":"Device", "x":100, "y":100, "width":200,
"height":200, "widget":"Device"}
/views/base/1 {"view":{"widget":"Slider", "x":10, "y":10, "width":30,
"height":150, "connect":"/l/tempo"}}
/views/base/2 {"view":{"widget":"Slider", "x":50, "y":10, "width":30,
"height":150, "connect":"/l/velocity"}}
/views/base/3 {"view":{"widget":"Pad""x", "x":50, "y":10, "width":30,
"height":150, "connect_x":"/l/velocity",
"connect_y":"/l/tempo"}}
/osc/subscribe "/some/source", "osc://'device name'/path/to/target"
Once the subscription has been accepted, @/some/source@ will send all values to the target:
osc://'device name'/path/to/target [value]
Subscriptions are serialized in the source's attributes with the @@targets@ key (a hash with keys as target URIs):
@targets:{"local/url":{}, "osc://'device name'/path/to/target":{}}
If the link to the target cannot be made, the link is kept in the "pending links" list and the server will retry when the target appears on the network.
Funding from the Swiss Federal Office of Culture to write the graphical frontend to rubyk !
Moving from a global mutex to a global select/poll loop.