opt: select dialog & feat: select subtitle if muted (#564)

* opt: select dialog

* opt: subtitle

* feat: select subtitle if muted
This commit is contained in:
My-Responsitories
2025-03-29 17:52:06 +08:00
committed by GitHub
parent 2ddfea5cf3
commit 82f9f48a8e
10 changed files with 284 additions and 236 deletions

View File

@@ -1,16 +1,17 @@
enum SubtitlePreference { off, on, withoutAi }
enum SubtitlePreference { off, on, withoutAi, auto }
extension SubtitlePreferenceDesc on SubtitlePreference {
static final List<String> _descList = [
'默认不显示字幕',
'选择第一个可用字幕',
'跳过自动生成(ai)字幕,选择第一个可用字幕'
'优先选择非自动生成(ai)字幕',
'跳过自动生成(ai)字幕,选择第一个可用字幕',
'静音时等同第二项,非静音时等同第三项'
];
get description => _descList[index];
String get description => _descList[index];
}
extension SubtitlePreferenceCode on SubtitlePreference {
static final List<String> _codeList = ['off', 'on', 'withoutAi'];
static const List<String> _codeList = ['off', 'on', 'withoutAi', 'auto'];
String get code => _codeList[index];
static SubtitlePreference? fromCode(String code) {