working on dimmer
This commit is contained in:
parent
08b609d56e
commit
206eaeb413
4 changed files with 62 additions and 21 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
{{#if ready}}
|
{{#if ready}}
|
||||||
<div class="row navigation antiDimmer">
|
<div class="row navigation">
|
||||||
<div class="col-lg-4 col-lg-offset-4 col-xs-6 col-xs-offset-3">
|
<div class="col-lg-4 col-lg-offset-4 col-xs-6 col-xs-offset-3">
|
||||||
{{#each tabData as |tab|}}
|
{{#each tabData as |tab|}}
|
||||||
<span class="navigationItem cursorPointer {{if tab.selected "active"}} text-uppercase" {{action "changeTab" tab.name}}>{{tab.name}}</span>
|
<span class="navigationItem cursorPointer {{if tab.selected "active"}} text-uppercase" {{action "changeTab" tab.name}}>{{tab.name}}</span>
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
<span class="bootstrapTooltip" data-toggle="tooltip" data-placement="bottom auto" data-title="Application Settings" {{action "toggleAppSettings"}}>{{paper-icon icon="settings"}}</span>
|
<span class="bootstrapTooltip" data-toggle="tooltip" data-placement="bottom auto" data-title="Application Settings" {{action "toggleAppSettings"}}>{{paper-icon icon="settings"}}</span>
|
||||||
|
|
||||||
{{#if appSettingsDisplayed}}
|
{{#if appSettingsDisplayed}}
|
||||||
<div id="appSettings" class="antiDimmer">
|
<div id="appSettings">
|
||||||
<div class="appSettingsItem" {{action "clearBridge"}}>Switch bridge</div>
|
<div class="appSettingsItem" {{action "clearBridge"}}>Switch bridge</div>
|
||||||
<div class="warn appSettingsItem" {{action "clearAllSettings"}}>Clear application settings</div>
|
<div class="warn appSettingsItem" {{action "clearAllSettings"}}>Clear application settings</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,9 @@ export default Em.Component.extend(musicControlMixin, visualizerMixin, {
|
||||||
}.observes('active'),
|
}.observes('active'),
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
toggleDimming: function(){
|
||||||
|
this.toggleProperty('dimmerEnabled');
|
||||||
|
},
|
||||||
useLocalAudio: function(){
|
useLocalAudio: function(){
|
||||||
var audioStream = this.get('audioStream');
|
var audioStream = this.get('audioStream');
|
||||||
this.changePlayerControl('audioMode', 0);
|
this.changePlayerControl('audioMode', 0);
|
||||||
|
|
@ -113,10 +116,12 @@ export default Em.Component.extend(musicControlMixin, visualizerMixin, {
|
||||||
}
|
}
|
||||||
|
|
||||||
dancer.play();
|
dancer.play();
|
||||||
this.setProperties({
|
|
||||||
dimmerOn: true,
|
if(this.get('dimmerEnabled')){
|
||||||
incrementElapseTimeHandle: window.setInterval(this.incrementElapseTime.bind(this), 1000)
|
this.set('dimmerOn', true);
|
||||||
});
|
}
|
||||||
|
|
||||||
|
this.setProperties('incrementElapseTimeHandle', window.setInterval(this.incrementElapseTime.bind(this), 1000));
|
||||||
}
|
}
|
||||||
this.toggleProperty('playing');
|
this.toggleProperty('playing');
|
||||||
}
|
}
|
||||||
|
|
@ -455,18 +460,18 @@ export default Em.Component.extend(musicControlMixin, visualizerMixin, {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
dancer.bind('update', function(){
|
//dancer.bind('update', function(){
|
||||||
var waveform = this.getWaveform(), spectrum = this.getSpectrum(), sumS = 0, sumW = 0;
|
// var waveform = this.getWaveform(), spectrum = this.getSpectrum(), sumS = 0, sumW = 0;
|
||||||
for (let i = 0, l = spectrum.length; i < l && i < 512; i++ ) {
|
// for (let i = 0, l = spectrum.length; i < l && i < 512; i++ ) {
|
||||||
sumS += spectrum[i];
|
// sumS += spectrum[i];
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
for (let i = 0, l = waveform.length; i < l && i < 512; i++ ) {
|
// for (let i = 0, l = waveform.length; i < l && i < 512; i++ ) {
|
||||||
sumW += waveform[i];
|
// sumW += waveform[i];
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
//console.log('sumW: ' + sumW + ', sumS: ' + sumS);
|
// //console.log('sumW: ' + sumW + ', sumS: ' + sumS);
|
||||||
});
|
//});
|
||||||
|
|
||||||
this.setProperties({
|
this.setProperties({
|
||||||
dancer: dancer,
|
dancer: dancer,
|
||||||
|
|
@ -509,6 +514,12 @@ export default Em.Component.extend(musicControlMixin, visualizerMixin, {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Em.$(document).on('mousedown', function(event){
|
||||||
|
if(Em.$('#musicTab').has(event.target).length === 0 && self.get('dimmerEnabled')){
|
||||||
|
self.set('dimmerEnabled', false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// control the volume by scrolling up/down
|
// control the volume by scrolling up/down
|
||||||
Em.$('#playerArea').on('mousewheel', function(event) {
|
Em.$('#playerArea').on('mousewheel', function(event) {
|
||||||
if(self.get('playQueueNotEmpty')) {
|
if(self.get('playQueueNotEmpty')) {
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,7 @@ export default Em.Mixin.create({
|
||||||
visualizationsDisplayed: false,
|
visualizationsDisplayed: false,
|
||||||
audioStream: null,
|
audioStream: null,
|
||||||
dimmerOn: false,
|
dimmerOn: false,
|
||||||
|
dimmerEnabled: false,
|
||||||
|
|
||||||
notFoundHtml: '<div class="alert alert-danger" role="alert">A microphone was not found.</div>',
|
notFoundHtml: '<div class="alert alert-danger" role="alert">A microphone was not found.</div>',
|
||||||
|
|
||||||
|
|
@ -210,6 +211,26 @@ export default Em.Mixin.create({
|
||||||
return classes;
|
return classes;
|
||||||
}.property('dragging', 'draggingOverPlayListArea', 'dimmerOn'),
|
}.property('dragging', 'draggingOverPlayListArea', 'dimmerOn'),
|
||||||
|
|
||||||
|
dimmingClass: function(){
|
||||||
|
var classes = 'playerControllIcon';
|
||||||
|
|
||||||
|
if(this.get('dimmerEnabled')){
|
||||||
|
classes += ' active';
|
||||||
|
}
|
||||||
|
|
||||||
|
return classes;
|
||||||
|
}.property('dimmerEnabled'),
|
||||||
|
|
||||||
|
volumeMutedClass: function(){
|
||||||
|
var classes = 'playerControllIcon volumeButton';
|
||||||
|
|
||||||
|
if(this.get('volumeMuted')){
|
||||||
|
classes += ' active';
|
||||||
|
}
|
||||||
|
|
||||||
|
return classes;
|
||||||
|
}.property('volumeMuted'),
|
||||||
|
|
||||||
usingLocalAudioClass: function() {
|
usingLocalAudioClass: function() {
|
||||||
return this.get('usingLocalAudio') ? 'playerControllIcon active' : 'playerControllIcon';
|
return this.get('usingLocalAudio') ? 'playerControllIcon active' : 'playerControllIcon';
|
||||||
}.property('usingLocalAudio'),
|
}.property('usingLocalAudio'),
|
||||||
|
|
@ -226,7 +247,7 @@ export default Em.Mixin.create({
|
||||||
return this.get('shuffle') ? 'playerControllIcon active' : 'playerControllIcon';
|
return this.get('shuffle') ? 'playerControllIcon active' : 'playerControllIcon';
|
||||||
}.property('shuffle'),
|
}.property('shuffle'),
|
||||||
|
|
||||||
volumeClass: function () {
|
volumeIcon: function () {
|
||||||
var volume = this.get('volume');
|
var volume = this.get('volume');
|
||||||
|
|
||||||
if (this.get('volumeMuted')) {
|
if (this.get('volumeMuted')) {
|
||||||
|
|
@ -240,6 +261,15 @@ export default Em.Mixin.create({
|
||||||
}
|
}
|
||||||
}.property('volumeMuted', 'volume'),
|
}.property('volumeMuted', 'volume'),
|
||||||
|
|
||||||
|
onDimmerEnabledChange: function(){
|
||||||
|
if(!this.get('dimmerEnabled')){
|
||||||
|
this.set('dimmerOn', false);
|
||||||
|
} else if(this.get('playing')){
|
||||||
|
this.set('dimmerOn', true);
|
||||||
|
}
|
||||||
|
|
||||||
|
}.observes('dimmerEnabled'),
|
||||||
|
|
||||||
onSpeakerViewedChange: function(){
|
onSpeakerViewedChange: function(){
|
||||||
localStorage.setItem('huegasm.speakerViewed', this.get('speakerViewed'));
|
localStorage.setItem('huegasm.speakerViewed', this.get('speakerViewed'));
|
||||||
this.get('beatHistory').clear();
|
this.get('beatHistory').clear();
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
data-title="Next" {{action "next"}}>{{paper-icon icon="skip-next" action="" class="playerControllIcon"}}</span><!--
|
data-title="Next" {{action "next"}}>{{paper-icon icon="skip-next" action="" class="playerControllIcon"}}</span><!--
|
||||||
-->{{/if}}<!--
|
-->{{/if}}<!--
|
||||||
--><span data-toggle="tooltip" data-placement="top" class="bootstrapTooltip" id="volumeMutedTooltip"
|
--><span data-toggle="tooltip" data-placement="top" class="bootstrapTooltip" id="volumeMutedTooltip"
|
||||||
data-title={{volumeMutedTooltipTxt}} {{action "volumeMutedChanged"}}>{{paper-icon icon=volumeClass class="playerControllIcon volumeButton"}}</span><!--
|
data-title={{volumeMutedTooltipTxt}} {{action "volumeMutedChanged"}}>{{paper-icon icon=volumeIcon class=volumeMutedClass}}</span><!--
|
||||||
-->{{range-slider start=volume min=0 max=100 slide="volumeChanged" id="volumeBar"}}
|
-->{{range-slider start=volume min=0 max=100 slide="volumeChanged" id="volumeBar"}}
|
||||||
|
|
||||||
<div id="playerTimeControls">{{timeElapsedTxt}} / {{timeTotalTxt}}</div>
|
<div id="playerTimeControls">{{timeElapsedTxt}} / {{timeTotalTxt}}</div>
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
<span class="pull-right">
|
<span class="pull-right">
|
||||||
<span data-toggle="tooltip" data-placement="top" class="bootstrapTooltip"
|
<span data-toggle="tooltip" data-placement="top" class="bootstrapTooltip"
|
||||||
data-title="Dim background on play" {{action "toggleDimming"}}>{{paper-icon icon="brightness-high" class="playerControllIcon"}}
|
data-title="Dim on play" {{action "toggleDimming"}}>{{paper-icon icon="brightness-high" class=dimmingClass}}
|
||||||
</span>
|
</span>
|
||||||
<span data-toggle="tooltip" data-placement="top" class="bootstrapTooltip"
|
<span data-toggle="tooltip" data-placement="top" class="bootstrapTooltip"
|
||||||
data-title="Visualizations" {{action "toggleVisualizations"}}>{{paper-icon icon="remove-red-eye" class="playerControllIcon"}}
|
data-title="Visualizations" {{action "toggleVisualizations"}}>{{paper-icon icon="remove-red-eye" class="playerControllIcon"}}
|
||||||
|
|
|
||||||
Reference in a new issue