mod: 默认长按倍速调整为3.0,预设倍速中的0.25替换为3.0

This commit is contained in:
orz12
2024-03-06 16:32:20 +08:00
parent 02148f641f
commit 1ea95a3079
3 changed files with 9 additions and 6 deletions

View File

@@ -58,7 +58,7 @@ class _PlaySpeedPageState extends State<PlaySpeedPage> {
videoStorage.get(VideoBoxKey.playSpeedDefault, defaultValue: 1.0); videoStorage.get(VideoBoxKey.playSpeedDefault, defaultValue: 1.0);
// 默认长按倍速 // 默认长按倍速
longPressSpeedDefault = longPressSpeedDefault =
videoStorage.get(VideoBoxKey.longPressSpeedDefault, defaultValue: 2.0); videoStorage.get(VideoBoxKey.longPressSpeedDefault, defaultValue: 3.0);
// 自定义倍速 // 自定义倍速
customSpeedsList = customSpeedsList =
videoStorage.get(VideoBoxKey.customSpeedsList, defaultValue: []); videoStorage.get(VideoBoxKey.customSpeedsList, defaultValue: []);
@@ -187,7 +187,7 @@ class _PlaySpeedPageState extends State<PlaySpeedPage> {
videoStorage.put(VideoBoxKey.playSpeedDefault, playSpeedDefault); videoStorage.put(VideoBoxKey.playSpeedDefault, playSpeedDefault);
} }
if (customSpeedsList[index] == longPressSpeedDefault) { if (customSpeedsList[index] == longPressSpeedDefault) {
longPressSpeedDefault = 2.0; longPressSpeedDefault = 3.0;
videoStorage.put( videoStorage.put(
VideoBoxKey.longPressSpeedDefault, longPressSpeedDefault); VideoBoxKey.longPressSpeedDefault, longPressSpeedDefault);
} }

View File

@@ -299,7 +299,7 @@ class PlPlayerController {
.get(SettingBoxKey.enableAutoLongPressSpeed, defaultValue: false); .get(SettingBoxKey.enableAutoLongPressSpeed, defaultValue: false);
if (!enableAutoLongPressSpeed) { if (!enableAutoLongPressSpeed) {
_longPressSpeed.value = videoStorage _longPressSpeed.value = videoStorage
.get(VideoBoxKey.longPressSpeedDefault, defaultValue: 2.0); .get(VideoBoxKey.longPressSpeedDefault, defaultValue: 3.0);
} }
speedsList = List<double>.from(videoStorage speedsList = List<double>.from(videoStorage
.get(VideoBoxKey.customSpeedsList, defaultValue: <double>[])); .get(VideoBoxKey.customSpeedsList, defaultValue: <double>[]));

View File

@@ -1,5 +1,5 @@
enum PlaySpeed { enum PlaySpeed {
pointTwoFive, // pointTwoFive,
pointFive, pointFive,
pointSevenFive, pointSevenFive,
@@ -9,11 +9,12 @@ enum PlaySpeed {
onePointSevenFive, onePointSevenFive,
two, two,
three,
} }
extension PlaySpeedExtension on PlaySpeed { extension PlaySpeedExtension on PlaySpeed {
static final List<String> _descList = [ static final List<String> _descList = [
'0.25', // '0.25',
'0.5', '0.5',
'0.75', '0.75',
'正常', '正常',
@@ -21,11 +22,12 @@ extension PlaySpeedExtension on PlaySpeed {
'1.5', '1.5',
'1.75', '1.75',
'2.0', '2.0',
'3.0'
]; ];
String get description => _descList[index]; String get description => _descList[index];
static final List<double> _valueList = [ static final List<double> _valueList = [
0.25, // 0.25,
0.5, 0.5,
0.75, 0.75,
1.0, 1.0,
@@ -33,6 +35,7 @@ extension PlaySpeedExtension on PlaySpeed {
1.5, 1.5,
1.75, 1.75,
2.0, 2.0,
3.0,
]; ];
double get value => _valueList[index]; double get value => _valueList[index];
double get defaultValue => _valueList[3]; double get defaultValue => _valueList[3];