Files
PiliPlus/lib/models/common/video/audio_quality.dart
bggRGjQaUbCoE 2f4c739f0b opt: enum
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
2025-05-05 15:13:17 +08:00

31 lines
611 B
Dart

// ignore_for_file: constant_identifier_names
enum AudioQuality { k64, k132, k192, dolby, hiRes }
extension AudioQualityExt on AudioQuality {
static const List<int> _codeList = [
30216,
30232,
30280,
30250,
30251,
];
int get code => _codeList[index];
static AudioQuality? fromCode(int code) {
final index = _codeList.indexOf(code);
if (index != -1) {
return AudioQuality.values[index];
}
return null;
}
String get description => const [
'64K',
'132K',
'192K',
'杜比全景声',
'Hi-Res无损',
][index];
}