hooking up the lights :D :D :D

This commit is contained in:
lone-cloud 2015-09-17 23:51:43 -07:00
parent bb7e4bf115
commit 75d3bdf63f
4 changed files with 33 additions and 23 deletions

View file

@ -241,36 +241,43 @@ export default Em.Component.extend(musicControlMixin, {
threshold = this.get('threshold'), threshold = this.get('threshold'),
decay = this.get('decay'), decay = this.get('decay'),
frequency = this.get('frequency'), frequency = this.get('frequency'),
//briOff = function (i) { briOff = function (i) {
// Em.$.ajax(self.get('apiURL') + '/lights/' + i + '/state', { Em.$.ajax(self.get('apiURL') + '/lights/' + i + '/state', {
// data: JSON.stringify({'bri': 1, 'transitiontime': 0}), data: JSON.stringify({'bri': 1, 'transitiontime': 0}),
// contentType: 'application/json', contentType: 'application/json',
// type: 'PUT' type: 'PUT'
// }); });
//}, },
kick = dancer.createKick({ kick = dancer.createKick({
threshold: threshold, threshold: threshold,
decay: decay, decay: decay,
frequency: frequency, frequency: frequency,
onKick: function (mag) { onKick: function (mag) {
var activeLights = self.get('activeLights');
if (self.get('paused') === false) { if (self.get('paused') === false) {
//for (let i = 1; i <= 1; i++) { //work the lights
// Em.$.ajax(self.get('apiURL') + '/lights/' + i + '/state', { if(activeLights.length > 0){
// data: JSON.stringify({'bri': 254, 'transitiontime': 0}), var lastLightBopIndex = self.get('lastLightBopIndex'), light = self.get('activeLights')[lastLightBopIndex];
// contentType: 'application/json', Em.$.ajax(self.get('apiURL') + '/lights/' + light + '/state', {
// type: 'PUT' data: JSON.stringify({'bri': 254, 'transitiontime': 0}),
// }); contentType: 'application/json',
// type: 'PUT'
// setTimeout(briOff, 50, i); });
//}
self.set('paused', true); setTimeout(briOff, 50, light);
lastLightBopIndex = (lastLightBopIndex+1)%activeLights.length;
setTimeout(function () { self.setProperties({
self.set('paused', false); paused: true,
}, 150); lastLightBopIndex: lastLightBopIndex
});
setTimeout(function () {
self.set('paused', false);
}, 150);
}
//work the music beat area
if(self.get('speakerViewed')){ if(self.get('speakerViewed')){
self.send('clickSpeaker'); self.send('clickSpeaker');
} else { } else {

View file

@ -57,6 +57,7 @@ export default Em.Mixin.create({
maxBeatHistorySize: 30, maxBeatHistorySize: 30,
timeElapsed: 0, timeElapsed: 0,
timeTotal: 0, timeTotal: 0,
lastLightBopIndex: 0,
dragging: false, dragging: false,
draggingOverPlayListArea: false, draggingOverPlayListArea: false,

View file

@ -466,6 +466,7 @@ md-toolbar {
border-radius: 5px; border-radius: 5px;
transition: 0.1s all ease-in-out; transition: 0.1s all ease-in-out;
position: relative; position: relative;
overflow: auto;
#dragHere { #dragHere {
position: absolute; position: absolute;
top: 27%; top: 27%;
@ -499,6 +500,7 @@ md-toolbar {
} }
.playlistItem { .playlistItem {
border-bottom: 1px solid #9E9E9E;
height: 45px; height: 45px;
font-family: 'Open Sans', sans-serif; font-family: 'Open Sans', sans-serif;
padding: 5px; padding: 5px;

View file

@ -67,12 +67,12 @@
<span id="beatOptionGroup"> <span id="beatOptionGroup">
<span class="beatOption"> <span class="beatOption">
{{range-slider start=threshold orientation="vertical" range=beatOptions.threshold.range slide="thresholdChanged" pips=beatOptions.threshold.pips}} {{range-slider start=threshold orientation="vertical" range=beatOptions.threshold.range slide="thresholdChanged" pips=beatOptions.threshold.pips}}
Beat Threshold Max. Beat Intensity
</span> </span>
<span class="beatOption"> <span class="beatOption">
{{range-slider start=decay orientation="vertical" step=beatOptions.decay.step range=beatOptions.decay.range slide="decayChanged" pips=beatOptions.decay.pips}} {{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
</span> </span>
<span class="beatOption"> <span class="beatOption">