mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-09 07:28:14 -07:00
feat: Implement next-up screen for native player (#533)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
311b647286
commit
29b1c2e633
25 changed files with 782 additions and 203 deletions
|
|
@ -29,6 +29,12 @@ bool _deepEquals(Object? a, Object? b) {
|
|||
}
|
||||
|
||||
|
||||
enum AutoNextType {
|
||||
off,
|
||||
static,
|
||||
smart,
|
||||
}
|
||||
|
||||
enum SegmentType {
|
||||
commercial,
|
||||
preview,
|
||||
|
|
@ -50,6 +56,7 @@ class PlayerSettings {
|
|||
this.themeColor,
|
||||
required this.skipForward,
|
||||
required this.skipBackward,
|
||||
required this.autoNextType,
|
||||
});
|
||||
|
||||
bool enableTunneling;
|
||||
|
|
@ -62,6 +69,8 @@ class PlayerSettings {
|
|||
|
||||
int skipBackward;
|
||||
|
||||
AutoNextType autoNextType;
|
||||
|
||||
List<Object?> _toList() {
|
||||
return <Object?>[
|
||||
enableTunneling,
|
||||
|
|
@ -69,6 +78,7 @@ class PlayerSettings {
|
|||
themeColor,
|
||||
skipForward,
|
||||
skipBackward,
|
||||
autoNextType,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -83,6 +93,7 @@ class PlayerSettings {
|
|||
themeColor: result[2] as int?,
|
||||
skipForward: result[3]! as int,
|
||||
skipBackward: result[4]! as int,
|
||||
autoNextType: result[5]! as AutoNextType,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -112,14 +123,17 @@ class _PigeonCodec extends StandardMessageCodec {
|
|||
if (value is int) {
|
||||
buffer.putUint8(4);
|
||||
buffer.putInt64(value);
|
||||
} else if (value is SegmentType) {
|
||||
} else if (value is AutoNextType) {
|
||||
buffer.putUint8(129);
|
||||
writeValue(buffer, value.index);
|
||||
} else if (value is SegmentSkip) {
|
||||
} else if (value is SegmentType) {
|
||||
buffer.putUint8(130);
|
||||
writeValue(buffer, value.index);
|
||||
} else if (value is PlayerSettings) {
|
||||
} else if (value is SegmentSkip) {
|
||||
buffer.putUint8(131);
|
||||
writeValue(buffer, value.index);
|
||||
} else if (value is PlayerSettings) {
|
||||
buffer.putUint8(132);
|
||||
writeValue(buffer, value.encode());
|
||||
} else {
|
||||
super.writeValue(buffer, value);
|
||||
|
|
@ -131,11 +145,14 @@ class _PigeonCodec extends StandardMessageCodec {
|
|||
switch (type) {
|
||||
case 129:
|
||||
final int? value = readValue(buffer) as int?;
|
||||
return value == null ? null : SegmentType.values[value];
|
||||
return value == null ? null : AutoNextType.values[value];
|
||||
case 130:
|
||||
final int? value = readValue(buffer) as int?;
|
||||
return value == null ? null : SegmentSkip.values[value];
|
||||
return value == null ? null : SegmentType.values[value];
|
||||
case 131:
|
||||
final int? value = readValue(buffer) as int?;
|
||||
return value == null ? null : SegmentSkip.values[value];
|
||||
case 132:
|
||||
return PlayerSettings.decode(readValue(buffer)!);
|
||||
default:
|
||||
return super.readValueOfType(type, buffer);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue