2020-11-14 16:22:21 +01:00
|
|
|
$(document).ready(function () {
|
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>
2020-05-22 19:40:50 +02:00
|
|
|
performTranslation();
|
2021-02-14 12:36:21 +01:00
|
|
|
var conf_editor_video = null;
|
|
|
|
var conf_editor_screen = null;
|
2020-05-02 15:47:15 +02:00
|
|
|
var conf_editor_instCapt = null;
|
2021-02-14 11:39:03 +01:00
|
|
|
var VIDEOGRABBER_AVAIL = window.serverInfo.grabbers.available.includes("v4l2");
|
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>
2020-05-22 19:40:50 +02:00
|
|
|
|
2020-11-14 16:22:21 +01:00
|
|
|
if (window.showOptHelp) {
|
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>
2020-05-22 19:40:50 +02:00
|
|
|
// 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")));
|
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
// Screen-Grabber
|
2021-02-14 12:36:21 +01:00
|
|
|
$('#conf_cont').append(createRow('conf_cont_screen'));
|
|
|
|
$('#conf_cont_screen').append(createOptPanel('fa-camera', $.i18n("edt_conf_fg_heading_title"), 'editor_container_screengrabber', 'btn_submit_screengrabber'));
|
|
|
|
$('#conf_cont_screen').append(createHelpTable(window.schema.framegrabber.properties, $.i18n("edt_conf_fg_heading_title")));
|
2018-12-27 23:11:32 +01:00
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
// Video-Grabber - hide if not available
|
2021-02-14 11:39:03 +01:00
|
|
|
if (VIDEOGRABBER_AVAIL) {
|
2021-02-14 12:36:21 +01:00
|
|
|
$('#conf_cont').append(createRow('conf_cont_video'));
|
|
|
|
$('#conf_cont_video').append(createOptPanel('fa-camera', $.i18n("edt_conf_v4l2_heading_title"), 'editor_container_videograbber', 'btn_submit_videograbber'));
|
|
|
|
$('#conf_cont_video').append(createHelpTable(window.schema.grabberV4L2.properties, $.i18n("edt_conf_v4l2_heading_title")));
|
2020-05-02 15:47:15 +02:00
|
|
|
}
|
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>
2020-05-22 19:40:50 +02:00
|
|
|
} else {
|
|
|
|
$('#conf_cont').addClass('row');
|
|
|
|
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_instCapture_heading_title"), 'editor_container_instCapt', 'btn_submit_instCapt'));
|
2021-02-14 12:36:21 +01:00
|
|
|
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_fg_heading_title"), 'editor_container_screengrabber', 'btn_submit_screengrabber'));
|
2021-02-14 11:39:03 +01:00
|
|
|
if (VIDEOGRABBER_AVAIL) {
|
2021-02-14 12:36:21 +01:00
|
|
|
$('#conf_cont').append(createOptPanel('fa-camera', $.i18n("edt_conf_v4l2_heading_title"), 'editor_container_videograbber', 'btn_submit_videograbber'));
|
2020-05-02 15:47:15 +02:00
|
|
|
}
|
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>
2020-05-22 19:40:50 +02:00
|
|
|
}
|
2020-04-17 16:59:20 +02:00
|
|
|
|
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>
2020-05-22 19:40:50 +02:00
|
|
|
// Instance Capture
|
|
|
|
conf_editor_instCapt = createJsonEditor('editor_container_instCapt', {
|
|
|
|
instCapture: window.schema.instCapture
|
|
|
|
}, true, true);
|
2018-12-27 23:11:32 +01:00
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
// Hide Video-Grabber elements, if not available
|
2021-02-14 11:39:03 +01:00
|
|
|
if (!VIDEOGRABBER_AVAIL) {
|
2020-12-29 15:54:32 +01:00
|
|
|
$('[data-schemapath*="root.instCapture.v4lEnable' + '"]').hide();
|
|
|
|
$('[data-schemapath*="root.instCapture.v4lPriority' + '"]').hide();
|
|
|
|
}
|
2020-11-14 16:22:21 +01:00
|
|
|
|
2020-12-29 15:54:32 +01:00
|
|
|
conf_editor_instCapt.on('change', function () {
|
2021-02-14 12:36:21 +01:00
|
|
|
var screenEnable = conf_editor_instCapt.getEditor("root.instCapture.systemEnable").getValue();
|
|
|
|
if (screenEnable) {
|
2020-12-29 15:54:32 +01:00
|
|
|
$('[data-schemapath*="root.instCapture.systemPriority' + '"]').show();
|
2021-02-14 12:36:21 +01:00
|
|
|
$('#conf_cont_screen').show();
|
2020-12-29 15:54:32 +01:00
|
|
|
} else {
|
2021-02-14 12:36:21 +01:00
|
|
|
$('#conf_cont_screen').hide();
|
2020-12-29 15:54:32 +01:00
|
|
|
$('[data-schemapath*="root.instCapture.systemPriority' + '"]').hide();
|
2020-11-14 16:22:21 +01:00
|
|
|
}
|
|
|
|
|
2021-02-14 11:39:03 +01:00
|
|
|
if (VIDEOGRABBER_AVAIL) {
|
2021-02-14 12:36:21 +01:00
|
|
|
var videoEnable = conf_editor_instCapt.getEditor("root.instCapture.v4lEnable").getValue();
|
|
|
|
if (videoEnable) {
|
2020-12-29 15:54:32 +01:00
|
|
|
$('[data-schemapath*="root.instCapture.v4lPriority' + '"]').show();
|
2021-02-14 12:36:21 +01:00
|
|
|
$('#conf_cont_video').show();
|
2021-02-14 11:39:03 +01:00
|
|
|
}
|
|
|
|
else {
|
2020-12-29 15:54:32 +01:00
|
|
|
$('[data-schemapath*="root.instCapture.v4lPriority' + '"]').hide();
|
2021-02-14 12:36:21 +01:00
|
|
|
$('#conf_cont_video').hide();
|
2020-12-18 17:38:21 +01:00
|
|
|
}
|
2020-12-29 15:54:32 +01:00
|
|
|
}
|
2021-02-14 11:39:03 +01:00
|
|
|
|
2020-12-29 15:54:32 +01:00
|
|
|
conf_editor_instCapt.validate().length || window.readOnlyMode ? $('#btn_submit_instCapt').attr('disabled', true) : $('#btn_submit_instCapt').attr('disabled', false);
|
|
|
|
});
|
2020-11-14 16:22:21 +01:00
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
|
|
|
|
conf_editor_instCapt.watch('root.instCapture.systemEnable', () => {
|
|
|
|
var systemEnable = conf_editor_instCapt.getEditor("root.instCapture.systemEnable").getValue();
|
|
|
|
if (systemEnable) {
|
|
|
|
discoverInputSources("screen");
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
2021-02-14 11:39:03 +01:00
|
|
|
conf_editor_instCapt.watch('root.instCapture.v4lEnable', () => {
|
|
|
|
if (VIDEOGRABBER_AVAIL) {
|
2021-02-14 12:36:21 +01:00
|
|
|
var videoEnable = conf_editor_instCapt.getEditor("root.instCapture.v4lEnable").getValue();
|
|
|
|
if (videoEnable) {
|
2021-02-14 11:39:03 +01:00
|
|
|
discoverInputSources("video");
|
|
|
|
}
|
|
|
|
}
|
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>
2020-05-22 19:40:50 +02:00
|
|
|
});
|
2018-12-27 23:11:32 +01:00
|
|
|
|
2021-02-14 11:39:03 +01:00
|
|
|
$('#btn_submit_instCapt').off().on('click', function () {
|
|
|
|
requestWriteConfig(conf_editor_instCapt.getValue());
|
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>
2020-05-22 19:40:50 +02:00
|
|
|
});
|
2018-12-27 23:11:32 +01:00
|
|
|
|
2021-02-17 23:26:39 +01:00
|
|
|
JSONEditor.defaults.custom_validators.push(function (schema, value, path) {
|
|
|
|
var errors = [];
|
|
|
|
|
|
|
|
if (path === "root.grabberV4L2" || path === "root.framegrabber") {
|
|
|
|
var editor;
|
|
|
|
switch (path) {
|
|
|
|
case "root.framegrabber":
|
|
|
|
editor = conf_editor_screen;
|
|
|
|
break;
|
|
|
|
case "root.grabberV4L2":
|
|
|
|
editor = conf_editor_video;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (value.cropLeft || value.cropRight) {
|
|
|
|
var width = editor.getEditor(path + ".width").getValue();
|
|
|
|
if (value.cropLeft + value.cropRight > width) {
|
|
|
|
errors.push({
|
|
|
|
path: path,
|
|
|
|
property: 'maximum',
|
|
|
|
message: $.i18n('edt_conf_v4l2_cropWidthValidation_error', width)
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (value.cropTop || value.cropBottom) {
|
|
|
|
var height = editor.getEditor(path + ".height").getValue();
|
|
|
|
if (value.cropTop + value.cropBottom > height) {
|
|
|
|
errors.push({
|
|
|
|
path: path,
|
|
|
|
property: 'maximum',
|
|
|
|
message: $.i18n('edt_conf_v4l2_cropHeightValidation_error', height)
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return errors;
|
|
|
|
});
|
|
|
|
|
|
|
|
function updateCropForWidth(editor, path) {
|
|
|
|
var width = editor.getEditor(path+".width").getValue();
|
|
|
|
updateJsonEditorRange(editor.getEditor(path), 'cropLeft', 0, width);
|
|
|
|
updateJsonEditorRange(editor.getEditor(path), 'cropRight', 0, width);
|
|
|
|
}
|
|
|
|
|
|
|
|
function updateCropForHeight(editor, path) {
|
|
|
|
var height = editor.getEditor(path + ".height").getValue();
|
|
|
|
updateJsonEditorRange(editor.getEditor(path), 'cropTop', 0, height);
|
|
|
|
updateJsonEditorRange(editor.getEditor(path), 'cropBottom', 0, height);
|
|
|
|
}
|
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
// Screen-Grabber
|
2021-02-14 12:36:21 +01:00
|
|
|
conf_editor_screen = createJsonEditor('editor_container_screengrabber', {
|
2020-12-29 15:54:32 +01:00
|
|
|
framegrabber: window.schema.framegrabber
|
|
|
|
}, true, true);
|
|
|
|
|
2021-02-14 12:36:21 +01:00
|
|
|
conf_editor_screen.on('ready', function () {
|
2020-12-29 15:54:32 +01:00
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
var screenEnable = conf_editor_instCapt.getEditor("root.instCapture.systemEnable").getValue();
|
|
|
|
if (screenEnable) {
|
|
|
|
discoverInputSources("screen");
|
|
|
|
}
|
2020-11-14 16:22:21 +01:00
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
updateCropForWidth(conf_editor_screen, "root.framegrabber");
|
|
|
|
updateCropForHeight(conf_editor_screen, "root.framegrabber");
|
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>
2020-05-22 19:40:50 +02:00
|
|
|
});
|
2018-12-27 23:11:32 +01:00
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
conf_editor_screen.on('change', function () {
|
|
|
|
conf_editor_screen.validate().length || window.readOnlyMode ? $('#btn_submit_screengrabber').attr('disabled', true) : $('#btn_submit_screengrabber').attr('disabled', false);
|
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>
2020-05-22 19:40:50 +02:00
|
|
|
});
|
2018-12-27 23:11:32 +01:00
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
conf_editor_screen.watch('root.framegrabber.type', () => {
|
|
|
|
var selectedType = conf_editor_screen.getEditor("root.framegrabber.type").getValue();
|
|
|
|
filterScreenInputOptions(selectedType);
|
|
|
|
});
|
2016-09-10 23:30:05 +02:00
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
conf_editor_screen.watch('root.framegrabber.available_devices', () => {
|
|
|
|
var deviceSelected = conf_editor_screen.getEditor("root.framegrabber.available_devices").getValue();
|
|
|
|
if (deviceSelected === "NONE" || deviceSelected === "") {
|
|
|
|
$('#btn_submit_screengrabber').attr('disabled', true);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
var addSchemaElements = {};
|
|
|
|
var enumVals = [];
|
|
|
|
var enumTitelVals = [];
|
|
|
|
var enumDefaultVal = "";
|
2018-12-27 23:11:32 +01:00
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
var deviceProperties = getPropertiesOfDevice(deviceSelected);
|
2020-04-17 16:59:20 +02:00
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
//Update hidden input element
|
|
|
|
conf_editor_screen.getEditor("root.framegrabber.device").setValue(deviceProperties.device);
|
2020-04-17 16:59:20 +02:00
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
var video_inputs = deviceProperties.video_inputs;
|
|
|
|
if (video_inputs.length <= 1) {
|
|
|
|
addSchemaElements.access = "expert";
|
|
|
|
}
|
2020-04-17 16:59:20 +02:00
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
for (const video_input of video_inputs) {
|
|
|
|
enumVals.push(video_input.inputIdx);
|
|
|
|
enumTitelVals.push(video_input.name);
|
2020-05-02 15:47:15 +02:00
|
|
|
}
|
2020-04-17 16:59:20 +02:00
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
if (enumVals.length > 0) {
|
|
|
|
if (deviceSelected === configuredDevice) {
|
|
|
|
var configuredVideoInput = window.serverConfig.framegrabber.input;
|
|
|
|
if ($.inArray(configuredVideoInput, enumVals) != -1) {
|
|
|
|
enumDefaultVal = configuredVideoInput;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
updateJsonEditorSelection(conf_editor_screen.getEditor('root.framegrabber'),
|
|
|
|
'device_inputs', addSchemaElements, enumVals, enumTitelVals, enumDefaultVal, false);
|
|
|
|
}
|
2020-06-17 20:55:57 +02:00
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
if (!window.readOnlyMode) {
|
|
|
|
$('#btn_submit_screengrabber').attr('disabled', false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2020-04-17 16:59:20 +02:00
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
conf_editor_screen.watch('root.framegrabber.device_inputs', () => {
|
|
|
|
var deviceSelected = conf_editor_screen.getEditor("root.framegrabber.available_devices").getValue();
|
|
|
|
var videoInputSelected = conf_editor_screen.getEditor("root.framegrabber.device_inputs").getValue();
|
2020-04-17 16:59:20 +02:00
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
//Update hidden input element
|
|
|
|
conf_editor_screen.getEditor("root.framegrabber.input").setValue(parseInt(videoInputSelected));
|
2020-04-17 16:59:20 +02:00
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
var addSchemaElements = {};
|
2020-12-29 15:54:32 +01:00
|
|
|
var enumVals = [];
|
|
|
|
var enumTitelVals = [];
|
|
|
|
var enumDefaultVal = "";
|
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
var deviceProperties = getPropertiesOfDevice(deviceSelected);
|
2020-04-17 16:59:20 +02:00
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
var formats = deviceProperties.video_inputs[videoInputSelected].formats;
|
|
|
|
var formatIdx = 0;
|
|
|
|
/*
|
|
|
|
if (formatSelected !== "NONE") {
|
|
|
|
formatIdx = formats.findIndex(x => x.format === formatSelected);
|
2020-12-29 15:54:32 +01:00
|
|
|
}
|
2021-04-04 12:43:29 +02:00
|
|
|
*/
|
2020-12-29 15:54:32 +01:00
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
var resolutions = formats[formatIdx].resolutions;
|
|
|
|
if (resolutions.length <= 1) {
|
|
|
|
addSchemaElements.access = "advanced";
|
|
|
|
} else {
|
|
|
|
resolutions.sort(compareTwoValues('width', 'height', 'asc'));
|
|
|
|
}
|
2020-12-29 15:54:32 +01:00
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
for (var i = 0; i < resolutions.length; i++) {
|
|
|
|
enumVals.push(i);
|
|
|
|
var resolutionText = resolutions[i].width + "x" + resolutions[i].height;
|
|
|
|
enumTitelVals.push(resolutionText);
|
|
|
|
}
|
2020-06-17 20:55:57 +02:00
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
if (enumVals.length > 0) {
|
|
|
|
if (deviceSelected === configuredDevice) {
|
|
|
|
var configuredResolutionText = window.serverConfig.framegrabber.width + "x" + window.serverConfig.framegrabber.height;
|
|
|
|
var idx = $.inArray(configuredResolutionText, enumTitelVals)
|
|
|
|
if (idx != -1) {
|
|
|
|
enumDefaultVal = idx;
|
|
|
|
}
|
2020-12-29 15:54:32 +01:00
|
|
|
}
|
2020-04-17 16:59:20 +02:00
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
updateJsonEditorSelection(conf_editor_screen.getEditor('root.framegrabber'),
|
|
|
|
'resolutions', addSchemaElements, enumVals, enumTitelVals, enumDefaultVal, false);
|
|
|
|
}
|
2020-04-17 16:59:20 +02:00
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
if (!window.readOnlyMode) {
|
|
|
|
$('#btn_submit_videograbber').attr('disabled', false);
|
2020-12-29 15:54:32 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
conf_editor_screen.watch('root.framegrabber.resolutions', () => {
|
|
|
|
var deviceSelected = conf_editor_screen.getEditor("root.framegrabber.available_devices").getValue();
|
|
|
|
var videoInputSelected = conf_editor_screen.getEditor("root.framegrabber.device_inputs").getValue();
|
|
|
|
var resolutionSelected = conf_editor_screen.getEditor("root.framegrabber.resolutions").getValue();
|
2020-04-17 16:59:20 +02:00
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
var addSchemaElements = {};
|
|
|
|
var enumVals = [];
|
|
|
|
var enumDefaultVal = "";
|
2018-12-27 23:11:32 +01:00
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
var deviceProperties = getPropertiesOfDevice(deviceSelected);
|
2020-04-17 16:59:20 +02:00
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
var formats = deviceProperties.video_inputs[videoInputSelected].formats;
|
|
|
|
var formatIdx = 0;
|
|
|
|
/*
|
|
|
|
if (formatSelected !== "NONE") {
|
|
|
|
formatIdx = formats.findIndex(x => x.format === formatSelected);
|
2020-05-02 15:47:15 +02:00
|
|
|
}
|
2021-04-04 12:43:29 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
//Update hidden resolution related elements
|
|
|
|
var width = parseInt(formats[formatIdx].resolutions[resolutionSelected].width);
|
|
|
|
conf_editor_screen.getEditor("root.framegrabber.width").setValue(width);
|
|
|
|
|
|
|
|
var height = parseInt(formats[formatIdx].resolutions[resolutionSelected].height);
|
|
|
|
conf_editor_screen.getEditor("root.framegrabber.height").setValue(height);
|
|
|
|
|
|
|
|
//Update crop rage depending on selected resolution
|
2021-02-17 23:26:39 +01:00
|
|
|
updateCropForWidth(conf_editor_screen, "root.framegrabber");
|
|
|
|
updateCropForHeight(conf_editor_screen, "root.framegrabber");
|
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
var fps = formats[formatIdx].resolutions[resolutionSelected].fps;
|
|
|
|
if (!fps) {
|
|
|
|
enumVals.push("NONE");
|
|
|
|
addSchemaElements.options = { "hidden": true };
|
|
|
|
} else {
|
|
|
|
fps.sort((a, b) => a - b);
|
|
|
|
for (var i = 0; i < fps.length; i++) {
|
|
|
|
enumVals.push(fps[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (enumVals.length <= 1) {
|
|
|
|
addSchemaElements.access = "expert";
|
|
|
|
}
|
|
|
|
|
|
|
|
if (enumVals.length > 0) {
|
|
|
|
if (deviceSelected === configuredDevice) {
|
|
|
|
var configuredFps = window.serverConfig.framegrabber.fps;
|
|
|
|
if ($.inArray(configuredFps, enumVals) != -1) {
|
|
|
|
enumDefaultVal = configuredFps;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
updateJsonEditorSelection(conf_editor_screen.getEditor('root.framegrabber'),
|
|
|
|
'framerates', addSchemaElements, enumVals, [], enumDefaultVal, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!window.readOnlyMode) {
|
|
|
|
$('#btn_submit_screengrabber').attr('disabled', false);
|
|
|
|
}
|
2021-02-17 23:26:39 +01:00
|
|
|
});
|
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
conf_editor_screen.watch('root.framegrabber.framerates', () => {
|
|
|
|
//Update hidden fps element
|
|
|
|
var fps = 0;
|
|
|
|
var framerates = conf_editor_screen.getEditor("root.framegrabber.framerates").getValue();
|
|
|
|
if (framerates !== "NONE") {
|
|
|
|
fps = parseInt(framerates);
|
|
|
|
}
|
|
|
|
|
|
|
|
//Show Frameskipping only when more than 2 fps
|
|
|
|
if (fps > 2 && storedAccess === "expert") {
|
|
|
|
showVideoInputOptions(["fpsSoftwareDecimation"], true);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
showVideoInputOptions(["fpsSoftwareDecimation"], false);
|
|
|
|
}
|
|
|
|
conf_editor_screen.getEditor("root.framegrabber.fps").setValue(fps);
|
2021-02-17 23:26:39 +01:00
|
|
|
});
|
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
|
2021-02-17 23:26:39 +01:00
|
|
|
conf_editor_screen.watch('root.framegrabber.width', () => {
|
|
|
|
updateCropForWidth(conf_editor_screen, "root.framegrabber");
|
|
|
|
});
|
|
|
|
|
|
|
|
conf_editor_screen.watch('root.framegrabber.height', () => {
|
|
|
|
updateCropForHeight(conf_editor_screen, "root.framegrabber");
|
2020-12-29 15:54:32 +01:00
|
|
|
});
|
|
|
|
|
2021-02-14 12:36:21 +01:00
|
|
|
function showScreenInputOptions(el, state) {
|
2020-11-14 16:22:21 +01:00
|
|
|
for (var i = 0; i < el.length; i++) {
|
|
|
|
$('[data-schemapath*="root.framegrabber.' + el[i] + '"]').toggle(state);
|
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>
2020-05-22 19:40:50 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-14 12:36:21 +01:00
|
|
|
function filterScreenInputOptions(type) {
|
2020-12-29 15:54:32 +01:00
|
|
|
//hide specific options for grabbers found
|
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>
2020-05-22 19:40:50 +02:00
|
|
|
var grabbers = window.serverInfo.grabbers.available;
|
2020-11-14 16:22:21 +01:00
|
|
|
if (grabbers.indexOf(type) > -1) {
|
2021-02-14 12:36:21 +01:00
|
|
|
showScreenInputOptions(["width", "height", "pixelDecimation", "display"], true);
|
2020-11-14 16:22:21 +01:00
|
|
|
|
|
|
|
switch (type) {
|
|
|
|
case "dispmanx":
|
2021-02-14 12:36:21 +01:00
|
|
|
showScreenInputOptions(["pixelDecimation", "display"], false);
|
2020-11-14 16:22:21 +01:00
|
|
|
break;
|
|
|
|
case "x11":
|
|
|
|
case "xcb":
|
2021-02-14 12:36:21 +01:00
|
|
|
showScreenInputOptions(["width", "height", "display"], false);
|
2020-11-14 16:22:21 +01:00
|
|
|
break;
|
|
|
|
case "framebuffer":
|
2021-02-14 12:36:21 +01:00
|
|
|
showScreenInputOptions(["display"], false);
|
2020-11-14 16:22:21 +01:00
|
|
|
break;
|
|
|
|
case "amlogic":
|
2021-02-14 12:36:21 +01:00
|
|
|
showScreenInputOptions(["pixelDecimation", "display"], false);
|
2020-11-14 16:22:21 +01:00
|
|
|
break;
|
|
|
|
case "qt":
|
|
|
|
break;
|
|
|
|
case "dx":
|
|
|
|
break;
|
|
|
|
case "osx":
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
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>
2020-05-22 19:40:50 +02:00
|
|
|
|
2021-02-14 12:36:21 +01:00
|
|
|
$('#btn_submit_screengrabber').off().on('click', function () {
|
2021-04-04 12:43:29 +02:00
|
|
|
var saveOptions = conf_editor_screen.getValue();
|
|
|
|
|
|
|
|
var instCaptOptions = window.serverConfig.instCapture;
|
|
|
|
instCaptOptions.systemEnable = true;
|
|
|
|
saveOptions.instCapture = instCaptOptions;
|
|
|
|
|
|
|
|
requestWriteConfig(saveOptions);
|
2021-02-14 11:39:03 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
// External Input Sources (Video-Grabbers)
|
|
|
|
|
|
|
|
var configuredDevice = "";
|
|
|
|
var discoveredInputSources = {};
|
|
|
|
var deviceProperties = {};
|
|
|
|
|
|
|
|
if (VIDEOGRABBER_AVAIL) {
|
2021-02-14 12:36:21 +01:00
|
|
|
conf_editor_video = createJsonEditor('editor_container_videograbber', {
|
2021-02-14 11:39:03 +01:00
|
|
|
grabberV4L2: window.schema.grabberV4L2
|
|
|
|
}, true, true);
|
|
|
|
|
2021-02-14 12:36:21 +01:00
|
|
|
conf_editor_video.on('ready', function () {
|
2021-02-14 11:39:03 +01:00
|
|
|
var v4lEnable = conf_editor_instCapt.getEditor("root.instCapture.v4lEnable").getValue();
|
|
|
|
if (v4lEnable) {
|
|
|
|
discoverInputSources("video");
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2021-02-14 12:36:21 +01:00
|
|
|
conf_editor_video.on('change', function () {
|
|
|
|
var deviceSelected = conf_editor_video.getEditor("root.grabberV4L2.available_devices").getValue();
|
|
|
|
if (!conf_editor_video.validate().length) {
|
2021-04-04 12:43:29 +02:00
|
|
|
|
|
|
|
switch (deviceSelected) {
|
|
|
|
case "SELECT":
|
|
|
|
showAllVideoInputOptions(conf_editor_video, "grabberV4L2", false);
|
|
|
|
break;
|
|
|
|
case "NONE":
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
window.readOnlyMode ? $('#btn_submit_videograbber').attr('disabled', true) : $('#btn_submit_videograbber').attr('disabled', false);
|
|
|
|
break;
|
2021-02-14 11:39:03 +01:00
|
|
|
}
|
|
|
|
}
|
2021-02-17 23:26:39 +01:00
|
|
|
else {
|
|
|
|
$('#btn_submit_videograbber').attr('disabled', true);
|
|
|
|
}
|
2021-02-14 11:39:03 +01:00
|
|
|
});
|
|
|
|
|
2021-02-14 12:36:21 +01:00
|
|
|
conf_editor_video.watch('root.grabberV4L2.available_devices', () => {
|
|
|
|
var deviceSelected = conf_editor_video.getEditor("root.grabberV4L2.available_devices").getValue();
|
2021-04-04 12:43:29 +02:00
|
|
|
if (deviceSelected === "NONE" || deviceSelected === "SELECT" || deviceSelected === "") {
|
2021-02-14 12:36:21 +01:00
|
|
|
$('#btn_submit_videograbber').attr('disabled', true);
|
2021-02-14 11:39:03 +01:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
var addSchemaElements = {};
|
|
|
|
var enumVals = [];
|
|
|
|
var enumTitelVals = [];
|
|
|
|
var enumDefaultVal = "";
|
|
|
|
|
|
|
|
var deviceProperties = getPropertiesOfDevice(deviceSelected);
|
|
|
|
|
|
|
|
//Update hidden input element
|
2021-02-14 12:36:21 +01:00
|
|
|
conf_editor_video.getEditor("root.grabberV4L2.device").setValue(deviceProperties.device);
|
2021-02-14 11:39:03 +01:00
|
|
|
|
|
|
|
var video_inputs = deviceProperties.video_inputs;
|
|
|
|
if (video_inputs.length <= 1) {
|
|
|
|
addSchemaElements.access = "expert";
|
|
|
|
}
|
|
|
|
|
|
|
|
for (const video_input of video_inputs) {
|
|
|
|
enumVals.push(video_input.inputIdx);
|
|
|
|
enumTitelVals.push(video_input.name);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (enumVals.length > 0) {
|
|
|
|
if (deviceSelected === configuredDevice) {
|
|
|
|
var configuredVideoInput = window.serverConfig.grabberV4L2.input;
|
|
|
|
if ($.inArray(configuredVideoInput, enumVals) != -1) {
|
|
|
|
enumDefaultVal = configuredVideoInput;
|
|
|
|
}
|
|
|
|
}
|
2021-04-04 12:43:29 +02:00
|
|
|
|
2021-02-14 12:36:21 +01:00
|
|
|
updateJsonEditorSelection(conf_editor_video.getEditor('root.grabberV4L2'),
|
2021-02-14 11:39:03 +01:00
|
|
|
'device_inputs', addSchemaElements, enumVals, enumTitelVals, enumDefaultVal, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!window.readOnlyMode) {
|
2021-02-14 12:36:21 +01:00
|
|
|
$('#btn_submit_videograbber').attr('disabled', false);
|
2021-02-14 11:39:03 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2021-02-14 12:36:21 +01:00
|
|
|
conf_editor_video.watch('root.grabberV4L2.device_inputs', () => {
|
|
|
|
var deviceSelected = conf_editor_video.getEditor("root.grabberV4L2.available_devices").getValue();
|
|
|
|
var videoInputSelected = conf_editor_video.getEditor("root.grabberV4L2.device_inputs").getValue();
|
2021-02-14 11:39:03 +01:00
|
|
|
|
|
|
|
var addSchemaElements = {};
|
|
|
|
var enumVals = [];
|
|
|
|
var enumTitelVals = [];
|
|
|
|
var enumDefaultVal = "";
|
|
|
|
|
|
|
|
var deviceProperties = getPropertiesOfDevice(deviceSelected);
|
|
|
|
var formats = deviceProperties.video_inputs[videoInputSelected].formats;
|
2021-02-17 23:26:39 +01:00
|
|
|
|
|
|
|
addSchemaElements.access = "advanced";
|
2021-02-14 11:39:03 +01:00
|
|
|
|
|
|
|
for (var i = 0; i < formats.length; i++) {
|
|
|
|
if (formats[i].format) {
|
|
|
|
enumVals.push(formats[i].format);
|
|
|
|
enumTitelVals.push(formats[i].format.toUpperCase());
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
enumVals.push("NONE");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (enumVals.length > 0) {
|
|
|
|
if (deviceSelected === configuredDevice) {
|
|
|
|
var configuredEncoding = window.serverConfig.grabberV4L2.encoding;
|
|
|
|
if ($.inArray(configuredEncoding, enumVals) != -1) {
|
|
|
|
enumDefaultVal = configuredEncoding;
|
|
|
|
}
|
|
|
|
}
|
2021-02-14 12:36:21 +01:00
|
|
|
updateJsonEditorSelection(conf_editor_video.getEditor('root.grabberV4L2'),
|
2021-02-14 11:39:03 +01:00
|
|
|
'encoding', addSchemaElements, enumVals, enumTitelVals, enumDefaultVal, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
var enumVals = [];
|
|
|
|
var enumDefaultVal = "";
|
|
|
|
|
|
|
|
var standards = deviceProperties.video_inputs[videoInputSelected].standards;
|
|
|
|
if (!standards) {
|
|
|
|
enumVals.push("NONE");
|
|
|
|
addSchemaElements.options = { "hidden": true };
|
|
|
|
} else {
|
|
|
|
enumVals = standards;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (enumVals.length > 0) {
|
|
|
|
if (deviceSelected === configuredDevice) {
|
|
|
|
var configuredStandard = window.serverConfig.grabberV4L2.standard;
|
|
|
|
if ($.inArray(configuredStandard, enumVals) != -1) {
|
|
|
|
enumDefaultVal = configuredStandard;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-14 12:36:21 +01:00
|
|
|
updateJsonEditorSelection(conf_editor_video.getEditor('root.grabberV4L2'),
|
2021-02-14 11:39:03 +01:00
|
|
|
'standard', addSchemaElements, enumVals, [], enumDefaultVal, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!window.readOnlyMode) {
|
2021-02-14 12:36:21 +01:00
|
|
|
$('#btn_submit_videograbber').attr('disabled', false);
|
2021-02-14 11:39:03 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2021-02-14 12:36:21 +01:00
|
|
|
conf_editor_video.watch('root.grabberV4L2.encoding', () => {
|
|
|
|
var deviceSelected = conf_editor_video.getEditor("root.grabberV4L2.available_devices").getValue();
|
|
|
|
var videoInputSelected = conf_editor_video.getEditor("root.grabberV4L2.device_inputs").getValue();
|
|
|
|
var formatSelected = conf_editor_video.getEditor("root.grabberV4L2.encoding").getValue();
|
2021-02-14 11:39:03 +01:00
|
|
|
|
|
|
|
//Update hidden input element
|
2021-02-14 12:36:21 +01:00
|
|
|
conf_editor_video.getEditor("root.grabberV4L2.input").setValue(parseInt(videoInputSelected));
|
2021-02-14 11:39:03 +01:00
|
|
|
|
|
|
|
var addSchemaElements = {};
|
|
|
|
var enumVals = [];
|
|
|
|
var enumTitelVals = [];
|
|
|
|
var enumDefaultVal = "";
|
|
|
|
|
|
|
|
var deviceProperties = getPropertiesOfDevice(deviceSelected);
|
|
|
|
|
|
|
|
var formats = deviceProperties.video_inputs[videoInputSelected].formats;
|
|
|
|
var formatIdx = 0;
|
|
|
|
if (formatSelected !== "NONE") {
|
|
|
|
formatIdx = formats.findIndex(x => x.format === formatSelected);
|
|
|
|
}
|
|
|
|
|
|
|
|
var resolutions = formats[formatIdx].resolutions;
|
|
|
|
if (resolutions.length <= 1) {
|
2021-04-04 12:43:29 +02:00
|
|
|
addSchemaElements.access = "advanced";
|
2021-02-14 11:39:03 +01:00
|
|
|
} else {
|
|
|
|
resolutions.sort(compareTwoValues('width', 'height', 'asc'));
|
|
|
|
}
|
|
|
|
|
|
|
|
for (var i = 0; i < resolutions.length; i++) {
|
|
|
|
enumVals.push(i);
|
|
|
|
var resolutionText = resolutions[i].width + "x" + resolutions[i].height;
|
|
|
|
enumTitelVals.push(resolutionText);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (enumVals.length > 0) {
|
|
|
|
if (deviceSelected === configuredDevice) {
|
|
|
|
var configuredResolutionText = window.serverConfig.grabberV4L2.width + "x" + window.serverConfig.grabberV4L2.height;
|
|
|
|
var idx = $.inArray(configuredResolutionText, enumTitelVals)
|
|
|
|
if (idx != -1) {
|
|
|
|
enumDefaultVal = idx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-14 12:36:21 +01:00
|
|
|
updateJsonEditorSelection(conf_editor_video.getEditor('root.grabberV4L2'),
|
2021-02-14 11:39:03 +01:00
|
|
|
'resolutions', addSchemaElements, enumVals, enumTitelVals, enumDefaultVal, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!window.readOnlyMode) {
|
2021-02-14 12:36:21 +01:00
|
|
|
$('#btn_submit_videograbber').attr('disabled', false);
|
2021-02-14 11:39:03 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2021-02-14 12:36:21 +01:00
|
|
|
conf_editor_video.watch('root.grabberV4L2.resolutions', () => {
|
|
|
|
var deviceSelected = conf_editor_video.getEditor("root.grabberV4L2.available_devices").getValue();
|
|
|
|
var videoInputSelected = conf_editor_video.getEditor("root.grabberV4L2.device_inputs").getValue();
|
|
|
|
var formatSelected = conf_editor_video.getEditor("root.grabberV4L2.encoding").getValue();
|
|
|
|
var resolutionSelected = conf_editor_video.getEditor("root.grabberV4L2.resolutions").getValue();
|
2021-02-14 11:39:03 +01:00
|
|
|
|
|
|
|
var addSchemaElements = {};
|
|
|
|
var enumVals = [];
|
|
|
|
var enumDefaultVal = "";
|
|
|
|
|
|
|
|
var deviceProperties = getPropertiesOfDevice(deviceSelected);
|
|
|
|
|
|
|
|
var formats = deviceProperties.video_inputs[videoInputSelected].formats;
|
|
|
|
var formatIdx = 0;
|
|
|
|
if (formatSelected !== "NONE") {
|
|
|
|
formatIdx = formats.findIndex(x => x.format === formatSelected);
|
|
|
|
}
|
|
|
|
|
|
|
|
//Update hidden resolution related elements
|
|
|
|
var width = parseInt(formats[formatIdx].resolutions[resolutionSelected].width);
|
2021-02-14 12:36:21 +01:00
|
|
|
conf_editor_video.getEditor("root.grabberV4L2.width").setValue(width);
|
2021-02-14 11:39:03 +01:00
|
|
|
|
|
|
|
var height = parseInt(formats[formatIdx].resolutions[resolutionSelected].height);
|
2021-02-14 12:36:21 +01:00
|
|
|
conf_editor_video.getEditor("root.grabberV4L2.height").setValue(height);
|
2021-02-14 11:39:03 +01:00
|
|
|
|
2021-02-17 23:26:39 +01:00
|
|
|
//Update crop rage depending on selected resolution
|
|
|
|
updateCropForWidth(conf_editor_video, "root.grabberV4L2");
|
|
|
|
updateCropForHeight(conf_editor_video, "root.grabberV4L2");
|
|
|
|
|
2021-02-14 11:39:03 +01:00
|
|
|
var fps = formats[formatIdx].resolutions[resolutionSelected].fps;
|
|
|
|
if (!fps) {
|
|
|
|
enumVals.push("NONE");
|
|
|
|
addSchemaElements.options = { "hidden": true };
|
|
|
|
} else {
|
|
|
|
fps.sort((a, b) => a - b);
|
|
|
|
for (var i = 0; i < fps.length; i++) {
|
|
|
|
enumVals.push(fps[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (enumVals.length <= 1) {
|
|
|
|
addSchemaElements.access = "expert";
|
|
|
|
}
|
|
|
|
|
|
|
|
if (enumVals.length > 0) {
|
|
|
|
if (deviceSelected === configuredDevice) {
|
|
|
|
var configuredFps = window.serverConfig.grabberV4L2.fps;
|
|
|
|
if ($.inArray(configuredFps, enumVals) != -1) {
|
|
|
|
enumDefaultVal = configuredFps;
|
|
|
|
}
|
|
|
|
}
|
2021-02-14 12:36:21 +01:00
|
|
|
updateJsonEditorSelection(conf_editor_video.getEditor('root.grabberV4L2'),
|
2021-02-14 11:39:03 +01:00
|
|
|
'framerates', addSchemaElements, enumVals, [], enumDefaultVal, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!window.readOnlyMode) {
|
2021-02-14 12:36:21 +01:00
|
|
|
$('#btn_submit_videograbber').attr('disabled', false);
|
2021-02-14 11:39:03 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2021-02-14 12:36:21 +01:00
|
|
|
conf_editor_video.watch('root.grabberV4L2.framerates', () => {
|
2021-02-14 11:39:03 +01:00
|
|
|
//Update hidden fps element
|
|
|
|
var fps = 0;
|
2021-02-14 12:36:21 +01:00
|
|
|
var framerates = conf_editor_video.getEditor("root.grabberV4L2.framerates").getValue();
|
2021-02-14 11:39:03 +01:00
|
|
|
if (framerates !== "NONE") {
|
|
|
|
fps = parseInt(framerates);
|
|
|
|
}
|
|
|
|
|
|
|
|
//Show Frameskipping only when more than 2 fps
|
2021-02-17 23:26:39 +01:00
|
|
|
if (fps > 2 && storedAccess === "expert" ) {
|
2021-02-14 12:36:21 +01:00
|
|
|
showVideoInputOptions(["fpsSoftwareDecimation"], true);
|
2021-02-14 11:39:03 +01:00
|
|
|
}
|
|
|
|
else {
|
2021-02-14 12:36:21 +01:00
|
|
|
showVideoInputOptions(["fpsSoftwareDecimation"], false);
|
2021-02-14 11:39:03 +01:00
|
|
|
}
|
2021-02-14 12:36:21 +01:00
|
|
|
conf_editor_video.getEditor("root.grabberV4L2.fps").setValue(fps);
|
2021-02-14 11:39:03 +01:00
|
|
|
});
|
|
|
|
|
2021-02-14 12:36:21 +01:00
|
|
|
$('#btn_submit_videograbber').off().on('click', function () {
|
2021-04-04 12:43:29 +02:00
|
|
|
var saveOptions = conf_editor_video.getValue();
|
|
|
|
|
|
|
|
var instCaptOptions = window.serverConfig.instCapture;
|
|
|
|
instCaptOptions.v4lEnable = true;
|
|
|
|
saveOptions.instCapture = instCaptOptions;
|
|
|
|
|
|
|
|
requestWriteConfig(saveOptions);
|
2021-02-14 11:39:03 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////
|
|
|
|
|
|
|
|
//create introduction
|
|
|
|
if (window.showOptHelp) {
|
2021-02-14 12:36:21 +01:00
|
|
|
createHint("intro", $.i18n('conf_grabber_fg_intro'), "editor_container_screengrabber");
|
2021-02-14 11:39:03 +01:00
|
|
|
if (VIDEOGRABBER_AVAIL) {
|
2021-02-14 12:36:21 +01:00
|
|
|
createHint("intro", $.i18n('conf_grabber_v4l_intro'), "editor_container_videograbber");
|
2021-02-14 11:39:03 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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>
2020-05-22 19:40:50 +02:00
|
|
|
removeOverlay();
|
2020-12-29 15:54:32 +01:00
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
// build dynamic screen input enum
|
|
|
|
var updateScreenSourcesList = function (type, discoveryInfo) {
|
2021-02-14 11:39:03 +01:00
|
|
|
var enumVals = [];
|
|
|
|
var enumTitelVals = [];
|
|
|
|
var enumDefaultVal = "";
|
|
|
|
|
|
|
|
if (jQuery.isEmptyObject(discoveryInfo)) {
|
|
|
|
enumVals.push("NONE");
|
|
|
|
enumTitelVals.push($.i18n('edt_conf_grabber_discovered_none'));
|
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
conf_editor_screen.getEditor('root.framegrabber').disable();
|
|
|
|
showAllVideoInputOptions(conf_editor_screen, "framegrabber", false);
|
2021-02-14 11:39:03 +01:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
for (const device of discoveryInfo) {
|
|
|
|
enumVals.push(device.device_name);
|
|
|
|
}
|
2021-04-04 12:43:29 +02:00
|
|
|
conf_editor_screen.getEditor('root.framegrabber').enable();
|
2021-02-14 11:39:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (enumVals.length > 0) {
|
2021-04-04 12:43:29 +02:00
|
|
|
configuredDevice = window.serverConfig.framegrabber.available_devices;
|
2021-02-14 11:39:03 +01:00
|
|
|
if ($.inArray(configuredDevice, enumVals) != -1) {
|
|
|
|
enumDefaultVal = configuredDevice;
|
|
|
|
}
|
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
updateJsonEditorSelection(conf_editor_screen.getEditor('root.framegrabber'),
|
2021-02-14 11:39:03 +01:00
|
|
|
'available_devices', {}, enumVals, enumTitelVals, enumDefaultVal, false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
// build dynamic video input enum
|
|
|
|
var updateVideoSourcesList = function (type, discoveryInfo) {
|
|
|
|
var enumVals = [];
|
|
|
|
var enumTitelVals = [];
|
|
|
|
var enumDefaultVal = "";
|
|
|
|
var addSelect = false;
|
|
|
|
|
|
|
|
if (jQuery.isEmptyObject(discoveryInfo)) {
|
|
|
|
enumVals.push("NONE");
|
|
|
|
enumTitelVals.push($.i18n('edt_conf_grabber_discovered_none'));
|
|
|
|
|
|
|
|
conf_editor_video.getEditor('root.grabberV4L2').disable();
|
|
|
|
showAllVideoInputOptions(conf_editor_video, "grabberV4L2", false);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
for (const device of discoveryInfo) {
|
|
|
|
enumVals.push(device.device_name);
|
|
|
|
}
|
|
|
|
conf_editor_video.getEditor('root.grabberV4L2').enable();
|
|
|
|
configuredDevice = window.serverConfig.grabberV4L2.available_devices;
|
|
|
|
|
|
|
|
if ($.inArray(configuredDevice, enumVals) != -1) {
|
|
|
|
enumDefaultVal = configuredDevice;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
addSelect = true;
|
|
|
|
showAllVideoInputOptions(conf_editor_video, "grabberV4L2", false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
updateJsonEditorSelection(conf_editor_video.getEditor('root.grabberV4L2'),
|
|
|
|
'available_devices', {}, enumVals, enumTitelVals, enumDefaultVal, addSelect);
|
|
|
|
}
|
|
|
|
|
2021-02-14 11:39:03 +01:00
|
|
|
async function discoverInputSources(type, params) {
|
|
|
|
const result = await requestInputSourcesDiscovery(type, params);
|
|
|
|
|
|
|
|
var discoveryResult;
|
|
|
|
if (result && !result.error) {
|
|
|
|
discoveryResult = result.info;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
discoveryResult = {
|
|
|
|
"video_sources": []
|
|
|
|
}
|
|
|
|
}
|
2021-04-04 12:43:29 +02:00
|
|
|
|
|
|
|
//console.log("discoveryResult", discoveryResult);
|
2021-02-14 11:39:03 +01:00
|
|
|
discoveredInputSources = discoveryResult.video_sources;
|
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
switch (type) {
|
|
|
|
case "screen":
|
|
|
|
updateScreenSourcesList(type, discoveredInputSources);
|
|
|
|
break;
|
|
|
|
case "video":
|
|
|
|
updateVideoSourcesList(type, discoveredInputSources);
|
|
|
|
break;
|
|
|
|
}
|
2021-02-14 11:39:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function getPropertiesOfDevice(deviceName) {
|
|
|
|
deviceProperties = {};
|
|
|
|
for (const deviceRecord of discoveredInputSources) {
|
|
|
|
if (deviceRecord.device_name === deviceName) {
|
|
|
|
deviceProperties = deviceRecord;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return deviceProperties;
|
|
|
|
}
|
2021-02-14 12:36:21 +01:00
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
function showVideoInputOptions(path, elements, state) {
|
2021-02-14 12:36:21 +01:00
|
|
|
for (var i = 0; i < elements.length; i++) {
|
2021-04-04 12:43:29 +02:00
|
|
|
$('[data-schemapath*="'+ path + '.' + elements[i] + '"]').toggle(state);
|
2021-02-14 12:36:21 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-04 12:43:29 +02:00
|
|
|
function showAllVideoInputOptions(editor, item, state) {
|
2021-02-14 12:36:21 +01:00
|
|
|
var elements = [];
|
2021-04-04 12:43:29 +02:00
|
|
|
for (var key in editor.schema.properties[item].properties) {
|
2021-02-14 12:36:21 +01:00
|
|
|
|
|
|
|
if (key !== "available_devices") {
|
|
|
|
elements.push(key);
|
|
|
|
}
|
|
|
|
}
|
2021-04-04 12:43:29 +02:00
|
|
|
showVideoInputOptions("root." + item, elements, state);
|
2021-02-14 12:36:21 +01:00
|
|
|
}
|
2021-02-14 11:39:03 +01:00
|
|
|
});
|