fromValue static method

MpvEndFileReason fromValue(
  1. int value
)

Converts a raw mpv integer reason code to the corresponding enum value. A code this version does not know gives error, so an unknown end never reads as the natural end of the file.

Implementation

static MpvEndFileReason fromValue(int value) {
  for (final reason in values) {
    if (reason.value == value) return reason;
  }
  return error;
}