From de4e68cfc5749f421fa68d2a68d5e19f56e4da6a Mon Sep 17 00:00:00 2001 From: Kevin Thomas Date: Wed, 4 Aug 2021 02:11:30 -0700 Subject: [PATCH] Add profile loading --- src/components/noise.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/components/noise.js b/src/components/noise.js index 1c6b10a..3af5a2d 100644 --- a/src/components/noise.js +++ b/src/components/noise.js @@ -175,7 +175,22 @@ export default { this.$http.get('https://localhost:3000/profiles/'.concat(this.profileItems.indexOf(this.selectedProfile) + 1)) .then(response => { if (response.status === 200) { - console.log(response.data.profile) + const profile = response.data.profile + + this.isTimerEnabled = profile.isTimerEnabled === 1 + this.duration = profile.duration + this.volume = profile.volume + this.noiseColor = profile.noiseColor + this.isFilterEnabled = profile.isFilterEnabled === 1 + this.filterType = profile.filterType + this.filterCutoff = profile.filterCutoff + this.isLFOFilterCutoffEnabled = profile.isLFOFilterCutoffEnabled === 1 + this.lfoFilterCutoffFrequency = profile.lfoFilterCutoffFrequency + this.lfoFilterCutoffRange[0] = profile.lfoFilterCutoffLow + this.lfoFilterCutoffRange[1] = profile.lfoFilterCutoffHigh + this.isTremoloEnabled = profile.isTimerEnabled === 1 + this.tremoloFrequency = profile.tremoloFrequency + this.tremoloDepth = profile.tremoloDepth } }) .catch(function (error) {