From 591d09e1923164220485e843ae3161090d5dc0ec Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 17 Oct 2010 01:08:23 +0000 Subject: Create new Message extension, and remove message type definition from Atom extension. Clean up Atom extension and define more struct types in header. --- ext/message.lv2/manifest.ttl | 7 ++++ ext/message.lv2/message.h | 46 ++++++++++++++++++++++++ ext/message.lv2/message.ttl | 83 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 136 insertions(+) create mode 100644 ext/message.lv2/manifest.ttl create mode 100644 ext/message.lv2/message.h create mode 100644 ext/message.lv2/message.ttl (limited to 'ext/message.lv2') diff --git a/ext/message.lv2/manifest.ttl b/ext/message.lv2/manifest.ttl new file mode 100644 index 0000000..2e0704a --- /dev/null +++ b/ext/message.lv2/manifest.ttl @@ -0,0 +1,7 @@ +@prefix lv2: . +@prefix rdfs: . + + + a lv2:Specification ; + rdfs:seeAlso . + diff --git a/ext/message.lv2/message.h b/ext/message.lv2/message.h new file mode 100644 index 0000000..45391c3 --- /dev/null +++ b/ext/message.lv2/message.h @@ -0,0 +1,46 @@ +/* lv2_message.h - C header file for the LV2 Message extension. + * Copyright (C) 2010 David Robillard + * + * This header is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This header 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 GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this header; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 01222-1307 USA + */ + +/** @file + * C header for the LV2 Message extension . + */ + +#ifndef LV2_MESSAGE_H +#define LV2_MESSAGE_H + +#define LV2_MESSAGE_URI "http://lv2plug.in/ns/ext/message" + +#include +#include + +#include "lv2/http/lv2plug.in/ns/ext/atom/atom.h" + +/** An LV2 Message. + * + * A "Message" is an Atom of type message:Message. The payload of a Message + * is a key/value dictionary with URI mapped integer keys (uint32_t), followed + * by a key/value dictionary with URI mapped integer keys and Atom values + * (atom:Blank, i.e. LV2_). + */ +typedef struct _LV2_Message_Message { + uint32_t selector; /***< Selector URI mapped to integer */ + LV2_Atom triples; /***< Always an atom:Triples */ +} LV2_Message_Message; + +#endif /* LV2_MESSAGE_H */ + diff --git a/ext/message.lv2/message.ttl b/ext/message.lv2/message.ttl new file mode 100644 index 0000000..03072f3 --- /dev/null +++ b/ext/message.lv2/message.ttl @@ -0,0 +1,83 @@ +# LV2 Message Extension +# Copyright (C) 2007-2010 David Robillard +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR +# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. + +@prefix message: . +@prefix atom: . +@prefix doap: . +@prefix foaf: . +@prefix lv2: . +@prefix rdf: . +@prefix rdfs: . +@prefix xsd: . + + + a lv2:Specification ; + doap:name "LV2 Message" ; + doap:maintainer [ + a foaf:Person ; + foaf:name "David Robillard" ; + foaf:homepage ; + rdfs:seeAlso + ] ; + rdfs:comment """ +This extension defines the format for "messages" which can be used to +dynamically control an LV2 plugin instance at runtime. Messages are useful +for any kind of plugin control that does not fit well with control ports. +Plugins can both receive and send messages (and thus send messages to each +other) via any mechanism. + +This extension requires the host to support the LV2 URI Map extension, and the +LV2 Atom extension. +""" . + + +message:MessageType a rdfs:Class ; + rdfs:label "LV2 Message Type" ; + rdfs:comment """ +Base class for all types of LV2 Message. + +A type of message, which must be a resource (i.e. have a URI). This URI +is used as the selector component of a Message and is used by receivers +to interpret the meaning of messages (e.g. which components are present). +""" . + +message:Message a atom:AtomType ; + rdfs:label "Message" ; + rdfs:comment """ +A message is a communication from one component to another. Messages consist +of a selector URI, and a key/value dictionary. Keys in the dictionary are +URI mapped integers, and values are Atoms. The selector URI dictates how +the message is to be interpreted (e.g. the selector can be used as a "verb" +to build commands). + +Messages are simple to serialise in many different formats (e.g. any RDF +serialisation including LV2 Turtle files, JSON, XML, etc) making network +transparency and persistence simple, assuming the implementation can +serialise Atoms. + +Because all messages have a standard format, plugins and hosts can store, +communicate, or otherwise work with messages even if they do not understand +that particular message's selector. + +In memory, a Message is simply a uint32_t selector (a URI mapped integer) +followed by an atom:Blank. +""" . -- cgit v1.2.1