Setting up a booteffect/color that is visible after Hyperion startup. Configure a background effect/color which is active, when all capture sources are disabled (also temporarily via Kodi Watch)
The color dot switches every x seconds the color (red, green), at the same time your leds switch too. Answer the questions at the bottom to check/correct your byte order.
+
+
+
+
+
s
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -262,6 +299,7 @@
+
diff --git a/assets/webconfig/js/content_effects.js b/assets/webconfig/js/content_effects.js
index 12be9da9..80166bb4 100644
--- a/assets/webconfig/js/content_effects.js
+++ b/assets/webconfig/js/content_effects.js
@@ -1,17 +1,114 @@
-var conf_editor = null;
+var olddEffects = [];
+var editorReady = false;
+var effects_editor = null;
+var confFgEff = parsedConfJSON.foregroundEffect.effect;
+var confBgEff = parsedConfJSON.backgroundEffect.effect;
+var foregroundEffect_editor = null;
+var backgroundEffect_editor = null;
+
$(hyperion).one("cmd-config-getschema", function(event) {
schema = parsedConfSchemaJSON.properties;
- conf_editor = createJsonEditor('editor_container', {
- effects : schema.effects,
- initialEffect : schema.initialEffect
- }, true);
+ effects_editor = createJsonEditor('editor_container_effects', {
+ effects : schema.effects
+ }, true, true);
- $('#btn_submit').off().on('click',function() {
- requestWriteConfig(conf_editor.getValue());
+ foregroundEffect_editor = createJsonEditor('editor_container_foregroundEffect', {
+ foregroundEffect : schema.foregroundEffect
+ }, true, true);
+
+ backgroundEffect_editor = createJsonEditor('editor_container_backgroundEffect', {
+ backgroundEffect : schema.backgroundEffect
+ }, true, true);
+
+
+ effects_editor.on('ready',function() {
+ editorReady = true;
});
+
+ foregroundEffect_editor.on('change',function() {
+ var type = foregroundEffect_editor.getEditor('root.foregroundEffect.type');
+ if(type.value == "color")
+ {
+ foregroundEffect_editor.getEditor('root.foregroundEffect.effect').disable();
+ foregroundEffect_editor.getEditor('root.foregroundEffect.color').enable();
+ }
+ else
+ {
+ foregroundEffect_editor.getEditor('root.foregroundEffect.effect').enable();
+ foregroundEffect_editor.getEditor('root.foregroundEffect.color').disable();
+ }
+ });
+
+ backgroundEffect_editor.on('change',function() {
+ var type = backgroundEffect_editor.getEditor('root.backgroundEffect.type');
+ if(type.value == "color")
+ {
+ backgroundEffect_editor.getEditor('root.backgroundEffect.effect').disable();
+ backgroundEffect_editor.getEditor('root.backgroundEffect.color').enable();
+ }
+ else
+ {
+ backgroundEffect_editor.getEditor('root.backgroundEffect.effect').enable();
+ backgroundEffect_editor.getEditor('root.backgroundEffect.color').disable();
+ }
+ });
+
+ $('#btn_submit_effects').off().on('click',function() {
+ requestWriteConfig(effects_editor.getValue());
+ });
+
+ $('#btn_submit_foregroundEffect').off().on('click',function() {
+ //requestWriteConfig(foregroundEffect_editor.getValue());
+ console.log(foregroundEffect_editor.getValue());
+ });
+
+ $('#btn_submit_backgroundEffect').off().on('click',function() {
+ //requestWriteConfig(backgroundEffect_editor.getValue());
+ console.log(backgroundEffect_editor.getValue());
+ });
+
+ if(showOptHelp)
+ {
+ $('#opt_expl_effects').html(createHelpTable(schema.effects.properties, ''+$.i18n("edt_conf_effp_heading_title")+' '+$.i18n("conf_helptable_expl")));
+ $('#opt_expl_foregroundEffect').html(createHelpTable(schema.foregroundEffect.properties, ''+$.i18n("edt_conf_fge_heading_title")+' '+$.i18n("conf_helptable_expl")));
+ $('#opt_expl_backgroundEffect').html(createHelpTable(schema.backgroundEffect.properties, ''+$.i18n("edt_conf_bge_heading_title")+' '+$.i18n("conf_helptable_expl")));
+ }
});
+function updateEffectlist(event){
+ if(editorReady)
+ {
+ var newEffects = event.response.info.effects;
+ if (newEffects.length != olddEffects.length)
+ {
+ $('#root_foregroundEffect_effect').html('');
+ var usrEffArr = [];
+ var sysEffArr = [];
+
+ for(i = 0; i < newEffects.length; i++)
+ {
+ var effectName = newEffects[i].name;
+ if(!/^\:/.test(newEffects[i].file))
+ usrEffArr.push(effectName);
+ else
+ sysEffArr.push(effectName);
+ }
+ $('#root_foregroundEffect_effect').append(createSel(usrEffArr, $.i18n('remote_optgroup_usreffets')));
+ $('#root_foregroundEffect_effect').append(createSel(sysEffArr, $.i18n('remote_optgroup_syseffets')));
+ $('#root_backgroundEffect_effect').html($('#root_foregroundEffect_effect').html());
+ olddEffects = newEffects;
+
+ $('#root_foregroundEffect_effect').val(confFgEff);
+ $('#root_foregroundEffect_effect').trigger('change');
+
+ $('#root_backgroundEffect_effect').val(confBgEff);
+ $('#root_backgroundEffect_effect').trigger('change');
+ }
+ }
+}
+
$(document).ready( function() {
performTranslation();
requestServerConfigSchema();
+ $(hyperion).on("cmd-serverinfo",updateEffectlist);
});
diff --git a/assets/webconfig/js/content_general.js b/assets/webconfig/js/content_general.js
index b0e4ab48..712fd137 100644
--- a/assets/webconfig/js/content_general.js
+++ b/assets/webconfig/js/content_general.js
@@ -4,13 +4,14 @@ $(hyperion).one("cmd-config-getschema", function(event) {
schema = parsedConfSchemaJSON.properties;
conf_editor = createJsonEditor('editor_container', {
general: schema.general
- }, true);
-
- $('#editor_container h3').remove();
+ }, true, true);
$('#btn_submit').off().on('click',function() {
requestWriteConfig(conf_editor.getValue());
});
+
+ if(showOptHelp)
+ $('#opt_expl').html(createHelpTable(schema.general.properties, ''+$.i18n("edt_conf_gen_heading_title")+' '+$.i18n("conf_helptable_expl")));
});
diff --git a/assets/webconfig/js/content_grabber.js b/assets/webconfig/js/content_grabber.js
index 6465e0fe..7c5ff060 100644
--- a/assets/webconfig/js/content_grabber.js
+++ b/assets/webconfig/js/content_grabber.js
@@ -19,8 +19,11 @@ $(hyperion).one("cmd-config-getschema", function(event) {
requestWriteConfig(conf_editor_v4l2.getValue());
});
- $('#opt_expl_fg').html(createHelpTable(schema.framegrabber.properties, ''+$.i18n("edt_conf_fg_heading_title")));
- $('#opt_expl_v4l2').html(createHelpTable(schema.grabberV4L2.items.properties, ''+$.i18n("edt_conf_v4l2_heading_title")));
+ if(showOptHelp)
+ {
+ $('#opt_expl_fg').html(createHelpTable(schema.framegrabber.properties, ''+$.i18n("edt_conf_fg_heading_title")+' '+$.i18n("conf_helptable_expl")));
+ $('#opt_expl_v4l2').html(createHelpTable(schema.grabberV4L2.items.properties, ''+$.i18n("edt_conf_v4l2_heading_title")+' '+$.i18n("conf_helptable_expl")));
+ }
});
diff --git a/assets/webconfig/js/content_index.js b/assets/webconfig/js/content_index.js
index 4fb59914..088d569f 100644
--- a/assets/webconfig/js/content_index.js
+++ b/assets/webconfig/js/content_index.js
@@ -2,7 +2,6 @@ $(document).ready( function() {
var uiLock = false;
$("#main-nav").hide();
- $("#loading_overlay").addClass("overlay");
loadContentTo("#container_connection_lost","connection_lost");
initWebSocket();
bindNavToContent("#load_dashboard","dashboard",true);
@@ -22,6 +21,7 @@ $(document).ready( function() {
bindNavToContent("#load_webconfig","webconfig",false);
$(hyperion).on("cmd-serverinfo",function(event){
+ showOptHelp = parsedConfJSON.general.showOptHelp;
parsedServerInfoJSON = event.response;
currentVersion = parsedServerInfoJSON.info.hyperion[0].version;
cleanCurrentVersion = currentVersion.replace(/\./g, '');
diff --git a/assets/webconfig/js/content_kodi.js b/assets/webconfig/js/content_kodi.js
index ec885bb4..fce20408 100644
--- a/assets/webconfig/js/content_kodi.js
+++ b/assets/webconfig/js/content_kodi.js
@@ -10,7 +10,8 @@ $(hyperion).one("cmd-config-getschema", function(event) {
requestWriteConfig(conf_editor.getValue());
});
- $('#opt_expl').html(createHelpTable(schema.kodiVideoChecker.properties, ''+$.i18n("conf_kodi_label_title")));
+ if(showOptHelp)
+ $('#opt_expl').html(createHelpTable(schema.kodiVideoChecker.properties, ''+$.i18n("conf_kodi_label_title")+' '+$.i18n("conf_helptable_expl")));
});
diff --git a/assets/webconfig/js/content_network.js b/assets/webconfig/js/content_network.js
index 6fea33e1..fb174591 100644
--- a/assets/webconfig/js/content_network.js
+++ b/assets/webconfig/js/content_network.js
@@ -49,11 +49,14 @@ $(hyperion).one("cmd-config-getschema", function(event) {
requestWriteConfig(conf_editor_forw.getValue());
});
- $('#opt_expl_jsonserver').html(createHelpTable(schema.jsonServer.properties, ''+$.i18n("edt_conf_js_heading_title")));
- $('#opt_expl_protoserver').html(createHelpTable(schema.protoServer.properties, ''+$.i18n("edt_conf_ps_heading_title")));
- $('#opt_expl_boblightserver').html(createHelpTable(schema.boblightServer.properties, ''+$.i18n("edt_conf_bobls_heading_title")));
- $('#opt_expl_udplistener').html(createHelpTable(schema.udpListener.properties, ''+$.i18n("edt_conf_udpl_heading_title")));
- $('#opt_expl_forwarder').html(createHelpTable(schema.forwarder.properties, ''+$.i18n("edt_conf_fw_heading_title")));
+ if(showOptHelp)
+ {
+ $('#opt_expl_jsonserver').html(createHelpTable(schema.jsonServer.properties, ''+$.i18n("edt_conf_js_heading_title")+' '+$.i18n("conf_helptable_expl")));
+ $('#opt_expl_protoserver').html(createHelpTable(schema.protoServer.properties, ''+$.i18n("edt_conf_ps_heading_title")));
+ $('#opt_expl_boblightserver').html(createHelpTable(schema.boblightServer.properties, ''+$.i18n("edt_conf_bobls_heading_title")+' '+$.i18n("conf_helptable_expl")));
+ $('#opt_expl_udplistener').html(createHelpTable(schema.udpListener.properties, ''+$.i18n("edt_conf_udpl_heading_title")+' '+$.i18n("conf_helptable_expl")));
+ $('#opt_expl_forwarder').html(createHelpTable(schema.forwarder.properties, ''+$.i18n("edt_conf_fw_heading_title")+' '+$.i18n("conf_helptable_expl")));
+ }
});
diff --git a/assets/webconfig/js/content_webconfig.js b/assets/webconfig/js/content_webconfig.js
index f145acf5..aa249074 100644
--- a/assets/webconfig/js/content_webconfig.js
+++ b/assets/webconfig/js/content_webconfig.js
@@ -4,11 +4,14 @@ $(hyperion).one("cmd-config-getschema", function(event) {
schema = parsedConfSchemaJSON.properties;
conf_editor = createJsonEditor('editor_container', {
webConfig : schema.webConfig
- }, true);
+ }, true, true);
$('#btn_submit').off().on('click',function() {
requestWriteConfig(conf_editor.getValue());
});
+
+ if(showOptHelp)
+ $('#opt_expl_webconfig').html(createHelpTable(schema.webConfig.properties, ''+$.i18n("edt_conf_webc_heading_title")+' '+$.i18n("conf_helptable_expl")));
});
diff --git a/assets/webconfig/js/hyperion.js b/assets/webconfig/js/hyperion.js
index 6ac36607..a47ff92f 100644
--- a/assets/webconfig/js/hyperion.js
+++ b/assets/webconfig/js/hyperion.js
@@ -1,5 +1,6 @@
// global vars
+var showOptHelp = true;
var currentVersion;
var cleanCurrentVersion;
var latestVersion;
@@ -24,7 +25,7 @@ function initRestart()
{
$(hyperion).off();
requestServerConfigReload();
- watchdog = 1;
+ watchdog = 2;
$("#wrapper").fadeOut("slow");
cron();
}
@@ -229,8 +230,6 @@ function requestWriteConfig(config)
});
var config_str = JSON.stringify(complete_config);
- console.log("save");
- console.log(config_str);
sendToHyperion("config","setconfig", '"config":'+config_str);
}
diff --git a/assets/webconfig/js/lib/jsoneditor.js b/assets/webconfig/js/lib/jsoneditor.js
index e24b41e3..324457df 100755
--- a/assets/webconfig/js/lib/jsoneditor.js
+++ b/assets/webconfig/js/lib/jsoneditor.js
@@ -4859,7 +4859,7 @@ JSONEditor.defaults.editors["enum"] = JSONEditor.AbstractEditor.extend({
JSONEditor.defaults.editors.select = JSONEditor.AbstractEditor.extend({
setValue: function(value,initial) {
- value = this.typecast(value||'');
+ value = this.typecast(value||'');
// Sanitize value before setting it
var sanitized = value;
@@ -5008,7 +5008,7 @@ JSONEditor.defaults.editors.select = JSONEditor.AbstractEditor.extend({
}
// Other, not supported
else {
- throw "'select' editor requires the enum property to be set.";
+ //throw "'select' editor requires the enum property to be set.";
}
},
build: function() {
@@ -5041,23 +5041,11 @@ JSONEditor.defaults.editors.select = JSONEditor.AbstractEditor.extend({
this.value = this.enum_values[0];
},
onInputChange: function() {
- var val = this.input.value;
-
- var new_val;
- // Invalid option, use first option instead
- if(this.enum_options.indexOf(val) === -1) {
- new_val = this.enum_values[0];
- }
- else {
- new_val = this.enum_values[this.enum_options.indexOf(val)];
- }
-
- // If valid hasn't changed
- if(new_val === this.value) return;
+ var val = this.input.value;
// Store new value and propogate change event
- this.value = new_val;
- this.onChange(true);
+ this.value = val;
+ this.onChange(true);
},
setupSelect2: function() {
// If the Select2 library is loaded use it when we have lots of items
@@ -6358,14 +6346,20 @@ JSONEditor.AbstractTheme = Class.extend({
this.setSelectOptions(switcher, options, titles);
},
setSelectOptions: function(select, options, titles) {
- titles = titles || [];
- select.innerHTML = '';
- for(var i=0; i= 0) {
diff --git a/assets/webconfig/js/localStorage.js b/assets/webconfig/js/localStorage.js
index d4d69853..650d3406 100644
--- a/assets/webconfig/js/localStorage.js
+++ b/assets/webconfig/js/localStorage.js
@@ -47,10 +47,11 @@
}
else
{
- showInfoDialog('warning', "Can't store settings", "Your browser doesn't support localStorage. You can't save a specific language setting (fallback to 'auto detection') and access level (fallback to 'default'). You could still use the webinterface without further issues");
+ showInfoDialog('warning', "Can't store settings", "Your browser doesn't support localStorage. You can't save a specific language setting (fallback to 'auto detection') and access level (fallback to 'default'). Some wizards may be hidden. You could still use the webinterface without further issues");
initTrans('auto');
$('#btn_setlang').toggle();
$('#btn_setaccess').toggle();
+ $('#btn_wizard_byteorder').toggle();
}
$('#btn_setlang').off().on('click',function() {
diff --git a/assets/webconfig/js/ui_utils.js b/assets/webconfig/js/ui_utils.js
index 12931cb7..4053666d 100644
--- a/assets/webconfig/js/ui_utils.js
+++ b/assets/webconfig/js/ui_utils.js
@@ -80,7 +80,7 @@ function showInfoDialog(type,header,message,btnid)
else if (type == "select"){
$('#modal_dialog .modal-bodyicon').html('');
$('#modal_dialog .modal-footer-button').html('');
- $('#modal_dialog .modal-footer-button').append('');
+ $('#modal_dialog .modal-footer-button').append('');
}
else if (type == "uilock"){
$('#modal_dialog .modal-bodyicon').html('');
@@ -182,8 +182,10 @@ function createHelpTable(list, phead){
thead.appendChild(createTableTh($.i18n('conf_helptable_option'), $.i18n('conf_helptable_expl')));
for (key in list){
- text = list[key].title.replace('title', 'expl');
- tbody.appendChild(createTableTd($.i18n(list[key].title), $.i18n(text)));
+ if(list[key].access != 'system'){
+ text = list[key].title.replace('title', 'expl');
+ tbody.appendChild(createTableTd($.i18n(list[key].title), $.i18n(text)));
+ }
}
table.appendChild(thead);
table.appendChild(tbody);
diff --git a/assets/webconfig/js/wizard.js b/assets/webconfig/js/wizard.js
new file mode 100644
index 00000000..a924d1f3
--- /dev/null
+++ b/assets/webconfig/js/wizard.js
@@ -0,0 +1,142 @@
+$(document).ready( function() {
+ //clear priority if people reload the page or lost connection while a wizard was active
+ var wizardStatus = localStorage.getItem("wizardactive");
+
+ $(hyperion).one("cmd-config-getschema", function(event) {
+ if(wizardStatus)
+ requestPriorityClear();
+ });
+
+ //rgb byte order wizard
+ var colorIntveralId;
+ var new_rgb_order;
+
+ function changeColor()
+ {
+ var color = $("#wiz_canv_color").css('background-color');
+
+ if (color == 'rgb(255, 0, 0)')
+ {
+ $("#wiz_canv_color").css('background-color','rgb(0, 255, 0)');
+ requestSetColor('0','255','0');
+ }
+ else
+ {
+ $("#wiz_canv_color").css('background-color','rgb(255, 0, 0)');
+ requestSetColor('255','0','0');
+ }
+ }
+
+ function startWizardRGB()
+ {
+ $("#wizard_modal").modal({
+ backdrop : "static",
+ keyboard: false,
+ show: true
+ });
+ }
+
+ function beginWizardRGB()
+ {
+ $("#wiz_switchtime_select").off().on('change',function() {
+ clearInterval(colorIntveralId);
+ var time = $("#wiz_switchtime_select").val();
+ colorIntveralId = setInterval(function() { changeColor(); }, time*1000);
+ });
+
+ $('.wselect').change(function () {
+ var rgb_order = order = parsedConfJSON.device.colorOrder.split("");
+ var redS = $("#wiz_r_select").val();
+ var greenS = $("#wiz_g_select").val();
+
+ for (var i = 0; isetColor(FG_PRIORITY, ColorRgb::BLACK, 100, false);
+ // clear the leds
+ hyperion->setColor(FG_PRIORITY, ColorRgb::BLACK, 100, false);
- // initial foreground effect/color
- const QJsonValue fgEffectConfig = effectConfig["foreground-effect"];
+ // initial foreground effect/color
+ if (FGEffectConfig["enable"].toBool(true))
+ {
+ const QString fgTypeConfig = FGEffectConfig["type"].toString("effect");
+ const QString fgEffectConfig = FGEffectConfig["effect"].toString("Rainbow swirl fast");
+ const QJsonValue fgColorConfig = FGEffectConfig["color"];
int default_fg_duration_ms = 3000;
- int fg_duration_ms = effectConfig["foreground-duration_ms"].toInt(default_fg_duration_ms);
+ int fg_duration_ms = FGEffectConfig["duration_ms"].toInt(default_fg_duration_ms);
if (fg_duration_ms == DURATION_INFINITY)
{
fg_duration_ms = default_fg_duration_ms;
Warning(_log, "foreground effect duration 'infinity' is forbidden, set to default value %d ms",default_fg_duration_ms);
}
- if ( ! fgEffectConfig.isNull() && fgEffectConfig.isArray() && FGCONFIG_ARRAY.size() == 3 )
+ if ( fgTypeConfig.contains("color") )
{
ColorRgb fg_color = {
(uint8_t)FGCONFIG_ARRAY.at(0).toInt(0),
@@ -242,19 +245,19 @@ void HyperionDaemon::startInitialEffect()
hyperion->setColor(FG_PRIORITY, fg_color, fg_duration_ms, false);
Info(_log,"Inital foreground color set (%d %d %d)",fg_color.red,fg_color.green,fg_color.blue);
}
- else if (! fgEffectConfig.isNull() && fgEffectConfig.isArray() && FGCONFIG_ARRAY.size() == 1 && FGCONFIG_ARRAY.at(0).isString())
+ else
{
- const QString fgEffectName = FGCONFIG_ARRAY.at(0).toString();
- int result = effectConfig.contains("foreground-effect-args")
-// ? hyperion->setEffect(fgEffectName, effectConfig["foreground-effect-args"], FG_PRIORITY, fg_duration_ms)
- ? hyperion->setEffect(fgEffectName, _qconfig["initialEffect"].toObject()["foreground-effect-args"].toObject(), FG_PRIORITY, fg_duration_ms)
- : hyperion->setEffect(fgEffectName, FG_PRIORITY, fg_duration_ms);
- Info(_log,"Inital foreground effect '%s' %s", fgEffectName.toUtf8().constData(), ((result == 0) ? "started" : "failed"));
+ int result = hyperion->setEffect(fgEffectConfig, FG_PRIORITY, fg_duration_ms);
+ Info(_log,"Inital foreground effect '%s' %s", fgEffectConfig.toUtf8().constData(), ((result == 0) ? "started" : "failed"));
}
-
- // initial background effect/color
- const QJsonValue bgEffectConfig = effectConfig["background-effect"];
- if ( ! bgEffectConfig.isNull() && bgEffectConfig.isArray() && BGCONFIG_ARRAY.size() == 3 )
+ }
+ // initial background effect/color
+ if (BGEffectConfig["enable"].toBool(true))
+ {
+ const QString bgTypeConfig = BGEffectConfig["type"].toString("effect");
+ const QString bgEffectConfig = BGEffectConfig["effect"].toString("Warm mood blobs");
+ const QJsonValue bgColorConfig = BGEffectConfig["color"];
+ if (bgTypeConfig.contains("color"))
{
ColorRgb bg_color = {
(uint8_t)BGCONFIG_ARRAY.at(0).toInt(0),
@@ -264,14 +267,10 @@ void HyperionDaemon::startInitialEffect()
hyperion->setColor(BG_PRIORITY, bg_color, DURATION_INFINITY, false);
Info(_log,"Inital background color set (%d %d %d)",bg_color.red,bg_color.green,bg_color.blue);
}
- else if (! bgEffectConfig.isNull() && bgEffectConfig.isArray() && BGCONFIG_ARRAY.size() == 1 && BGCONFIG_ARRAY.at(0).isString())
+ else
{
- const QString bgEffectName = BGCONFIG_ARRAY.at(0).toString();
- int result = effectConfig.contains("background-effect-args")
-// ? hyperion->setEffect(bgEffectName, effectConfig["background-effect-args"], BG_PRIORITY, fg_duration_ms)
- ? hyperion->setEffect(bgEffectName, _qconfig["initialEffect"].toObject()["background-effect-args"].toObject(), BG_PRIORITY, DURATION_INFINITY)
- : hyperion->setEffect(bgEffectName, BG_PRIORITY, DURATION_INFINITY);
- Info(_log,"Inital background effect '%s' %s", bgEffectName.toUtf8().constData(), ((result == 0) ? "started" : "failed"));
+ int result = hyperion->setEffect(bgEffectConfig, BG_PRIORITY, DURATION_INFINITY);
+ Info(_log,"Inital background effect '%s' %s", bgEffectConfig.toUtf8().constData(), ((result == 0) ? "started" : "failed"));
}
}