Skip to content

Commit

Permalink
Fix linting problems in widgets/pitchslider.js
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishekkumar08 authored Jan 31, 2021
1 parent 36d1949 commit 47b47f9
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion js/widgets/pitchslider.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,40 @@
// from given frequency to nextoctave frequency(two times the given frequency)
// in continuous manner.

/* global _, Tone, logo */

/*
Global locations
js/activity.js
logo, Tone
js/utils/utils.js
_
*/

/* exported PitchSlider */
class PitchSlider {
static ICONSIZE = 32;
static SEMITONE = Math.pow(2, 1 / 12);

/**
* @constructor
*/
constructor() {
this._delta = 0;
this.sliders = {};
this._cellScale = 0;
}

/**
* Intializes the pitch/slider
* @returns {void}
*/
init() {
if (window.widgetWindows.openWindows["slider"]) return;
if (!this.frequencies || !this.frequencies.length) this.frequencies = [392];

const oscillators = [];
for (const _ in this.frequencies) {
for (let i = 0; i < this.frequencies.length; i++) {
const osc = new Tone.AMSynth().toDestination();
oscillators.push(osc);
}
Expand Down Expand Up @@ -120,6 +138,11 @@ class PitchSlider {
setTimeout(this.widgetWindow.sendToCenter, 0);
}

/**
* @private
* @param {number} frequency
* @returns {void}
*/
_save(frequency) {
for (const name in logo.blocks.palettes.dict) {
logo.blocks.palettes.dict[name].hideMenu(true);
Expand Down

0 comments on commit 47b47f9

Please sign in to comment.