new presets now use the eqPreset object type

This commit is contained in:
booploops 2022-01-27 22:52:37 -08:00
parent 86e79b5013
commit 411eeacfd9

View file

@ -116,6 +116,8 @@
return { return {
app: this.$root, app: this.$root,
eqPreset: function () { eqPreset: function () {
this.preset = uuidv4()
this.name = ""
this.frequencies = [] this.frequencies = []
this.gain = [] this.gain = []
this.Q = [] this.Q = []
@ -218,7 +220,6 @@
}, },
props: ["src", "url"], props: ["src", "url"],
mounted() { mounted() {
console.log(new this.eqPreset())
}, },
methods: { methods: {
close() { close() {
@ -251,18 +252,18 @@
}) })
}, },
addPreset() { addPreset() {
let self = this
bootbox.prompt("New EQ Preset Name", (res) => { bootbox.prompt("New EQ Preset Name", (res) => {
if (res) { if (res) {
let eqSettings = Clone(app.cfg.audio.equalizer) let eqSettings = Clone(app.cfg.audio.equalizer)
app.cfg.audio.equalizer.presets.push({ let newPreset = new self.eqPreset()
preset: uuidv4(), newPreset.name = res
name: res, newPreset.frequencies = eqSettings.frequencies
frequencies: eqSettings.frequencies, newPreset.gain = eqSettings.gain
gain: eqSettings.gain, newPreset.Q = eqSettings.Q
Q: eqSettings.Q, newPreset.preamp = eqSettings.preamp
preamp: eqSettings.preamp, newPreset.mix = eqSettings.mix
mix: eqSettings.mix, app.cfg.audio.equalizer.presets.push(newPreset)
})
notyf.success("Added Preset") notyf.success("Added Preset")
} }
}) })