# LV2 Event

A port-based real-time generic event interface.

ID | http://lv2plug.in/ns/ext/event
Version | 1.12 DEPRECATED
Date | 2021-01-09
Discuss | devel@lists.lv2plug.in (subscribe)

- Index
- History
- API

This extension is deprecated. New implementations should use LV2 Atom instead.

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:

    <http://example.org/some-plugin>
        lv2:port [
            a ev:EventPort, lv2:InputPort ;
            lv2:index 0 ;
            ev:supportsEvent <http://lv2plug.in/ns/ext/midi#MidiEvent> ;
            lv2:symbol "midi_input" ;
            lv2:name "MIDI input" ;
        ] .

## Index

Classes | Properties | Instances
--- | --- | ---
Event EventPort TimeStamp FrameStamp | generatesTimeStamp inheritsEvent inheritsTimeStamp supportsEvent supportsTimeStamp | generic

## Classes

### Event

Class

Label | Event

A single generic time-stamped event.

An EventPort contains an LV2_Event_Buffer which contains a sequence of these events. The binary format of LV2 events is defined by the LV2_Event struct in event.h.

Specific event types (such as MIDI or OSC) are defined by extensions, and should be rdfs:subClassOf this class.

### EventPort

Class

Label | Event Port
Subclass of | lv2:Port
In domain of | generatesTimeStamp
| inheritsEvent
| inheritsTimeStamp
| supportsEvent
| supportsTimeStamp

An LV2 event port.

Ports of this type will be connected to a struct of type LV2_Event_Buffer, defined in event.h. These ports contain a sequence of generic events (possibly several types mixed in a single stream), the specific types of which are defined by some URI in another LV2 extension.

### FrameStamp

Class

Label | Audio Frame Time Stamp
Subclass of | TimeStamp

The default time stamp unit for an event.

The default time stamp unit for an LV2 event: the frames field represents audio frames (in the sample rate passed to intantiate), and the subframes field is 1/UINT32_MAX of a frame.

### TimeStamp

Class

Label | Event Time Stamp
Superclass of | FrameStamp

The time stamp of an Event.

This defines the meaning of the 'frames' and 'subframes' fields of an LV2_Event (both unsigned 32-bit integers).

## Properties

### generatesTimeStamp

Property

Label | generates time stamp type
Domain | EventPort
| lv2:OutputPort
Range | rdfs:Class
Type | Object Property

A time stamp type generated by this input port.

Indicates that this port may output a certain time stamp type, regardless of the time stamp type of any input ports.

If the port outputs stamps based on what type inputs are connected to, this property should not be set (use the inheritsTimeStamp property for that). Hosts MUST check the time_stamp value of any output port buffers after a call to connect_port on ANY event input port on the plugin.

If the plugin changes the stamp_type field of an output event buffer during a call to run(), the plugin must call the stamp_type_changed function provided by the host in the LV2_Event_Feature struct, if it is non-NULL.

### inheritsEvent

Property

Label | inherits event type
Domain | EventPort
| lv2:OutputPort
Range | lv2:Port
Type | Object Property

Output port inherits event types from an input port.

Indicates that this output port might pass through events that arrived at some other input port (or generate an event of the same type as events arriving at that input). The host must always check the stamp type of all outputs when connecting an input, but this property should be set whenever it applies.

### inheritsTimeStamp

Property

Label | inherits time stamp type
Domain | EventPort
| lv2:OutputPort
Range | lv2:Port
Type | Object Property

Output port inherits time stamp types from an input port.

Indicates that this port follows the time stamp type of an input port.

This property is not necessary, but it should be set for outputs that base their output type on an input port so the host can make more sense of the plugin and provide a more sensible interface.

### supportsEvent

Property

Label | supports event type
Domain | EventPort
Range | rdfs:Class
Type | Object Property

An event type supported by this port.

Indicates that this port supports or "understands" a certain event type.

For input ports, this means the plugin understands and does something useful with events of this type. For output ports, this means the plugin may generate events of this type. If the plugin never actually generates events of this type, but might pass them through from an input, this property should not be set (use inheritsEvent for that).

Plugins with event input ports must always gracefully handle any type of event, even if it does not 'support' it. This property should always be set for event types the plugin understands/generates so hosts can discover plugins appropriate for a given scenario (for example, plugins with a MIDI input). Hosts are not expected to consider event ports suitable for some type of event if the relevant :supportsEvent property is not set, unless the generic property for that port is also set.

### supportsTimeStamp

Property

Label | supports time stamp type
Domain | EventPort
| lv2:InputPort
Range | rdfs:Class
Type | Object Property

A time stamp type suported by this input port.

Indicates that this port supports or "understands" a certain time stamp type. Meaningful only for input ports, the host must never connect a port to an event buffer with a time stamp type that isn't supported by the port.

## Instances

### generic

Instance

Label | generic event port
Type | lv2:PortProperty

Port works with generic events.

Indicates that this port does something meaningful for any event type. This is useful for things like event mixers, delays, serialisers, and so on.

If this property is set, hosts should consider the port suitable for any type of event. Otherwise, hosts should consider the port 'appropriate' only for the specific event types listed with :supportsEvent. Note that plugins must gracefully handle unknown event types whether or not this property is present.

## History

Version 1.12 (2014-08-08)
  - Minor documentation improvements.
Version 1.10 (2013-01-13)
  - Fix incorrect return type in lv2_event_get().
Version 1.8 (2012-10-14)
  - Make event iterator gracefully handle optional ports.
  - Remove asserts from event-helper.h.
  - Use more precise domain and range for EventPort properties.
  - Use consistent label style.
Version 1.6 (2012-04-17)
  - Fix bug in lv2_event_reserve().
  - Fix incorrect ranges of some properties.
  - Merge with unified LV2 package.
Version 1.4 (2011-11-21)
  - Update packaging.
Version 1.2 (2011-05-26)
  - Add build system (for installation).
  - Convert documentation to HTML and use lv2:documentation.
  - Use lv2:Specification to be discovered as an extension.
Version 1.0 (2010-11-24)
  - Initial release.