public unsafe void Transmit(HLVR_Effect *effect) { HLVR_Timeline *timelinePtr = null; Interop.HLVR_Timeline_Create(&timelinePtr); for (int i = 0; i < _events.Count; i++) { _events[i].Generate(timelinePtr); } Interop.HLVR_Timeline_Transmit(timelinePtr, HLVR_Plugin.Ptr, effect); Interop.HLVR_Timeline_Destroy(timelinePtr); Debug.Assert(timelinePtr == null); }
protected override unsafe void _generateEvent(HLVR_Timeline *timelinePtr) { Debug.Assert(timelinePtr != null); HLVR_Event *eventPtr = null; Interop.HLVR_Event_Create(&eventPtr, Interop.HLVR_EventType.DiscreteHaptic); Debug.Assert(eventPtr != null); Interop.HLVR_Event_SetUInt32(eventPtr, Interop.HLVR_EventKey.DiscreteHaptic_Repetitions_UInt32, (uint)(_duration * 1000 / GetEffectDuration(_effect))); Interop.HLVR_Event_SetUInt32s(eventPtr, Interop.HLVR_EventKey.Target_Regions_UInt32s, _area, (uint)_area.Length); Interop.HLVR_Event_SetFloat(eventPtr, Interop.HLVR_EventKey.DiscreteHaptic_Strength_Float, _strength); Interop.HLVR_Event_SetInt(eventPtr, Interop.HLVR_EventKey.DiscreteHaptic_Waveform_Int, (int)_effect); Interop.HLVR_Timeline_AddEvent(timelinePtr, _time, eventPtr); Interop.HLVR_Event_Destroy(eventPtr); Debug.Assert(eventPtr == null); }
public static extern unsafe int HLVR_Timeline_Transmit(HLVR_Timeline *timeline, HLVR_System *agent, HLVR_Effect *effect);
public static extern unsafe int HLVR_Timeline_AddEvent(HLVR_Timeline *timeline, double timeOffsetSeconds, HLVR_Event *data);
public static extern unsafe void HLVR_Timeline_Destroy(HLVR_Timeline *timeline);
public unsafe void Generate(HLVR_Timeline *timeline) { _generateEvent(timeline); }
protected abstract unsafe void _generateEvent(HLVR_Timeline *timeline);