This structure describes a PCM haptic effect.
The runtime may resample the provided samples in the buffer, and maintain an internal buffer which should be of MAX_HAPTIC_PCM_BUFFER_SIZE_FB length. The resampling should happen based on the sampleRate and the device’s sample rate.
If append is TRUE and a preceding XrHapticPcmVibrationFB haptic effect on this action has not yet completed, then the runtime must finish playing the preceding samples and then play the new haptic effect. If a preceding haptic event on this action has not yet completed, and either the preceding effect is not an XrHapticPcmVibrationFB haptic effect or append is FALSE, the runtime must cancel the preceding incomplete effects on that action and start playing the new haptic effect, as usual for the core specification.
When append is true and a preceding XrHapticPcmVibrationFB haptic effect on this action has not yet completed, then the application can provide a different sampleRate in the new haptic effect.
The runtime must populate the samplesConsumed with the count of the samples from buffer which were consumed. The samplesConsumed is populated before the ApplyHapticFeedback returns.
XR_FB_haptic_pcm extension must be enabled prior to using XrHapticPcmVibrationFBtype must be TYPE_HAPTIC_PCM_VIBRATION_FBnext must be NULL or a valid pointer to the next structure in a structure chainbuffer must be a pointer to an array of bufferSize float valuessamplesConsumed must be a pointer to a uint32_t valuebufferSize parameter must be greater than 0
struct XrHapticPcmVibrationFB {
XrStructureType type;
void const * next;
uint32_t bufferSize;
float const * buffer;
float sampleRate;
XrBool32 append;
uint32_t * samplesConsumed;
}
| Modifier and Type | Class and Description |
|---|---|
| public static class | XrHapticPcmVibrationFB.
An array of |
| Modifier and Type | Field and Description |
|---|---|
| public static final int | ALIGNOF
The struct alignment in bytes. |
| public static final int | APPEND
The struct member offsets. |
| public static final int | BUFFER
The struct member offsets. |
| public static final int | BUFFERSIZE
The struct member offsets. |
| public static final int | NEXT
The struct member offsets. |
| public static final int | SAMPLERATE
The struct member offsets. |
| public static final int | SAMPLESCONSUMED
The struct member offsets. |
| public static final int | SIZEOF
The struct size in bytes. |
| public static final int | TYPE
The struct member offsets. |
| Access | Constructor and Description |
|---|---|
| protected | |
| public | XrHapticPcmVibrationFB(ByteBuffer container)
Creates a |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public XrHapticPcmVibrationFB | |
| public FloatBuffer | |
| public XrHapticPcmVibrationFB | |
| public int | |
| public static XrHapticPcmVibrationFB | |
| public static XrHapticPcmVibrationFB. | calloc(int
the buffer capacity capacity)Returns a new |
| public static XrHapticPcmVibrationFB | calloc(MemoryStack
the stack from which to allocate stack)Returns a new |
| public static XrHapticPcmVibrationFB. | calloc(int
the buffer capacity capacity, MemoryStack the stack from which to allocate stack)Returns a new |
| protected XrHapticPcmVibrationFB | create(long
the struct memory address address, ByteBuffer an optional container buffer, to be referenced strongly by the struct instance. container)Implements abstract org. the constructor, but returns the exact type of the Struct subclass.
|
| public static XrHapticPcmVibrationFB | |
| public static XrHapticPcmVibrationFB | |
| public static XrHapticPcmVibrationFB | create(XrHapticBaseHeader value)
Downcasts the specified |
| public static XrHapticPcmVibrationFB. | create(int
the buffer capacity capacity)Returns a new |
| public static XrHapticPcmVibrationFB. | create(long
the memory address address, int the buffer capacity capacity)Create a |
| public static XrHapticPcmVibrationFB. | create(XrHapticBaseHeader.
Downcasts the specified |
| public static XrHapticPcmVibrationFB | |
| public static XrHapticPcmVibrationFB. | |
| public static XrHapticPcmVibrationFB | |
| public static XrHapticPcmVibrationFB. | malloc(int
the buffer capacity capacity)Returns a new |
| public static XrHapticPcmVibrationFB | malloc(MemoryStack
the stack from which to allocate stack)Returns a new |
| public static XrHapticPcmVibrationFB. | malloc(int
the buffer capacity capacity, MemoryStack the stack from which to allocate stack)Returns a new |
| public static int | |
| public static void | |
| public static FloatBuffer | |
| public static void | |
| public static int | |
| public static void | nbufferSize(long struct, int value)
Sets the specified value to the |
| public long | |
| public XrHapticPcmVibrationFB | |
| public static long | |
| public static void | |
| public static float | |
| public static void | |
| public static IntBuffer | |
| public static void | |
| public static int | |
| public static void | |
| public float | sampleRate()
the number of samples to be played per second, this is used to determine the duration of the haptic effect. |
| public XrHapticPcmVibrationFB | |
| public IntBuffer | Returns: a pointer to an unsigned integer; it is populated by runtime, to tell the application about how many samples were consumed from the inputbufferthe number of elements in the returned buffer capacity)
|
| public XrHapticPcmVibrationFB | samplesConsumed(IntBuffer value)
Sets the address of the specified |
| public XrHapticPcmVibrationFB | set(int type, long next, FloatBuffer buffer, float sampleRate, boolean append, IntBuffer samplesConsumed)
Initializes this struct with the specified values. |
| public XrHapticPcmVibrationFB | Returns: this structthe source struct src)Copies the specified struct data to this struct. |
| public int | |
| public int | |
| public XrHapticPcmVibrationFB | |
| public XrHapticPcmVibrationFB | |
| public static void |
| ALIGNOF | back to summary |
|---|---|
| public static final int ALIGNOF The struct alignment in bytes. | |
| APPEND | back to summary |
|---|---|
| public static final int APPEND The struct member offsets. | |
| BUFFER | back to summary |
|---|---|
| public static final int BUFFER The struct member offsets. | |
| BUFFERSIZE | back to summary |
|---|---|
| public static final int BUFFERSIZE The struct member offsets. | |
| NEXT | back to summary |
|---|---|
| public static final int NEXT The struct member offsets. | |
| SAMPLERATE | back to summary |
|---|---|
| public static final int SAMPLERATE The struct member offsets. | |
| SAMPLESCONSUMED | back to summary |
|---|---|
| public static final int SAMPLESCONSUMED The struct member offsets. | |
| SIZEOF | back to summary |
|---|---|
| public static final int SIZEOF The struct size in bytes. | |
| TYPE | back to summary |
|---|---|
| public static final int TYPE The struct member offsets. | |
| XrHapticPcmVibrationFB | back to summary |
|---|---|
| protected XrHapticPcmVibrationFB(long address, ByteBuffer container) | |
| XrHapticPcmVibrationFB | back to summary |
|---|---|
| public XrHapticPcmVibrationFB(ByteBuffer container) Creates a The created instance holds a strong reference to the container object. | |
| append | back to summary |
|---|---|
| public boolean append() if set to
| |
| append | back to summary |
|---|---|
| public XrHapticPcmVibrationFB append(boolean value) Sets the specified value to the | |
| buffer | back to summary |
|---|---|
| public FloatBuffer buffer() a pointer to a float array representing the PCM samples. If you consider the haptic effect as a sampled analog audio, then this buffer will contain the samples representing that effect. The values in this buffer are expected to be in the range [-1.0, 1.0].
| |
| buffer | back to summary |
|---|---|
| public XrHapticPcmVibrationFB buffer(FloatBuffer value) Sets the address of the specified | |
| bufferSize | back to summary |
|---|---|
| public int bufferSize() the number of samples in the buffer.
| |
| calloc | back to summary |
|---|---|
| public static XrHapticPcmVibrationFB calloc() Returns a new | |
| calloc | back to summary |
|---|---|
| public static XrHapticPcmVibrationFB. Returns a new
| |
| calloc | back to summary |
|---|---|
| public static XrHapticPcmVibrationFB calloc(MemoryStack stack) Returns a new
| |
| calloc | back to summary |
|---|---|
| public static XrHapticPcmVibrationFB. Returns a new
| |
| create | back to summary |
|---|---|
| protected XrHapticPcmVibrationFB create(long address, ByteBuffer container) Implements abstract org. Doc from org. Similar to Effectively, every
| |
| create | back to summary |
|---|---|
| public static XrHapticPcmVibrationFB create() Returns a new | |
| create | back to summary |
|---|---|
| public static XrHapticPcmVibrationFB create(long address) Returns a new | |
| create | back to summary |
|---|---|
| public static XrHapticPcmVibrationFB create(XrHapticBaseHeader value) Downcasts the specified | |
| create | back to summary |
|---|---|
| public static XrHapticPcmVibrationFB. Returns a new
| |
| create | back to summary |
|---|---|
| public static XrHapticPcmVibrationFB. Create a
| |
| create | back to summary |
|---|---|
| public static XrHapticPcmVibrationFB. Downcasts the specified | |
| createSafe | back to summary |
|---|---|
| public static XrHapticPcmVibrationFB createSafe(long address) Like
| |
| createSafe | back to summary |
|---|---|
| public static XrHapticPcmVibrationFB. Like
| |
| malloc | back to summary |
|---|---|
| public static XrHapticPcmVibrationFB malloc() Returns a new | |
| malloc | back to summary |
|---|---|
| public static XrHapticPcmVibrationFB. Returns a new
| |
| malloc | back to summary |
|---|---|
| public static XrHapticPcmVibrationFB malloc(MemoryStack stack) Returns a new
| |
| malloc | back to summary |
|---|---|
| public static XrHapticPcmVibrationFB. Returns a new
| |
| nappend | back to summary |
|---|---|
| public static int nappend(long struct) Unsafe version of | |
| nappend | back to summary |
|---|---|
| public static void nappend(long struct, int value) Unsafe version of | |
| nbuffer | back to summary |
|---|---|
| public static FloatBuffer nbuffer(long struct) Unsafe version of | |
| nbuffer | back to summary |
|---|---|
| public static void nbuffer(long struct, FloatBuffer value) Unsafe version of | |
| nbufferSize | back to summary |
|---|---|
| public static int nbufferSize(long struct) Unsafe version of | |
| nbufferSize | back to summary |
|---|---|
| public static void nbufferSize(long struct, int value) Sets the specified value to the | |
| next | back to summary |
|---|---|
| public long next()
| |
| next | back to summary |
|---|---|
| public XrHapticPcmVibrationFB next(long value) Sets the specified value to the | |
| nnext | back to summary |
|---|---|
| public static long nnext(long struct) Unsafe version of | |
| nnext | back to summary |
|---|---|
| public static void nnext(long struct, long value) Unsafe version of | |
| nsampleRate | back to summary |
|---|---|
| public static float nsampleRate(long struct) Unsafe version of | |
| nsampleRate | back to summary |
|---|---|
| public static void nsampleRate(long struct, float value) Unsafe version of | |
| nsamplesConsumed | back to summary |
|---|---|
| public static IntBuffer nsamplesConsumed(long struct, int capacity) Unsafe version of | |
| nsamplesConsumed | back to summary |
|---|---|
| public static void nsamplesConsumed(long struct, IntBuffer value) Unsafe version of | |
| ntype | back to summary |
|---|---|
| public static int ntype(long struct) Unsafe version of | |
| ntype | back to summary |
|---|---|
| public static void ntype(long struct, int value) Unsafe version of | |
| sampleRate | back to summary |
|---|---|
| public float sampleRate() the number of samples to be played per second, this is used to determine the duration of the haptic effect. | |
| sampleRate | back to summary |
|---|---|
| public XrHapticPcmVibrationFB sampleRate(float value) Sets the specified value to the | |
| samplesConsumed | back to summary |
|---|---|
public IntBuffer samplesConsumed(int capacity)
| |
| samplesConsumed | back to summary |
|---|---|
| public XrHapticPcmVibrationFB samplesConsumed(IntBuffer value) Sets the address of the specified | |
| set | back to summary |
|---|---|
| public XrHapticPcmVibrationFB set(int type, long next, FloatBuffer buffer, float sampleRate, boolean append, IntBuffer samplesConsumed) Initializes this struct with the specified values. | |
| set | back to summary |
|---|---|
| public XrHapticPcmVibrationFB set(XrHapticPcmVibrationFB src) Copies the specified struct data to this struct.
| |
| sizeof | back to summary |
|---|---|
| public int sizeof() Implements abstract org. Doc from org. Returns
| |
| type | back to summary |
|---|---|
| public int type() the
| |
| type | back to summary |
|---|---|
| public XrHapticPcmVibrationFB type(int value) Sets the specified value to the | |
| type$Default | back to summary |
|---|---|
| public XrHapticPcmVibrationFB type$Default() Sets the | |
| validate | back to summary |
|---|---|
| public static void validate(long struct) Validates pointer members that should not be
| |
XrHapticPcmVibrationFB structs.
| Modifier and Type | Field and Description |
|---|---|
| private static final XrHapticPcmVibrationFB |
| Access | Constructor and Description |
|---|---|
| public | Buffer(ByteBuffer container)
Creates a new |
| public | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public XrHapticPcmVibrationFB. | |
| public FloatBuffer | |
| public XrHapticPcmVibrationFB. | buffer(FloatBuffer value)
Sets the address of the specified |
| public int | |
| protected XrHapticPcmVibrationFB | |
| public long | |
| public XrHapticPcmVibrationFB. | |
| public float | |
| public XrHapticPcmVibrationFB. | |
| public IntBuffer | Returns: aIntBuffer view of the data pointed to by the XrHapticPcmVibrationFB#samplesConsumed field.the number of elements in the returned buffer capacity)
|
| public XrHapticPcmVibrationFB. | samplesConsumed(IntBuffer value)
Sets the address of the specified |
| protected XrHapticPcmVibrationFB. | |
| public int | |
| public XrHapticPcmVibrationFB. | |
| public XrHapticPcmVibrationFB. |
| ELEMENT_FACTORY | back to summary |
|---|---|
| private static final XrHapticPcmVibrationFB ELEMENT_FACTORY | |
| Buffer | back to summary |
|---|---|
| public Buffer(ByteBuffer container) Creates a new Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
by The created buffer instance holds a strong reference to the container object. | |
| Buffer | back to summary |
|---|---|
| public Buffer(long address, int cap) | |
| Buffer | back to summary |
|---|---|
| pack-priv Buffer(long address, ByteBuffer container, int mark, int pos, int lim, int cap) | |
| append | back to summary |
|---|---|
public boolean append()
| |
| append | back to summary |
|---|---|
| public XrHapticPcmVibrationFB. Sets the specified value to the | |
| buffer | back to summary |
|---|---|
public FloatBuffer buffer()
| |
| buffer | back to summary |
|---|---|
| public XrHapticPcmVibrationFB. Sets the address of the specified | |
| bufferSize | back to summary |
|---|---|
public int bufferSize()
| |
| getElementFactory | back to summary |
|---|---|
| protected XrHapticPcmVibrationFB getElementFactory() Implements abstract org.
| |
| next | back to summary |
|---|---|
public long next()
| |
| next | back to summary |
|---|---|
| public XrHapticPcmVibrationFB. Sets the specified value to the | |
| sampleRate | back to summary |
|---|---|
public float sampleRate()
| |
| sampleRate | back to summary |
|---|---|
| public XrHapticPcmVibrationFB. Sets the specified value to the | |
| samplesConsumed | back to summary |
|---|---|
public IntBuffer samplesConsumed(int capacity)
| |
| samplesConsumed | back to summary |
|---|---|
| public XrHapticPcmVibrationFB. Sets the address of the specified | |
| self | back to summary |
|---|---|
| protected XrHapticPcmVibrationFB. Implements abstract org.
| |
| type | back to summary |
|---|---|
public int type()
| |
| type | back to summary |
|---|---|
| public XrHapticPcmVibrationFB. Sets the specified value to the | |
| type$Default | back to summary |
|---|---|
| public XrHapticPcmVibrationFB. Sets the | |