[][src]Struct lv2_sys::LV2_Event

#[repr(C)]pub struct LV2_Event {
    pub frames: u32,
    pub subframes: u32,
    pub type_: u16,
    pub size: u16,
}

An LV2 event (header only).

LV2 events are generic time-stamped containers for any type of event. The type field defines the format of a given event's contents.

This struct defines the header of an LV2 event. An LV2 event is a single chunk of POD (plain old data), usually contained in a flat buffer (see LV2_EventBuffer below). Unless a required feature says otherwise, hosts may assume a deep copy of an LV2 event can be created safely using a simple:

memcpy(ev_copy, ev, sizeof(LV2_Event) + ev->size); (or equivalent)

Fields

frames: u32

The frames portion of timestamp. The units used here can optionally be set for a port (with the lv2ev:timeUnits property), otherwise this is audio frames, corresponding to the sample_count parameter of the LV2 run method (e.g. frame 0 is the first frame for that call to run).

subframes: u32

The sub-frames portion of timestamp. The units used here can optionally be set for a port (with the lv2ev:timeUnits property), otherwise this is 1/(2^32) of an audio frame.

type_: u16

The type of this event, as a number which represents some URI defining an event type. This value MUST be some value previously returned from a call to the uri_to_id function defined in the LV2 URI map extension (see lv2_uri_map.h). There are special rules which must be followed depending on the type of an event. If the plugin recognizes an event type, the definition of that event type will describe how to interpret the event, and any required behaviour. Otherwise, if the type is 0, this event is a non-POD event and lv2_event_unref MUST be called if the event is 'dropped' (see above). Even if the plugin does not understand an event, it may pass the event through to an output by simply copying (and NOT calling lv2_event_unref). These rules are designed to allow for generic event handling plugins and large non-POD events, but with minimal hassle on simple plugins that "don't care" about these more advanced features.

size: u16

The size of the data portion of this event in bytes, which immediately follows. The header size (12 bytes) is not included in this value.

Trait Implementations

impl Clone for LV2_Event[src]

impl Copy for LV2_Event[src]

impl Debug for LV2_Event[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.