Adds basic low feedback mode implementation

This commit is contained in:
Tony Edwards 2023-11-30 13:07:30 +00:00
parent a26f37aa49
commit 1b06dbd78c
4 changed files with 30 additions and 4 deletions

View file

@ -122,7 +122,8 @@ data class DeviceSettings(
var sleepTimerLength: Long, // Time in milliseconds
var disableSleepTimerFadeOut: Boolean,
var disableSleepTimerResetFeedback: Boolean,
var languageCode: String
var languageCode: String,
var enableLowFeedbackMode: Boolean
) {
companion object {
// Static method to get default device settings
@ -145,7 +146,7 @@ data class DeviceSettings(
autoSleepTimerAutoRewindTime = 300000L, // 5 minutes
disableSleepTimerFadeOut = false,
disableSleepTimerResetFeedback = false,
languageCode = "en-us"
enableLowFeedbackMode = false
)
}
}

View file

@ -27,7 +27,7 @@
<p v-if="subtitle" class="text-gray-100 text-base">{{ subtitle }}</p>
</div>
<div v-if="hasLocal" class="mx-1">
<div v-if="hasLocal && !isLowFeedback" class="mx-1">
<div v-if="isLocalOnly" class="w-full rounded-md bg-warning/10 border border-warning p-4">
<p class="text-sm">{{ $strings.MessageMediaNotLinkedToServer }}</p>
</div>
@ -454,6 +454,9 @@ export default {
if (width * this.bookCoverAspectRatio > 325) width = 325 / this.bookCoverAspectRatio
return width
},
isLowFeedback() {
return this.$store.state.deviceData.deviceSettings.enableLowFeedbackMode
}
},
methods: {

View file

@ -15,6 +15,12 @@
</div>
<p class="pl-4">{{ $strings.LabelLockOrientation }}</p>
</div>
<div class="flex items-center py-3" @click="toggleLowFeedbackMode">
<div class="w-10 flex justify-center">
<ui-toggle-switch v-model="settings.enableLowFeedbackMode" @input="saveSettings" />
</div>
<p class="pl-4">Low Feedback Mode</p>
</div>
<div class="py-3 flex items-center">
<p class="pr-4 w-36">{{ $strings.LabelHapticFeedback }}</p>
<div @click.stop="showHapticFeedbackOptions">
@ -158,7 +164,8 @@ export default {
disableSleepTimerResetFeedback: false,
autoSleepTimerAutoRewind: false,
autoSleepTimerAutoRewindTime: 300000, // 5 minutes
languageCode: 'en-us'
languageCode: 'en-us', // 5 minutes
enableLowFeedbackMode: false
},
lockCurrentOrientation: false,
settingInfo: {
@ -185,6 +192,12 @@ export default {
enableMp3IndexSeeking: {
name: this.$strings.LabelEnableMp3IndexSeeking,
message: this.$strings.LabelEnableMp3IndexSeekingHelp
name: 'Enable mp3 index seeking',
message: 'This setting should only be enabled if you have mp3 files that are not seeking correctly. Inaccurate seeking is most likely due to Variable birate (VBR) MP3 files. This setting will force index seeking, in which a time-to-byte mapping is built as the file is read. In some cases with large MP3 files there will be a delay when seeking towards the end of the file.'
},
enableLowFeedbackMode: {
name: 'Low feedback mode',
message: 'Danger. This setting will hide confirmation messages, error messages, notifications and feedback within the apps interface. With low feedback enabled, you WILL miss important messages. You WILL experience unexpected behavior. Proceed with caution.'
}
},
hapticFeedbackItems: [
@ -423,6 +436,10 @@ export default {
this.settings.jumpBackwardsTime = this.jumpBackwardsItems[next].value
this.saveSettings()
},
toggleLowFeedbackMode() {
this.settings.enableLowFeedbackMode = !this.settings.enableLowFeedbackMode
this.saveSettings()
},
async saveSettings() {
await this.$hapticsImpact()
const updatedDeviceData = await this.$db.updateDeviceSettings({ ...this.settings })
@ -459,6 +476,8 @@ export default {
this.settings.autoSleepTimerAutoRewindTime = !isNaN(deviceSettings.autoSleepTimerAutoRewindTime) ? deviceSettings.autoSleepTimerAutoRewindTime : 300000 // 5 minutes
this.settings.languageCode = deviceSettings.languageCode || 'en-us'
this.settings.enableLowFeedbackMode = !!deviceSettings.enableLowFeedbackMode
}
},
mounted() {

View file

@ -75,6 +75,9 @@ export const getters = {
},
getOrientationLockSetting: state => {
return state.deviceData?.deviceSettings?.lockOrientation
},
getLowFeedbackModeSetting: state => {
return state.deviceData?.deviceSettings?.enableLowFeebackMode
}
}