a few mic mode things, starting to switch to pods
This commit is contained in:
parent
e320cf25a7
commit
1b8a21541e
3 changed files with 22 additions and 11 deletions
|
|
@ -5,5 +5,6 @@
|
||||||
|
|
||||||
Setting `disableAnalytics` to true will prevent any data from being sent.
|
Setting `disableAnalytics` to true will prevent any data from being sent.
|
||||||
*/
|
*/
|
||||||
"disableAnalytics": true
|
"disableAnalytics": true,
|
||||||
|
"usePods": true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,13 +18,17 @@ export default Em.Component.extend(musicControlMixin, visualizerMixin, {
|
||||||
var usingMic = this.get('usingMic');
|
var usingMic = this.get('usingMic');
|
||||||
|
|
||||||
if(!usingMic){
|
if(!usingMic){
|
||||||
this.startUsingMic(!usingMic);
|
this.startUsingMic();
|
||||||
} else {
|
} else {
|
||||||
this.changePlayerControl('usingMic', !usingMic);
|
this.changePlayerControl('usingMic', !usingMic);
|
||||||
|
|
||||||
|
this.get('audioStream').stop();
|
||||||
if(this.get('playQueuePointer') !== -1) {
|
if(this.get('playQueuePointer') !== -1) {
|
||||||
this.send('goToSong',this.get('playQueuePointer'));
|
this.send('goToSong',this.get('playQueuePointer'));
|
||||||
this.volumeChanged(this.get('volume'));
|
this.send('volumeChanged', this.get('volume'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
document.title = 'Huegasm';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
slideTogglePlayerBottom(){
|
slideTogglePlayerBottom(){
|
||||||
|
|
@ -187,9 +191,9 @@ export default Em.Component.extend(musicControlMixin, visualizerMixin, {
|
||||||
},
|
},
|
||||||
usingMicChanged(value){
|
usingMicChanged(value){
|
||||||
if(value) {
|
if(value) {
|
||||||
this.startUsingMic(value);
|
this.startUsingMic();
|
||||||
} else {
|
} else {
|
||||||
this.set('usingMic', value);
|
this.set('usingMic', false);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
clickSpeaker(){
|
clickSpeaker(){
|
||||||
|
|
@ -238,23 +242,25 @@ export default Em.Component.extend(musicControlMixin, visualizerMixin, {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
startUsingMic(value) {
|
startUsingMic() {
|
||||||
navigator.getUserMedia(
|
navigator.getUserMedia(
|
||||||
{audio: true},
|
{audio: true},
|
||||||
(stream) => {
|
(stream) => {
|
||||||
this.changePlayerControl('usingMic', value);
|
this.changePlayerControl('usingMic', true);
|
||||||
var dancer = this.get('dancer');
|
var dancer = this.get('dancer');
|
||||||
|
|
||||||
if(dancer.audio) {
|
if(dancer.audio && dancer.audio.pause) {
|
||||||
dancer.pause();
|
dancer.pause();
|
||||||
clearInterval(this.get('incrementElapseTimeHandle'));
|
clearInterval(this.get('incrementElapseTimeHandle'));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setProperties({
|
this.setProperties({
|
||||||
volumeCache: this.get('volume'),
|
volumeCache: this.get('volume'),
|
||||||
playing: true
|
playing: true,
|
||||||
|
audioStream: stream
|
||||||
});
|
});
|
||||||
|
|
||||||
|
document.title = 'Listening to Mic - Huegasm';
|
||||||
dancer.load(stream, true);
|
dancer.load(stream, true);
|
||||||
dancer.setVolume(0);
|
dancer.setVolume(0);
|
||||||
},
|
},
|
||||||
|
|
@ -288,7 +294,10 @@ export default Em.Component.extend(musicControlMixin, visualizerMixin, {
|
||||||
clearCurrentAudio(resetPointer) {
|
clearCurrentAudio(resetPointer) {
|
||||||
var dancer = this.get('dancer');
|
var dancer = this.get('dancer');
|
||||||
|
|
||||||
dancer.pause();
|
if(dancer.audio.pause) {
|
||||||
|
dancer.pause();
|
||||||
|
}
|
||||||
|
|
||||||
clearInterval(this.get('incrementElapseTimeHandle'));
|
clearInterval(this.get('incrementElapseTimeHandle'));
|
||||||
|
|
||||||
if(resetPointer){
|
if(resetPointer){
|
||||||
|
|
@ -426,7 +435,7 @@ export default Em.Component.extend(musicControlMixin, visualizerMixin, {
|
||||||
sumW += waveform[i];
|
sumW += waveform[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('sumW: ' + sumW + ', sumS: ' + sumS)
|
//console.log('sumW: ' + sumW + ', sumS: ' + sumS);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.setProperties({
|
this.setProperties({
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,7 @@ export default Em.Mixin.create({
|
||||||
draggingOverPlayListArea: false,
|
draggingOverPlayListArea: false,
|
||||||
dragLeaveTimeoutHandle: null,
|
dragLeaveTimeoutHandle: null,
|
||||||
visualizationsDisplayed: false,
|
visualizationsDisplayed: false,
|
||||||
|
audioStream: null,
|
||||||
|
|
||||||
notUsingMic: Em.computed.not('usingMic'),
|
notUsingMic: Em.computed.not('usingMic'),
|
||||||
playQueueEmpty: Em.computed.empty('playQueue'),
|
playQueueEmpty: Em.computed.empty('playQueue'),
|
||||||
|
|
|
||||||
Reference in a new issue