Commit 57c4f6a3 authored by Hanspeter Portner's avatar Hanspeter Portner

remove usage of Atom_Object.id and happy turtling.

* Atom_Object.id seems not to be widely used.
* Add prototype of OSC Turtle Specificatoin.
parent 2c3a342f
# Copyright (c) 2015 Hanspeter Portner (dev@open-music-kontrollers.ch)
#
# This is free software: you can redistribute it and/or modify
# it under the terms of the Artistic License 2.0 as published by
# The Perl Foundation.
#
# This source is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# Artistic License 2.0 for more details.
#
# You should have received a copy of the Artistic License 2.0
# along the source as a COPYING file. If not, obtain it from
# http://www.perlfoundation.org/artistic_license_2_0.
@prefix dcs: <http://ontologi.es/doap-changeset#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix lic: <http://opensource.org/licenses/> .
@prefix omk: <http://open-music-kontrollers.ch/ventosus#> .
<http://open-music-kontrollers.ch/lv2/osc>
a doap:Project ;
doap:license lic:Artistic-2.0 ;
doap:name "LV2 OSC" ;
doap:shortdesc "A definition of atomified OSC." ;
doap:maintainer omk:me ;
doap:created "2015-06-19" ;
doap:developer omk:me ;
doap:release [
doap:revision "1.0" ;
doap:created "2015-06-19" ;
dcs:blame omk:me ;
dcs:changeset [
dcs:item [
rdfs:label "Initial release."
]
]
] .
......@@ -26,10 +26,10 @@
#include <lv2/lv2plug.in/ns/ext/atom/forge.h>
#include <lv2/lv2plug.in/ns/ext/midi/midi.h>
#define OSC_URI "http://opensoundcontrol.org"
#define OSC_URI "http://open-music-kontrollers.ch/lv2/osc"
#define OSC_PREFIX OSC_URI "#"
#define OSC__Event OSC_PREFIX "Event" // object id
#define OSC__Event OSC_PREFIX "Event" // event
#define OSC__Bundle OSC_PREFIX "Bundle" // object otype
#define OSC__Message OSC_PREFIX "Message" // object otype
#define OSC__bundleTimestamp OSC_PREFIX "bundleTimestamp" // property key
......@@ -40,6 +40,9 @@
typedef struct _osc_forge_t osc_forge_t;
typedef void (*osc_message_cb_t)(uint64_t timestamp, const char *path,
const char *fmt, const LV2_Atom_Tuple *arguments, void *data);
struct _osc_forge_t {
LV2_URID OSC_Event;
......@@ -82,7 +85,6 @@ static inline int
osc_atom_is_bundle(osc_forge_t *oforge, const LV2_Atom_Object *obj)
{
return (obj->atom.type == oforge->ATOM_Object)
&& (obj->body.id == oforge->OSC_Event)
&& (obj->body.otype == oforge->OSC_Bundle);
}
......@@ -106,7 +108,6 @@ static inline int
osc_atom_is_message(osc_forge_t *oforge, const LV2_Atom_Object *obj)
{
return (obj->atom.type == oforge->ATOM_Object)
&& (obj->body.id == oforge->OSC_Event)
&& (obj->body.otype == oforge->OSC_Message);
}
......@@ -129,9 +130,6 @@ osc_atom_message_unpack(osc_forge_t *oforge, const LV2_Atom_Object *obj,
lv2_atom_object_query(obj, q);
}
typedef void (*osc_message_cb_t)(uint64_t timestamp, const char *path,
const char *fmt, const LV2_Atom_Tuple *arguments, void *data);
static inline void osc_atom_event_unroll(osc_forge_t *oforge,
const LV2_Atom_Object *obj, osc_message_cb_t cb, void *data);
......@@ -200,8 +198,7 @@ static inline LV2_Atom_Forge_Ref
osc_forge_bundle_push(osc_forge_t *oforge, LV2_Atom_Forge *forge,
LV2_Atom_Forge_Frame frame [2], uint64_t timestamp)
{
if(!lv2_atom_forge_object(forge, &frame[0], oforge->OSC_Event,
oforge->OSC_Bundle))
if(!lv2_atom_forge_object(forge, &frame[0], 0, oforge->OSC_Bundle))
return 0;
if(!lv2_atom_forge_key(forge, oforge->OSC_bundleTimestamp))
......@@ -227,8 +224,7 @@ static inline LV2_Atom_Forge_Ref
osc_forge_message_push(osc_forge_t *oforge, LV2_Atom_Forge *forge,
LV2_Atom_Forge_Frame frame [2], const char *path, const char *fmt)
{
if(!lv2_atom_forge_object(forge, &frame[0], oforge->OSC_Event,
oforge->OSC_Message))
if(!lv2_atom_forge_object(forge, &frame[0], 0, oforge->OSC_Message))
return 0;
if(!lv2_atom_forge_key(forge, oforge->OSC_messagePath))
......@@ -318,14 +314,16 @@ osc_forge_char(osc_forge_t *oforge, LV2_Atom_Forge *forge, char c)
}
static inline LV2_Atom_Forge_Ref
osc_forge_midi(osc_forge_t *oforge, LV2_Atom_Forge *forge, const uint8_t *m)
osc_forge_midi(osc_forge_t *oforge, LV2_Atom_Forge *forge, uint32_t size,
const uint8_t *m)
{
// Note: this is not standard MIDI, e.g. first byte is a port number
LV2_Atom_Forge_Ref ref;
if(!(ref = lv2_atom_forge_atom(forge, 4, oforge->MIDI_MidiEvent)))
if(!(ref = lv2_atom_forge_atom(forge, size, oforge->MIDI_MidiEvent)))
return 0;
if(!(ref = lv2_atom_forge_raw(forge, m, 4)))
if(!(ref = lv2_atom_forge_raw(forge, m, size)))
return 0;
lv2_atom_forge_pad(forge, 4);
lv2_atom_forge_pad(forge, size);
return ref;
}
......
# Copyright (c) 2015 Hanspeter Portner (dev@open-music-kontrollers.ch)
#
# This is free software: you can redistribute it and/or modify
# it under the terms of the Artistic License 2.0 as published by
# The Perl Foundation.
#
# This source is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# Artistic License 2.0 for more details.
#
# You should have received a copy of the Artistic License 2.0
# along the source as a COPYING file. If not, obtain it from
# http://www.perlfoundation.org/artistic_license_2_0.
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
<http://open-music-kontrollers.ch/lv2/osc>
a lv2:Specification ;
lv2:minorVersion 1 ;
lv2:microVersion 0 ;
rdfs:seeAlso <osc.ttl> .
# Copyright (c) 2015 Hanspeter Portner (dev@open-music-kontrollers.ch)
#
# This is free software: you can redistribute it and/or modify
# it under the terms of the Artistic License 2.0 as published by
# The Perl Foundation.
#
# This source is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# Artistic License 2.0 for more details.
#
# You should have received a copy of the Artistic License 2.0
# along the source as a COPYING file. If not, obtain it from
# http://www.perlfoundation.org/artistic_license_2_0.
@prefix atom: <http://lv2plug.in/ns/ext/atom#> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix midi: <http://lv2plug.in/ns/midi#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix osc: <http://open-music-kontrollers.ch/lv2/osc#> .
<http://open-music-kontrollers.ch/lv2/osc>
a owl:Ontology ;
rdfs:seeAlso <lv2_osc.h> ,
<lv2-osc.doap.ttl> ;
lv2:documentation """
<p>This specification defines event data types for OSC bundles and message.
To signal support for OSC events on an atom:AtomPort with an atom:bufferType
of atom:Sequence, plugin authors should add atom:supports osc:Event to
the plugin specification.</p>
""" .
osc:Event
a rdfs:Class ;
rdfs:subClassOf atom:Object ;
rdfs:label "OSC Event (Bundle or Message)" .
osc:Bundle
a rdfs:Class ;
rdfs:subClassOf osc:Event ;
rdfs:label "OSC Bundle" .
osc:Message
a rdfs:Class ;
rdfs:subClassOf osc:Event ;
rdfs:label "OSC Message" .
osc:bundleTimestamp
a rdf:Property ,
owl:ObjectProperty ,
owl:FunctionalProperty ;
rdfs:domain osc:Bundle ;
rdfs:range atom:Long ;
rdfs:label "OSC Bundle Timestamp" .
osc:bundleItems
a rdf:Property ,
owl:ObjectProperty ,
owl:FunctionalProperty ;
rdfs:domain osc:Bundle ;
rdfs:range atom:Tuple ;
rdfs:label "OSC Bundle Items" ;
lv2:documentation """
<p>Tuple of OSC Bundle Items (e.g. nested osc:Bundle's and/or
osc:Message's).</p>
""" .
osc:messagePath
a rdf:Property ,
owl:ObjectProperty ,
owl:FunctionalProperty ;
rdfs:domain osc:Message ;
rdfs:range atom:String ;
rdfs:label "OSC Message Path" .
osc:messageFormat
a rdf:Property ,
owl:ObjectProperty ,
owl:FunctionalProperty ;
rdfs:domain osc:Message ;
rdfs:range atom:String ;
rdfs:label "OSC Message Format" .
osc:messageArguments
a rdf:Property ,
owl:ObjectProperty ,
owl:FunctionalProperty ;
rdfs:domain osc:Message ;
rdfs:range atom:Tuple ;
rdfs:label "OSC Message Arguments" ;
lv2:documentation """
<p>Tuple of OSC Message Arguments (e.g. Atom:Int, Atom:Long, Atom:Float,
Atom:Double, Atom:String, Atom:Chunk, Atom:Bool, Atom:Blank,
MIDI:MidiEvent).</p>
""" .
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