Added Playback Rate functionality (#933)

* Add () to openAudioControls function call

* Duplicate new placeholder modal

* Add to app.modals

* Make modal do something

* Changed input to slider

* Change i18n string name and remove con.log

* Finalized i18n strings

* Add to store.ts and update i18n hehe

* Save rate to cfg

* fuck off

* AAHH

* Make auto-set more reliable

* no nightcore stuff here

Co-authored-by: cryptofyre <cryptofyre@cryptofyre.org>
This commit is contained in:
Amaru8 2022-04-25 07:55:13 +02:00 committed by GitHub
parent 67834c192a
commit 144127f142
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 106 additions and 2 deletions

View file

@ -0,0 +1,43 @@
<script type="text/x-template" id="audio-playbackrate">
<div class="modal-fullscreen addtoplaylist-panel" @click.self="app.resetState()"
@contextmenu.self="app.resetState()">
<div class="modal-window">
<div class="modal-header">
<div class="modal-title">{{app.getLz('settings.option.audio.changePlaybackRate')}}</div>
<button class="close-btn" @click="app.resetState()"></button>
</div>
<div class="modal-content">
<div class="md-option-line">
<div class="md-option-segment">
{{app.getLz('settings.option.audio.playbackRate')}}
</div>
<div class="md-option-segment playbackrate-text" v-if="this.playbackRate">
{{playbackRate}} ×
</div>
<div class="md-option-segment md-option-segment_auto">
<input type="range" :step="0.05" min="0.25" :max="2" v-model="playbackRate">
</div>
</div>
</div>
</div>
</div>
</script>
<script>
Vue.component('audio-playbackrate', {
template: '#audio-playbackrate',
data: function () {
return {
app: this.$root,
playbackRate: this.$root.cfg.audio.playbackRate
}
},
watch: {
playbackRate: function (newValue, _oldValue) {
this.$root.mk.playbackRate = newValue
this.$root.cfg.audio.playbackRate = newValue
this.playbackRate = newValue
}
}
});
</script>