Skip to content
Snippets Groups Projects
Commit 8bf56354 authored by Nicolas Pomepuy's avatar Nicolas Pomepuy Committed by Duncan McNamara
Browse files

Change max playback speed to 8

parent f521ea50
No related branches found
Tags 3.0.12.1
1 merge request!1896Improve the playback speed dialog
Pipeline #479552 failed with stages
in 20 minutes and 31 seconds
......@@ -42,7 +42,7 @@
android:layout_weight="1"
android:gravity="bottom|right"
android:importantForAccessibility="no"
android:text="4.00"
android:text="8.00"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="@+id/playback_speed_seek"
app:layout_constraintEnd_toEndOf="parent"
......
......@@ -62,7 +62,7 @@ class PlaybackSpeedDialog : VLCBottomSheetDialogFragment() {
if (playbackService == null || playbackService!!.currentMediaWrapper == null)
return
if (fromUser) {
val rate = (4.0).pow(progress.toDouble() / 100.0 - 1).toFloat()
val rate = (8.0).pow(progress.toDouble() / 100.0 - 1).toFloat()
playbackService!!.setRate(rate, true)
updateInterface()
}
......@@ -145,7 +145,7 @@ class PlaybackSpeedDialog : VLCBottomSheetDialogFragment() {
private fun setRateProgress() {
var speed = playbackService!!.rate.toDouble()
speed = 100 * (1 + ln(speed) / ln(4.0))
speed = 100 * (1 + ln(speed) / ln(8.0))
binding.playbackSpeedSeek.progress = speed.toInt()
updateInterface()
}
......@@ -153,7 +153,7 @@ class PlaybackSpeedDialog : VLCBottomSheetDialogFragment() {
private fun changeSpeedTo(newValue: Float) {
if (playbackService == null)
return
if (newValue > 4.0F || newValue < 0.25F) return
if (newValue > 8.0F || newValue < 0.25F) return
playbackService!!.setRate(newValue, true)
setRateProgress()
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment