record method

void record({
  1. String? to,
  2. String? format,
})

Implementation

void record({String? to, String? format}) {
  final cto = to?.toNativeUtf8();
  final cfmt = format?.toNativeUtf8();
  _player.ref.record
      .asFunction<
        void Function(Pointer<mdkPlayer>, Pointer<Char>, Pointer<Char>)
      >()(
    _player.ref.object,
    cto?.cast() ?? nullptr,
    cfmt?.cast() ?? nullptr,
  );
  if (cto != null) {
    malloc.free(cto);
  }
  if (cfmt != null) {
    malloc.free(cfmt);
  }
}