From 81f5f512577a97f4c9f01aa4a55fe63d64cfd065 Mon Sep 17 00:00:00 2001 From: brindosch Date: Mon, 4 Sep 2017 23:12:59 +0200 Subject: [PATCH] UI fixes/updates (#468) * fix logging display * hue wizard add usrname * fix restartAction sometimes not executed * remove configRevision * remove v4l2 grabMode(2d/3d) * remove latchTime from configs not in main led device schema * config comment: all grabbers can crop * remove smoothing delay&pause for effects * finalize disable effects ui * fix empty effect selects * remote page add 2D/3D videoMode * add blackborder texts * Update EffectEngine.cpp --- assets/webconfig/content/remote.html | 8 + assets/webconfig/i18n/de.json | 33 ++-- assets/webconfig/i18n/en.json | 35 ++-- assets/webconfig/js/content_effects.js | 82 ++++---- assets/webconfig/js/content_general.js | 46 ++--- assets/webconfig/js/content_index.js | 6 - assets/webconfig/js/content_logging.js | 7 + assets/webconfig/js/content_remote.js | 90 +++++---- assets/webconfig/js/hyperion.js | 18 +- assets/webconfig/js/wizard.js | 179 +++++++++--------- config/hyperion.config.json.commented | 82 ++++---- config/hyperion.config.json.default | 18 +- effects/candle.json | 4 +- effects/mood-blobs-warm.json | 5 +- effects/rainbow-swirl.json | 5 +- effects/random.json | 4 +- effects/schema/candle.schema.json | 33 +--- effects/schema/mood-blobs.schema.json | 37 ++++ effects/schema/random.schema.json | 33 +--- effects/schema/swirl.schema.json | 37 ++++ libsrc/effectengine/EffectEngine.cpp | 94 +++++---- libsrc/hyperion/schema/schema-effects.json | 3 + libsrc/hyperion/schema/schema-general.json | 11 +- .../hyperion/schema/schema-grabberV4L2.json | 58 ++++-- .../leddevice/schemas/schema-philipshue.json | 2 +- src/hyperiond/hyperiond.cpp | 26 ++- 26 files changed, 503 insertions(+), 453 deletions(-) diff --git a/assets/webconfig/content/remote.html b/assets/webconfig/content/remote.html index 5d6f6548..6bf020ce 100644 --- a/assets/webconfig/content/remote.html +++ b/assets/webconfig/content/remote.html @@ -75,6 +75,14 @@ +
+
+
+
+
+
+
+
diff --git a/assets/webconfig/i18n/de.json b/assets/webconfig/i18n/de.json index 7cd154f5..75ecee0d 100644 --- a/assets/webconfig/i18n/de.json +++ b/assets/webconfig/i18n/de.json @@ -95,7 +95,7 @@ "conf_general_impexp_expbtn" : "Exportieren", "conf_helptable_option" : "Option", "conf_helptable_expl" : "Erklärung", - "conf_effect_path_intro" : "Definiere weitere Effekt-Pfade, wenn nötig.", + "conf_effect_path_intro" : "Hier kannst du Ordner angeben, die beim Laden von Effekten berücksichtig werden sollen. Zusätzlich können Effekte anhand ihres Namens deaktiviert werden um sie aus Listen zu löschen.", "conf_effect_fgeff_intro" : "Definiere einen Start Effekt/Farbe, dieser wird angezeigt, wenn Hyperion startet für die angegebene Dauer.", "conf_effect_bgeff_intro" : "Definiere einen Hintergrund Effekt/Farbe. Dieser wird aktiv, wenn Hyperion sich im Leerlauf befindet. Wird immer mit Priorität 255 gestartet.", "conf_leds_device_intro" : "Wähle eine Methode zur Steuerung deiner LEDs aus, sie sind unterteilt in verschiedene Kategorien. Neben den allgemeinen Optionen die für alle gültig sind, gibt es auch spezfische die sich unterscheiden je nach Wahl.", @@ -188,6 +188,11 @@ "remote_effects_label_effects" : "Effekt:", "remote_adjustment_label" : "Farbanpassung", "remote_adjustment_intro" : "Verändere live Farbe/Helligkeit/Kompensation. $1", + "remote_videoMode_label" : "Video Modus", + "remote_videoMode_intro" : "Wähle zwischen verschiedenen Video Modi um neben 2D auch 3D Filme zu genießen. Unterstützt werden alle Aufnahmearten. $1", + "remote_videoMode_3DSBS" : "3DSBS", + "remote_videoMode_3DTAB" : "3DTAB", + "remote_videoMode_2D" : "2D", "remote_input_label" : "Quellenauswahl", "remote_input_intro" : "Hyperion nutzt ein Prioritätensystem um die Quelle zu wählen. Alles was du setzt hat eine Priorität (Effekte/Farben/Plattform Aufnahme/USB Aufnahme und Netzwerkquellen). Standardmäßig nutzt Hyperion die Quelle mit der niedrigsten Priorität. Hier kannst du aktiv Einfluss darauf nehmen. $1", "remote_input_label_autoselect" : "Automatische Auswahl", @@ -283,7 +288,6 @@ "infoDialog_writeconf_error_text" : "Das speichern der Konfiguration ist fehlgeschlagen.", "infoDialog_import_jsonerror_text" : "Die ausgewählte Konfigurations-Datei \"$1\" ist keine .json Datei oder ist beschädigt! Fehlermeldung: ($2)", "infoDialog_import_hyperror_text" : "Die ausgewählte Konfigurations-Datei \"$1\" kann nicht importiert werden. Sie ist nicht kompatibel mit Hyperion 2.0 und höher!", - "infoDialog_import_reverror_text" : "Die Version deiner Konfigurations-Datei \"$1\" stimmt nicht mit deiner Hyperion Version überein (Datei: $2, Hyperion: $3). Du kannst nur übereinstimmende Versionen importieren!", "infoDialog_import_comperror_text" : "Dein Browser unterstützt leider keinen Import. Bitte versuche es mit einem anderen Browser erneut.", "infoDialog_import_confirm_title" : "Bestätige Import", "infoDialog_import_confirm_text" : "Bist du sicher, dass du die Konfigurations-Datei \"$1\" importieren möchtest? Diese Aktion kann nicht rückgängig gemacht werden!", @@ -490,8 +494,6 @@ "edt_conf_v4l2_frameDecimation_expl" : "Der Faktor der Bildverkleinerung", "edt_conf_v4l2_sizeDecimation_title" : "Größenänderung", "edt_conf_v4l2_sizeDecimation_expl" : "Der Faktor der Größenänderung", - "edt_conf_v4l2_mode_title" : "Modus", - "edt_conf_v4l2_mode_expl" : "Modus der USB Aufnahme", "edt_conf_v4l2_useKodiChecker_title" : "Nutze Kodi Überwachung", "edt_conf_v4l2_useKodiChecker_expl" : "Starte/Stoppe Aufnahme mithilfe der Kodi Überwachung.", "edt_conf_v4l2_cropLeft_title" : "Entferne links", @@ -539,10 +541,14 @@ "edt_conf_bb_heading_title" : "Schwarze Balken Erkennung", "edt_conf_bb_threshold_title" : "Schwelle", "edt_conf_bb_threshold_expl" : "Wenn die Erkennung nicht funktioniert, erhöhe die Schwelle um auf 'graues' schwarz zu reagieren.", - "edt_conf_bb_unknownFrameCnt_title" : "unknownFrameCnt", - "edt_conf_bb_borderFrameCnt_title" : "borderFrameCnt", - "edt_conf_bb_maxInconsistentCnt_title" : "maxInconsistentCn", - "edt_conf_bb_blurRemoveCnt_title" : "blurRemoveCnt", + "edt_conf_bb_unknownFrameCnt_title" : "Unbekannte Bilder", + "edt_conf_bb_unknownFrameCnt_expl" : "Anzahl an Bildern die negativ sind, welche den Rand auf 0 zurücksetzen.", + "edt_conf_bb_borderFrameCnt_title" : "Randbilder", + "edt_conf_bb_borderFrameCnt_expl" : "Anzahl an Bildern bis ein neuer Rand festgelegt wird.", + "edt_conf_bb_maxInconsistentCnt_title" : "Inkosistente Bilder", + "edt_conf_bb_maxInconsistentCnt_expl" : "Anzahl der zu ignorierenden Bilder bis ein neuer Rand überprüft wird.", + "edt_conf_bb_blurRemoveCnt_title" : "Unscharfe Pixel", + "edt_conf_bb_blurRemoveCnt_expl" : "Anzahl an Pixeln, die zusätzlich vom Rand abgeschnitten werden.", "edt_conf_bb_mode_title" : "Modus", "edt_conf_bb_mode_expl" : "Algorithmus zur Auswertung. (siehe Wiki)", "edt_conf_kodic_heading_title" : "Kodi Überwachung", @@ -599,15 +605,14 @@ "edt_conf_effp_paths_expl" : "Es können mehrere Ordner definiert werden die Effekte enthalten. Der Effekt Konfigurator speichert immer im Ersten Ordner.", "edt_conf_effp_paths_itemtitle" : "Pfad", "edt_conf_effp_disable_title" : "Deaktivierte Effekte", + "edt_conf_effp_disable_expl" : "Trage hier die Namen der Effekte ein, die in Effektlisten nicht mehr zur Auswahl stehen sollen.", "edt_conf_effp_disable_itemtitle" : "Effekt", "edt_conf_log_heading_title" : "Protokoll", "edt_conf_log_level_title" : "Protokollstufe", "edt_conf_log_level_expl" : "Abhängig der Stufe sind weniger oder mehr Meldungen sichtbar.", - "edt_eff_smooth_custom_title" : "Aktivere Glättung", - "edt_eff_smooth_time_ms_title" : "Glättung: Zeit", - "edt_eff_smooth_updateFrequency_title" : "Glättung: Aktualisierungsfrequenz", - "edt_eff_smooth_updateDelay_title" : "Glättung: Aktualisierungsverzögerung", - "edt_eff_smooth_pause_title" : "Glättung pausieren", + "edt_eff_smooth_custom" : "Aktivere Glättung", + "edt_eff_smooth_time_ms" : "Glättung: Zeit", + "edt_eff_smooth_updateFrequency" : "Glättung: Aktualisierungsfrequenz", "edt_eff_candle_header" : "Kerze", "edt_eff_candle_header_desc" : "Flackerndes Kerzenlicht", "edt_eff_police_header" : "Polizei", @@ -618,7 +623,7 @@ "edt_eff_knightrider_header" : "Knight Rider", "edt_eff_knightrider_header_desc" : "K.I.T.T ist zurück! Der Front-Scanner des bekannten Autos, diesmal nicht nur in rot.", "edt_eff_lightclock_header" : "Lichtuhr", - "edt_eff_lightclock_header_desc" : "Eine echte Uhr als Licht! Passe die Farben von Stunden, Minuten, Sekunden deinen Vorstellungen an. Optional können 3/6/9/12 Uhr Markierungen aktiviert werden. Sollte die Uhr eine falsche Zeit anzeigen, überprüfe die Uhrzeit deines Systems.", + "edt_eff_lightclock_header_desc" : "Eine echte Uhr als Licht! Passe die Farben von Stunden, Minuten, Sekunden deinen Vorstellungen an. Optional können 3/6/9/12 Uhr Markierungen aktiviert werden. Sollte die Uhr eine falsche Zeit anzeigen, überprüfe die Uhrzeit deines Systems.", "edt_eff_pacman_header" : "Pac-Man", "edt_eff_moodblobs_header" : "Stimmungskugeln", "edt_eff_swirl_header" : "Farbwirbel", diff --git a/assets/webconfig/i18n/en.json b/assets/webconfig/i18n/en.json index 319352d7..1a4e1452 100644 --- a/assets/webconfig/i18n/en.json +++ b/assets/webconfig/i18n/en.json @@ -95,7 +95,7 @@ "conf_general_impexp_expbtn" : "Export", "conf_helptable_option" : "Option", "conf_helptable_expl" : "Explanation", - "conf_effect_path_intro" : "Define more effect paths if necessary.", + "conf_effect_path_intro" : "Load effects from the defined paths. Additional you can disable single effects by name to hide them from all effect lists.", "conf_effect_fgeff_intro" : "Define a booteffect or color, which is shown during Hyperion startup for the defined duration.", "conf_effect_bgeff_intro" : "Define a background effect/color, which is shown during Hyperion \"idle\". Sarts always with priority channel 255.", "conf_leds_device_intro" : "Hyperion supports a lot of controllers to transmit data to your target device. Select a LED controller out of the sorted list and configure it. We have chosen the best default settings for each device.", @@ -188,6 +188,11 @@ "remote_effects_label_effects" : "Effect:", "remote_adjustment_label" : "Color adjustment", "remote_adjustment_intro" : "Modifiy color/brightness/compensation during runtime. $1", + "remote_videoMode_label" : "Video mode", + "remote_videoMode_intro" : "Switch between different video modes to enjoy 3D movies! Supported are all capture devices. $1", + "remote_videoMode_3DSBS" : "3DSBS", + "remote_videoMode_3DTAB" : "3DTAB", + "remote_videoMode_2D" : "2D", "remote_input_label" : "Source Selection", "remote_input_intro" : "Hyperion uses a priority system to select a source. Everything you set has a priority (Effect/Color/Platform capture/USB capture and network sources). By default, Hyperion select sources depending on priority (lowest number reflects the current active source). Now you have the opportunity to select sources on your own. $1", "remote_input_label_autoselect" : "Auto Selection", @@ -283,7 +288,6 @@ "infoDialog_writeconf_error_text" : "Saving your configuration failed.", "infoDialog_import_jsonerror_text" : "The selected configuration file \"$1\" is no .json file or it's corrupted. Error message: ($2)", "infoDialog_import_hyperror_text" : "The selected configuration file \"$1\" can't be imported. It's not compatible with Hyperion 2.0 and higher!", - "infoDialog_import_reverror_text" : "The revision of your configuration file \"$1\" doesnt match the current Hyperion version you run (File: $2, Hyperion: $3). You could just import matching configurations!", "infoDialog_import_comperror_text" : "Sad! Your browser doesn't support a import. Please try again with another browser.", "infoDialog_import_confirm_title" : "Confirm import", "infoDialog_import_confirm_text" : "Are you sure to import \"$1\"? This process can't be reverted!", @@ -491,8 +495,6 @@ "edt_conf_v4l2_frameDecimation_expl" : "The factor of frame decimation", "edt_conf_v4l2_sizeDecimation_title" : "Size decimation", "edt_conf_v4l2_sizeDecimation_expl" : "The factor of size decimation", - "edt_conf_v4l2_mode_title" : "Mode", - "edt_conf_v4l2_mode_expl" : "Modus of USB capture", "edt_conf_v4l2_useKodiChecker_title" : "Use Kodi Watch", "edt_conf_v4l2_useKodiChecker_expl" : "Start/stop capturing with Kodi Watch results.", "edt_conf_v4l2_cropLeft_title" : "Crop left", @@ -540,10 +542,14 @@ "edt_conf_bb_heading_title" : "Blackbar detector", "edt_conf_bb_threshold_title" : "Threshold", "edt_conf_bb_threshold_expl" : "If the detection doesn't work, higher the threshold to adjust on 'greyish' black", - "edt_conf_bb_unknownFrameCnt_title" : "unknownFrameCnt", - "edt_conf_bb_borderFrameCnt_title" : "borderFrameCnt", - "edt_conf_bb_maxInconsistentCnt_title" : "maxInconsistentCn", - "edt_conf_bb_blurRemoveCnt_title" : "blurRemoveCnt", + "edt_conf_bb_unknownFrameCnt_title" : "Unknown frames", + "edt_conf_bb_unknownFrameCnt_expl" : "Number of frames without any detection before the border is set to 0.", + "edt_conf_bb_borderFrameCnt_title" : "Border frames", + "edt_conf_bb_borderFrameCnt_expl" : "Number of frames before a consistent detected border gets set.", + "edt_conf_bb_maxInconsistentCnt_title" : "Inconsistent frames", + "edt_conf_bb_maxInconsistentCnt_expl" : "Number of inconsistent frames that are ignored before a new border gets a chance to proof consistency.", + "edt_conf_bb_blurRemoveCnt_title" : "Blur pixel", + "edt_conf_bb_blurRemoveCnt_expl" : "Number of pixels that get removed from the detected border to cut away blur.", "edt_conf_bb_mode_title" : "Mode", "edt_conf_bb_mode_expl" : "Algorithm for processing. (see Wiki)", "edt_conf_kodic_heading_title" : "Kodi Watch", @@ -599,16 +605,15 @@ "edt_conf_effp_paths_title" : "Effect Path(s)", "edt_conf_effp_paths_expl" : "You could define more folders that contain effects. The effect configurator will always save inside the first folder.", "edt_conf_effp_paths_itemtitle" : "Path", - "edt_conf_effp_disable_title" : "Disabed Effects", + "edt_conf_effp_disable_title" : "Disabled Effects", + "edt_conf_effp_disable_expl" : "Add effect names here to disable/hide them from all effect lists.", "edt_conf_effp_disable_itemtitle" : "Effect", "edt_conf_log_heading_title" : "Logging", "edt_conf_log_level_title" : "Log-Level", "edt_conf_log_level_expl" : "Depending on loglevel you see less or more messages in your log.", - "edt_eff_smooth_custom_title" : "Enable smoothing", - "edt_eff_smooth_time_ms_title" : "Smoothing time", - "edt_eff_smooth_updateFrequency_title" : "Smoothing update frequency", - "edt_eff_smooth_updateDelay_title" : "Smoothing update delay", - "edt_eff_smooth_pause_title" : "Pause smoothing", + "edt_eff_smooth_custom" : "Enable smoothing", + "edt_eff_smooth_time_ms" : "Smoothing time", + "edt_eff_smooth_updateFrequency" : "Smoothing update frequency", "edt_eff_candle_header" : "Candle", "edt_eff_candle_header_desc" : "Shimmering candles", "edt_eff_police_header" : "Police", @@ -620,7 +625,7 @@ "edt_eff_knightrider_header" : "Knight Rider", "edt_eff_knightrider_header_desc" : "K.I.T.T is back! The front-scanner of the well known car, this time not just in red.", "edt_eff_lightclock_header" : "Light Clock", - "edt_eff_lightclock_header_desc" : "A real clock as light! Adjsut the colors of hours, minute, seconds. A optional 3/6/9/12 o'clock marker is also available. In case the clock is wrong, you need to check your system clock.", + "edt_eff_lightclock_header_desc" : "A real clock as light! Adjsut the colors of hours, minute, seconds. A optional 3/6/9/12 o'clock marker is also available. In case the clock is wrong, you need to check your system clock.", "edt_eff_pacman_header" : "Pac-Man", "edt_eff_moodblobs_header" : "Mood Blobs", "edt_eff_swirl_header" : "Color Swirl", diff --git a/assets/webconfig/js/content_effects.js b/assets/webconfig/js/content_effects.js index 2aa9f8d0..1c054ddf 100644 --- a/assets/webconfig/js/content_effects.js +++ b/assets/webconfig/js/content_effects.js @@ -1,25 +1,24 @@ $(document).ready( function() { performTranslation(); var oldEffects = []; - var editorReady = false; var effects_editor = null; var confFgEff = serverConfig.foregroundEffect.effect; var confBgEff = serverConfig.backgroundEffect.effect; var foregroundEffect_editor = null; var backgroundEffect_editor = null; - + if(showOptHelp) - { + { //foreground effect $('#conf_cont').append(createRow('conf_cont_fge')) $('#conf_cont_fge').append(createOptPanel('fa-spinner', $.i18n("edt_conf_fge_heading_title"), 'editor_container_foregroundEffect', 'btn_submit_foregroundEffect')); $('#conf_cont_fge').append(createHelpTable(schema.foregroundEffect.properties, $.i18n("edt_conf_fge_heading_title"))); - + //background effect $('#conf_cont').append(createRow('conf_cont_bge')) $('#conf_cont_bge').append(createOptPanel('fa-spinner', $.i18n("edt_conf_bge_heading_title"), 'editor_container_backgroundEffect', 'btn_submit_backgroundEffect')); $('#conf_cont_bge').append(createHelpTable(schema.backgroundEffect.properties, $.i18n("edt_conf_bge_heading_title"))); - + //effect path if(storedAccess != 'default') { @@ -33,20 +32,20 @@ $(document).ready( function() { $('#conf_cont').addClass('row'); $('#conf_cont').append(createOptPanel('fa-spinner', $.i18n("edt_conf_fge_heading_title"), 'editor_container_foregroundEffect', 'btn_submit_foregroundEffect')); $('#conf_cont').append(createOptPanel('fa-spinner', $.i18n("edt_conf_bge_heading_title"), 'editor_container_backgroundEffect', 'btn_submit_backgroundEffect')); - if(storedAccess != 'default') + if(storedAccess != 'default') $('#conf_cont').append(createOptPanel('fa-spinner', $.i18n("edt_conf_effp_heading_title"), 'editor_container_effects', 'btn_submit_effects')); } - + if(storedAccess != 'default') { effects_editor = createJsonEditor('editor_container_effects', { effects : schema.effects }, true, true); - + effects_editor.on('change',function() { effects_editor.validate().length ? $('#btn_submit_effects').attr('disabled', true) : $('#btn_submit_effects').attr('disabled', false); }); - + $('#btn_submit_effects').off().on('click',function() { requestWriteConfig(effects_editor.getValue()); }); @@ -55,38 +54,38 @@ $(document).ready( function() { foregroundEffect_editor = createJsonEditor('editor_container_foregroundEffect', { foregroundEffect : schema.foregroundEffect }, true, true); - + backgroundEffect_editor = createJsonEditor('editor_container_backgroundEffect', { backgroundEffect : schema.backgroundEffect }, true, true); - - + + foregroundEffect_editor.on('ready',function() { - editorReady = true; + updateEffectlist(); }); - + foregroundEffect_editor.on('change',function() { foregroundEffect_editor.validate().length ? $('#btn_submit_foregroundEffect').attr('disabled', true) : $('#btn_submit_foregroundEffect').attr('disabled', false); }); - + backgroundEffect_editor.on('change',function() { backgroundEffect_editor.validate().length ? $('#btn_submit_backgroundEffect').attr('disabled', true) : $('#btn_submit_backgroundEffect').attr('disabled', false); }); - + $('#btn_submit_foregroundEffect').off().on('click',function() { var value = foregroundEffect_editor.getValue(); if(typeof value.foregroundEffect.effect == 'undefined') value.foregroundEffect.effect = serverConfig.foregroundEffect.effect; - requestWriteConfig(value); + requestWriteConfig(value); }); - + $('#btn_submit_backgroundEffect').off().on('click',function() { var value = backgroundEffect_editor.getValue(); if(typeof value.backgroundEffect.effect == 'undefined') value.backgroundEffect.effect = serverConfig.backgroundEffect.effect; requestWriteConfig(value); }); - + //create introduction if(showOptHelp) { @@ -96,36 +95,33 @@ $(document).ready( function() { } function updateEffectlist(){ - if(editorReady) + var newEffects = serverInfo.effects; + if (newEffects.length != oldEffects.length) { - var newEffects = serverInfo.effects; - if (newEffects.length != oldEffects.length) + $('#root_foregroundEffect_effect').html(''); + var usrEffArr = []; + var sysEffArr = []; + + for(i = 0; i < newEffects.length; i++) { - $('#root_foregroundEffect_effect').html(''); - var usrEffArr = []; - var sysEffArr = []; - - for(i = 0; i < newEffects.length; i++) - { - var effectName = newEffects[i].name; - if(!/^\:/.test(newEffects[i].file)) - usrEffArr.push(effectName); - else - sysEffArr.push(effectName); - } - $('#root_foregroundEffect_effect').append(createSel(usrEffArr, $.i18n('remote_optgroup_usreffets'))); - $('#root_foregroundEffect_effect').append(createSel(sysEffArr, $.i18n('remote_optgroup_syseffets'))); - $('#root_backgroundEffect_effect').html($('#root_foregroundEffect_effect').html()); - oldEffects = newEffects; - - $('#root_foregroundEffect_effect').val(confFgEff); - $('#root_backgroundEffect_effect').val(confBgEff); + var effectName = newEffects[i].name; + if(!/^\:/.test(newEffects[i].file)) + usrEffArr.push(effectName); + else + sysEffArr.push(effectName); } + $('#root_foregroundEffect_effect').append(createSel(usrEffArr, $.i18n('remote_optgroup_usreffets'))); + $('#root_foregroundEffect_effect').append(createSel(sysEffArr, $.i18n('remote_optgroup_syseffets'))); + $('#root_backgroundEffect_effect').html($('#root_foregroundEffect_effect').html()); + oldEffects = newEffects; + + $('#root_foregroundEffect_effect').val(confFgEff); + $('#root_backgroundEffect_effect').val(confBgEff); } } - + //interval update $(hyperion).on("cmd-serverinfo",updateEffectlist); - + removeOverlay(); }); diff --git a/assets/webconfig/js/content_general.js b/assets/webconfig/js/content_general.js index b1a91039..d0e41fd8 100644 --- a/assets/webconfig/js/content_general.js +++ b/assets/webconfig/js/content_general.js @@ -1,10 +1,10 @@ $(document).ready( function() { performTranslation(); - + var importedConf; var confName; var conf_editor = null; - + $('#conf_cont').append(createOptPanel('fa-wrench', $.i18n("edt_conf_gen_heading_title"), 'editor_container', 'btn_submit')); if(showOptHelp) { @@ -12,25 +12,25 @@ $(document).ready( function() { } else $('#conf_imp').appendTo('#conf_cont'); - + conf_editor = createJsonEditor('editor_container', { general: schema.general }, true, true); - + conf_editor.on('change',function() { conf_editor.validate().length ? $('#btn_submit').attr('disabled', true) : $('#btn_submit').attr('disabled', false); }); - + $('#btn_submit').off().on('click',function() { requestWriteConfig(conf_editor.getValue()); }); - + //import function dis_imp_btn(state) { state ? $('#btn_import_conf').attr('disabled', true) : $('#btn_import_conf').attr('disabled', false); } - + function readFile(evt) { var f = evt.target.files[0]; @@ -60,45 +60,36 @@ $(document).ready( function() { } else { - //check config revision - if(content.general.configVersion !== serverConfig.general.configVersion) - { - showInfoDialog('error', "", $.i18n('infoDialog_import_reverror_text', f.name, content.general.configVersion, serverConfig.general.configVersion)); - dis_imp_btn(true); - } - else - { - dis_imp_btn(false); - importedConf = content; - confName = f.name; - } + dis_imp_btn(false); + importedConf = content; + confName = f.name; } } } r.readAsText(f); } } - + $('#btn_import_conf').off().on('click', function(){ showInfoDialog('import', $.i18n('infoDialog_import_confirm_title'), $.i18n('infoDialog_import_confirm_text', confName)); - + $('#id_btn_import').off().on('click', function(){ requestWriteConfig(importedConf, true); setTimeout(initRestart, 100); }); }); - + $('#select_import_conf').off().on('change', function(e){ if (window.File && window.FileReader && window.FileList && window.Blob) readFile(e); else showInfoDialog('error', "", $.i18n('infoDialog_import_comperror_text')); }); - + //export $('#btn_export_conf').off().on('click', function(){ var name = serverConfig.general.name; - + var d = new Date(); var month = d.getMonth()+1; var day = d.getDate(); @@ -106,14 +97,13 @@ $(document).ready( function() { var timestamp = d.getFullYear() + '.' + (month<10 ? '0' : '') + month + '.' + (day<10 ? '0' : '') + day; - + download(JSON.stringify(serverConfig, null, "\t"), 'Hyperion-'+currentVersion+'-Backup ('+name+') '+timestamp+'.json', "application/json"); }); - + //create introduction if(showOptHelp) createHint("intro", $.i18n('conf_general_intro'), "editor_container"); - + removeOverlay(); }); - diff --git a/assets/webconfig/js/content_index.js b/assets/webconfig/js/content_index.js index 08d59a4e..a45ad775 100644 --- a/assets/webconfig/js/content_index.js +++ b/assets/webconfig/js/content_index.js @@ -19,12 +19,6 @@ $(document).ready( function() { $("#hyperion_disabled_notify").fadeIn("fast"); else $("#hyperion_disabled_notify").fadeOut("fast"); - - if ($("#logmessages").length == 0 && loggingStreamActive) - { - requestLoggingStop(); - loggingStreamActive = false; - } if (!serverInfo.hyperion.config_writeable) { diff --git a/assets/webconfig/js/content_logging.js b/assets/webconfig/js/content_logging.js index ac6b70a4..faa097a3 100644 --- a/assets/webconfig/js/content_logging.js +++ b/assets/webconfig/js/content_logging.js @@ -144,6 +144,13 @@ $(document).ready(function() { { loggingHandlerInstalled = true; $(hyperion).on("cmd-logging-update",function(event){ + + if ($("#logmessages").length == 0 && loggingStreamActive) + { + requestLoggingStop(); + loggingStreamActive = false; + } + messages = (event.response.result.messages); if(messages.length != 0 && !createdCont) { diff --git a/assets/webconfig/js/content_remote.js b/assets/webconfig/js/content_remote.js index c03a21dc..32d36c99 100644 --- a/assets/webconfig/js/content_remote.js +++ b/assets/webconfig/js/content_remote.js @@ -1,18 +1,18 @@ $(document).ready(function() { performTranslation(); - + var oldEffects = []; var cpcolor = '#B500FF'; var mappingList = serverSchema.properties.color.properties.imageToLedMappingType.enum; var duration = 0; var rgb = {r:255,g:0,b:0}; - + //create html createTable('ssthead', 'sstbody', 'sstcont'); $('.ssthead').html(createTableRow([$.i18n('remote_input_origin'), $.i18n('remote_input_owner'), $.i18n('remote_input_priority'), $.i18n('remote_input_status')], true, true)); createTable('crthead', 'crtbody', 'adjust_content', true); - - + + //create introduction if(showOptHelp) { @@ -21,12 +21,13 @@ $(document).ready(function() { createHint("intro", $.i18n('remote_adjustment_intro', $.i18n('remote_losthint')), "adjust_content"); createHint("intro", $.i18n('remote_components_intro', $.i18n('remote_losthint')), "comp_intro"); createHint("intro", $.i18n('remote_maptype_intro', $.i18n('remote_losthint')), "maptype_intro"); + createHint("intro", $.i18n('remote_videoMode_intro', $.i18n('remote_losthint')), "videomode_intro"); } - + //color adjustment var sColor = sortProperties(serverSchema.properties.color.properties.channelAdjustment.items.properties) var values = serverInfo.adjustment[0] - + for(key in sColor) { if(sColor[key].key != "id" && sColor[key].key != "leds") @@ -47,18 +48,18 @@ $(document).ready(function() { { property = '
'; $('.crtbody').append(createTableRow([title, property], false, true)); - + $('#cr_'+sColor[key].key).off().on('change', function(e){ requestAdjustment(e.target.id.substr(e.target.id.indexOf("_") + 1), e.currentTarget.checked); }); } else { - if(sColor[key].key == "brightness" || sColor[key].key == "brightnessCompensation" || sColor[key].key == "backlightThreshold") + if(sColor[key].key == "brightness" || sColor[key].key == "brightnessCompensation" || sColor[key].key == "backlightThreshold") property = '
'+$.i18n("edt_append_percent")+'
'; else property = ''; - + $('.crtbody').append(createTableRow([title, property], false, true)); $('#cr_'+sColor[key].key).off().on('change', function(e){ valValue(this.id,this.value,this.min,this.max); @@ -79,12 +80,12 @@ $(document).ready(function() { }); } } - + function sendColor() { requestSetColor(rgb.r, rgb.g, rgb.b,duration); } - + function updateRemote() { if ($('#componentsbutton').length == 0) @@ -95,13 +96,14 @@ $(document).ready(function() { { updateInputSelect(); updateLedMapping(); + updateVideoMode(); updateComponents(); updateEffectlist(); } } - + function updateInputSelect() - { + { $('.sstbody').html(""); var data = ""; var prios = serverInfo.priorities @@ -114,7 +116,7 @@ $(document).ready(function() { origin = origin.split("@"); var ip = origin[1]; origin = origin[0]; - + var owner = prios[i].owner; var active = prios[i].active; var visible = prios[i].visible; @@ -127,7 +129,7 @@ $(document).ready(function() { if (active) btn_type = "primary"; - + if(priority > 254) continue; if(priority < 254 && (compId == "EFFECT" || compId == "COLOR") ) @@ -164,15 +166,15 @@ $(document).ready(function() { owner = $.i18n('general_comp_UDPLISTENER'); break; } - + if(duration && compId != "GRABBER" && compId != "PROTOSERVER") owner += '
'+$.i18n('remote_input_duration')+' '+duration.toFixed(0)+$.i18n('edt_append_s')+''; - + var btn = ''; - + if((compId == "EFFECT" || compId == "COLOR") && priority < 254) btn += ''; - + if(btn_type != 'default') $('.sstbody').append(createTableRow([origin, owner, priority, btn], false, true)); } @@ -182,15 +184,15 @@ $(document).ready(function() { var btn_call_state = (clearAll? "enabled" : "disabled"); $('#auto_btn').html(''); $('#auto_btn').append(''); - + var max_width=100; $('.btn_input_selection').each(function() { if ($(this).innerWidth() > max_width) max_width = $(this).innerWidth(); }); - $('.btn_input_selection').css("min-width",max_width+"px"); + $('.btn_input_selection').css("min-width",max_width+"px"); } - + function updateLedMapping() { mapping = serverInfo.ledMAppingType; @@ -219,7 +221,7 @@ $(document).ready(function() { comp_name = components[idx].name; comp_btn_id = "comp_btn_"+comp_name; comp_goff = serverInfo.hyperion.off? "disabled" : "enabled"; - + // create btn if not there if ($("#"+comp_btn_id).length == 0) { @@ -236,7 +238,7 @@ $(document).ready(function() { } } } - + function updateEffectlist() { var newEffects = serverInfo.effects; @@ -245,7 +247,7 @@ $(document).ready(function() { $('#effect_select').html(''); var usrEffArr = []; var sysEffArr = []; - + for(i = 0; i < newEffects.length; i++) { var effectName = newEffects[i].name; if(!/^\:/.test(newEffects[i].file)){ @@ -260,20 +262,36 @@ $(document).ready(function() { oldEffects = newEffects; } } - + + function updateVideoMode() + { + videoModes = ["2D","3DSBS","3DTAB"]; + currVideoMode = serverInfo.grabbers.videomode; + + $('#videomodebtns').html(""); + for(var ix = 0; ix < videoModes.length; ix++) + { + if(currVideoMode == videoModes[ix]) + btn_style = 'btn-success'; + else + btn_style = 'btn-primary'; + $('#videomodebtns').append('
'); + } + } + // colorpicker and effect if (getStorage('rmcpcolor') != null) { cpcolor = getStorage('rmcpcolor'); rgb = hexToRgb(cpcolor); } - + if (getStorage('rmduration') != null) { $("#remote_duration").val(getStorage('rmduration')); duration = getStorage('rmduration'); } - + createCP('cp2', cpcolor, function(rgbT,hex){ rgb = rgbT; sendColor() @@ -284,7 +302,7 @@ $(document).ready(function() { requestPriorityClear(); $("#effect_select").val("__none__"); }); - + $("#remote_duration").off().on("change", function(){ duration = valValue(this.id,this.value,this.min,this.max); setStorage('rmduration', duration); @@ -293,26 +311,26 @@ $(document).ready(function() { $("#effect_select").off().on("change", function(event) { sendEffect(); }); - + $("#remote_input_reseff, #remote_input_rescol").off().on("click", function(){ if(this.id == "remote_input_rescol") sendColor(); else sendEffect(); }); - + $("#remote_input_img").change(function(){ readImg(this, function(src,width,height){ console.log(src,width,height) requestSetImage(src,width,height,duration) }); }); - + //force first update - updateRemote(); - + updateRemote(); + // interval updates $(hyperion).on("cmd-serverinfo",updateRemote); - - removeOverlay(); + + removeOverlay(); }); diff --git a/assets/webconfig/js/hyperion.js b/assets/webconfig/js/hyperion.js index 39695d7a..73f97f16 100644 --- a/assets/webconfig/js/hyperion.js +++ b/assets/webconfig/js/hyperion.js @@ -40,8 +40,9 @@ function connectionLostDetection(type) window.clearInterval(i); if(type == 'restart') { - $("body").html($("#container_restart").html()); - restartAction(); + $("body").html($("#container_restart").html()); + // setTimeout delay for probably slower systems, some browser don't execute THIS action + setTimeout(restartAction,250); } else { @@ -222,17 +223,17 @@ function requestClearAll() } function requestPlayEffect(effectName, duration) -{ +{ sendToHyperion("effect", "", '"effect":{"name":"'+effectName+'"},"priority":'+webPrio+',"duration":'+validateDuration(duration)+',"origin":"'+webOrigin+'"'); } function requestSetColor(r,g,b,duration) -{ +{ sendToHyperion("color", "", '"color":['+r+','+g+','+b+'], "priority":'+webPrio+',"duration":'+validateDuration(duration)+',"origin":"'+webOrigin+'"'); } function requestSetImage(data,width,height,duration) -{ +{ sendToHyperion("image", "", '"imagedata":"'+data+'", "imagewidth":'+width+',"imageheight":'+height+', "priority":'+webPrio+',"duration":'+validateDuration(duration)+''); } @@ -305,10 +306,15 @@ function requestMappingType(type) sendToHyperion("processing", "", '"mappingType": "'+type+'"'); } +function requestVideoMode(newMode) +{ + sendToHyperion("videomode", "", '"videoMode": "'+newMode+'"'); +} + function requestAdjustment(type, value, complete) { if(complete === true) sendToHyperion("adjustment", "", '"adjustment": '+type+''); - else + else sendToHyperion("adjustment", "", '"adjustment": {"'+type+'": '+value+'}'); } diff --git a/assets/webconfig/js/wizard.js b/assets/webconfig/js/wizard.js index 4df8c863..c501b8a8 100644 --- a/assets/webconfig/js/wizard.js +++ b/assets/webconfig/js/wizard.js @@ -1,7 +1,7 @@ //clear priority and other tasks if people reload the page or lost connection while a wizard was active - $(hyperion).one("ready", function(event) { - if(getStorage("wizardactive") === 'true') + $(hyperion).one("ready", function(event) { + if(getStorage("wizardactive") === 'true') { requestPriorityClear(); setStorage("wizardactive", false); @@ -12,7 +12,7 @@ } } }); - + function resetWizard() { $("#wizard_modal").modal('hide'); @@ -27,7 +27,7 @@ sendToKodi("stop"); step = 0; } - + //rgb byte order wizard var wIntveralId; var new_rgb_order; @@ -59,14 +59,14 @@ $('#wizp2_body').append(''); $('#wizp2_body').append('
'); $('#wizp2_footer').html('') - + //open modal $("#wizard_modal").modal({ backdrop : "static", keyboard: false, show: true }); - + //listen for continue $('#btn_wiz_cont').off().on('click',function() { beginWizardRGB(); @@ -76,7 +76,7 @@ } function beginWizardRGB() - { + { $("#wiz_switchtime_select").off().on('change',function() { clearInterval(wIntveralId); var time = $("#wiz_switchtime_select").val(); @@ -88,19 +88,19 @@ var redS = $("#wiz_r_select").val(); var greenS = $("#wiz_g_select").val(); var blueS = rgb_order.toString().replace(/,/g,"").replace(redS, "").replace(greenS,""); - + for (var i = 0; i'+$.i18n('wiz_cc_link')+'

'; h += '

'+$.i18n('wiz_cc_summary')+'

'; $('#wiz_cc_desc').html(h); - + $('.videobtn').off().on('click', function(e){ if(e.target.id == "stop") sendToKodi("stop"); else sendToKodi("playV",e.target.id+'.mp4'); - + $(this).attr("disabled", true); setTimeout(function(){$('.videobtn').attr("disabled", false)},10000); }); - + $('#btn_wiz_next').attr("disabled", true); $('#btn_wiz_save').toggle(true); } @@ -397,7 +397,7 @@ $('#btn_wiz_save').toggle(false); } } - + function updateWEditor(el, all) { for (var key in cobj) @@ -408,7 +408,7 @@ $('#editor_container_wiz [data-schemapath*=".'+profile+'.'+key+'"]').toggle(false); } } - + function startWizardCC() { //create html @@ -417,14 +417,14 @@ $('#wizp1_footer').html(''); $('#wizp2_body').html('
'); $('#wizp2_footer').html('') - + //open modal $("#wizard_modal").modal({ backdrop : "static", keyboard: false, show: true }); - + $('#wiz_cc_kodiip').off().on('change',function() { kodiAddress = $(this).val(); setStorage("kodiAddress", kodiAddress); @@ -439,62 +439,62 @@ $('#kodi_status').html('

'+$.i18n('wiz_cc_kodicon')+'

'); withKodi = true; } - + $('#btn_wiz_cont').attr('disabled', false); }); }); - + //listen for continue $('#btn_wiz_cont').off().on('click',function() { beginWizardCC(); $('#wizp1').toggle(false); $('#wizp2').toggle(true); }); - + $('#wiz_cc_kodiip').trigger("change") colorLength = serverConfig.color.channelAdjustment; cobj = schema.color.properties.channelAdjustment.items.properties; websAddress = document.location.hostname+':'+serverConfig.webConfig.port; imgAddress = 'http://'+websAddress+'/img/cc/'; setStorage("wizardactive", true); - + //check profile count if(colorLength.length > 1) { $('#multi_cali').html('

'+$.i18n('wiz_cc_morethanone')+'

'); for(var i = 0; i',''])); } - + $('.hue_sel_watch').bind("change", function(){ var cC = 0; for(key in lightIDs) - { + { if($('#hue_'+key).val() != "disabled") { cC++; @@ -830,7 +833,7 @@ } cC == 0 ? $('#btn_wiz_save').attr("disabled",true) : $('#btn_wiz_save').attr("disabled",false); }); - + $('.hue_sel_watch').trigger('change'); } else @@ -847,4 +850,4 @@ $('#wizp2').toggle(true); $('#wizp3').toggle(false); $("#wiz_hue_usrstate").html($.i18n('wiz_hue_failure_connection')); - } \ No newline at end of file + } diff --git a/config/hyperion.config.json.commented b/config/hyperion.config.json.commented index 7634b336..f403bcc3 100644 --- a/config/hyperion.config.json.commented +++ b/config/hyperion.config.json.commented @@ -4,15 +4,13 @@ { - /// geenral Settings + /// general Settings /// * 'name' : The user friendly name of the hyperion instance (used for network things) /// * 'showOptHelp' : Show option expanations at the webui. Highly recommended for beginners. - /// * 'configVersion' : Don't touch! It's an internal value regarding which validation schema for this config is used. "general" : { "name" : "MyHyperionConfig", - "showOptHelp" : true, - "configVersion" : 2 + "showOptHelp" : true }, /// set log level: silent warn verbose debug "logger" : @@ -20,26 +18,24 @@ "level" : "warn" }, - /// Device configuration contains the following fields: + /// Device configuration contains the following fields: /// * 'name' : The user friendly name of the device (only used for display purposes) /// * 'type' : The type of the device or leds (known types for now are /// APA102, WS2801, P9813, LPD6803, LPD8806, ---------PWM---------, WS2812b (just RPi1), WS281X (RPi1, RPi2, RPi3), --------OTHER--------, PhilipsHUE, AtmoOrb, PiBlaster, Tinkerforge, FadeCandy, RawHID (USB), UDP, SEDU, TPM2, USBASP-WS2801, USBASP-WS2812, ------3rd PARTY------, Adalight, AdalightAPA102, Atmo, Lightpack, Multi-Lightpack, Paintpack, Test (file), None) /// * [device type specific configuration] /// * 'colorOrder' : The order of the color bytes ('rgb', 'rbg', 'bgr', etc.). /// * 'rewriteTime': in ms. Data is resend to leds, if no new data is available in thistime. 0 means no refresh - /// * 'latchTime' : minimum time between led writes. 0 means no limit. default 10 means a rate of max 100Hz write time "device" : { "type" : "file", "output" : "/dev/null", "rate" : 1000000, "colorOrder" : "rgb", - "rewriteTime": 0, - "latchTime" : 10 + "rewriteTime": 0 }, - /// Color manipulation configuration used to tune the output colors to specific surroundings. - /// The configuration contains a list of color-transforms. Each transform contains the + /// Color manipulation configuration used to tune the output colors to specific surroundings. + /// The configuration contains a list of color-transforms. Each transform contains the /// following fields: /// * 'imageToLedMappingType' : multicolor_mean - every led has it's own calculatedmean color /// unicolor_mean - every led has same color, color is the mean of whole image @@ -48,7 +44,7 @@ /// * 'leds' : The indices (or index ranges) of the leds to which this channel adjustment applies /// (eg '0-5, 9, 11, 12-17'). The indices are zero based. /// * 'black'/'white'/'red'/'green'/'blue'/'cyan'/'magenta'/'yellow' : Array of RGB to adjust the output color - /// * 'gammaRed'/'gammaGreen'/'gammaBlue' : Gamma value for each channel + /// * 'gammaRed'/'gammaGreen'/'gammaBlue' : Gamma value for each channel /// * 'id' : The unique identifier of the channel adjustments (eg 'device_1') /// * 'id' : The unique identifier of the channel adjustments (eg 'device_1') /// * 'backlightThreshold' : Minimum brightness (backlight) @@ -84,7 +80,7 @@ }, /// smoothing - /// * 'smoothing' : Smoothing of the colors in the time-domain with the following tuning + /// * 'smoothing' : Smoothing of the colors in the time-domain with the following tuning /// parameters: /// - 'enable' Enable or disable the smoothing (true/false) /// - 'type' The type of smoothing algorithm ('linear' or 'none') @@ -112,7 +108,6 @@ /// * frameDecimation : Frame decimation factor [default=2] /// * sizeDecimation : Size decimation factor [default=8] /// * priority : Hyperion priority channel [default=900] - /// * mode : 3D mode to use 2D/3DSBS/3DTAB (note: no autodetection) [default="2D"] /// * useKodiChecker : Enable/disable V4L2 according kodichecker sate if set to true [default=false] /// * cropLeft : Cropping from the left [default=0] /// * cropRight : Cropping from the right [default=0] @@ -138,7 +133,6 @@ "frameDecimation" : 2, "sizeDecimation" : 8, "priority" : 240, - "mode" : "2D", "useKodiChecker" : false, "cropLeft" : 0, "cropRight" : 0, @@ -155,14 +149,14 @@ } ], - /// The configuration for the frame-grabber, contains the following items: + /// The configuration for the frame-grabber, contains the following items: /// * enable : true if the framegrabber (platform grabber) should be activated /// * type : type of grabber. (auto|osx|dispmanx|amlogic|x11|framebuffer) [auto] /// * width : The width of the grabbed frames [pixels] /// * height : The height of the grabbed frames [pixels] /// * frequency_Hz : The frequency of the frame grab [Hz] - /// * priority : The priority of the frame-gabber (Default=250) HINT: lower value result in HIGHER priority! - /// * ATTENTION : Power-of-Two resolution is not supported and leads to unexpected behaviour! + /// * priority : The priority of the frame-gabber (Default=250) HINT: lower value result in HIGHER priority! + /// * ATTENTION : Power-of-Two resolution is not supported and leads to unexpected behaviour! "framegrabber" : { // for all type of grabbers @@ -170,27 +164,25 @@ "type" : "framebuffer", "frequency_Hz" : 10, "priority" : 250, + "cropLeft" : 0, + "cropRight" : 0, + "cropTop" : 0, + "cropBottom" : 0, // valid for grabber: osx|dispmanx|amlogic|framebuffer "width" : 96, "height" : 96, - + // valid for x11 "useXGetImage" : false, "horizontalPixelDecimation" : 8, "verticalPixelDecimation" : 8, - - // valid for dispmanx and x11 - "cropLeft" : 0, - "cropRight" : 0, - "cropTop" : 0, - "cropBottom" : 0, // valid for framebuffer "device" : "/dev/fb0" }, - /// The black border configuration, contains the following items: + /// The black border configuration, contains the following items: /// * enable : true if the detector should be activated /// * threshold : Value below which a pixel is regarded as black (value between 0 and 100 [%]) /// * unknownFrameCnt : Number of frames without any detection before the border is set to 0 (default 600) @@ -209,7 +201,7 @@ "mode" : "default" }, - /// The configuration of the Kodi connection used to enable and disable the frame-grabber. Contains the following fields: + /// The configuration of the Kodi connection used to enable and disable the frame-grabber. Contains the following fields: /// * enable : enable/disable Kodi-Checker /// * kodiAddress : The IP address of the Kodi-host /// * kodiTcpPort : The TCP-port of the Kodi-server @@ -220,7 +212,7 @@ /// * grabPause : Flag indicating that the frame-grabber is on(true) at player state "pause" /// * grabScreensaver : Flag indicating that the frame-grabber is on(true) when Kodi is on screensaver /// * enable3DDetection : Flag indicating that the frame-grabber should switch to a 3D compatible modus if a 3D video is playing - "kodiVideoChecker" : + "kodiVideoChecker" : { "enable" : true, "kodiAddress" : "127.0.0.1", @@ -249,7 +241,7 @@ "effect" : "Rainbow swirl fast", "duration_ms" : 3000 }, - + /// backgroundEffect sets a background effect or color. It is used when all capture devices are stopped (with the help of the kodiVideChecker or manual via remote). Could be also selected via priorities selection. /// * enable : if true, background effect is enabled /// * type : choose between "color" or "effect" @@ -263,11 +255,11 @@ "effect" : "Warm mood blobs" }, - /// The configuration of the Json/Proto forwarder. Forward messages to multiple instances of Hyperion on same and/or other hosts - /// 'proto' is mostly used for video streams and 'json' for effects + /// The configuration of the Json/Proto forwarder. Forward messages to multiple instances of Hyperion on same and/or other hosts + /// 'proto' is mostly used for video streams and 'json' for effects /// * enable : Enable or disable the forwarder (true/false) - /// * proto : Proto server adress and port of your target. Syntax:[IP:PORT] -> ["127.0.0.1:19447"] or more instances to forward ["127.0.0.1:19447","192.168.0.24:19449"] - /// * json : Json server adress and port of your target. Syntax:[IP:PORT] -> ["127.0.0.1:19446"] or more instances to forward ["127.0.0.1:19446","192.168.0.24:19448"] + /// * proto : Proto server adress and port of your target. Syntax:[IP:PORT] -> ["127.0.0.1:19447"] or more instances to forward ["127.0.0.1:19447","192.168.0.24:19449"] + /// * json : Json server adress and port of your target. Syntax:[IP:PORT] -> ["127.0.0.1:19446"] or more instances to forward ["127.0.0.1:19446","192.168.0.24:19448"] /// HINT:If you redirect to "127.0.0.1" (localhost) you could start a second hyperion with another device/led config! /// Be sure your client(s) is/are listening on the configured ports. The second Hyperion (if used) also needs to be configured! (HyperCon -> External -> Json Server/Proto Server) "forwarder" : @@ -294,7 +286,7 @@ /// The configuration of the boblight server which enables the boblight remote interface /// * enable : Enable or disable the boblight server (true/false) /// * port : Port at which the boblight server is started - /// * priority : Priority of the boblight server (Default=201) HINT: lower value result in HIGHER priority! + /// * priority : Priority of the boblight server (Default=201) HINT: lower value result in HIGHER priority! "boblightServer" : { "enable" : false, @@ -330,10 +322,10 @@ "port" : 8099 }, - /// The configuration of the effect engine, contains the following items: - /// * paths : An array with absolute/relative location(s) of directories with effects - /// * disable : An array with effect names that shouldn't be loaded - "effects" : + /// The configuration of the effect engine, contains the following items: + /// * paths : An array with absolute/relative location(s) of directories with effects + /// * disable : An array with effect names that shouldn't be loaded + "effects" : { "paths" : [ @@ -346,7 +338,7 @@ "X-Mas" ] }, - + /// Recreate and save led layouts made with web config. These values are just helpers for ui, not for Hyperion. "ledConfig" : { @@ -363,17 +355,17 @@ "overlap" : 0, "edgegap" : 0 }, - - /// The configuration for each individual led. This contains the specification of the area - /// averaged of an input image for each led to determine its color. Each item in the list + + /// The configuration for each individual led. This contains the specification of the area + /// averaged of an input image for each led to determine its color. Each item in the list /// contains the following fields: - /// * index: The index of the led. This determines its location in the string of leds; zero + /// * index: The index of the led. This determines its location in the string of leds; zero /// being the first led. - /// * hscan: The fractional part of the image along the horizontal used for the averaging + /// * hscan: The fractional part of the image along the horizontal used for the averaging /// (minimum and maximum inclusive) - /// * vscan: The fractional part of the image along the vertical used for the averaging + /// * vscan: The fractional part of the image along the vertical used for the averaging /// (minimum and maximum inclusive) - + "leds": [ { diff --git a/config/hyperion.config.json.default b/config/hyperion.config.json.default index 7b3f6076..47ca888a 100644 --- a/config/hyperion.config.json.default +++ b/config/hyperion.config.json.default @@ -2,8 +2,7 @@ "general" : { "name" : "My Hyperion Config", - "showOptHelp" : true, - "configVersion" : 2 + "showOptHelp" : true }, "logger" : { @@ -16,8 +15,7 @@ "output" : "/dev/null", "rate" : 1000000, "colorOrder" : "rgb", - "rewriteTime": 5000, - "latchTime" : 10 + "rewriteTime": 5000 }, "color" : @@ -69,7 +67,6 @@ "frameDecimation" : 2, "sizeDecimation" : 8, "priority" : 240, - "mode" : "2D", "useKodiChecker" : false, "cropLeft" : 0, "cropRight" : 0, @@ -137,7 +134,7 @@ "effect" : "Rainbow swirl fast", "duration_ms" : 3000 }, - + "backgroundEffect" : { "enable" : true, @@ -162,14 +159,14 @@ { "port" : 19445 }, - + "boblightServer" : { "enable" : false, "port" : 19333, "priority" : 201 }, - + "udpListener" : { "enable" : false, @@ -189,7 +186,8 @@ "effects" : { - "paths" : ["../custom-effects"] + "paths" : ["../custom-effects"], + "disable": [""] }, "ledConfig" : @@ -207,7 +205,7 @@ "overlap" : 0, "edgegap" : 0 }, - + "leds": [ { diff --git a/effects/candle.json b/effects/candle.json index 73253371..36b79731 100644 --- a/effects/candle.json +++ b/effects/candle.json @@ -9,8 +9,6 @@ "candles" : "all", "smoothing-custom-settings" : true, "smoothing-time_ms" : 500, - "smoothing-updateDelay" : 0, - "smoothing-updateFrequency" : 20.0, - "smoothing-pause" : false + "smoothing-updateFrequency" : 20.0 } } diff --git a/effects/mood-blobs-warm.json b/effects/mood-blobs-warm.json index 39443092..68239671 100644 --- a/effects/mood-blobs-warm.json +++ b/effects/mood-blobs-warm.json @@ -11,6 +11,9 @@ "baseChange" : true, "baseColorRangeLeft" : 333, "baseColorRangeRight" : 151, - "baseColorChangeRate" : 2.0 + "baseColorChangeRate" : 2.0, + "smoothing-custom-settings" : true, + "smoothing-time_ms" : 200, + "smoothing-updateFrequency" : 25.0 } } diff --git a/effects/rainbow-swirl.json b/effects/rainbow-swirl.json index b60a1757..41909f6d 100644 --- a/effects/rainbow-swirl.json +++ b/effects/rainbow-swirl.json @@ -10,6 +10,9 @@ "custom-colors":[], "random-center":false, "custom-colors2":[], - "enable-second":false + "enable-second":false, + "smoothing-custom-settings" : true, + "smoothing-time_ms" : 200, + "smoothing-updateFrequency" : 25.0 } } diff --git a/effects/random.json b/effects/random.json index 3b75c3b2..df1badc3 100644 --- a/effects/random.json +++ b/effects/random.json @@ -7,8 +7,6 @@ "saturation" : 1.0, "smoothing-custom-settings" : true, "smoothing-time_ms" : 200, - "smoothing-updateDelay" : 0, - "smoothing-updateFrequency" : 20.0, - "smoothing-pause" : false + "smoothing-updateFrequency" : 20.0 } } diff --git a/effects/schema/candle.schema.json b/effects/schema/candle.schema.json index 16436c66..90251cfc 100644 --- a/effects/schema/candle.schema.json +++ b/effects/schema/candle.schema.json @@ -71,14 +71,14 @@ "smoothing-custom-settings" : { "type" : "boolean", - "title" : "edt_eff_smooth_custom_title", + "title" : "edt_eff_smooth_custom", "default" : false, "propertyOrder" : 7 }, "smoothing-time_ms" : { "type" : "integer", - "title" : "edt_eff_smooth_time_ms_title", + "title" : "edt_eff_smooth_time_ms", "minimum" : 25, "maximum": 600, "default" : 200, @@ -93,7 +93,7 @@ "smoothing-updateFrequency" : { "type" : "number", - "title" : "edt_eff_smooth_updateFrequency_title", + "title" : "edt_eff_smooth_updateFrequency", "minimum" : 1.0, "maximum" : 100.0, "default" : 25.0, @@ -104,33 +104,6 @@ } }, "propertyOrder" : 9 - }, - "smoothing-updateDelay" : - { - "type" : "integer", - "title" : "edt_eff_smooth_updateDelay_title", - "minimum" : 0, - "maximum": 2048, - "default" : 0, - "append" : "edt_append_ms", - "options": { - "dependencies": { - "smoothing-custom-settings": true - } - }, - "propertyOrder" : 10 - }, - "smoothing-pause" : - { - "type" : "boolean", - "title" : "edt_eff_smooth_pause_title", - "default" : false, - "options": { - "dependencies": { - "smoothing-custom-settings": true - } - }, - "propertyOrder" : 12 } }, "additionalProperties": false diff --git a/effects/schema/mood-blobs.schema.json b/effects/schema/mood-blobs.schema.json index cf05cd1b..74cdea3b 100644 --- a/effects/schema/mood-blobs.schema.json +++ b/effects/schema/mood-blobs.schema.json @@ -98,6 +98,43 @@ } }, "propertyOrder" : 8 + }, + "smoothing-custom-settings" : + { + "type" : "boolean", + "title" : "edt_eff_smooth_custom", + "default" : false, + "propertyOrder" : 9 + }, + "smoothing-time_ms" : + { + "type" : "integer", + "title" : "edt_eff_smooth_time_ms", + "minimum" : 25, + "maximum": 600, + "default" : 200, + "append" : "edt_append_ms", + "options": { + "dependencies": { + "smoothing-custom-settings": true + } + }, + "propertyOrder" : 10 + }, + "smoothing-updateFrequency" : + { + "type" : "number", + "title" : "edt_eff_smooth_updateFrequency", + "minimum" : 1.0, + "maximum" : 100.0, + "default" : 25.0, + "append" : "edt_append_hz", + "options": { + "dependencies": { + "smoothing-custom-settings": true + } + }, + "propertyOrder" : 11 } }, "additionalProperties": false diff --git a/effects/schema/random.schema.json b/effects/schema/random.schema.json index bacacd6a..fe69ff65 100644 --- a/effects/schema/random.schema.json +++ b/effects/schema/random.schema.json @@ -24,14 +24,14 @@ "smoothing-custom-settings" : { "type" : "boolean", - "title" : "edt_eff_smooth_custom_title", + "title" : "edt_eff_smooth_custom", "default" : false, "propertyOrder" : 3 }, "smoothing-time_ms" : { "type" : "integer", - "title" : "edt_eff_smooth_time_ms_title", + "title" : "edt_eff_smooth_time_ms", "minimum" : 25, "maximum": 600, "default" : 200, @@ -46,7 +46,7 @@ "smoothing-updateFrequency" : { "type" : "number", - "title" : "edt_eff_smooth_updateFrequency_title", + "title" : "edt_eff_smooth_updateFrequency", "minimum" : 1.0, "maximum" : 100.0, "default" : 25.0, @@ -57,33 +57,6 @@ } }, "propertyOrder" : 5 - }, - "smoothing-updateDelay" : - { - "type" : "integer", - "title" : "edt_eff_smooth_updateDelay_title", - "minimum" : 0, - "maximum": 2048, - "default" : 0, - "append" : "edt_append_ms", - "options": { - "dependencies": { - "smoothing-custom-settings": true - } - }, - "propertyOrder" : 6 - }, - "smoothing-pause" : - { - "type" : "boolean", - "title" : "edt_eff_smooth_pause_title", - "default" : false, - "options": { - "dependencies": { - "smoothing-custom-settings": true - } - }, - "propertyOrder" : 7 } }, "additionalProperties": false diff --git a/effects/schema/swirl.schema.json b/effects/schema/swirl.schema.json index f50c9cb3..fc9cc121 100644 --- a/effects/schema/swirl.schema.json +++ b/effects/schema/swirl.schema.json @@ -145,6 +145,43 @@ } }, "propertyOrder" : 12 + }, + "smoothing-custom-settings" : + { + "type" : "boolean", + "title" : "edt_eff_smooth_custom", + "default" : false, + "propertyOrder" : 13 + }, + "smoothing-time_ms" : + { + "type" : "integer", + "title" : "edt_eff_smooth_time_ms", + "minimum" : 25, + "maximum": 600, + "default" : 200, + "append" : "edt_append_ms", + "options": { + "dependencies": { + "smoothing-custom-settings": true + } + }, + "propertyOrder" : 14 + }, + "smoothing-updateFrequency" : + { + "type" : "number", + "title" : "edt_eff_smooth_updateFrequency", + "minimum" : 1.0, + "maximum" : 100.0, + "default" : 25.0, + "append" : "edt_append_hz", + "options": { + "dependencies": { + "smoothing-custom-settings": true + } + }, + "propertyOrder" : 15 } }, "additionalProperties": false diff --git a/libsrc/effectengine/EffectEngine.cpp b/libsrc/effectengine/EffectEngine.cpp index ace23bb9..ae367c9e 100644 --- a/libsrc/effectengine/EffectEngine.cpp +++ b/libsrc/effectengine/EffectEngine.cpp @@ -57,7 +57,7 @@ EffectEngine::~EffectEngine() const std::list &EffectEngine::getActiveEffects() { _availableActiveEffects.clear(); - + for (Effect * effect : _activeEffects) { ActiveEffectDefinition activeEffectDefinition; @@ -68,19 +68,19 @@ const std::list &EffectEngine::getActiveEffects() activeEffectDefinition.args = effect->getArgs(); _availableActiveEffects.push_back(activeEffectDefinition); } - + return _availableActiveEffects; } bool EffectEngine::loadEffectDefinition(const QString &path, const QString &effectConfigFile, EffectDefinition & effectDefinition) { Logger * log = Logger::getInstance("EFFECTENGINE"); - + QString fileName = path + QDir::separator() + effectConfigFile; QJsonParseError error; - + // ---------- Read the effect json config file ---------- - + QFile file(fileName); if (!file.open(QIODevice::ReadOnly)) { @@ -90,12 +90,12 @@ bool EffectEngine::loadEffectDefinition(const QString &path, const QString &effe QByteArray fileContent = file.readAll(); QJsonDocument configEffect = QJsonDocument::fromJson(fileContent, &error); - + if (error.error != QJsonParseError::NoError) { // report to the user the failure and their locations in the document. int errorLine(0), errorColumn(0); - + for( int i=0, count=qMin( error.offset,fileContent.size()); iaddSmoothingConfig(pause); - } - else - { - effectDefinition.smoothCfg = _hyperion->addSmoothingConfig( - effectDefinition.args["smoothing-time_ms"].toInt(), - effectDefinition.args["smoothing-updateFrequency"].toDouble(), - effectDefinition.args["smoothing-updateDelay"].toInt() ); - } + effectDefinition.smoothCfg = _hyperion->addSmoothingConfig( + effectDefinition.args["smoothing-time_ms"].toInt(), + effectDefinition.args["smoothing-updateFrequency"].toDouble(), + 0 ); + } + else + { + effectDefinition.smoothCfg = _hyperion->addSmoothingConfig(true); } return true; } @@ -205,12 +201,12 @@ bool EffectEngine::loadEffectDefinition(const QString &path, const QString &effe bool EffectEngine::loadEffectSchema(const QString &path, const QString &effectSchemaFile, EffectSchema & effectSchema) { Logger * log = Logger::getInstance("EFFECTENGINE"); - + QString fileName = path + "schema/" + QDir::separator() + effectSchemaFile; QJsonParseError error; - + // ---------- Read the effect schema file ---------- - + QFile file(fileName); if (!file.open(QIODevice::ReadOnly)) { @@ -220,12 +216,12 @@ bool EffectEngine::loadEffectSchema(const QString &path, const QString &effectSc QByteArray fileContent = file.readAll(); QJsonDocument schemaEffect = QJsonDocument::fromJson(fileContent, &error); - + if (error.error != QJsonParseError::NoError) { // report to the user the failure and their locations in the document. int errorLine(0), errorColumn(0); - + for( int i=0, count=qMin( error.offset,fileContent.size()); i validate = schemaChecker.validate(_qconfig); - + if (!validate.first && validate.second) { Warning(_log,"Errors have been found in the configuration file. Automatic correction is applied"); - + _qconfig = schemaChecker.getAutoCorrectedConfig(_qconfig); if (!QJsonFactory::writeJson(configFile, _qconfig)) @@ -251,7 +251,7 @@ void HyperionDaemon::startInitialEffect() Info(_log,"Inital background effect '%s' %s", QSTRING_CSTR(bgEffectConfig), ((result == 0) ? "started" : "failed")); } } - + #undef FGCONFIG_ARRAY #undef BGCONFIG_ARRAY } @@ -409,7 +409,6 @@ void HyperionDaemon::createSystemFrameGrabber() #else QString type = grabberConfig["type"].toString("auto"); #endif - // auto eval of type if ( type == "auto" ) @@ -430,7 +429,7 @@ void HyperionDaemon::createSystemFrameGrabber() type = "amlogic"; } // x11 -> if DISPLAY is set - else if (getenv("DISPLAY") != NULL ) + else if (getenv("DISPLAY") != NULL ) { type = "x11"; } @@ -441,7 +440,7 @@ void HyperionDaemon::createSystemFrameGrabber() } Info( _log, "set screen capture device to '%s'", QSTRING_CSTR(type)); } - + bool grabberCompState = grabberConfig["enable"].toBool(true); if (type == "") { Info( _log, "screen capture device disabled"); grabberCompState = false; } else if (type == "framebuffer") createGrabberFramebuffer(grabberConfig); @@ -450,7 +449,7 @@ void HyperionDaemon::createSystemFrameGrabber() else if (type == "osx") createGrabberOsx(grabberConfig); else if (type == "x11") createGrabberX11(grabberConfig); else { Warning( _log, "unknown framegrabber type '%s'", QSTRING_CSTR(type)); grabberCompState = false; } - + // _hyperion->getComponentRegister().componentStateChanged(hyperion::COMP_GRABBER, grabberCompState); _hyperion->setComponentState(hyperion::COMP_GRABBER, grabberCompState ); } @@ -539,7 +538,7 @@ void HyperionDaemon::createGrabberOsx(const QJsonObject & grabberConfig) _osxGrabber = new OsxWrapper( grabberConfig["display"].toInt(0), _grabber_width, _grabber_height, _grabber_frequency, _grabber_priority); - + QObject::connect(_osxGrabber, SIGNAL(emitImage(int, const Image&, const int)), _protoServer, SLOT(sendImageToProtoSlaves(int, const Image&, const int)) ); _osxGrabber->start(); @@ -556,7 +555,7 @@ void HyperionDaemon::createGrabberV4L2() bool v4lConfigured = _qconfig.contains("grabberV4L2"); bool v4lStarted = false; unsigned v4lEnableCount = 0; - + if (_qconfig["grabberV4L2"].isArray()) { const QJsonArray & v4lArray = _qconfig["grabberV4L2"].toArray(); @@ -583,7 +582,6 @@ void HyperionDaemon::createGrabberV4L2() grabberConfig["blueSignalThreshold"].toDouble(0.0)/100.0, grabberConfig["priority"].toInt(890), grabberConfig["useKodiChecker"].toBool(false)); - grabber->setVideoMode(parse3DMode(grabberConfig["mode"].toString("2D"))); grabber->setCropping( grabberConfig["cropLeft"].toInt(0), grabberConfig["cropRight"].toInt(0),