This commit is contained in:
Adam 2026-05-06 13:51:21 +02:00 committed by GitHub
commit cf42351f0c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 17 additions and 2 deletions

View file

@ -8,6 +8,12 @@
<span>{{ $strings.LabelUseChapterTrack }}</span>
</div>
</div>
<div class="flex items-center mb-4">
<ui-toggle-switch v-model="useLogarithmicVolume" @input="setUseLogarithmicVolume" />
<div class="pl-4">
<span>{{ $strings.LabelUseLogarithmicVolume }}</span>
</div>
</div>
<div class="flex items-center mb-4">
<ui-select-input v-model="jumpForwardAmount" :label="$strings.LabelJumpForwardAmount" menuMaxHeight="250px" :items="jumpValues" @input="setJumpForwardAmount" />
</div>
@ -29,6 +35,7 @@ export default {
data() {
return {
useChapterTrack: false,
useLogarithmicVolume: true,
jumpValues: [
{ text: this.$getString('LabelTimeDurationXSeconds', ['10']), value: 10 },
{ text: this.$getString('LabelTimeDurationXSeconds', ['15']), value: 15 },
@ -57,6 +64,9 @@ export default {
setUseChapterTrack() {
this.$store.dispatch('user/updateUserSettings', { useChapterTrack: this.useChapterTrack })
},
setUseLogarithmicVolume() {
this.$store.dispatch('user/updateUserSettings', { useLogarithmicVolume: this.useLogarithmicVolume })
},
setJumpForwardAmount(val) {
this.jumpForwardAmount = val
this.$store.dispatch('user/updateUserSettings', { jumpForwardAmount: val })
@ -71,6 +81,7 @@ export default {
},
settingsUpdated() {
this.useChapterTrack = this.$store.getters['user/getUserSetting']('useChapterTrack')
this.useLogarithmicVolume = this.$store.getters['user/getUserSetting']('useLogarithmicVolume')
this.jumpForwardAmount = this.$store.getters['user/getUserSetting']('jumpForwardAmount')
this.jumpBackwardAmount = this.$store.getters['user/getUserSetting']('jumpBackwardAmount')
this.playbackRateIncrementDecrement = this.$store.getters['user/getUserSetting']('playbackRateIncrementDecrement')

View file

@ -303,7 +303,9 @@ export default class LocalAudioPlayer extends EventEmitter {
setVolume(volume) {
if (!this.player) return
this.player.volume = volume
const useLogarithmicVolume = this.ctx.$store.getters['user/getUserSetting']('useLogarithmicVolume')
// Apply quadratic curve for more natural volume perception if enabled
this.player.volume = useLogarithmicVolume ? volume * volume : volume
}
// Utils

View file

@ -18,7 +18,8 @@ export const state = () => ({
authorSortBy: 'name',
authorSortDesc: false,
jumpForwardAmount: 10,
jumpBackwardAmount: 10
jumpBackwardAmount: 10,
useLogarithmicVolume: false
}
})

View file

@ -712,6 +712,7 @@
"LabelUploaderItemFetchMetadataHelp": "Automatically fetch title, author, and series",
"LabelUseAdvancedOptions": "Use Advanced Options",
"LabelUseChapterTrack": "Use chapter track",
"LabelUseLogarithmicVolume": "Natural volume scaling",
"LabelUseFullTrack": "Use full track",
"LabelUseZeroForUnlimited": "Use 0 for unlimited",
"LabelUser": "User",