add Hue EntertainmentAPI + Forwarder & other Fixes (#592)

* whitespaces + typo fixes

* JS / LGTM fixes

* SSDP Handler crash fix

* MessageForwarder handlePriorityChanges Slave fixes

* use aboutToQuit Signal

* complete rewriten Hue Entertainment API structure
combined Philips Hue and Entertainment API
with new MbedTLS based SSL UDP Provider

* add required cross-compile submodules

* logical rebuild fn: initLeds, setLights + new logs
-more detailed checks and error handling inside iniLeds and setLights
- logical script procedure before ProviderUdpSSL init
- first steps for multiple ProviderUdpSSL usage
- better fallback support to old RestAPI, if entertainment api is not supported
- just 4 u LordGrey: new log fn for cosmetic config outputs ;)

* add OSX CompileHowTo - undo from CrossCompileHowTo

* whitespace fixes

* lightID toString fix

* fix unsigned int E-API + debug output

* bugfixes, reworked black signal detection, wizard:
- change device config field light-ids from int to string -> real unsigned int fix
- add signal detection brightness minimum threshold value
0.0 for 0% brightness - 1.0 for 100% brightness to count for blacklight signal detection
reason: input may not 100% black, like mine - i have a deep dark gray input signal
-> my threshold value is set to 0.005 for 0.5% minimum brightness = 1 (from max 255) to count as black
- wizard optimations, with fallback without entertainment support (beta state)
- whitespace fixes

* cleanup + minor fixes

* change fixed Hue UPD SSL config to _devConfig paras

* Hotfix SSL Connection, new light models, wizard:
- Fix UPD SSL Connection failed Problems
- add new supported gamut C light models: LCG002, LCA001, LCA002, LCA003
- wizard: extend fallback support to classic mode + hints

* whitespace, typo fix

* uncheck useEntertainmentAPI, if noAPISupport detected + hint

* coredump fix -> add _blackLightsTimer nullptr init

* code cleanup / remove old debugs + whitespacefixes

* add gamut C LCP001, LCP002

* SSL UDP config made more flexible + remove qDebug
-> switch to hyerion.ng _log
-> replace logCommand with verbose
-> code cleanups etc...

* extended mbedtls debugging infos

* add adjustable ssl timeout settings

* error handling

* streamdebugger bugfixes

* UPDSSL psk / psk_identity bugfixes! + hue wizard fn typo fix +
- verbose option available without dependencies
- whitespace fixes

* Philips Hue Assistant now recognizes non-original bridges better...
+ Added note if no clientkey is set when using the entertainment API
+ User creation (+ clientkey) for non-original bridges can now also be used
+ Minor changes and bug fixes

* CMAKE mbedTLS  detection

* minor bug fixes + code cleanups

* FindMbedTLS.cmake remove Path-Hints + wizard.js: ajax timeout handling
Test - content_grabber.js: run relevant code only, if V4L2_AVAIL is true:
conf_grabber don't displays other devices, if V4L2 is not available

* compile mbedtls via cmake as static lib

* remove libmbedtls-dev from compileHowto / scripts

* Fix Windows build

* Fix windows build (part 2)

* removed unnecessary osx x11 include directory path

* QTimer Shutdown bugfix

* cmake win32 fix + minor bugfixes

* cmake debug msg used mbedtls libs

* Bugfix: noSignalDetection wasn't switchedOn again
if no signal was previously detected

* Some code fixes based on alerts from lgtm.com

Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
This commit is contained in:
SJunkies
2020-05-22 19:40:50 +02:00
committed by GitHub
parent 4aebd55715
commit 259becea04
37 changed files with 3832 additions and 1302 deletions

View File

@@ -159,9 +159,19 @@
"conf_leds_layout_preview_l1": "Das ist die erste LED (Einspeisung)",
"conf_leds_layout_preview_l2": "Das visualisiert die Richtung des Datenstroms (zweite/dritte LED)",
"conf_leds_layout_cl_top": "Oben",
"conf_leds_layout_cl_topleft": "Oben Links (Ecke)",
"conf_leds_layout_cl_topright": "Oben Rechts (Ecke)",
"conf_leds_layout_cl_bottom": "Unten",
"conf_leds_layout_cl_bottomleft": "Unten Links (Ecke)",
"conf_leds_layout_cl_bottomright": "Unten Rechts (Ecke)",
"conf_leds_layout_cl_left": "Links",
"conf_leds_layout_cl_lefttop": "Links 0% - 50% von Oben",
"conf_leds_layout_cl_leftmiddle": "Links 25% - 75% Mitte",
"conf_leds_layout_cl_leftbottom": "Links 50% - 100% Unten",
"conf_leds_layout_cl_right": "Rechts",
"conf_leds_layout_cl_righttop": "Rechts 0% - 50% von Oben",
"conf_leds_layout_cl_rightmiddle": "Rechts 25% - 75% Mitte",
"conf_leds_layout_cl_rightbottom": "Rechts 50% - 100% Unten",
"conf_leds_layout_cl_gaglength": "Lückenlänge",
"conf_leds_layout_cl_gappos": "Lückenposition",
"conf_leds_layout_cl_inppos": "Einspeisepunkt",
@@ -356,6 +366,7 @@
"wiz_hue_desc2": "Nun kannst du auswählen, welche der Lampen (IDs) hinzugefügt werden sollen. Mit der Position wählst du aus, wo die jeweilige Lampe \"im Bild\" sitzen soll. Deaktivierte Lampen werden nicht hinzugefügt. Als Hilfe zur Identifizierung kannst du sie mit einem Klick auf den rechten Button kurz aufleuchten lassen.",
"wiz_hue_ip": "Hue Bridge IP:",
"wiz_hue_username": "Benutzer ID:",
"wiz_hue_clientkey": "Clientkey:",
"wiz_hue_create_user": "Neuen Benutzer erstellen",
"wiz_hue_failure_ip": "Keine Hue Bridge gefunden, bitte überprüfe die IP",
"wiz_hue_failure_connection": "Zeitüberschreitung. Bitte drücke die Taste auf deiner Hue Bridge rechtzeitig",
@@ -368,6 +379,19 @@
"wiz_hue_searchb": "Suche nach Hue Bridge...",
"wiz_hue_blinkblue": "Lasse ID $1 blau aufleuchten",
"wiz_hue_ident": "Identifiziere",
"wiz_hue_e_create_user": "Neuen Benutzer und Clientkey erstellen",
"wiz_hue_e_clientkey_needed": "Für die Verwendung der Entertainment API, ist ein zum Usernamen passender Clientkey erforderlich. Bitte einen vorhandenen eingeben oder über die Schaltflächen unten einen neuen erstellen.",
"wiz_hue_e_use_groupid": "Gruppen ID $1 verwenden",
"wiz_hue_e_noegrpids": "Es wurden keine Entertainment Gruppen in dieser Hue Bridge gefunden.",
"wiz_hue_e_nogrpids": "Diese Hue Bridge hat keine definierten Gruppen, bitte erstelle zuvor wenigstens eine in der Hue App.",
"wiz_hue_e_noapisupport": "Der Assistent hat die Entertainment API Unterstützung deaktiviert und wird mit der klassischen API weitergeführt.",
"wiz_hue_e_noapisupport_hint": "Die Einstellung \"<b>Hue Entertainment API verwenden</b>\" wurde deaktiviert.",
"wiz_hue_e_title": "Philips Hue Entertainment Assistent",
"wiz_hue_e_intro1": "Dieser Assistent hilft dir bei der Konfiguration von Hyperion für Philips Hue Entertainment. Zu den Funktionen zählen ein automatisches finden der Hue Bridge, einen neuen Benutzer und dazugehörigen Clientkey zum verwenden der Entertainment API erstellen, eine Entertainment Gruppenauswahl und die zur Gruppe gehörenden Lampen unterschiedlichen Bereichen im Bild zuzuordnen, sowie weitere Einstellungen von Hyperion automatisch anzupassen. Kurz gesagt: Komplette Einrichtung mit ein paar Klicks.",
"wiz_hue_e_desc1": "Es wird automatisch nach der Hue Bridge gesucht, solltest sie nicht gefunden werden, gebe die IP an und drücke den \"neu laden\" Button. Danach benötigst du eine gültige Benutzer ID und den dazugehörigen Clientkey, damit die Entertainment API verwendet werden kann. Beides kann auch automatisch erstellt werden.",
"wiz_hue_e_desc2": "Nun kannst du die Entertainment Gruppe auswählen, welche die Lampen zur Verwendung mit Hyperion beinhaltet.",
"wiz_hue_e_desc3": "Nun kannst du auswählen, mit welcher Position die jeweilige Lampe \"im Bild\" sitzen soll. Eine Vorauswahl der Position, wurde Anhand der konfigurierten Positionen der Lampen in der Entertainment Gruppe gewählt. Dies ist nur eine Empfehlung und kann beliebig angepasst werden. Als Hilfe zur Identifizierung kannst du sie mit einem Klick auf den rechten Button kurz aufleuchten lassen und die Auswahl zu verbessern.",
"wiz_hue_e_use_group": "Gruppe verwenden",
"wiz_cc_title": "Farbkalibrierungs Assistent",
"wiz_cc_intro1": "Der Assistent wird dich durch die Kalibrierung deiner LEDs leiten. Sofern du Kodi nutzt, können die Bilder und Testvideos direkt an Kodi geschickt werden. Andernfalls musst du das Material selbst herunterladen und anwenden.",
"wiz_cc_kwebs": "Kodi Webserver (IP:Port)",
@@ -424,9 +448,20 @@
"edt_dev_spec_lightid_title": "Lampen ID(s)",
"edt_dev_spec_lightid_itemtitle": "ID",
"edt_dev_spec_transistionTime_title": "Übergangszeit",
"edt_dev_spec_blackLightsTimeout_title": "Signal Erkennung Timeout bei schwarz",
"edt_dev_spec_brightnessThreshold_title": "Signal Erkennung Helligkeitsminimum",
"edt_dev_spec_switchOffOnBlack_title": "Aus bei schwarz",
"edt_dev_spec_brightnessFactor_title": "Helligkeitsfaktor",
"edt_dev_spec_restoreOriginalState_title" : "Lampen Originalzustand wiederhestellen",
"edt_dev_spec_brightnessMin_title": "Helligkeit minimum",
"edt_dev_spec_brightnessMax_title": "Helligkeit maximum",
"edt_dev_spec_sslReadTimeout_title" : "Streamer lese Timeout",
"edt_dev_spec_sslHSTimeoutMin_title" : "Streamer Handshake minimum Timeout",
"edt_dev_spec_sslHSTimeoutMax_title" : "Streamer Handshake maximum Timeout",
"edt_dev_spec_verbose_title": "Logge alle Hue Commandos",
"edt_dev_spec_debugStreamer_title": "Streamer Debugging",
"edt_dev_spec_debugLevel_title": "Streamer Verbindung Debug Stufe",
"edt_dev_spec_restoreOriginalState_title" : "Lampen Originalzustand wiederherstellen",
"edt_dev_spec_useEntertainmentAPI_title": "Hue Entertainment API verwenden",
"edt_dev_spec_ledType_title": "LED typ",
"edt_dev_spec_uid_title": "UID",
"edt_dev_spec_intervall_title": "Intervall",
@@ -449,7 +484,9 @@
"edt_dev_spec_gpioBcm_title": "GPIO Pin",
"edt_dev_spec_ledIndex_title": "LED index",
"edt_dev_spec_colorComponent_title": "Farbkomponente",
"edt_dev_spec_clientKey_title": "Clientkey",
"edt_dev_spec_printTimeStamp_title" : "Mit Zeitstempel",
"edt_dev_spec_groupId_title": "Gruppen ID",
"edt_conf_general_enable_title": "Aktiviert",
"edt_conf_general_enable_expl": "Wenn aktiviert, ist die Komponente aktiv.",
"edt_conf_general_priority_title": "Priorität",
@@ -479,6 +516,11 @@
"edt_conf_enum_bbclassic": "Klassisch",
"edt_conf_enum_bbosd": "OSD",
"edt_conf_enum_automatic": "Automatisch",
"edt_conf_enum_dl_nodebug": "kein Debugging",
"edt_conf_enum_dl_error": "nur Fehler",
"edt_conf_enum_dl_statechange": "bei Änderungen",
"edt_conf_enum_dl_informational": "informativ",
"edt_conf_enum_dl_verbose": "sehr detailiert",
"edt_conf_enum_custom": "Benutzerdefiniert",
"edt_conf_gen_heading_title": "Allgemeine Einstellungen",
"edt_conf_gen_name_title": "Name der Konfiguration",

View File

@@ -157,10 +157,20 @@
"conf_leds_layout_preview_ledpower" : "Max. power consumption: $1 A",
"conf_leds_layout_preview_l1" : "This is your first led (input position)",
"conf_leds_layout_preview_l2" : "This visualizes the data direction (second/third led)",
"conf_leds_layout_cl_top" : "Top",
"conf_leds_layout_cl_bottom" : "Bottom",
"conf_leds_layout_cl_left" : "Left",
"conf_leds_layout_cl_right" : "Right",
"conf_leds_layout_cl_top": "Top",
"conf_leds_layout_cl_topleft": "Top Left (Corner)",
"conf_leds_layout_cl_topright": "Top Right (Corner)",
"conf_leds_layout_cl_bottom": "Bottom",
"conf_leds_layout_cl_bottomleft": "Bottom Left (Corner)",
"conf_leds_layout_cl_bottomright": "Bottom Right (Corner)",
"conf_leds_layout_cl_left": "Left",
"conf_leds_layout_cl_lefttop": "Left 0% - 50% Top",
"conf_leds_layout_cl_leftmiddle": "Left 25% - 75% Middle",
"conf_leds_layout_cl_leftbottom": "Left 50% - 100% Bottom",
"conf_leds_layout_cl_right": "Right",
"conf_leds_layout_cl_righttop": "Right 0% - 50% Top",
"conf_leds_layout_cl_rightmiddle": "Right 25% - 75% Middle",
"conf_leds_layout_cl_rightbottom": "Right 50% - 100% Bottom",
"conf_leds_layout_cl_gaglength" : "Gap length",
"conf_leds_layout_cl_gappos" : "gap position",
"conf_leds_layout_cl_inppos" : "Input position",
@@ -355,6 +365,7 @@
"wiz_hue_desc2" : "Now choose which lamps should be added. The position assigns the lamp to a specific position on your \"picture\". Disabled lamps won't be added. To identify single lamps press the button on the right.",
"wiz_hue_ip" : "Hue Bridge IP:",
"wiz_hue_username" : "User ID:",
"wiz_hue_clientkey" : "Clientkey:",
"wiz_hue_create_user" : "Create new User",
"wiz_hue_failure_ip" : "No Bridge found, please type in a valid ip",
"wiz_hue_failure_connection" : "Timeout: Please press the bridge button within the period of 30 seconds",
@@ -367,8 +378,21 @@
"wiz_hue_searchb": "Searching for bridge...",
"wiz_hue_blinkblue": "Let ID $1 light up blue",
"wiz_hue_ident" : "Identify",
"wiz_cc_title" : "Color calibration wizard",
"wiz_cc_intro1" : "This wizard will guide you through your led calibration. If you are using Kodi, the calibration pictures and videos can be send directly to kodi without further tasks on your side. If not, you need to download these files yourself and apply them, if the wizard wants it.",
"wiz_hue_e_create_user" : "Create new User and clientkey",
"wiz_hue_e_clientkey_needed": "A clientkey that matches the username is required to use the entertainment API. Please enter an existing one or use the button below to create a new one.",
"wiz_hue_e_use_groupid": "Use group ID $1",
"wiz_hue_e_noegrpids": "No entertainment groups in this Hue bridge defined.",
"wiz_hue_e_nogrpids": "This Hue bridge has no groups defined, please create at least one before with the Hue Apps.",
"wiz_hue_e_noapisupport": "The Wizard has disabled entertainment API support and will continue in classic mode.",
"wiz_hue_e_noapisupport_hint": "The option \"<b>Use Hue Entertainment API</b>\" was unchecked.",
"wiz_hue_e_title" : "Philips Hue Entertainment Wizard",
"wiz_hue_e_intro1" : "This wizards configures Hyperion for the well known Philips Hue Entertainment system. Features are Hue Bridge auto detection, user and clientkey creation, entertainment group selection and set group lights to a specific position on your picture and tune the Hyperion settings automatically! So in short: All you need are some clicks and you are done!",
"wiz_hue_e_desc1" : "It searches automatically for a hue bridge, in case it can't find one you need to provide the ip address and push the reload button on the right. Now you need a user id and the clientkey, if you don't have both, create a new one.",
"wiz_hue_e_desc2" : "Now choose your entertainment group, which has all your lights inside for use with Hyperion.",
"wiz_hue_e_desc3": "Now you can choose in which position the respective lamp should be \"in the picture\". A preselection of the position was made based on the configured positions of the lights in the entertainment group. This is just a recommendation and can be customized as desired. You can therefore highlight them briefly by clicking on the right button to improve the selection.",
"wiz_hue_e_use_group" : "Use group",
"wiz_cc_title" : "Colour calibration wizard",
"wiz_cc_intro1" : "This wizard will guide you through your led calibration. If you are using Kodi, the calibration pictures and videos can be sent directly to it without further actions on your side. If not, you will need to download these files yourself and display them when the wizard needs you to adjust the setting.",
"wiz_cc_kwebs" : "Kodi webserver (IP:Port)",
"wiz_cc_kodidiscon" : "Kodi webserver not found, proceed without Kodi support.",
"wiz_cc_kodidisconlink" : "Download link pictures:",
@@ -422,10 +446,21 @@
"edt_dev_spec_username_title" : "Username",
"edt_dev_spec_lightid_title" : "Light ID(s)",
"edt_dev_spec_lightid_itemtitle" : "ID",
"edt_dev_spec_transistionTime_title" : "Transistion time",
"edt_dev_spec_transistionTime_title" : "Transition time",
"edt_dev_spec_blackLightsTimeout_title": "Signal detection timeout on black",
"edt_dev_spec_brightnessThreshold_title": "Signal detection brightness minimum",
"edt_dev_spec_switchOffOnBlack_title" : "Switch off on black",
"edt_dev_spec_brightnessFactor_title" : "Brightness factor",
"edt_dev_spec_brightnessMin_title": "Brightness minimum",
"edt_dev_spec_brightnessMax_title": "Brightness maximum",
"edt_dev_spec_sslReadTimeout_title" : "Streamer read timeout",
"edt_dev_spec_sslHSTimeoutMin_title" : "Streamer handshake timeout minimum",
"edt_dev_spec_sslHSTimeoutMax_title" : "Streamer handshake timeout maximum",
"edt_dev_spec_verbose_title": "Log all Hue commands",
"edt_dev_spec_debugStreamer_title": "Streamer Debug",
"edt_dev_spec_debugLevel_title": "Streamer Connection Debug Level",
"edt_dev_spec_restoreOriginalState_title" : "Restore lights' original state",
"edt_dev_spec_useEntertainmentAPI_title": "Use Hue Entertainment API",
"edt_dev_spec_ledType_title" : "LED Type",
"edt_dev_spec_uid_title" : "UID",
"edt_dev_spec_intervall_title" : "Intervall",
@@ -447,7 +482,10 @@
"edt_dev_spec_PBFiFo_title" : "Pi-Blaster FiFo",
"edt_dev_spec_gpioBcm_title" : "GPIO Pin",
"edt_dev_spec_ledIndex_title" : "LED index",
"edt_dev_spec_colorComponent_title" : "Color component",
"edt_dev_spec_colorComponent_title" : "Colour component",
"edt_dev_spec_printTimeStamp_title" : "Add timestamp",
"edt_dev_spec_clientKey_title" : "Clientkey",
"edt_dev_spec_groupId_title" : "Group Id",
"edt_conf_general_enable_title" : "Activate",
"edt_conf_general_enable_expl" : "If checked, the component is enabled.",
"edt_conf_general_priority_title" : "Priority channel",
@@ -477,6 +515,11 @@
"edt_conf_enum_bbclassic" : "Classic",
"edt_conf_enum_bbosd" : "OSD",
"edt_conf_enum_automatic" : "Automatic",
"edt_conf_enum_dl_nodebug": "No Debug",
"edt_conf_enum_dl_error": "Error",
"edt_conf_enum_dl_statechange": "State Change",
"edt_conf_enum_dl_informational": "Informational",
"edt_conf_enum_dl_verbose": "Verbose",
"edt_conf_enum_custom": "Custom",
"edt_conf_gen_heading_title" : "General Settings",
"edt_conf_gen_name_title" : "Configuration name",

View File

@@ -180,9 +180,11 @@ $(document).ready( function() {
//create introduction
if(window.showOptHelp)
{
createHint("intro", $.i18n('conf_general_intro'), "editor_container");
createHint("intro", $.i18n('conf_general_tok_desc'), "tok_desc_cont");
createHint("intro", $.i18n('conf_general_inst_desc'), "inst_desc_cont");
}
removeOverlay();
});

View File

@@ -1,205 +1,207 @@
$(document).ready( function() {
performTranslation();
var conf_editor_v4l2 = null;
var conf_editor_fg = null;
performTranslation();
var conf_editor_v4l2 = null;
var conf_editor_fg = null;
var conf_editor_instCapt = null;
var V4L2_AVAIL = window.serverInfo.grabbers.available.includes("v4l2");
// Dynamic v4l2 enum schema
var v4l2_dynamic_enum_schema = {
"available_devices":
{
"type": "string",
"title": "edt_conf_v4l2_device_title",
"propertyOrder" : 1,
"required" : true
},
"resolutions":
{
"type": "string",
"title": "edt_conf_v4l2_resolution_title",
"propertyOrder" : 4,
"required" : true
},
"framerates":
{
"type": "string",
"title": "edt_conf_v4l2_framerate_title",
"propertyOrder" : 7,
"required" : true
}
};
if(V4L2_AVAIL) {
// Dynamic v4l2 enum schema
var v4l2_dynamic_enum_schema = {
"available_devices":
{
"type": "string",
"title": "edt_conf_v4l2_device_title",
"propertyOrder" : 1,
"required" : true
},
"resolutions":
{
"type": "string",
"title": "edt_conf_v4l2_resolution_title",
"propertyOrder" : 4,
"required" : true
},
"framerates":
{
"type": "string",
"title": "edt_conf_v4l2_framerate_title",
"propertyOrder" : 7,
"required" : true
}
};
// Build dynamic v4l2 enum schema parts
var buildSchemaPart = function(key, schema, device) {
if (schema[key]) {
var enumVals = [];
var enumTitelVals = [];
var v4l2_properties = JSON.parse(JSON.stringify(window.serverInfo.grabbers.v4l2_properties));
// Build dynamic v4l2 enum schema parts
var buildSchemaPart = function(key, schema, device) {
if (schema[key]) {
var enumVals = [];
var enumTitelVals = [];
var v4l2_properties = JSON.parse(JSON.stringify(window.serverInfo.grabbers.v4l2_properties));
if (key === 'available_devices') {
for (var i = 0; i < v4l2_properties.length; i++) {
enumVals.push(v4l2_properties[i]['device']);
if (key === 'available_devices') {
for (var i = 0; i < v4l2_properties.length; i++) {
enumVals.push(v4l2_properties[i]['device']);
v4l2_properties[i].hasOwnProperty('name')
? enumTitelVals.push(v4l2_properties[i]['name'])
: enumTitelVals.push(v4l2_properties[i]['device']);
}
} else if (key == 'resolutions' || key == 'framerates') {
for (var i = 0; i < v4l2_properties.length; i++) {
if (v4l2_properties[i]['device'] == device) {
enumVals = enumTitelVals = v4l2_properties[i][key];
break;
}
}
}
v4l2_properties[i].hasOwnProperty('name')
? enumTitelVals.push(v4l2_properties[i]['name'])
: enumTitelVals.push(v4l2_properties[i]['device']);
}
} else if (key == 'resolutions' || key == 'framerates') {
for (var i = 0; i < v4l2_properties.length; i++) {
if (v4l2_properties[i]['device'] == device) {
enumVals = enumTitelVals = v4l2_properties[i][key];
break;
}
}
}
window.schema.grabberV4L2.properties[key] = {
"type": schema[key].type,
"title": schema[key].title,
"enum": [].concat(["auto"], enumVals, ["custom"]),
"options" :
{
"enum_titles" : [].concat(["edt_conf_enum_automatic"], enumTitelVals, ["edt_conf_enum_custom"]),
},
"propertyOrder" : schema[key].propertyOrder,
"required" : schema[key].required
};
}
};
window.schema.grabberV4L2.properties[key] = {
"type": schema[key].type,
"title": schema[key].title,
"enum": [].concat(["auto"], enumVals, ["custom"]),
"options" :
{
"enum_titles" : [].concat(["edt_conf_enum_automatic"], enumTitelVals, ["edt_conf_enum_custom"]),
},
"propertyOrder" : schema[key].propertyOrder,
"required" : schema[key].required
};
}
};
// Switch between visible states
function toggleOption(option, state) {
$('[data-schemapath*="root.grabberV4L2.'+option+'"]').toggle(state);
if (state) (
$('[data-schemapath*="root.grabberV4L2.'+option+'"]').addClass('col-md-12'),
$('label[for="root_grabberV4L2_'+option+'"]').css('left','10px'),
$('[id="root_grabberV4L2_'+option+'"]').css('left','10px')
);
}
// Switch between visible states
function toggleOption(option, state) {
$('[data-schemapath*="root.grabberV4L2.'+option+'"]').toggle(state);
if (state) (
$('[data-schemapath*="root.grabberV4L2.'+option+'"]').addClass('col-md-12'),
$('label[for="root_grabberV4L2_'+option+'"]').css('left','10px'),
$('[id="root_grabberV4L2_'+option+'"]').css('left','10px')
);
}
// Watch all v4l2 dynamic fields
var setWatchers = function(schema) {
var path = 'root.grabberV4L2.';
Object.keys(schema).forEach(function(key) {
conf_editor_v4l2.watch(path + key, function() {
var ed = conf_editor_v4l2.getEditor(path + key);
var val = ed.getValue();
// Watch all v4l2 dynamic fields
var setWatchers = function(schema) {
var path = 'root.grabberV4L2.';
Object.keys(schema).forEach(function(key) {
conf_editor_v4l2.watch(path + key, function() {
var ed = conf_editor_v4l2.getEditor(path + key);
var val = ed.getValue();
if (key == 'available_devices') {
var V4L2properties = ['resolutions', 'framerates'];
if (val == 'custom') {
var grabberV4L2 = ed.parent;
V4L2properties.forEach(function(item) {
buildSchemaPart(item, v4l2_dynamic_enum_schema, 'none');
grabberV4L2.original_schema.properties[item] = window.schema.grabberV4L2.properties[item];
grabberV4L2.schema.properties[item] = window.schema.grabberV4L2.properties[item];
if (key == 'available_devices') {
var V4L2properties = ['resolutions', 'framerates'];
if (val == 'custom') {
var grabberV4L2 = ed.parent;
V4L2properties.forEach(function(item) {
buildSchemaPart(item, v4l2_dynamic_enum_schema, 'none');
grabberV4L2.original_schema.properties[item] = window.schema.grabberV4L2.properties[item];
grabberV4L2.schema.properties[item] = window.schema.grabberV4L2.properties[item];
grabberV4L2.removeObjectProperty(item);
delete grabberV4L2.cached_editors[item];
grabberV4L2.addObjectProperty(item);
grabberV4L2.removeObjectProperty(item);
delete grabberV4L2.cached_editors[item];
grabberV4L2.addObjectProperty(item);
conf_editor_v4l2.getEditor(path + item).enable();
});
conf_editor_v4l2.getEditor(path + item).enable();
});
toggleOption('device', true);
} else if (val == 'auto') {
V4L2properties.forEach(function(item) {
conf_editor_v4l2.getEditor(path + item).setValue('auto');
conf_editor_v4l2.getEditor(path + item).disable();
});
toggleOption('device', true);
} else if (val == 'auto') {
V4L2properties.forEach(function(item) {
conf_editor_v4l2.getEditor(path + item).setValue('auto');
conf_editor_v4l2.getEditor(path + item).disable();
});
(toggleOption('device', false), toggleOption('width', false),
toggleOption('height', false), toggleOption('fps', false));
} else {
var grabberV4L2 = ed.parent;
V4L2properties.forEach(function(item) {
buildSchemaPart(item, v4l2_dynamic_enum_schema, val);
grabberV4L2.original_schema.properties[item] = window.schema.grabberV4L2.properties[item];
grabberV4L2.schema.properties[item] = window.schema.grabberV4L2.properties[item];
(toggleOption('device', false), toggleOption('width', false),
toggleOption('height', false), toggleOption('fps', false));
} else {
var grabberV4L2 = ed.parent;
V4L2properties.forEach(function(item) {
buildSchemaPart(item, v4l2_dynamic_enum_schema, val);
grabberV4L2.original_schema.properties[item] = window.schema.grabberV4L2.properties[item];
grabberV4L2.schema.properties[item] = window.schema.grabberV4L2.properties[item];
grabberV4L2.removeObjectProperty(item);
delete grabberV4L2.cached_editors[item];
grabberV4L2.addObjectProperty(item);
grabberV4L2.removeObjectProperty(item);
delete grabberV4L2.cached_editors[item];
grabberV4L2.addObjectProperty(item);
conf_editor_v4l2.getEditor(path + item).enable();
});
conf_editor_v4l2.getEditor(path + item).enable();
});
toggleOption('device', false);
}
}
toggleOption('device', false);
}
}
if (key == 'resolutions')
val != 'custom'
? (toggleOption('width', false), toggleOption('height', false))
: (toggleOption('width', true), toggleOption('height', true));
if (key == 'resolutions')
val != 'custom'
? (toggleOption('width', false), toggleOption('height', false))
: (toggleOption('width', true), toggleOption('height', true));
if (key == 'framerates')
val != 'custom'
? toggleOption('fps', false)
: toggleOption('fps', true);
});
});
};
if (key == 'framerates')
val != 'custom'
? toggleOption('fps', false)
: toggleOption('fps', true);
});
});
};
// Insert dynamic v4l2 enum schema parts
Object.keys(v4l2_dynamic_enum_schema).forEach(function(key) {
buildSchemaPart(key, v4l2_dynamic_enum_schema, window.serverConfig.grabberV4L2.device);
});
// Insert dynamic v4l2 enum schema parts
Object.keys(v4l2_dynamic_enum_schema).forEach(function(key) {
buildSchemaPart(key, v4l2_dynamic_enum_schema, window.serverConfig.grabberV4L2.device);
});
}
if(window.showOptHelp) {
// Instance Capture
$('#conf_cont').append(createRow('conf_cont_instCapt'));
$('#conf_cont_instCapt').append(createOptPanel('fa-camera', $.i18n("edt_conf_instCapture_heading_title"), 'editor_container_instCapt', 'btn_submit_instCapt'));
$('#conf_cont_instCapt').append(createHelpTable(window.schema.instCapture.properties, $.i18n("edt_conf_instCapture_heading_title")));
if(window.showOptHelp) {
// Instance Capture
$('#conf_cont').append(createRow('conf_cont_instCapt'));
$('#conf_cont_instCapt').append(createOptPanel('fa-camera', $.i18n("edt_conf_instCapture_heading_title"), 'editor_container_instCapt', 'btn_submit_instCapt'));
$('#conf_cont_instCapt').append(createHelpTable(window.schema.instCapture.properties, $.i18n("edt_conf_instCapture_heading_title")));
// Framegrabber
$('#conf_cont').append(createRow('conf_cont_fg'));
$('#conf_cont_fg').append(createOptPanel('fa-camera', $.i18n("edt_conf_fg_heading_title"), 'editor_container_fg', 'btn_submit_fg'));
$('#conf_cont_fg').append(createHelpTable(window.schema.framegrabber.properties, $.i18n("edt_conf_fg_heading_title")));
// Framegrabber
$('#conf_cont').append(createRow('conf_cont_fg'));
$('#conf_cont_fg').append(createOptPanel('fa-camera', $.i18n("edt_conf_fg_heading_title"), 'editor_container_fg', 'btn_submit_fg'));
$('#conf_cont_fg').append(createHelpTable(window.schema.framegrabber.properties, $.i18n("edt_conf_fg_heading_title")));
// V4L2 - hide if not available
if(V4L2_AVAIL){
if(V4L2_AVAIL) {
$('#conf_cont').append(createRow('conf_cont_v4l'));
$('#conf_cont_v4l').append(createOptPanel('fa-camera', $.i18n("edt_conf_v4l2_heading_title"), 'editor_container_v4l2', 'btn_submit_v4l2'));
$('#conf_cont_v4l').append(createHelpTable(window.schema.grabberV4L2.properties, $.i18n("edt_conf_v4l2_heading_title")));
}
} else {
$('#conf_cont').addClass('row');
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_instCapture_heading_title"), 'editor_container_instCapt', 'btn_submit_instCapt'));
} else {
$('#conf_cont').addClass('row');
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_instCapture_heading_title"), 'editor_container_instCapt', 'btn_submit_instCapt'));
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_fg_heading_title"), 'editor_container_fg', 'btn_submit_fg'));
if(V4L2_AVAIL){
if(V4L2_AVAIL) {
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_v4l2_heading_title"), 'editor_container_v4l2', 'btn_submit_v4l2'));
}
}
}
// Instance Capture
conf_editor_instCapt = createJsonEditor('editor_container_instCapt', {
instCapture: window.schema.instCapture
}, true, true);
// Instance Capture
conf_editor_instCapt = createJsonEditor('editor_container_instCapt', {
instCapture: window.schema.instCapture
}, true, true);
conf_editor_instCapt.on('change',function() {
conf_editor_instCapt.validate().length ? $('#btn_submit_instCapt').attr('disabled', true) : $('#btn_submit_instCapt').attr('disabled', false);
});
conf_editor_instCapt.on('change',function() {
conf_editor_instCapt.validate().length ? $('#btn_submit_instCapt').attr('disabled', true) : $('#btn_submit_instCapt').attr('disabled', false);
});
$('#btn_submit_instCapt').off().on('click',function() {
requestWriteConfig(conf_editor_instCapt.getValue());
});
$('#btn_submit_instCapt').off().on('click',function() {
requestWriteConfig(conf_editor_instCapt.getValue());
});
// Framegrabber
conf_editor_fg = createJsonEditor('editor_container_fg', {
framegrabber: window.schema.framegrabber
}, true, true);
// Framegrabber
conf_editor_fg = createJsonEditor('editor_container_fg', {
framegrabber: window.schema.framegrabber
}, true, true);
conf_editor_fg.on('change',function() {
conf_editor_fg.validate().length ? $('#btn_submit_fg').attr('disabled', true) : $('#btn_submit_fg').attr('disabled', false);
});
conf_editor_fg.on('change',function() {
conf_editor_fg.validate().length ? $('#btn_submit_fg').attr('disabled', true) : $('#btn_submit_fg').attr('disabled', false);
});
$('#btn_submit_fg').off().on('click',function() {
requestWriteConfig(conf_editor_fg.getValue());
});
$('#btn_submit_fg').off().on('click',function() {
requestWriteConfig(conf_editor_fg.getValue());
});
if(V4L2_AVAIL){
if(V4L2_AVAIL) {
conf_editor_v4l2 = createJsonEditor('editor_container_v4l2', {
grabberV4L2 : window.schema.grabberV4L2
}, true, true);
@@ -258,35 +260,35 @@ $(document).ready( function() {
});
}
//////////////////////////////////////////////////
//////////////////////////////////////////////////
//create introduction
if(window.showOptHelp) {
//create introduction
if(window.showOptHelp) {
createHint("intro", $.i18n('conf_grabber_fg_intro'), "editor_container_fg");
if(V4L2_AVAIL){
createHint("intro", $.i18n('conf_grabber_v4l_intro'), "editor_container_v4l2");
}
}
}
function hideEl(el) {
for(var i = 0; i<el.length; i++) {
$('[data-schemapath*="root.framegrabber.'+el[i]+'"]').toggle(false);
}
}
function hideEl(el) {
for(var i = 0; i<el.length; i++) {
$('[data-schemapath*="root.framegrabber.'+el[i]+'"]').toggle(false);
}
}
//hide specific options
conf_editor_fg.on('ready',function() {
var grabbers = window.serverInfo.grabbers.available;
//hide specific options
conf_editor_fg.on('ready',function() {
var grabbers = window.serverInfo.grabbers.available;
if (grabbers.indexOf('dispmanx') > -1)
hideEl(["device","pixelDecimation"]);
else if (grabbers.indexOf('x11') > -1)
hideEl(["device","width","height"]);
else if (grabbers.indexOf('osx') > -1 )
hideEl(["device","pixelDecimation"]);
else if (grabbers.indexOf('amlogic') > -1)
hideEl(["pixelDecimation"]);
});
if (grabbers.indexOf('dispmanx') > -1)
hideEl(["device","pixelDecimation"]);
else if (grabbers.indexOf('x11') > -1)
hideEl(["device","width","height"]);
else if (grabbers.indexOf('osx') > -1 )
hideEl(["device","pixelDecimation"]);
else if (grabbers.indexOf('amlogic') > -1)
hideEl(["pixelDecimation"]);
});
removeOverlay();
removeOverlay();
});

View File

@@ -163,7 +163,6 @@ $(document).ready(function () {
requestTokenAuthorization(loginToken)
else
loadContentTo("#page-content", "login")
}
});

View File

@@ -39,12 +39,12 @@ function createLedPreview(leds, origin){
{
var led = leds[idx];
var led_id='ledc_'+[idx];
var bgcolor = "background-color:hsl("+(idx*360/leds.length)+",100%,50%);";
var bgcolor = "background-color:hsla("+(idx*360/leds.length)+",100%,50%,0.75);";
var pos = "left:"+(led.hmin * canvas_width)+"px;"+
"top:"+(led.vmin * canvas_height)+"px;"+
"width:"+((led.hmax-led.hmin) * (canvas_width-1))+"px;"+
"height:"+((led.vmax-led.vmin) * (canvas_height-1))+"px;";
leds_html += '<div id="'+led_id+'" class="led" style="'+bgcolor+pos+'" title="'+idx+'"><span id="'+led_id+'_num" class="led_prev_num">'+idx+'</span></div>';
leds_html += '<div id="'+led_id+'" class="led" style="'+bgcolor+pos+'" title="'+idx+'"><span id="'+led_id+'_num" class="led_prev_num">'+((led.name) ? led.name : idx)+'</span></div>';
}
$('#leds_preview').html(leds_html);
$('#ledc_0').css({"background-color":"black","z-index":"12"});
@@ -496,9 +496,13 @@ $(document).ready(function() {
$("#leddevices").off().on("change", function() {
var generalOptions = window.serverSchema.properties.device;
// Modified schema enty "hardwareLedCount" in generalOptions to minimum LedCount
// Modified schema entry "hardwareLedCount" in generalOptions to minimum LedCount
var ledType = $(this).val();
var specificOptions = window.serverSchema.properties.alldevices[$(this).val()];
//philipshueentertainment backward fix
if(ledType == "philipshueentertainment") ledType = "philipshue";
var specificOptions = window.serverSchema.properties.alldevices[ledType];
conf_editor = createJsonEditor('editor_container', {
generalOptions : generalOptions,
specificOptions : specificOptions,
@@ -506,21 +510,19 @@ $(document).ready(function() {
var values_general = {};
var values_specific = {};
var isCurrentDevice = (window.serverConfig.device.type == $(this).val());
var isCurrentDevice = (window.serverConfig.device.type == ledType);
for(var key in window.serverConfig.device){
if (key != "type" && key in generalOptions.properties)
values_general[key] = window.serverConfig.device[key];
for(var key in window.serverConfig.device) {
if (key != "type" && key in generalOptions.properties) values_general[key] = window.serverConfig.device[key];
};
conf_editor.getEditor("root.generalOptions").setValue( values_general );
if (isCurrentDevice)
{
var specificOptions_val = conf_editor.getEditor("root.specificOptions").getValue()
var specificOptions_val = conf_editor.getEditor("root.specificOptions").getValue();
for(var key in specificOptions_val){
values_specific[key] = (key in window.serverConfig.device) ? window.serverConfig.device[key] : specificOptions_val[key];
values_specific[key] = (key in window.serverConfig.device) ? window.serverConfig.device[key] : specificOptions_val[key];
};
conf_editor.getEditor("root.specificOptions").setValue( values_specific );
};
@@ -528,18 +530,29 @@ $(document).ready(function() {
conf_editor.validate().length ? $('#btn_submit_controller').attr('disabled', true) : $('#btn_submit_controller').attr('disabled', false);
// led controller sepecific wizards
if($(this).val() == "philipshue")
{
createHint("wizard", $.i18n('wiz_hue_title'), "btn_wiz_holder","btn_led_device_wiz");
$('#btn_led_device_wiz').off().on('click',startWizardPhilipsHue);
}
else
{
$('#btn_wiz_holder').html("")
$('#btn_led_device_wiz').off();
}
$('#btn_wiz_holder').html("")
$('#btn_led_device_wiz').off();
if(ledType == "philipshue") {
$('#root_specificOptions_useEntertainmentAPI').bind("change", function() {
var ledWizardType = (this.checked) ? "philipshueentertainment" : ledType;
var data = { type: ledWizardType };
var hue_title = (this.checked) ? 'wiz_hue_e_title' : 'wiz_hue_title';
changeWizard(data, hue_title, startWizardPhilipsHue);
});
$("#root_specificOptions_useEntertainmentAPI").trigger("change");
}
function changeWizard(data, hint, fn) {
$('#btn_wiz_holder').html("")
createHint("wizard", $.i18n(hint), "btn_wiz_holder","btn_led_device_wiz");
$('#btn_led_device_wiz').off().on('click', data , fn);
}
});
//philipshueentertainment backward fix
if(window.serverConfig.device.type == "philipshueentertainment") window.serverConfig.device.type = "philipshue";
// create led device selection
var ledDevices = window.serverInfo.ledDevices.available;
var devRPiSPI = ['apa102', 'apa104', 'ws2801', 'lpd6803', 'lpd8806', 'p9813', 'sk6812spi', 'sk6822spi', 'ws2812spi'];

View File

@@ -147,15 +147,19 @@ $(document).ready(function() {
//roundRect(ledsCanvasNodeCtx, led.hmin * canvas_width, led.vmin * canvas_height, (led.hmax-led.hmin) * canvas_width, (led.vmax-led.vmin) * canvas_height, 4, true, colors[idx])
//ledsCanvasNodeCtx.fillRect(led.hmin * canvas_width, led.vmin * canvas_height, (led.hmax-led.hmin) * canvas_width, (led.vmax-led.vmin) * canvas_height);
ledsCanvasNodeCtx.fillStyle = (useColor) ? "rgba("+colors[cPos]+","+colors[cPos+1]+","+colors[cPos+2]+",0.9)" : "hsl("+(idx*360/leds.length)+",100%,50%)";
ledsCanvasNodeCtx.fillStyle = (useColor) ? "rgba("+colors[cPos]+","+colors[cPos+1]+","+colors[cPos+2]+",0.75)" : "hsla("+(idx*360/leds.length)+",100%,50%,0.75)";
ledsCanvasNodeCtx.fill(twoDPaths[idx]);
ledsCanvasNodeCtx.stroke(twoDPaths[idx]);
if(toggleLedsNum)
{
ledsCanvasNodeCtx.fillStyle = "blue";
//ledsCanvasNodeCtx.shadowOffsetX = 1;
//ledsCanvasNodeCtx.shadowOffsetY = 1;
//ledsCanvasNodeCtx.shadowColor = "black";
//ledsCanvasNodeCtx.shadowBlur = 4;
ledsCanvasNodeCtx.fillStyle = "white";
ledsCanvasNodeCtx.textAlign = "center";
ledsCanvasNodeCtx.fillText(idx, (led.hmin * canvas_width) + ( ((led.hmax-led.hmin) * canvas_width) / 2), (led.vmin * canvas_height) + ( ((led.vmax-led.vmin) * canvas_height) / 2));
ledsCanvasNodeCtx.fillText(((led.name) ? led.name : idx), (led.hmin * canvas_width) + ( ((led.hmax-led.hmin) * canvas_width) / 2), (led.vmin * canvas_height) + ( ((led.vmax-led.vmin) * canvas_height) / 2));
}
// increment colorsPosition

View File

@@ -247,7 +247,7 @@
String.locale = String.locale || $( 'html' ).attr( 'lang' );
if ( !String.locale ) {
if ( typeof window.navigator !== undefined ) {
if ( typeof window.navigator !== 'undefined' ) {
nav = window.navigator;
String.locale = nav.language || nav.userLanguage || '';
} else {

View File

@@ -360,7 +360,7 @@
// Check if the restore to Latin number flag is set:
if ( integer ) {
if ( parseFloat( num, 10 ) === num ) {
if ( parseFloat( num ) === num ) {
return num;
}
@@ -381,7 +381,7 @@
}
}
return integer ? parseFloat( convertedNumber, 10 ) : convertedNumber;
return integer ? parseFloat( convertedNumber ) : convertedNumber;
},
/**

View File

@@ -157,20 +157,16 @@ $(document).ready( function() {
{
if(lsys != window.wSess[i].host+':'+window.wSess[i].port)
{
var hyperionAddress
if (window.wSess[i].address.indexOf(':') > -1 && window.wSess[i].address.length == 36)
hyperionAddress = 'http://['+window.wSess[i].address+']:'+window.wSess[i].port
else
hyperionAddress = 'http://'+window.wSess[i].address+':'+window.wSess[i].port
$('#id_select').append(createSelOpt(hyperionAddress, window.wSess[i].host))
var hyperionAddress = window.wSess[i].address;
if(hyperionAddress.indexOf(':') > -1 && hyperionAddress.length == 36) hyperionAddress = '['+hyperionAddress+']';
hyperionAddress = 'http://'+hyperionAddress+':'+window.wSess[i].port;
$('#id_select').append(createSelOpt(hyperionAddress, window.wSess[i].name));
}
}
$('#id_btn_saveset').off().on('click',function() {
$("#loading_overlay").addClass("overlay");
window.location.href = $('#id_select').val()
window.location.href = $('#id_select').val();
});
});

View File

@@ -2,7 +2,7 @@ $(document).ready( function() {
// check if browser supports streaming
if(window.navigator.mediaDevices && window.navigator.mediaDevices.getDisplayMedia){
$("#btn_streamer").toggle()
$("#btn_streamer").toggle();
}
// variables

View File

@@ -109,7 +109,7 @@ function loadContent(event, forceRefresh)
var lastSelectedInstance = getStorage('lastSelectedInstance', false);
if (lastSelectedInstance && (lastSelectedInstance != window.currentHyperionInstance))
if (typeof(window.serverInfo.instance[lastSelectedInstance].running) !== 'undefined' && window.serverInfo.instance[lastSelectedInstance].running)
if (typeof(window.serverInfo.instance[lastSelectedInstance].running) !== 'undefined' && window.serverInfo.instance[lastSelectedInstance].running)
instanceSwitch(lastSelectedInstance);
else
removeStorage('lastSelectedInstance', false);
@@ -890,12 +890,12 @@ function getReleases(callback)
continue;
if(releases[i].tag_name.includes('alpha'))
{
{
if (sem = semverLite.gt(releases[i].tag_name, highestAlphaRelease.tag_name))
highestAlphaRelease = releases[i];
highestAlphaRelease = releases[i];
}
else if (releases[i].tag_name.includes('beta'))
{
{
if (sem = semverLite.gt(releases[i].tag_name, highestBetaRelease.tag_name))
highestBetaRelease = releases[i];
}
@@ -907,7 +907,7 @@ function getReleases(callback)
else
{
if (semverLite.gt(releases[i].tag_name, highestRelease.tag_name))
highestRelease = releases[i];
highestRelease = releases[i];
}
}
window.latestStableVersion = highestRelease;
@@ -915,7 +915,7 @@ function getReleases(callback)
window.latestAlphaVersion= highestAlphaRelease;
window.latestRcVersion = highestRcRelease;
if(window.serverConfig.general.watchedVersionBranch == "Beta" && semverLite.gt(highestBetaRelease.tag_name, highestRelease.tag_name))
window.latestVersion = highestBetaRelease;
else
@@ -951,4 +951,4 @@ function handleDarkMode()
setStorage("darkMode", "on", false);
$('#btn_darkmode_icon').removeClass('fa fa-moon-o');
$('#btn_darkmode_icon').addClass('fa fa-sun-o');
}
}

File diff suppressed because it is too large Load Diff