Ardour
9.0-pre0-582-g084a23a80d
|
#include <dsp_filter.h>
Public Member Functions | |
DspShm (size_t s=0) | |
~DspShm () | |
void | allocate (size_t s) |
void | clear () |
float * | to_float (size_t off) |
int32_t * | to_int (size_t off) |
void | atomic_set_int (size_t off, int32_t val) |
int32_t | atomic_get_int (size_t off) |
Private Attributes | |
void * | _data |
size_t | _size |
C/C++ Shared Memory
A convenience class representing a C array of float[] or int32_t[] data values. This is useful for lua scripts to perform DSP operations directly using C/C++ with CPU Hardware acceleration.
Access to this memory area is always 4 byte aligned. The data is interpreted either as float or as int.
This memory area can also be shared between different instances or the same lua plugin (DSP, GUI).
Since memory allocation is not realtime safe it should be allocated during dsp_init() or dsp_configure(). The memory is free()ed automatically when the lua instance is destroyed.
Definition at line 55 of file dsp_filter.h.
|
inline |
Definition at line 57 of file dsp_filter.h.
|
inline |
Definition at line 66 of file dsp_filter.h.
|
inline |
[re] allocate memory in host's memory space
s | size, total number of float or integer elements to store. |
Definition at line 74 of file dsp_filter.h.
|
inline |
atomically read integer at offset
This involves a memory barrier. This call is intended for buffers which are shared with another instance.
off | offset in shared memory region |
Definition at line 132 of file dsp_filter.h.
|
inline |
atomically set integer at offset
This involves a memory barrier. This call is intended for buffers which are shared with another instance.
off | offset in shared memory region |
val | value to set |
Definition at line 115 of file dsp_filter.h.
|
inline |
clear memory (set to zero)
Definition at line 82 of file dsp_filter.h.
|
inline |
access memory as float array
off | offset in shared memory region |
Definition at line 91 of file dsp_filter.h.
|
inline |
access memory as integer array
off | offset in shared memory region |
Definition at line 101 of file dsp_filter.h.
|
private |
Definition at line 141 of file dsp_filter.h.
|
private |
Definition at line 142 of file dsp_filter.h.