added more shaders

This commit is contained in:
Schnitzel5 2025-07-26 02:03:44 +02:00
parent 6be2775fee
commit 163bc9cec9
18 changed files with 126 additions and 19 deletions

View file

@ -474,5 +474,6 @@
"sync_enable_settings": "Sync settings",
"anime4K": "Enable Anime4K",
"anime4K_info": "Supports .js scripts under /mpv/scripts/",
"anime4K_download": "MPV config files are required!\nDownload now?"
"anime4K_download": "MPV config files are required!\nDownload now?",
"n_days": "{n} days"
}

View file

@ -2920,6 +2920,12 @@ abstract class AppLocalizations {
/// In en, this message translates to:
/// **'MPV config files are required!\nDownload now?'**
String get anime4K_download;
/// No description provided for @n_days.
///
/// In en, this message translates to:
/// **'{n} days'**
String n_days(Object n);
}
class _AppLocalizationsDelegate

View file

@ -1504,4 +1504,9 @@ class AppLocalizationsAr extends AppLocalizations {
@override
String get anime4K_download =>
'MPV config files are required!\nDownload now?';
@override
String n_days(Object n) {
return '$n days';
}
}

View file

@ -1517,4 +1517,9 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get anime4K_download =>
'MPV config files are required!\nDownload now?';
@override
String n_days(Object n) {
return '$n days';
}
}

View file

@ -1505,4 +1505,9 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get anime4K_download =>
'MPV config files are required!\nDownload now?';
@override
String n_days(Object n) {
return '$n days';
}
}

View file

@ -1522,6 +1522,11 @@ class AppLocalizationsEs extends AppLocalizations {
@override
String get anime4K_download =>
'MPV config files are required!\nDownload now?';
@override
String n_days(Object n) {
return '$n days';
}
}
/// The translations for Spanish Castilian, as used in Latin America and the Caribbean (`es_419`).

View file

@ -1523,4 +1523,9 @@ class AppLocalizationsFr extends AppLocalizations {
@override
String get anime4K_download =>
'MPV config files are required!\nDownload now?';
@override
String n_days(Object n) {
return '$n days';
}
}

View file

@ -1511,4 +1511,9 @@ class AppLocalizationsId extends AppLocalizations {
@override
String get anime4K_download =>
'MPV config files are required!\nDownload now?';
@override
String n_days(Object n) {
return '$n days';
}
}

View file

@ -1520,4 +1520,9 @@ class AppLocalizationsIt extends AppLocalizations {
@override
String get anime4K_download =>
'MPV config files are required!\nDownload now?';
@override
String n_days(Object n) {
return '$n days';
}
}

View file

@ -1519,6 +1519,11 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get anime4K_download =>
'MPV config files are required!\nDownload now?';
@override
String n_days(Object n) {
return '$n days';
}
}
/// The translations for Portuguese, as used in Brazil (`pt_BR`).

View file

@ -1521,4 +1521,9 @@ class AppLocalizationsRu extends AppLocalizations {
@override
String get anime4K_download =>
'MPV config files are required!\nDownload now?';
@override
String n_days(Object n) {
return '$n days';
}
}

View file

@ -1505,4 +1505,9 @@ class AppLocalizationsTh extends AppLocalizations {
@override
String get anime4K_download =>
'MPV config files are required!\nDownload now?';
@override
String n_days(Object n) {
return '$n days';
}
}

View file

@ -1511,4 +1511,9 @@ class AppLocalizationsTr extends AppLocalizations {
@override
String get anime4K_download =>
'MPV config files are required!\nDownload now?';
@override
String n_days(Object n) {
return '$n days';
}
}

View file

@ -1476,4 +1476,9 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get anime4K_download =>
'MPV config files are required!\nDownload now?';
@override
String n_days(Object n) {
return '$n days';
}
}

View file

@ -1072,13 +1072,23 @@ class _AnimeStreamPageState extends riv.ConsumerState<AnimeStreamPage>
icon: const Icon(Icons.high_quality, color: Colors.white),
itemBuilder: (context) =>
[
("Anime4K: Mode A (Fast)", "CTRL+1"),
("Anime4K: Mode B (Fast)", "CTRL+2"),
("Anime4K: Mode C (Fast)", "CTRL+3"),
("Anime4K: Mode A+A (Fast)", "CTRL+4"),
("Anime4K: Mode B+B (Fast)", "CTRL+5"),
("Anime4K: Mode C+A (Fast)", "CTRL+6"),
("Clear GLSL shaders", "CTRL+0"),
("Anime4K: Mode A (Fast)", "set_anime_a"),
("Anime4K: Mode B (Fast)", "set_anime_b"),
("Anime4K: Mode C (Fast)", "set_anime_c"),
("Anime4K: Mode A+A (Fast)", "set_anime_aa"),
("Anime4K: Mode B+B (Fast)", "set_anime_bb"),
("Anime4K: Mode C+A (Fast)", "set_anime_ca"),
("Anime4K: Mode A (HQ)", "set_anime_hq_a"),
("Anime4K: Mode B (HQ)", "set_anime_hq_b"),
("Anime4K: Mode C (HQ)", "set_anime_hq_c"),
("Anime4K: Mode A+A (HQ)", "set_anime_hq_aa"),
("Anime4K: Mode B+B (HQ)", "set_anime_hq_bb"),
("Anime4K: Mode C+A (HQ)", "set_anime_hq_ca"),
("AMD FSR", "set_fsr"),
("Luma Upscaling", "set_luma"),
("Qualcomm Snapdragon GSR", "set_snapdragon"),
("NVIDIA Image Scaling", "set_nvidia"),
("Clear GLSL shaders", "clear_anime"),
]
.map(
(mode) => PopupMenuItem<String>(
@ -1086,7 +1096,7 @@ class _AnimeStreamPageState extends riv.ConsumerState<AnimeStreamPage>
child: Text(mode.$1),
onTap: () {
(_player.platform as dynamic).command([
"keydown",
"script-message",
mode.$2,
]);
},

View file

@ -216,25 +216,46 @@ class _DesktopControllerWidgetState
await _changeFullScreen(ref, desktopFullScreenPlayer, value: false);
},
const SingleActivator(LogicalKeyboardKey.digit0, control: true): () {
(widget.videoController.player.platform as dynamic).command(["keydown", "CTRL+0"]);
(widget.videoController.player.platform as dynamic).command([
"script-message",
"clear_anime",
]);
},
const SingleActivator(LogicalKeyboardKey.digit1, control: true): () {
(widget.videoController.player.platform as dynamic).command(["keydown", "CTRL+1"]);
(widget.videoController.player.platform as dynamic).command([
"script-message",
"set_anime_a",
]);
},
const SingleActivator(LogicalKeyboardKey.digit2, control: true): () {
(widget.videoController.player.platform as dynamic).command(["keydown", "CTRL+2"]);
(widget.videoController.player.platform as dynamic).command([
"script-message",
"set_anime_b",
]);
},
const SingleActivator(LogicalKeyboardKey.digit3, control: true): () {
(widget.videoController.player.platform as dynamic).command(["keydown", "CTRL+3"]);
(widget.videoController.player.platform as dynamic).command([
"script-message",
"set_anime_c",
]);
},
const SingleActivator(LogicalKeyboardKey.digit4, control: true): () {
(widget.videoController.player.platform as dynamic).command(["keydown", "CTRL+4"]);
(widget.videoController.player.platform as dynamic).command([
"script-message",
"set_anime_aa",
]);
},
const SingleActivator(LogicalKeyboardKey.digit5, control: true): () {
(widget.videoController.player.platform as dynamic).command(["keydown", "CTRL+5"]);
(widget.videoController.player.platform as dynamic).command([
"script-message",
"set_anime_bb",
]);
},
const SingleActivator(LogicalKeyboardKey.digit6, control: true): () {
(widget.videoController.player.platform as dynamic).command(["keydown", "CTRL+6"]);
(widget.videoController.player.platform as dynamic).command([
"script-message",
"set_anime_ca",
]);
},
},
child: Stack(

View file

@ -1923,7 +1923,9 @@ class _MangaDetailViewState extends ConsumerState<MangaDetailView>
),
const SizedBox(height: 4),
Text(
"${widget.manga?.smartUpdateDays ?? "N/A"}",
widget.manga?.smartUpdateDays != null
? context.l10n.n_days(widget.manga!.smartUpdateDays!)
: "N/A",
style: TextStyle(fontSize: 11, color: context.secondaryColor),
textAlign: TextAlign.center,
),

View file

@ -657,7 +657,7 @@ class _PlayerScreenState extends ConsumerState<PlayerScreen> {
http.Request(
'GET',
Uri.parse(
"https://github.com/Tama47/Anime4K/releases/download/v4.0.1/GLSL_Windows_Low-end.zip",
"https://github.com/Schnitzel5/mangayomi/releases/download/v0.6.3-anime4k/mangayomi_mpv.zip",
),
),
);
@ -689,11 +689,18 @@ class _PlayerScreenState extends ConsumerState<PlayerScreen> {
await mpvFile.writeAsBytes(file.content);
} else if (file.name == "input.conf") {
await inputFile.writeAsBytes(file.content);
} else if (file.name.endsWith(".glsl")) {
} else if (file.name.startsWith("shaders/") &&
file.name.endsWith(".glsl")) {
final shaderFile = File(
'$shadersDir/${file.name.split("/").last}',
);
await shaderFile.writeAsBytes(file.content);
} else if (file.name.startsWith("scripts/") &&
file.name.endsWith(".js")) {
final scriptFile = File(
'$scriptsDir/${file.name.split("/").last}',
);
await scriptFile.writeAsBytes(file.content);
}
}
_total = 0;