opt: enum

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-05-05 15:06:19 +08:00
parent 4e68c765c5
commit 2f4c739f0b
116 changed files with 577 additions and 554 deletions

View File

@@ -1,40 +0,0 @@
enum LiveQuality {
dolby,
super4K,
origin,
bluRay,
superHD,
smooth,
flunt,
}
extension LiveQualityCode on LiveQuality {
static const List<int> _codeList = [
30000,
20000,
10000,
400,
250,
150,
80,
];
int get code => _codeList[index];
static LiveQuality? fromCode(int code) {
final index = _codeList.indexOf(code);
if (index != -1) {
return LiveQuality.values[index];
}
return null;
}
String get description => const [
'杜比',
'4K',
'原画',
'蓝光',
'超清',
'高清',
'流畅',
][index];
}