let the user select caption size

This commit is contained in:
Toni Förster
2024-05-20 15:34:31 +02:00
parent 4fa5a15ad4
commit 96df7fdec5
3 changed files with 26 additions and 0 deletions

View File

@@ -68,6 +68,7 @@ final class MPVClient: ObservableObject {
checkError(mpv_set_option_string(mpv, "vo", "libmpv"))
checkError(mpv_set_option_string(mpv, "demuxer-lavf-analyzeduration", "1"))
checkError(mpv_set_option_string(mpv, "deinterlace", Defaults[.mpvDeinterlace] ? "yes" : "no"))
checkError(mpv_set_option_string(mpv, "sub-scale", "\(Defaults[.captionsFontScaleSize])"))
checkError(mpv_initialize(mpv))
@@ -413,6 +414,10 @@ final class MPVClient: ObservableObject {
setString("sub", "no")
}
func setSubFontSize() {
setString("sub-scale", "\(Defaults[.captionsFontScaleSize])")
}
var tracksCount: Int {
Int(getString("track-list/count") ?? "-1") ?? -1
}