allow user to choose captions color

This commit is contained in:
Toni Förster
2024-05-20 17:17:52 +02:00
parent 96df7fdec5
commit 108b4de483
3 changed files with 36 additions and 8 deletions

View File

@@ -68,7 +68,8 @@ 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_set_option_string(mpv, "sub-scale", Defaults[.captionsFontScaleSize]))
checkError(mpv_set_option_string(mpv, "sub-color", Defaults[.captionsFontColor]))
checkError(mpv_initialize(mpv))
@@ -414,8 +415,12 @@ final class MPVClient: ObservableObject {
setString("sub", "no")
}
func setSubFontSize() {
setString("sub-scale", "\(Defaults[.captionsFontScaleSize])")
func setSubFontSize(scaleSize: String) {
setString("sub-scale", scaleSize)
}
func setSubFontColor(color: String) {
setString("sub-color", color)
}
var tracksCount: Int {