CC-3725: Make it so that ON-AIR light never goes off between tracks.
-fixed
This commit is contained in:
parent
57ab56216e
commit
88100e79ad
1 changed files with 14 additions and 2 deletions
|
@ -20,6 +20,11 @@ var live_dj_on_air = false;
|
||||||
var scheduled_play_on_air = false;
|
var scheduled_play_on_air = false;
|
||||||
var scheduled_play_source = false;
|
var scheduled_play_source = false;
|
||||||
|
|
||||||
|
//keep track of how many UI refreshes the ON-AIR light has been off for.
|
||||||
|
//For example, the uiUpdateInterval is every 200ms, so if onAirOffIterations
|
||||||
|
//is 25, then that means 5 seconds have gone by.
|
||||||
|
var onAirOffIterations = 0;
|
||||||
|
|
||||||
//var timezoneOffset = 0;
|
//var timezoneOffset = 0;
|
||||||
|
|
||||||
//set to "development" if we are developing :). Useful to disable alerts
|
//set to "development" if we are developing :). Useful to disable alerts
|
||||||
|
@ -328,6 +333,13 @@ function parseSwitchStatus(obj){
|
||||||
function controlOnAirLight(){
|
function controlOnAirLight(){
|
||||||
if ((scheduled_play_on_air && scheduled_play_source) || live_dj_on_air || master_dj_on_air) {
|
if ((scheduled_play_on_air && scheduled_play_source) || live_dj_on_air || master_dj_on_air) {
|
||||||
$('#on-air-info').attr("class", "on-air-info on");
|
$('#on-air-info').attr("class", "on-air-info on");
|
||||||
|
onAirOffIterations = 0;
|
||||||
|
} else if (onAirOffIterations < 15) {
|
||||||
|
//if less than 3 seconds have gone by (< 15 executions of this function)
|
||||||
|
//then keep the ON-AIR light on. Only after at least 3 seconds have gone by,
|
||||||
|
//should we be allowed to turn it off. This is to stop the light from temporarily turning
|
||||||
|
//off between tracks: CC-3725
|
||||||
|
onAirOffIterations++;
|
||||||
} else {
|
} else {
|
||||||
$('#on-air-info').attr("class", "on-air-info off");
|
$('#on-air-info').attr("class", "on-air-info off");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue