diff options
author | David Robillard <d@drobilla.net> | 2011-11-03 22:36:43 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-11-03 22:36:43 +0000 |
commit | d2fa4f8292a50b47864d561c33ced39c55c89254 (patch) | |
tree | 72e320a6cd7979c66941ce1203334617a57df227 /ext | |
parent | e8b25617db84184a2b299ef57f7c4295081b7576 (diff) | |
download | lv2-d2fa4f8292a50b47864d561c33ced39c55c89254.tar.xz |
Syntax highlight C and Turtle code in documentation.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/atom.lv2/atom.ttl | 8 | ||||
-rw-r--r-- | ext/cv-port.lv2/cv-port.ttl | 2 | ||||
-rw-r--r-- | ext/event.lv2/event.ttl | 2 | ||||
-rw-r--r-- | ext/host-info.lv2/host-info.ttl | 5 | ||||
-rw-r--r-- | ext/persist.lv2/persist.ttl | 6 | ||||
-rw-r--r-- | ext/port-props.lv2/port-props.ttl | 4 | ||||
-rw-r--r-- | ext/pui.lv2/pui.ttl | 24 | ||||
-rw-r--r-- | ext/time.lv2/time.ttl | 20 |
8 files changed, 37 insertions, 34 deletions
diff --git a/ext/atom.lv2/atom.ttl b/ext/atom.lv2/atom.ttl index 4039739..0cc5abf 100644 --- a/ext/atom.lv2/atom.ttl +++ b/ext/atom.lv2/atom.ttl @@ -129,7 +129,7 @@ href="http://www.loc.gov/standards/iso639-2/">ISO 693-2</a> or <a href="http://www.loc.gov/standards/iso639-2/">ISO 693-3</a> language code.</p> <p>For example, "Hello" in English:</p> -<pre> +<pre class="c-code"> struct LV2_Atom { uint16_t type = uri_to_id(atom:Literal); uint16_t size = 14; @@ -139,7 +139,7 @@ uint32_t lang = uri_to_id("http://lexvo.org/id/term/en"); char str[] = "Hello"; </pre> and French: -<pre> +<pre class="c-code"> struct LV2_Atom { uint16_t type = uri_to_id(atom:Literal); uint16_t size = 16; @@ -149,7 +149,7 @@ uint32_t lang = uri_to_id("http://lexvo.org/id/term/fr"); char str[] = "Bonjour"; </pre> <p>or a Turtle string:</p> -<pre> +<pre class="c-code"> struct LV2_Atom { uint16_t type = uri_to_id(atom:Literal); uint16_t size = 64; @@ -196,7 +196,7 @@ href="#Atom">Atom</a> type, i.e. the size of each element is the vector's <p>For example, an atom:Vector containing 42 elements of type atom:Float looks like this in memory:</p> -<pre> +<pre class="c-code"> struct LV2_Atom { uint16_t type = uri_to_id(atom:Vector); uint16_t size = sizeof(LV2_Atom) + sizeof(LV2_Atom_Vector) + (42 * sizeof(float); diff --git a/ext/cv-port.lv2/cv-port.ttl b/ext/cv-port.lv2/cv-port.ttl index c67b099..9c08b57 100644 --- a/ext/cv-port.lv2/cv-port.ttl +++ b/ext/cv-port.lv2/cv-port.ttl @@ -63,7 +63,7 @@ Hosts SHOULD take care to prevent data from a CVPort port from being used as audio except in cases where this is known to be safe. Example: -<pre> +<pre class="turtle-code"> <http://example.org/some-plugin> lv2:port [ a cv:CVPort, lv2:InputPort ; diff --git a/ext/event.lv2/event.ttl b/ext/event.lv2/event.ttl index 8691146..6f9bce3 100644 --- a/ext/event.lv2/event.ttl +++ b/ext/event.lv2/event.ttl @@ -44,7 +44,7 @@ This extension defines a generic time-stamped event port type, which can be used to create plugins that read and write real-time events, such as MIDI, OSC, or any other type of event payload. The type(s) of event supported by a port is defined in the data file for a plugin, for example: -<pre> +<pre class="turtle-code"> <http://example.org/some-plugin> lv2:port [ a ev:EventPort, lv2:InputPort ; diff --git a/ext/host-info.lv2/host-info.ttl b/ext/host-info.lv2/host-info.ttl index d19a7a4..38bdd2d 100644 --- a/ext/host-info.lv2/host-info.ttl +++ b/ext/host-info.lv2/host-info.ttl @@ -45,10 +45,11 @@ about LV2 hosts. Currently, the primary use of this specification is to describ extensions are supported by a given host.</p> <p>The extensions supported by a host can be described like this:</p> -<pre> +<pre class="turtle-code"> @prefix hi: <http://lv2plug.in/ns/ext/host-info#> . -<http://example.org/some-host> a hi:Host ; +<http://example.org/some-host> + a hi:Host ; doap:name "Foo Rack" ; hi:supportsExtension [ hi:extension <http://example.org/some-extension> ; diff --git a/ext/persist.lv2/persist.ttl b/ext/persist.lv2/persist.ttl index bb70e8e..1c02cc2 100644 --- a/ext/persist.lv2/persist.ttl +++ b/ext/persist.lv2/persist.ttl @@ -82,7 +82,7 @@ possible. Extensions may define a dynamic mechanism for accessing plugin state, or conventional state keys likely to be useful to several implementations.</p> <p>In pseudo code, a typical use case in a plugin is:</p> -<pre> +<pre class="c-code"> #define NS_EG "http://example.org/" #define NS_ATOM "http://lv2plug.in/ns/ext/atom#" #define NS_XSD "http://www.w3.org/2001/XMLSchema#" @@ -139,7 +139,7 @@ void my_restore(LV2_Handle instance, </pre> <p>Similarly, a typical use case in a host is:</p> -<pre> +<pre class="c-code"> int store_callback(void* callback_data, uint32_t key, const void* value, @@ -193,7 +193,7 @@ wherever the state of a particular plugin instance needs to be represented. Note that the domain of this property is unspecified, since LV2 does not define any RDF class for plugin instance. This predicate may be used wherever it makes sense to do so, e.g.: -<pre> +<pre class="turtle-code"> @prefix eg: <http://example.org/> . <plugininstance> persist:instanceState [ diff --git a/ext/port-props.lv2/port-props.ttl b/ext/port-props.lv2/port-props.ttl index d2956e5..d811959 100644 --- a/ext/port-props.lv2/port-props.ttl +++ b/ext/port-props.lv2/port-props.ttl @@ -197,13 +197,13 @@ encoders, etc.</p> <p>Note that when used with a pprops:logarithmic port, the steps are logarithmic too, and port value can be calculated as:</p> -<pre> +<pre class="c-code"> value = lower * pow(upper / lower, step / (steps - 1)) </pre> <p>and the step from value is:</p> -<pre> +<pre class="c-code"> step = (steps - 1) * log(value / lower) / log(upper / lower) </pre> diff --git a/ext/pui.lv2/pui.ttl b/ext/pui.lv2/pui.ttl index 20c9ee8..c84aa98 100644 --- a/ext/pui.lv2/pui.ttl +++ b/ext/pui.lv2/pui.ttl @@ -51,12 +51,12 @@ <p>This extension defines an interface that can be used to create UIs for plugins. The UIs are code that reside in shared object files in an LV2 bundle and are referenced in the RDF data using the triples -<pre> - @prefix pui: <http://lv2plug.in/ns/ext/pui#> . - @prefix pui-gtk: <http://lv2plug.in/ns/ext/pui-gtk#> . - <http://example.org/my-ui> a pui-gtk:GtkUI ; - lv2:appliesTo <http://example.org/my-plugin> ; - pui:binary <my-ui.so> . +<pre class="turtle-code"> +@prefix pui: <http://lv2plug.in/ns/ext/pui#> . +@prefix pui-gtk: <http://lv2plug.in/ns/ext/pui-gtk#> . +<http://example.org/my-ui> a pui-gtk:GtkUI ; + lv2:appliesTo <http://example.org/my-plugin> ; + pui:binary <my-ui.so> . </pre> where <code>http://example.org/my-plugin</code> is the URI of the plugin, <code>http://example.org/my-ui</code> is the URI of the plugin UI and @@ -103,12 +103,12 @@ pui:UI a rdfs:Class; </p> <p>To be used by a host a UI MUST have at least the following properties: -<pre> - rdf:type (with object a proper subclass of pui:UI) - doap:name (one without language tag) - lv2:binary (with a shared object file as object) - lv2:appliesTo (with a LV2 plugin as object) -</pre> +<ul> +<li>rdf:type (with object a proper subclass of pui:UI)</li> +<li>doap:name (one without language tag)</li> +<li>lv2:binary (with a shared object file as object)</li> +<li>lv2:appliesTo (with a LV2 plugin as object)</li> +</li> The rdf:type of an UI is used by the host to decide whether it supports the UI and how to handle the LV2_PUI_Widget object that is returned by the UIs get_widget() function. For example, a type of pui-gtk:GtkGUI might tell the host diff --git a/ext/time.lv2/time.ttl b/ext/time.lv2/time.ttl index 88aa0cf..5d23991 100644 --- a/ext/time.lv2/time.ttl +++ b/ext/time.lv2/time.ttl @@ -41,14 +41,16 @@ time:Position a rdfs:Class ; rdfs:label "LV2 time position" ; lv2:documentation """ -Type for an LV2_Time_Position struct. This can be mapped to an integer -and used as the type field of an event to indicate that the event payload -is an LV2_Time_Positon struct. Plugins can indicate that a port supports -time information using the ev:supports predicate, e.g.: -<pre> - <plugin> lv2:port [ - a ev:EventPort ; - ev:supports time:Position - ] +Type for an LV2_Time_Position struct. This can be mapped to an integer and +used as the type field of an event to indicate that the event payload is an +LV2_Time_Positon struct. Plugins SHOULD indicate that a port supports time +information using the ev:supports predicate, e.g.: +<pre class="turtle-code"> +<plugin> lv2:port [ + a lv2:InputPort , ev:EventPort ; + lv2:name "control" ; + lv2:index 0 ; + ev:supports time:Position +] . </pre> """ . |