[−][src]Struct lv2_sys::LV2_Event_Buffer
A buffer of LV2 events (header only).
Like events (which this contains) an event buffer is a single chunk of POD: the entire buffer (including contents) can be copied with a single memcpy. The first contained event begins sizeof(LV2_EventBuffer) bytes after the start of this struct.
After this header, the buffer contains an event header (defined by struct LV2_Event), followed by that event's contents (padded to 64 bits), followed by another header, etc:
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |FRAMES |SUBFRMS|TYP|LEN|DATA..DATA..PAD|FRAMES | ...
Fields
data: *mut u8
The contents of the event buffer. This may or may not reside in the same block of memory as this header, plugins must not assume either. The host guarantees this points to at least capacity bytes of allocated memory (though only size bytes of that are valid events).
header_size: u16
The size of this event header in bytes (including everything).
This is to allow for extending this header in the future without breaking binary compatibility. Whenever this header is copied, it MUST be done using this field (and NOT the sizeof this struct).
stamp_type: u16
The type of the time stamps for events in this buffer. As a special exception, '0' always means audio frames and subframes (1/UINT32_MAX'th of a frame) in the sample rate passed to instantiate.
INPUTS: The host must set this field to the numeric ID of some URI defining the meaning of the frames/subframes fields of contained events (obtained by the LV2 URI Map uri_to_id function with the URI of this extension as the 'map' argument, see lv2_uri_map.h). The host must never pass a plugin a buffer which uses a stamp type the plugin does not 'understand'. The value of this field must never change, except when connect_port is called on the input port, at which time the host MUST have set the stamp_type field to the value that will be used for all subsequent run calls.
OUTPUTS: The plugin may set this to any value that has been returned from uri_to_id with the URI of this extension for a 'map' argument. When connected to a buffer with connect_port, output ports MUST set this field to the type of time stamp they will be writing. On any call to connect_port on an event input port, the plugin may change this field on any output port, it is the responsibility of the host to check if any of these values have changed and act accordingly.
event_count: u32
The number of events in this buffer.
INPUTS: The host must set this field to the number of events contained in the data buffer before calling run(). The plugin must not change this field.
OUTPUTS: The plugin must set this field to the number of events it has written to the buffer before returning from run(). Any initial value should be ignored by the plugin.
capacity: u32
The size of the data buffer in bytes. This is set by the host and must not be changed by the plugin. The host is allowed to change this between run() calls.
size: u32
The size of the initial portion of the data buffer containing data.
INPUTS: The host must set this field to the number of bytes used by all events it has written to the buffer (including headers) before calling the plugin's run(). The plugin must not change this field.
OUTPUTS: The plugin must set this field to the number of bytes used by all events it has written to the buffer (including headers) before returning from run(). Any initial value should be ignored by the plugin.
Trait Implementations
impl Clone for LV2_Event_Buffer
[src]
fn clone(&self) -> LV2_Event_Buffer
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for LV2_Event_Buffer
[src]
impl Debug for LV2_Event_Buffer
[src]
Auto Trait Implementations
impl RefUnwindSafe for LV2_Event_Buffer
impl !Send for LV2_Event_Buffer
impl !Sync for LV2_Event_Buffer
impl Unpin for LV2_Event_Buffer
impl UnwindSafe for LV2_Event_Buffer
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,