|
|
@ -192,8 +192,9 @@ HuesUI.prototype.updateVolume = function(vol) {}; |
|
|
|
HuesUI.prototype.setSongText = function() { |
|
|
|
HuesUI.prototype.setSongText = function() { |
|
|
|
var song = this.core.currentSong; |
|
|
|
var song = this.core.currentSong; |
|
|
|
|
|
|
|
|
|
|
|
if(!song) |
|
|
|
if(!song) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.songLink.textContent = song.title.toUpperCase(); |
|
|
|
this.songLink.textContent = song.title.toUpperCase(); |
|
|
|
this.songLink.href = song.source; |
|
|
|
this.songLink.href = song.source; |
|
|
@ -202,8 +203,9 @@ HuesUI.prototype.setSongText = function() { |
|
|
|
HuesUI.prototype.setImageText = function() { |
|
|
|
HuesUI.prototype.setImageText = function() { |
|
|
|
var image = this.core.currentImage; |
|
|
|
var image = this.core.currentImage; |
|
|
|
|
|
|
|
|
|
|
|
if(!image) |
|
|
|
if(!image) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var name = image.fullname ? image.fullname : image.name; |
|
|
|
var name = image.fullname ? image.fullname : image.name; |
|
|
|
|
|
|
|
|
|
|
@ -374,8 +376,9 @@ RetroUI.prototype.modeUpdated = function() { |
|
|
|
RetroUI.prototype.setImageText = function() { |
|
|
|
RetroUI.prototype.setImageText = function() { |
|
|
|
var image = this.core.currentImage; |
|
|
|
var image = this.core.currentImage; |
|
|
|
|
|
|
|
|
|
|
|
if(!image) |
|
|
|
if(!image) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.imageLink.textContent = "I=" + image.name.toUpperCase(); |
|
|
|
this.imageLink.textContent = "I=" + image.name.toUpperCase(); |
|
|
|
this.imageLink.href = image.source; |
|
|
|
this.imageLink.href = image.source; |
|
|
@ -666,6 +669,7 @@ ModernUI.prototype.toggleHide = function() { |
|
|
|
case 1: |
|
|
|
case 1: |
|
|
|
this.beatBar.className = "hues-m-beatbar hidden"; |
|
|
|
this.beatBar.className = "hues-m-beatbar hidden"; |
|
|
|
this.beatCenter.className = "hues-m-beatcenter hidden"; |
|
|
|
this.beatCenter.className = "hues-m-beatcenter hidden"; |
|
|
|
|
|
|
|
/* falls through */ |
|
|
|
case 0: |
|
|
|
case 0: |
|
|
|
this.controls.className = "hues-m-controls hidden"; |
|
|
|
this.controls.className = "hues-m-controls hidden"; |
|
|
|
this.hideRestore.className = "hues-m-hiderestore hidden"; |
|
|
|
this.hideRestore.className = "hues-m-hiderestore hidden"; |
|
|
@ -737,8 +741,9 @@ ModernUI.prototype.resizeImage = function() { |
|
|
|
ModernUI.prototype.setSongText = function() { |
|
|
|
ModernUI.prototype.setSongText = function() { |
|
|
|
HuesUI.prototype.setSongText.call(this); |
|
|
|
HuesUI.prototype.setSongText.call(this); |
|
|
|
|
|
|
|
|
|
|
|
if(!this.core.currentSong) |
|
|
|
if(!this.core.currentSong) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.resizeSong(); |
|
|
|
this.resizeSong(); |
|
|
|
}; |
|
|
|
}; |
|
|
@ -746,8 +751,9 @@ ModernUI.prototype.setSongText = function() { |
|
|
|
ModernUI.prototype.setImageText = function() { |
|
|
|
ModernUI.prototype.setImageText = function() { |
|
|
|
HuesUI.prototype.setImageText.call(this); |
|
|
|
HuesUI.prototype.setImageText.call(this); |
|
|
|
|
|
|
|
|
|
|
|
if(!this.core.currentImage) |
|
|
|
if(!this.core.currentImage) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.resizeImage(); |
|
|
|
this.resizeImage(); |
|
|
|
}; |
|
|
|
}; |
|
|
@ -760,7 +766,12 @@ function XmasUI() { |
|
|
|
this.controls.removeChild(this.rightInfo); |
|
|
|
this.controls.removeChild(this.rightInfo); |
|
|
|
this.controls.removeChild(this.leftInfo); |
|
|
|
this.controls.removeChild(this.leftInfo); |
|
|
|
|
|
|
|
|
|
|
|
this.leftBox = this.rightBox = this.hueName = this.xBlur = this.yBlur = this.timer = null; |
|
|
|
this.leftBox = null; |
|
|
|
|
|
|
|
this.rightBox = null; |
|
|
|
|
|
|
|
this.hueName = null; |
|
|
|
|
|
|
|
this.xBlur = null; |
|
|
|
|
|
|
|
this.yBlur = null; |
|
|
|
|
|
|
|
this.timer = null; |
|
|
|
|
|
|
|
|
|
|
|
this.controls.className = "hues-x-controls"; |
|
|
|
this.controls.className = "hues-x-controls"; |
|
|
|
this.beatBar.className = "hues-x-beatbar"; |
|
|
|
this.beatBar.className = "hues-x-beatbar"; |
|
|
@ -772,38 +783,35 @@ function XmasUI() { |
|
|
|
|
|
|
|
|
|
|
|
var left = document.createElement("div"); |
|
|
|
var left = document.createElement("div"); |
|
|
|
left.className = "hues-x-wiresleft"; |
|
|
|
left.className = "hues-x-wiresleft"; |
|
|
|
for(var i = 0; i < xleft.length; i++) { |
|
|
|
xleft.forEach(function(l, i, a) { |
|
|
|
var l = xleft[i]; |
|
|
|
|
|
|
|
var light = this.newLight(l, left); |
|
|
|
var light = this.newLight(l, left); |
|
|
|
light.style.transform = "rotate(" + l.angle + "deg)"; |
|
|
|
light.style.transform = "rotate(" + l.angle + "deg)"; |
|
|
|
light.style.left = l.x + "px"; |
|
|
|
light.style.left = l.x + "px"; |
|
|
|
light.style.top = l.y + "px"; |
|
|
|
light.style.top = l.y + "px"; |
|
|
|
this.lights.push(light); |
|
|
|
this.lights.push(light); |
|
|
|
} |
|
|
|
}, this); |
|
|
|
|
|
|
|
|
|
|
|
var right = document.createElement("div"); |
|
|
|
var right = document.createElement("div"); |
|
|
|
right.className = "hues-x-wiresright"; |
|
|
|
right.className = "hues-x-wiresright"; |
|
|
|
for(var i = 0; i < xright.length; i++) { |
|
|
|
xright.forEach(function(l, i, a) { |
|
|
|
var l = xright[i]; |
|
|
|
|
|
|
|
var light = this.newLight(l, right); |
|
|
|
var light = this.newLight(l, right); |
|
|
|
light.style.transform = "rotate(" + (-l.angle) + "deg)"; |
|
|
|
light.style.transform = "rotate(" + (-l.angle) + "deg)"; |
|
|
|
light.style.right = l.x + "px"; |
|
|
|
light.style.right = l.x + "px"; |
|
|
|
light.style.top = l.y + "px"; |
|
|
|
light.style.top = l.y + "px"; |
|
|
|
this.lights.push(light); |
|
|
|
this.lights.push(light); |
|
|
|
} |
|
|
|
}, this); |
|
|
|
|
|
|
|
|
|
|
|
var bottomHelper = document.createElement("div"); |
|
|
|
var bottomHelper = document.createElement("div"); |
|
|
|
bottomHelper.className = "hues-x-wiresbottomhelper"; |
|
|
|
bottomHelper.className = "hues-x-wiresbottomhelper"; |
|
|
|
var bottom = document.createElement("div"); |
|
|
|
var bottom = document.createElement("div"); |
|
|
|
bottom.className = "hues-x-wiresbottom"; |
|
|
|
bottom.className = "hues-x-wiresbottom"; |
|
|
|
for(var i = 0; i < xbottom.length; i++) { |
|
|
|
xbottom.forEach(function(l, i, a) { |
|
|
|
var l = xbottom[i]; |
|
|
|
|
|
|
|
var light = this.newLight(l, bottom); |
|
|
|
var light = this.newLight(l, bottom); |
|
|
|
light.style.transform = "rotate(" + l.angle + "deg)"; |
|
|
|
light.style.transform = "rotate(" + l.angle + "deg)"; |
|
|
|
light.style.left = l.x + "px"; |
|
|
|
light.style.left = l.x + "px"; |
|
|
|
light.style.bottom = l.y + "px"; |
|
|
|
light.style.bottom = l.y + "px"; |
|
|
|
this.lights.push(light); |
|
|
|
this.lights.push(light); |
|
|
|
} |
|
|
|
}, this); |
|
|
|
|
|
|
|
|
|
|
|
wires.appendChild(left); |
|
|
|
wires.appendChild(left); |
|
|
|
wires.appendChild(right); |
|
|
|
wires.appendChild(right); |
|
|
@ -877,20 +885,19 @@ XmasUI.prototype.newLight = function(l, parent) { |
|
|
|
XmasUI.prototype.beat = function() { |
|
|
|
XmasUI.prototype.beat = function() { |
|
|
|
ModernUI.prototype.beat.call(this); |
|
|
|
ModernUI.prototype.beat.call(this); |
|
|
|
if(this.currentBeat != ".") { |
|
|
|
if(this.currentBeat != ".") { |
|
|
|
for(var i = 0; i < this.lights.length; i++) { |
|
|
|
this.lights.forEach(function(light, i, a) { |
|
|
|
var l = this.lights[i]; |
|
|
|
|
|
|
|
switch(this.currentBeat) { |
|
|
|
switch(this.currentBeat) { |
|
|
|
case ": ":
|
|
|
|
case ": ":
|
|
|
|
this.lightOn(l); |
|
|
|
this.lightOn(light); |
|
|
|
this.lightRecolour(l); |
|
|
|
this.lightRecolour(light); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "+":
|
|
|
|
case "+":
|
|
|
|
this.lightFadeOut(l); |
|
|
|
this.lightFadeOut(light); |
|
|
|
break; |
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
this.randomLight(this.lights[i]); |
|
|
|
this.randomLight(light); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}, this); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -902,6 +909,7 @@ XmasUI.prototype.toggleHide = function() { |
|
|
|
case 1: |
|
|
|
case 1: |
|
|
|
this.beatBar.className = "hues-x-beatbar hidden"; |
|
|
|
this.beatBar.className = "hues-x-beatbar hidden"; |
|
|
|
this.beatCenter.className = "hues-m-beatcenter hidden"; |
|
|
|
this.beatCenter.className = "hues-m-beatcenter hidden"; |
|
|
|
|
|
|
|
/* falls through */ |
|
|
|
case 0: |
|
|
|
case 0: |
|
|
|
this.controls.className = "hues-x-controls hidden"; |
|
|
|
this.controls.className = "hues-x-controls hidden"; |
|
|
|
} |
|
|
|
} |
|
|
@ -912,6 +920,7 @@ XmasUI.prototype.setColourText = function(colour) {}; |
|
|
|
XmasUI.prototype.blurUpdated = function(x, y) {}; |
|
|
|
XmasUI.prototype.blurUpdated = function(x, y) {}; |
|
|
|
XmasUI.prototype.updateTime = function(time) {}; |
|
|
|
XmasUI.prototype.updateTime = function(time) {}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Positions and angles for the Xmas lights
|
|
|
|
var xleft = [ |
|
|
|
var xleft = [ |
|
|
|
{"angle": 122.529582194, "x": 19.4, "y": -19.35}, |
|
|
|
{"angle": 122.529582194, "x": 19.4, "y": -19.35}, |
|
|
|
{"angle": 92.5309436511, "x": 25.4, "y": 38.7}, |
|
|
|
{"angle": 92.5309436511, "x": 25.4, "y": 38.7}, |
|
|
|