loadFromPointer method

  1. @override
void loadFromPointer(
  1. Pointer<SdlHapticEffect> pointer
)
override

Implementation

@override
void loadFromPointer(Pointer<SdlHapticEffect> pointer) {
  type = pointer.ref.custom.type;
  direction.type = pointer.ref.custom.direction.type;
  direction.dir.clear();
  for (var i = 0; i < 3; i++) {
    direction.dir.add(pointer.ref.custom.direction.dir[i]);
  }
  length = pointer.ref.custom.length;
  delay = pointer.ref.custom.delay;
  button = pointer.ref.custom.button;
  interval = pointer.ref.custom.interval;
  channels = pointer.ref.custom.channels;
  period = pointer.ref.custom.period;
  samples = pointer.ref.custom.samples;
  if (pointer.ref.custom.data != nullptr) {
    data = Uint16List.fromList(
      pointer.ref.custom.data.asTypedList(channels * samples),
    );
  }
  attackLength = pointer.ref.custom.attackLength;
  attackLevel = pointer.ref.custom.attackLevel;
  fadeLength = pointer.ref.custom.fadeLength;
  fadeLevel = pointer.ref.custom.fadeLevel;
}