mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-09 16:11:20 +02:00
Support custom mpv.conf (#327)
Part of #235 Closes #305 Adds a preference for specifying a custom `mpv.conf` Also adds a preference to toggle between `vo=gpu` and `vo=gpu-next`, see https://github.com/mpv-player/mpv/wiki/GPU-Next-vs-GPU There are some caveats: * Multi-line text entry via a remote is rough * [Track selection options](https://mpv.io/manual/stable/#track-selection) may not work as expected because Wholphin manages this itself * Bad settings will crash the app hard Dev note: This rewrites the text field inputs to use the [state based implementations](https://developer.android.com/develop/ui/compose/text/migrate-state-based)
This commit is contained in:
parent
45cb385b9b
commit
a294661520
15 changed files with 408 additions and 269 deletions
|
|
@ -701,6 +701,24 @@ sealed interface AppPreference<Pref, T> {
|
|||
summary = R.string.disable_if_crash,
|
||||
)
|
||||
|
||||
val MpvGpuNext =
|
||||
AppSwitchPreference<AppPreferences>(
|
||||
title = R.string.mpv_use_gpu_next,
|
||||
defaultValue = true,
|
||||
getter = { it.playbackPreferences.mpvOptions.useGpuNext },
|
||||
setter = { prefs, value ->
|
||||
prefs.updateMpvOptions { useGpuNext = value }
|
||||
},
|
||||
summaryOn = R.string.enabled,
|
||||
summaryOff = R.string.disabled,
|
||||
)
|
||||
|
||||
val MpvConfFile =
|
||||
AppClickablePreference<AppPreferences>(
|
||||
title = R.string.mpv_conf,
|
||||
summary = null,
|
||||
)
|
||||
|
||||
val DebugLogging =
|
||||
AppSwitchPreference<AppPreferences>(
|
||||
title = R.string.verbose_logging,
|
||||
|
|
@ -851,7 +869,11 @@ val advancedPreferences =
|
|||
),
|
||||
ConditionalPreferences(
|
||||
{ it.playbackPreferences.playerBackend == PlayerBackend.MPV },
|
||||
listOf(AppPreference.MpvHardwareDecoding),
|
||||
listOf(
|
||||
AppPreference.MpvHardwareDecoding,
|
||||
AppPreference.MpvGpuNext,
|
||||
AppPreference.MpvConfFile,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ class AppPreferencesSerializer
|
|||
.apply {
|
||||
enableHardwareDecoding =
|
||||
AppPreference.MpvHardwareDecoding.defaultValue
|
||||
useGpuNext = AppPreference.MpvGpuNext.defaultValue
|
||||
}.build()
|
||||
}.build()
|
||||
homePagePreferences =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue