diff --git a/app/components/controls/music-control.js b/app/components/controls/music-control.js index d49f847..5f13d28 100644 --- a/app/components/controls/music-control.js +++ b/app/components/controls/music-control.js @@ -241,36 +241,43 @@ export default Em.Component.extend(musicControlMixin, { threshold = this.get('threshold'), decay = this.get('decay'), frequency = this.get('frequency'), - //briOff = function (i) { - // Em.$.ajax(self.get('apiURL') + '/lights/' + i + '/state', { - // data: JSON.stringify({'bri': 1, 'transitiontime': 0}), - // contentType: 'application/json', - // type: 'PUT' - // }); - //}, + briOff = function (i) { + Em.$.ajax(self.get('apiURL') + '/lights/' + i + '/state', { + data: JSON.stringify({'bri': 1, 'transitiontime': 0}), + contentType: 'application/json', + type: 'PUT' + }); + }, kick = dancer.createKick({ threshold: threshold, decay: decay, frequency: frequency, onKick: function (mag) { - + var activeLights = self.get('activeLights'); if (self.get('paused') === false) { - //for (let i = 1; i <= 1; i++) { - // Em.$.ajax(self.get('apiURL') + '/lights/' + i + '/state', { - // data: JSON.stringify({'bri': 254, 'transitiontime': 0}), - // contentType: 'application/json', - // type: 'PUT' - // }); - // - // setTimeout(briOff, 50, i); - //} + //work the lights + if(activeLights.length > 0){ + var lastLightBopIndex = self.get('lastLightBopIndex'), light = self.get('activeLights')[lastLightBopIndex]; + Em.$.ajax(self.get('apiURL') + '/lights/' + light + '/state', { + data: JSON.stringify({'bri': 254, 'transitiontime': 0}), + contentType: 'application/json', + type: 'PUT' + }); - self.set('paused', true); + setTimeout(briOff, 50, light); + lastLightBopIndex = (lastLightBopIndex+1)%activeLights.length; - setTimeout(function () { - self.set('paused', false); - }, 150); + self.setProperties({ + paused: true, + lastLightBopIndex: lastLightBopIndex + }); + setTimeout(function () { + self.set('paused', false); + }, 150); + } + + //work the music beat area if(self.get('speakerViewed')){ self.send('clickSpeaker'); } else { diff --git a/app/components/mixins/music-control.js b/app/components/mixins/music-control.js index a54b4a3..d182d0e 100644 --- a/app/components/mixins/music-control.js +++ b/app/components/mixins/music-control.js @@ -57,6 +57,7 @@ export default Em.Mixin.create({ maxBeatHistorySize: 30, timeElapsed: 0, timeTotal: 0, + lastLightBopIndex: 0, dragging: false, draggingOverPlayListArea: false, diff --git a/app/styles/app.scss b/app/styles/app.scss index 8ac0814..b6dcd18 100644 --- a/app/styles/app.scss +++ b/app/styles/app.scss @@ -466,6 +466,7 @@ md-toolbar { border-radius: 5px; transition: 0.1s all ease-in-out; position: relative; + overflow: auto; #dragHere { position: absolute; top: 27%; @@ -499,6 +500,7 @@ md-toolbar { } .playlistItem { + border-bottom: 1px solid #9E9E9E; height: 45px; font-family: 'Open Sans', sans-serif; padding: 5px; diff --git a/app/templates/components/controls/music-control.hbs b/app/templates/components/controls/music-control.hbs index 0b39444..0dae7f3 100644 --- a/app/templates/components/controls/music-control.hbs +++ b/app/templates/components/controls/music-control.hbs @@ -67,12 +67,12 @@ {{range-slider start=threshold orientation="vertical" range=beatOptions.threshold.range slide="thresholdChanged" pips=beatOptions.threshold.pips}} - Beat Threshold + Max. Beat Intensity {{range-slider start=decay orientation="vertical" step=beatOptions.decay.step range=beatOptions.decay.range slide="decayChanged" pips=beatOptions.decay.pips}} - Beat Decay + Beat Decay Rate