-
-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(player): Add debanding setting (#1112)
Co-authored-by: jmir1 <[email protected]>
- Loading branch information
1 parent
89e1da0
commit 4fc7b41
Showing
6 changed files
with
70 additions
and
14 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
...src/main/java/eu/kanade/presentation/more/settings/screen/AdvancedPlayerSettingsScreen.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package eu.kanade.presentation.more.settings.screen | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.runtime.rememberCoroutineScope | ||
import androidx.compose.ui.platform.LocalContext | ||
import eu.kanade.presentation.more.settings.Preference | ||
import eu.kanade.tachiyomi.R | ||
import eu.kanade.tachiyomi.ui.player.settings.PlayerPreferences | ||
import eu.kanade.tachiyomi.util.preference.asState | ||
import uy.kohesive.injekt.Injekt | ||
import uy.kohesive.injekt.api.get | ||
|
||
object AdvancedPlayerSettingsScreen : SearchableSettings { | ||
@Composable | ||
override fun getTitleRes() = R.string.pref_category_player_advanced | ||
|
||
@Composable | ||
override fun getPreferences(): List<Preference> { | ||
val playerPreferences = remember { Injekt.get<PlayerPreferences>() } | ||
val context = LocalContext.current | ||
val mpvConf = playerPreferences.mpvConf() | ||
val scope = rememberCoroutineScope() | ||
|
||
return listOf( | ||
Preference.PreferenceItem.MultiLineEditTextPreference( | ||
pref = mpvConf, | ||
title = context.getString(R.string.pref_mpv_conf), | ||
subtitle = mpvConf.asState(scope).value | ||
.lines().take(2) | ||
.joinToString( | ||
separator = "\n", | ||
postfix = if (mpvConf.asState(scope).value.lines().size > 2) "\n..." else "", | ||
), | ||
|
||
), | ||
Preference.PreferenceItem.ListPreference( | ||
title = context.getString(R.string.pref_debanding_title), | ||
pref = playerPreferences.deband(), | ||
entries = mapOf( | ||
0 to context.getString(R.string.pref_debanding_disabled), | ||
1 to context.getString(R.string.pref_debanding_cpu), | ||
2 to context.getString(R.string.pref_debanding_gpu), | ||
), | ||
), | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters