Trying out locally
This commit is contained in:
parent
0239245307
commit
29c023c343
4 changed files with 14 additions and 19 deletions
|
|
@ -415,7 +415,9 @@ export default Em.Component.extend(musicControlMixin, visualizerMixin, {
|
|||
self.simulateKick(mag);
|
||||
}
|
||||
}
|
||||
});
|
||||
}),
|
||||
Store = window.Locally.Store,
|
||||
locally = new Store();
|
||||
|
||||
kick.on();
|
||||
|
||||
|
|
@ -440,7 +442,8 @@ export default Em.Component.extend(musicControlMixin, visualizerMixin, {
|
|||
|
||||
this.setProperties({
|
||||
dancer: dancer,
|
||||
kick: kick
|
||||
kick: kick,
|
||||
locally: locally
|
||||
});
|
||||
|
||||
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;
|
||||
|
|
@ -450,17 +453,8 @@ export default Em.Component.extend(musicControlMixin, visualizerMixin, {
|
|||
}
|
||||
|
||||
['volume', 'shuffle', 'repeat', 'volumeMuted', 'threshold', 'decay', 'frequency', 'speakerViewed', 'transitionTime', 'randomTransition', 'playerBottomDisplayed', 'onBeatBriAndColor', 'usingMic'].forEach(function (item) {
|
||||
if (localStorage.getItem('huegasm.' + item)) {
|
||||
var itemVal = localStorage.getItem('huegasm.' + item);
|
||||
if (item === 'repeat' || item === 'volume' || item === 'decay' || item === 'threshold' || item === 'transitionTime') {
|
||||
itemVal = Number(itemVal);
|
||||
} else if(item === 'frequency') {
|
||||
itemVal = itemVal.split(',').map(function(val){return Number(val);});
|
||||
} else {
|
||||
itemVal = (itemVal === 'true');
|
||||
}
|
||||
|
||||
self.send(item+'Changed', itemVal);
|
||||
if (locally.get('huegasm.' + item)) {
|
||||
self.send(item+'Changed', locally.get('huegasm.' + item));
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ export default Em.Mixin.create({
|
|||
dragLeaveTimeoutHandle: null,
|
||||
visualizationsDisplayed: false,
|
||||
audioStream: null,
|
||||
locallly: null,
|
||||
|
||||
notUsingMic: Em.computed.not('usingMic'),
|
||||
playQueueEmpty: Em.computed.empty('playQueue'),
|
||||
|
|
@ -148,7 +149,7 @@ export default Em.Mixin.create({
|
|||
}
|
||||
|
||||
this.set(name, value);
|
||||
localStorage.setItem('huegasm.' + name, value);
|
||||
this.get('locally').set('huegasm.' + name, value);
|
||||
},
|
||||
|
||||
incrementElapseTimeHandle: null,
|
||||
|
|
@ -224,12 +225,12 @@ export default Em.Mixin.create({
|
|||
}.property('volumeMuted', 'volume'),
|
||||
|
||||
onSpeakerViewedChange: function(){
|
||||
localStorage.setItem('huegasm.speakerViewed', this.get('speakerViewed'));
|
||||
this.get('locally').set('huegasm.speakerViewed', this.get('speakerViewed'));
|
||||
this.get('beatHistory').clear();
|
||||
}.observes('speakerViewed'),
|
||||
|
||||
onOptionChange: function(self, option){
|
||||
localStorage.setItem('huegasm.' + option, this.get(option));
|
||||
this.get('locally').set('huegasm.' + option, this.get(option));
|
||||
}.observes('randomTransition', 'onBeatBriAndColor'),
|
||||
|
||||
onRepeatChange: function () {
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
"jquery": "~2.1.4",
|
||||
"jquery-mousewheel": "~3.1.13",
|
||||
"loader.js": "ember-cli/loader.js#3.2.0",
|
||||
"locallyjs": "~0.3.1",
|
||||
"matchMedia": "~0.2.0",
|
||||
"nouislider": "^8.0.1",
|
||||
"qunit": "~1.18.0",
|
||||
|
|
@ -22,8 +23,6 @@
|
|||
},
|
||||
"resolutions": {
|
||||
"ember": "~2.0.2",
|
||||
"jquery": "~2.1.4",
|
||||
"ember-qunit": "0.4.9",
|
||||
"qunit": "~1.18.0"
|
||||
"jquery": "~2.1.4"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ module.exports = function(defaults) {
|
|||
app.import('bower_components/JavaScript-ID3-Reader/dist/id3-minimized.js');
|
||||
app.import('bower_components/jquery-mousewheel/jquery.mousewheel.js');
|
||||
app.import('bower_components/three.js/three.js');
|
||||
app.import('bower_components/locallyjs/dist/locally.min.js');
|
||||
|
||||
// Use `app.import` to add additional libraries to the generated
|
||||
// output files.
|
||||
|
|
|
|||
Reference in a new issue