aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-02-23 01:53:15 +0000
committerDavid Robillard <d@drobilla.net>2012-02-23 01:53:15 +0000
commitc2cc2607f8d5b9eea933a18abd91b2ce708fc90c (patch)
tree9923ca1257024897eccad5aae61c74cd37ce6609 /plugins
parentc69ce6e891824fc64022a3615542fc30edc89cd7 (diff)
downloadlv2-c2cc2607f8d5b9eea933a18abd91b2ce708fc90c.tar.xz
Separately define body types for atoms with non-trivial bodies so the type definitions are useful when only the body is available (e.g. state API).
Use a single int64_t stamp for frame times since range is more important now and subframes was never really used anyway. Add atom:frameTime and atom:beatTime for serialising events. Consistently use name "body" for all types of atom bodies. Add lv2_atom_forge_atom() and lv2_atom_forge_raw() for constructing arbitrary atoms. Merge similar string-like forge methods. Update language URI requirements to match current (and hopefully permanent, geeze) http://lexvo.org reality.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/eg-sampler.lv2/sampler.c8
-rw-r--r--plugins/eg-sampler.lv2/uris.h4
2 files changed, 6 insertions, 6 deletions
diff --git a/plugins/eg-sampler.lv2/sampler.c b/plugins/eg-sampler.lv2/sampler.c
index 6ac5a38..fd450c6 100644
--- a/plugins/eg-sampler.lv2/sampler.c
+++ b/plugins/eg-sampler.lv2/sampler.c
@@ -335,13 +335,13 @@ run(LV2_Handle instance,
if (ev->body.type == uris->midi_Event) {
uint8_t* const data = (uint8_t* const)(ev + 1);
if ((data[0] & 0xF0) == 0x90) {
- start_frame = ev->time.audio.frames;
+ start_frame = ev->time.frames;
plugin->frame = 0;
plugin->play = true;
}
} else if (is_object_type(uris, ev->body.type)) {
const LV2_Atom_Object* obj = (LV2_Atom_Object*)&ev->body;
- if (obj->otype == uris->msg_Set) {
+ if (obj->body.otype == uris->msg_Set) {
/* Received a set message, send it to the worker thread. */
fprintf(stderr, "Queueing set message\n");
zix_ring_write(plugin->to_worker,
@@ -350,7 +350,7 @@ run(LV2_Handle instance,
lv2_atom_total_size(&obj->atom)));
zix_sem_post(&plugin->signal);
} else {
- fprintf(stderr, "Unknown object type %d\n", obj->otype);
+ fprintf(stderr, "Unknown object type %d\n", obj->body.otype);
}
} else {
fprintf(stderr, "Unknown event type %d\n", ev->body.type);
@@ -410,7 +410,7 @@ run(LV2_Handle instance,
plugin->sample = m.sample;
/* Send a notification that we're using a new sample. */
- lv2_atom_forge_audio_time(&plugin->forge, 0, 0);
+ lv2_atom_forge_frame_time(&plugin->forge, 0);
write_set_file(&plugin->forge, uris,
plugin->sample->path,
plugin->sample->path_len);
diff --git a/plugins/eg-sampler.lv2/uris.h b/plugins/eg-sampler.lv2/uris.h
index de1cbd3..8d0a983 100644
--- a/plugins/eg-sampler.lv2/uris.h
+++ b/plugins/eg-sampler.lv2/uris.h
@@ -107,8 +107,8 @@ static inline const LV2_Atom*
read_set_file(const SamplerURIs* uris,
const LV2_Atom_Object* obj)
{
- if (obj->otype != uris->msg_Set) {
- fprintf(stderr, "Ignoring unknown message type %d\n", obj->otype);
+ if (obj->body.otype != uris->msg_Set) {
+ fprintf(stderr, "Ignoring unknown message type %d\n", obj->body.otype);
return NULL;
}