From 8ff6722a1f1e2ce8ccc739f345f3bcec31a15c7a Mon Sep 17 00:00:00 2001
From: David Robillard
Date: Sun, 12 Feb 2012 04:18:46 +0000
Subject: Finish up sequence / time type stuff.
---
lv2/lv2plug.in/ns/ext/atom/atom.h | 11 ++++++++---
lv2/lv2plug.in/ns/ext/atom/atom.ttl | 28 ++++++++++++++++++++++++++--
lv2/lv2plug.in/ns/ext/atom/forge.h | 6 +++---
3 files changed, 37 insertions(+), 8 deletions(-)
(limited to 'lv2/lv2plug.in/ns/ext/atom')
diff --git a/lv2/lv2plug.in/ns/ext/atom/atom.h b/lv2/lv2plug.in/ns/ext/atom/atom.h
index bea9197..5c0b3fd 100644
--- a/lv2/lv2plug.in/ns/ext/atom/atom.h
+++ b/lv2/lv2plug.in/ns/ext/atom/atom.h
@@ -180,6 +180,11 @@ typedef struct {
This is used as the contents of an atom:EventPort, but is a generic Atom
type which can be used anywhere.
+ The unit field is either a URID that described an appropriate time stamp
+ type, or may be 0 where a default stamp type is known. For
+ LV2_Descriptor::run(), the default stamp type is atom:AudioFrames, i.e.
+ LV2_Atom_Audio_Time.
+
The contents of a sequence is a series of LV2_Atom_Event, each aligned
to 64-bits, e.g.:
@@ -190,9 +195,9 @@ typedef struct {
*/
typedef struct {
- LV2_Atom atom; /**< Atom header. */
- uint32_t capacity; /**< Maximum size of contents. */
- uint32_t time_type; /**< URID type of event time stamps. */
+ LV2_Atom atom; /**< Atom header. */
+ uint32_t unit; /**< URID of unit of event time stamps. */
+ uint32_t pad; /**< Currently unused. */
/* Contents (a series of events) follow here. */
} LV2_Atom_Sequence;
diff --git a/lv2/lv2plug.in/ns/ext/atom/atom.ttl b/lv2/lv2plug.in/ns/ext/atom/atom.ttl
index 7d534d0..4d87ce5 100644
--- a/lv2/lv2plug.in/ns/ext/atom/atom.ttl
+++ b/lv2/lv2plug.in/ns/ext/atom/atom.ttl
@@ -114,7 +114,7 @@ atom:Bang
a rdfs:Class ;
rdfs:subClassOf atom:Atom ;
rdfs:label "Bang" ;
- rdfs:comment "Generic activity or trigger, with no body." .
+ rdfs:comment "Generic activity or trigger, with no body." .
atom:Number
a rdfs:Class ;
@@ -322,7 +322,31 @@ atom:Blank
The ID of a Blank is valid only within the context the Blank appears in. For
ports this is the context of the associated run() call, i.e. all ports share
the same context so outputs can contain IDs that correspond to IDs of blanks in
-the input.
""" .
+the input.
+""" .
+
+atom:TimeUnit
+ a rdfs:Class ;
+ rdfs:label "Time Unit" ;
+ lv2:documentation "A unit for atom:Event time stamps.
" .
+
+atom:AudioFrames
+ a rdfs:Class ;
+ rdfs:subClassOf atom:TimeUnit ;
+ rdfs:label "Audio frames" ;
+ lv2:documentation """
+Time in audio frames. Converting this to absolute time depends on the
+sample rate. When this is the stamp unit for an atom:Sequence, the events in
+that sequence have LV2_Atom_Audio_Time stamps (event.time.audio
)
""" .
+
+atom:Beats
+ a rdfs:Class ;
+ rdfs:subClassOf atom:TimeUnit ;
+ rdfs:label "Beats" ;
+ lv2:documentation """
+Time in beats. Converting this to absolute time depends on the tempo. When
+this is the stamp unit for an atom:Sequence, the events in that sequence have a
+double
stamp (event.time.beats
).
""" .
atom:Event
a rdfs:Class ;
diff --git a/lv2/lv2plug.in/ns/ext/atom/forge.h b/lv2/lv2plug.in/ns/ext/atom/forge.h
index 08c1961..78c7873 100644
--- a/lv2/lv2plug.in/ns/ext/atom/forge.h
+++ b/lv2/lv2plug.in/ns/ext/atom/forge.h
@@ -410,15 +410,15 @@ static inline LV2_Atom_Sequence*
lv2_atom_forge_sequence_head(LV2_Atom_Forge* forge,
LV2_Atom* parent,
uint32_t capacity,
- uint32_t time_type)
+ uint32_t unit)
{
LV2_Atom_Sequence* out = (LV2_Atom_Sequence*)
lv2_atom_forge_reserve(forge, parent, sizeof(LV2_Atom_Sequence));
if (out) {
out->atom.type = forge->Sequence;
out->atom.size = sizeof(LV2_Atom_Sequence) - sizeof(LV2_Atom);
- out->capacity = capacity;
- out->time_type = 0;
+ out->unit = unit;
+ out->pad = 0;
}
return out;
}
--
cgit v1.2.1