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
This commit is contained in:
brindosch 2017-09-04 23:12:59 +02:00 committed by GitHub
parent cb7b5fa588
commit 81f5f51257
26 changed files with 503 additions and 453 deletions

View File

@ -75,6 +75,14 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-6 col-lg-6 col-xxl-5">
<div class="panel panel-default" >
<div class="panel-heading"><i class="fa fa-wifi fa-fw"></i><span data-i18n="remote_videoMode_label"></span></div>
<div class="panel-body" id="videomode_intro">
<div id="videomodebtns"></div>
</div>
</div>
</div>
</div> </div>
</div> </div>
<script src="/js/content_remote.js" ></script> <script src="/js/content_remote.js" ></script>

View File

@ -95,7 +95,7 @@
"conf_general_impexp_expbtn" : "Exportieren", "conf_general_impexp_expbtn" : "Exportieren",
"conf_helptable_option" : "Option", "conf_helptable_option" : "Option",
"conf_helptable_expl" : "Erklärung", "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_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_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.", "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_effects_label_effects" : "Effekt:",
"remote_adjustment_label" : "Farbanpassung", "remote_adjustment_label" : "Farbanpassung",
"remote_adjustment_intro" : "Verändere live Farbe/Helligkeit/Kompensation. $1", "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_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_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", "remote_input_label_autoselect" : "Automatische Auswahl",
@ -283,7 +288,6 @@
"infoDialog_writeconf_error_text" : "Das speichern der Konfiguration ist fehlgeschlagen.", "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_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_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_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_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!", "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_frameDecimation_expl" : "Der Faktor der Bildverkleinerung",
"edt_conf_v4l2_sizeDecimation_title" : "Größenänderung", "edt_conf_v4l2_sizeDecimation_title" : "Größenänderung",
"edt_conf_v4l2_sizeDecimation_expl" : "Der Faktor der 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_title" : "Nutze Kodi Überwachung",
"edt_conf_v4l2_useKodiChecker_expl" : "Starte/Stoppe Aufnahme mithilfe der Kodi Überwachung.", "edt_conf_v4l2_useKodiChecker_expl" : "Starte/Stoppe Aufnahme mithilfe der Kodi Überwachung.",
"edt_conf_v4l2_cropLeft_title" : "Entferne links", "edt_conf_v4l2_cropLeft_title" : "Entferne links",
@ -539,10 +541,14 @@
"edt_conf_bb_heading_title" : "Schwarze Balken Erkennung", "edt_conf_bb_heading_title" : "Schwarze Balken Erkennung",
"edt_conf_bb_threshold_title" : "Schwelle", "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_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_unknownFrameCnt_title" : "Unbekannte Bilder",
"edt_conf_bb_borderFrameCnt_title" : "borderFrameCnt", "edt_conf_bb_unknownFrameCnt_expl" : "Anzahl an Bildern die negativ sind, welche den Rand auf 0 zurücksetzen.",
"edt_conf_bb_maxInconsistentCnt_title" : "maxInconsistentCn", "edt_conf_bb_borderFrameCnt_title" : "Randbilder",
"edt_conf_bb_blurRemoveCnt_title" : "blurRemoveCnt", "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_title" : "Modus",
"edt_conf_bb_mode_expl" : "Algorithmus zur Auswertung. (siehe Wiki)", "edt_conf_bb_mode_expl" : "Algorithmus zur Auswertung. (siehe Wiki)",
"edt_conf_kodic_heading_title" : "Kodi Überwachung", "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_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_paths_itemtitle" : "Pfad",
"edt_conf_effp_disable_title" : "Deaktivierte Effekte", "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_effp_disable_itemtitle" : "Effekt",
"edt_conf_log_heading_title" : "Protokoll", "edt_conf_log_heading_title" : "Protokoll",
"edt_conf_log_level_title" : "Protokollstufe", "edt_conf_log_level_title" : "Protokollstufe",
"edt_conf_log_level_expl" : "Abhängig der Stufe sind weniger oder mehr Meldungen sichtbar.", "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_custom" : "Aktivere Glättung",
"edt_eff_smooth_time_ms_title" : "Glättung: Zeit", "edt_eff_smooth_time_ms" : "Glättung: Zeit",
"edt_eff_smooth_updateFrequency_title" : "Glättung: Aktualisierungsfrequenz", "edt_eff_smooth_updateFrequency" : "Glättung: Aktualisierungsfrequenz",
"edt_eff_smooth_updateDelay_title" : "Glättung: Aktualisierungsverzögerung",
"edt_eff_smooth_pause_title" : "Glättung pausieren",
"edt_eff_candle_header" : "Kerze", "edt_eff_candle_header" : "Kerze",
"edt_eff_candle_header_desc" : "Flackerndes Kerzenlicht", "edt_eff_candle_header_desc" : "Flackerndes Kerzenlicht",
"edt_eff_police_header" : "Polizei", "edt_eff_police_header" : "Polizei",
@ -618,7 +623,7 @@
"edt_eff_knightrider_header" : "Knight Rider", "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_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" : "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_pacman_header" : "Pac-Man",
"edt_eff_moodblobs_header" : "Stimmungskugeln", "edt_eff_moodblobs_header" : "Stimmungskugeln",
"edt_eff_swirl_header" : "Farbwirbel", "edt_eff_swirl_header" : "Farbwirbel",

View File

@ -95,7 +95,7 @@
"conf_general_impexp_expbtn" : "Export", "conf_general_impexp_expbtn" : "Export",
"conf_helptable_option" : "Option", "conf_helptable_option" : "Option",
"conf_helptable_expl" : "Explanation", "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_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_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.", "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_effects_label_effects" : "Effect:",
"remote_adjustment_label" : "Color adjustment", "remote_adjustment_label" : "Color adjustment",
"remote_adjustment_intro" : "Modifiy color/brightness/compensation during runtime. $1", "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_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_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", "remote_input_label_autoselect" : "Auto Selection",
@ -283,7 +288,6 @@
"infoDialog_writeconf_error_text" : "Saving your configuration failed.", "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_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_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_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_title" : "Confirm import",
"infoDialog_import_confirm_text" : "Are you sure to import \"$1\"? This process can't be reverted!", "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_frameDecimation_expl" : "The factor of frame decimation",
"edt_conf_v4l2_sizeDecimation_title" : "Size decimation", "edt_conf_v4l2_sizeDecimation_title" : "Size decimation",
"edt_conf_v4l2_sizeDecimation_expl" : "The factor of 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_title" : "Use Kodi Watch",
"edt_conf_v4l2_useKodiChecker_expl" : "Start/stop capturing with Kodi Watch results.", "edt_conf_v4l2_useKodiChecker_expl" : "Start/stop capturing with Kodi Watch results.",
"edt_conf_v4l2_cropLeft_title" : "Crop left", "edt_conf_v4l2_cropLeft_title" : "Crop left",
@ -540,10 +542,14 @@
"edt_conf_bb_heading_title" : "Blackbar detector", "edt_conf_bb_heading_title" : "Blackbar detector",
"edt_conf_bb_threshold_title" : "Threshold", "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_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_unknownFrameCnt_title" : "Unknown frames",
"edt_conf_bb_borderFrameCnt_title" : "borderFrameCnt", "edt_conf_bb_unknownFrameCnt_expl" : "Number of frames without any detection before the border is set to 0.",
"edt_conf_bb_maxInconsistentCnt_title" : "maxInconsistentCn", "edt_conf_bb_borderFrameCnt_title" : "Border frames",
"edt_conf_bb_blurRemoveCnt_title" : "blurRemoveCnt", "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_title" : "Mode",
"edt_conf_bb_mode_expl" : "Algorithm for processing. (see Wiki)", "edt_conf_bb_mode_expl" : "Algorithm for processing. (see Wiki)",
"edt_conf_kodic_heading_title" : "Kodi Watch", "edt_conf_kodic_heading_title" : "Kodi Watch",
@ -599,16 +605,15 @@
"edt_conf_effp_paths_title" : "Effect Path(s)", "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_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_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_effp_disable_itemtitle" : "Effect",
"edt_conf_log_heading_title" : "Logging", "edt_conf_log_heading_title" : "Logging",
"edt_conf_log_level_title" : "Log-Level", "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_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_custom" : "Enable smoothing",
"edt_eff_smooth_time_ms_title" : "Smoothing time", "edt_eff_smooth_time_ms" : "Smoothing time",
"edt_eff_smooth_updateFrequency_title" : "Smoothing update frequency", "edt_eff_smooth_updateFrequency" : "Smoothing update frequency",
"edt_eff_smooth_updateDelay_title" : "Smoothing update delay",
"edt_eff_smooth_pause_title" : "Pause smoothing",
"edt_eff_candle_header" : "Candle", "edt_eff_candle_header" : "Candle",
"edt_eff_candle_header_desc" : "Shimmering candles", "edt_eff_candle_header_desc" : "Shimmering candles",
"edt_eff_police_header" : "Police", "edt_eff_police_header" : "Police",
@ -620,7 +625,7 @@
"edt_eff_knightrider_header" : "Knight Rider", "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_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" : "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_pacman_header" : "Pac-Man",
"edt_eff_moodblobs_header" : "Mood Blobs", "edt_eff_moodblobs_header" : "Mood Blobs",
"edt_eff_swirl_header" : "Color Swirl", "edt_eff_swirl_header" : "Color Swirl",

View File

@ -1,25 +1,24 @@
$(document).ready( function() { $(document).ready( function() {
performTranslation(); performTranslation();
var oldEffects = []; var oldEffects = [];
var editorReady = false;
var effects_editor = null; var effects_editor = null;
var confFgEff = serverConfig.foregroundEffect.effect; var confFgEff = serverConfig.foregroundEffect.effect;
var confBgEff = serverConfig.backgroundEffect.effect; var confBgEff = serverConfig.backgroundEffect.effect;
var foregroundEffect_editor = null; var foregroundEffect_editor = null;
var backgroundEffect_editor = null; var backgroundEffect_editor = null;
if(showOptHelp) if(showOptHelp)
{ {
//foreground effect //foreground effect
$('#conf_cont').append(createRow('conf_cont_fge')) $('#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(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"))); $('#conf_cont_fge').append(createHelpTable(schema.foregroundEffect.properties, $.i18n("edt_conf_fge_heading_title")));
//background effect //background effect
$('#conf_cont').append(createRow('conf_cont_bge')) $('#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(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"))); $('#conf_cont_bge').append(createHelpTable(schema.backgroundEffect.properties, $.i18n("edt_conf_bge_heading_title")));
//effect path //effect path
if(storedAccess != 'default') if(storedAccess != 'default')
{ {
@ -33,20 +32,20 @@ $(document).ready( function() {
$('#conf_cont').addClass('row'); $('#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_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')); $('#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')); $('#conf_cont').append(createOptPanel('fa-spinner', $.i18n("edt_conf_effp_heading_title"), 'editor_container_effects', 'btn_submit_effects'));
} }
if(storedAccess != 'default') if(storedAccess != 'default')
{ {
effects_editor = createJsonEditor('editor_container_effects', { effects_editor = createJsonEditor('editor_container_effects', {
effects : schema.effects effects : schema.effects
}, true, true); }, true, true);
effects_editor.on('change',function() { effects_editor.on('change',function() {
effects_editor.validate().length ? $('#btn_submit_effects').attr('disabled', true) : $('#btn_submit_effects').attr('disabled', false); effects_editor.validate().length ? $('#btn_submit_effects').attr('disabled', true) : $('#btn_submit_effects').attr('disabled', false);
}); });
$('#btn_submit_effects').off().on('click',function() { $('#btn_submit_effects').off().on('click',function() {
requestWriteConfig(effects_editor.getValue()); requestWriteConfig(effects_editor.getValue());
}); });
@ -55,38 +54,38 @@ $(document).ready( function() {
foregroundEffect_editor = createJsonEditor('editor_container_foregroundEffect', { foregroundEffect_editor = createJsonEditor('editor_container_foregroundEffect', {
foregroundEffect : schema.foregroundEffect foregroundEffect : schema.foregroundEffect
}, true, true); }, true, true);
backgroundEffect_editor = createJsonEditor('editor_container_backgroundEffect', { backgroundEffect_editor = createJsonEditor('editor_container_backgroundEffect', {
backgroundEffect : schema.backgroundEffect backgroundEffect : schema.backgroundEffect
}, true, true); }, true, true);
foregroundEffect_editor.on('ready',function() { foregroundEffect_editor.on('ready',function() {
editorReady = true; updateEffectlist();
}); });
foregroundEffect_editor.on('change',function() { foregroundEffect_editor.on('change',function() {
foregroundEffect_editor.validate().length ? $('#btn_submit_foregroundEffect').attr('disabled', true) : $('#btn_submit_foregroundEffect').attr('disabled', false); foregroundEffect_editor.validate().length ? $('#btn_submit_foregroundEffect').attr('disabled', true) : $('#btn_submit_foregroundEffect').attr('disabled', false);
}); });
backgroundEffect_editor.on('change',function() { backgroundEffect_editor.on('change',function() {
backgroundEffect_editor.validate().length ? $('#btn_submit_backgroundEffect').attr('disabled', true) : $('#btn_submit_backgroundEffect').attr('disabled', false); backgroundEffect_editor.validate().length ? $('#btn_submit_backgroundEffect').attr('disabled', true) : $('#btn_submit_backgroundEffect').attr('disabled', false);
}); });
$('#btn_submit_foregroundEffect').off().on('click',function() { $('#btn_submit_foregroundEffect').off().on('click',function() {
var value = foregroundEffect_editor.getValue(); var value = foregroundEffect_editor.getValue();
if(typeof value.foregroundEffect.effect == 'undefined') if(typeof value.foregroundEffect.effect == 'undefined')
value.foregroundEffect.effect = serverConfig.foregroundEffect.effect; value.foregroundEffect.effect = serverConfig.foregroundEffect.effect;
requestWriteConfig(value); requestWriteConfig(value);
}); });
$('#btn_submit_backgroundEffect').off().on('click',function() { $('#btn_submit_backgroundEffect').off().on('click',function() {
var value = backgroundEffect_editor.getValue(); var value = backgroundEffect_editor.getValue();
if(typeof value.backgroundEffect.effect == 'undefined') if(typeof value.backgroundEffect.effect == 'undefined')
value.backgroundEffect.effect = serverConfig.backgroundEffect.effect; value.backgroundEffect.effect = serverConfig.backgroundEffect.effect;
requestWriteConfig(value); requestWriteConfig(value);
}); });
//create introduction //create introduction
if(showOptHelp) if(showOptHelp)
{ {
@ -96,36 +95,33 @@ $(document).ready( function() {
} }
function updateEffectlist(){ function updateEffectlist(){
if(editorReady) var newEffects = serverInfo.effects;
if (newEffects.length != oldEffects.length)
{ {
var newEffects = serverInfo.effects; $('#root_foregroundEffect_effect').html('');
if (newEffects.length != oldEffects.length) var usrEffArr = [];
var sysEffArr = [];
for(i = 0; i < newEffects.length; i++)
{ {
$('#root_foregroundEffect_effect').html(''); var effectName = newEffects[i].name;
var usrEffArr = []; if(!/^\:/.test(newEffects[i].file))
var sysEffArr = []; usrEffArr.push(effectName);
else
for(i = 0; i < newEffects.length; i++) sysEffArr.push(effectName);
{
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);
} }
$('#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 //interval update
$(hyperion).on("cmd-serverinfo",updateEffectlist); $(hyperion).on("cmd-serverinfo",updateEffectlist);
removeOverlay(); removeOverlay();
}); });

View File

@ -1,10 +1,10 @@
$(document).ready( function() { $(document).ready( function() {
performTranslation(); performTranslation();
var importedConf; var importedConf;
var confName; var confName;
var conf_editor = null; var conf_editor = null;
$('#conf_cont').append(createOptPanel('fa-wrench', $.i18n("edt_conf_gen_heading_title"), 'editor_container', 'btn_submit')); $('#conf_cont').append(createOptPanel('fa-wrench', $.i18n("edt_conf_gen_heading_title"), 'editor_container', 'btn_submit'));
if(showOptHelp) if(showOptHelp)
{ {
@ -12,25 +12,25 @@ $(document).ready( function() {
} }
else else
$('#conf_imp').appendTo('#conf_cont'); $('#conf_imp').appendTo('#conf_cont');
conf_editor = createJsonEditor('editor_container', { conf_editor = createJsonEditor('editor_container', {
general: schema.general general: schema.general
}, true, true); }, true, true);
conf_editor.on('change',function() { conf_editor.on('change',function() {
conf_editor.validate().length ? $('#btn_submit').attr('disabled', true) : $('#btn_submit').attr('disabled', false); conf_editor.validate().length ? $('#btn_submit').attr('disabled', true) : $('#btn_submit').attr('disabled', false);
}); });
$('#btn_submit').off().on('click',function() { $('#btn_submit').off().on('click',function() {
requestWriteConfig(conf_editor.getValue()); requestWriteConfig(conf_editor.getValue());
}); });
//import //import
function dis_imp_btn(state) function dis_imp_btn(state)
{ {
state ? $('#btn_import_conf').attr('disabled', true) : $('#btn_import_conf').attr('disabled', false); state ? $('#btn_import_conf').attr('disabled', true) : $('#btn_import_conf').attr('disabled', false);
} }
function readFile(evt) function readFile(evt)
{ {
var f = evt.target.files[0]; var f = evt.target.files[0];
@ -60,45 +60,36 @@ $(document).ready( function() {
} }
else else
{ {
//check config revision dis_imp_btn(false);
if(content.general.configVersion !== serverConfig.general.configVersion) importedConf = content;
{ confName = f.name;
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;
}
} }
} }
} }
r.readAsText(f); r.readAsText(f);
} }
} }
$('#btn_import_conf').off().on('click', function(){ $('#btn_import_conf').off().on('click', function(){
showInfoDialog('import', $.i18n('infoDialog_import_confirm_title'), $.i18n('infoDialog_import_confirm_text', confName)); showInfoDialog('import', $.i18n('infoDialog_import_confirm_title'), $.i18n('infoDialog_import_confirm_text', confName));
$('#id_btn_import').off().on('click', function(){ $('#id_btn_import').off().on('click', function(){
requestWriteConfig(importedConf, true); requestWriteConfig(importedConf, true);
setTimeout(initRestart, 100); setTimeout(initRestart, 100);
}); });
}); });
$('#select_import_conf').off().on('change', function(e){ $('#select_import_conf').off().on('change', function(e){
if (window.File && window.FileReader && window.FileList && window.Blob) if (window.File && window.FileReader && window.FileList && window.Blob)
readFile(e); readFile(e);
else else
showInfoDialog('error', "", $.i18n('infoDialog_import_comperror_text')); showInfoDialog('error', "", $.i18n('infoDialog_import_comperror_text'));
}); });
//export //export
$('#btn_export_conf').off().on('click', function(){ $('#btn_export_conf').off().on('click', function(){
var name = serverConfig.general.name; var name = serverConfig.general.name;
var d = new Date(); var d = new Date();
var month = d.getMonth()+1; var month = d.getMonth()+1;
var day = d.getDate(); var day = d.getDate();
@ -106,14 +97,13 @@ $(document).ready( function() {
var timestamp = d.getFullYear() + '.' + var timestamp = d.getFullYear() + '.' +
(month<10 ? '0' : '') + month + '.' + (month<10 ? '0' : '') + month + '.' +
(day<10 ? '0' : '') + day; (day<10 ? '0' : '') + day;
download(JSON.stringify(serverConfig, null, "\t"), 'Hyperion-'+currentVersion+'-Backup ('+name+') '+timestamp+'.json', "application/json"); download(JSON.stringify(serverConfig, null, "\t"), 'Hyperion-'+currentVersion+'-Backup ('+name+') '+timestamp+'.json', "application/json");
}); });
//create introduction //create introduction
if(showOptHelp) if(showOptHelp)
createHint("intro", $.i18n('conf_general_intro'), "editor_container"); createHint("intro", $.i18n('conf_general_intro'), "editor_container");
removeOverlay(); removeOverlay();
}); });

View File

@ -19,12 +19,6 @@ $(document).ready( function() {
$("#hyperion_disabled_notify").fadeIn("fast"); $("#hyperion_disabled_notify").fadeIn("fast");
else else
$("#hyperion_disabled_notify").fadeOut("fast"); $("#hyperion_disabled_notify").fadeOut("fast");
if ($("#logmessages").length == 0 && loggingStreamActive)
{
requestLoggingStop();
loggingStreamActive = false;
}
if (!serverInfo.hyperion.config_writeable) if (!serverInfo.hyperion.config_writeable)
{ {

View File

@ -144,6 +144,13 @@ $(document).ready(function() {
{ {
loggingHandlerInstalled = true; loggingHandlerInstalled = true;
$(hyperion).on("cmd-logging-update",function(event){ $(hyperion).on("cmd-logging-update",function(event){
if ($("#logmessages").length == 0 && loggingStreamActive)
{
requestLoggingStop();
loggingStreamActive = false;
}
messages = (event.response.result.messages); messages = (event.response.result.messages);
if(messages.length != 0 && !createdCont) if(messages.length != 0 && !createdCont)
{ {

View File

@ -1,18 +1,18 @@
$(document).ready(function() { $(document).ready(function() {
performTranslation(); performTranslation();
var oldEffects = []; var oldEffects = [];
var cpcolor = '#B500FF'; var cpcolor = '#B500FF';
var mappingList = serverSchema.properties.color.properties.imageToLedMappingType.enum; var mappingList = serverSchema.properties.color.properties.imageToLedMappingType.enum;
var duration = 0; var duration = 0;
var rgb = {r:255,g:0,b:0}; var rgb = {r:255,g:0,b:0};
//create html //create html
createTable('ssthead', 'sstbody', 'sstcont'); 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)); $('.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); createTable('crthead', 'crtbody', 'adjust_content', true);
//create introduction //create introduction
if(showOptHelp) if(showOptHelp)
{ {
@ -21,12 +21,13 @@ $(document).ready(function() {
createHint("intro", $.i18n('remote_adjustment_intro', $.i18n('remote_losthint')), "adjust_content"); 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_components_intro', $.i18n('remote_losthint')), "comp_intro");
createHint("intro", $.i18n('remote_maptype_intro', $.i18n('remote_losthint')), "maptype_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 //color adjustment
var sColor = sortProperties(serverSchema.properties.color.properties.channelAdjustment.items.properties) var sColor = sortProperties(serverSchema.properties.color.properties.channelAdjustment.items.properties)
var values = serverInfo.adjustment[0] var values = serverInfo.adjustment[0]
for(key in sColor) for(key in sColor)
{ {
if(sColor[key].key != "id" && sColor[key].key != "leds") if(sColor[key].key != "id" && sColor[key].key != "leds")
@ -47,18 +48,18 @@ $(document).ready(function() {
{ {
property = '<div class="checkbox"><input id="cr_'+sColor[key].key+'" type="checkbox" value="'+value+'"/><label></label></div>'; property = '<div class="checkbox"><input id="cr_'+sColor[key].key+'" type="checkbox" value="'+value+'"/><label></label></div>';
$('.crtbody').append(createTableRow([title, property], false, true)); $('.crtbody').append(createTableRow([title, property], false, true));
$('#cr_'+sColor[key].key).off().on('change', function(e){ $('#cr_'+sColor[key].key).off().on('change', function(e){
requestAdjustment(e.target.id.substr(e.target.id.indexOf("_") + 1), e.currentTarget.checked); requestAdjustment(e.target.id.substr(e.target.id.indexOf("_") + 1), e.currentTarget.checked);
}); });
} }
else 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 = '<div class="input-group"><input id="cr_'+sColor[key].key+'" type="number" class="form-control" min="0" max="100" step="10" value="'+value+'"/><span class="input-group-addon">'+$.i18n("edt_append_percent")+'</span></div>'; property = '<div class="input-group"><input id="cr_'+sColor[key].key+'" type="number" class="form-control" min="0" max="100" step="10" value="'+value+'"/><span class="input-group-addon">'+$.i18n("edt_append_percent")+'</span></div>';
else else
property = '<input id="cr_'+sColor[key].key+'" type="number" class="form-control" min="0.1" max="4.0" step="0.1" value="'+value+'"/>'; property = '<input id="cr_'+sColor[key].key+'" type="number" class="form-control" min="0.1" max="4.0" step="0.1" value="'+value+'"/>';
$('.crtbody').append(createTableRow([title, property], false, true)); $('.crtbody').append(createTableRow([title, property], false, true));
$('#cr_'+sColor[key].key).off().on('change', function(e){ $('#cr_'+sColor[key].key).off().on('change', function(e){
valValue(this.id,this.value,this.min,this.max); valValue(this.id,this.value,this.min,this.max);
@ -79,12 +80,12 @@ $(document).ready(function() {
}); });
} }
} }
function sendColor() function sendColor()
{ {
requestSetColor(rgb.r, rgb.g, rgb.b,duration); requestSetColor(rgb.r, rgb.g, rgb.b,duration);
} }
function updateRemote() function updateRemote()
{ {
if ($('#componentsbutton').length == 0) if ($('#componentsbutton').length == 0)
@ -95,13 +96,14 @@ $(document).ready(function() {
{ {
updateInputSelect(); updateInputSelect();
updateLedMapping(); updateLedMapping();
updateVideoMode();
updateComponents(); updateComponents();
updateEffectlist(); updateEffectlist();
} }
} }
function updateInputSelect() function updateInputSelect()
{ {
$('.sstbody').html(""); $('.sstbody').html("");
var data = ""; var data = "";
var prios = serverInfo.priorities var prios = serverInfo.priorities
@ -114,7 +116,7 @@ $(document).ready(function() {
origin = origin.split("@"); origin = origin.split("@");
var ip = origin[1]; var ip = origin[1];
origin = origin[0]; origin = origin[0];
var owner = prios[i].owner; var owner = prios[i].owner;
var active = prios[i].active; var active = prios[i].active;
var visible = prios[i].visible; var visible = prios[i].visible;
@ -127,7 +129,7 @@ $(document).ready(function() {
if (active) if (active)
btn_type = "primary"; btn_type = "primary";
if(priority > 254) if(priority > 254)
continue; continue;
if(priority < 254 && (compId == "EFFECT" || compId == "COLOR") ) if(priority < 254 && (compId == "EFFECT" || compId == "COLOR") )
@ -164,15 +166,15 @@ $(document).ready(function() {
owner = $.i18n('general_comp_UDPLISTENER'); owner = $.i18n('general_comp_UDPLISTENER');
break; break;
} }
if(duration && compId != "GRABBER" && compId != "PROTOSERVER") if(duration && compId != "GRABBER" && compId != "PROTOSERVER")
owner += '<br/><span style="font-size:80%; color:grey;">'+$.i18n('remote_input_duration')+' '+duration.toFixed(0)+$.i18n('edt_append_s')+'</span>'; owner += '<br/><span style="font-size:80%; color:grey;">'+$.i18n('remote_input_duration')+' '+duration.toFixed(0)+$.i18n('edt_append_s')+'</span>';
var btn = '<button id="srcBtn'+i+'" type="button" '+btn_state+' class="btn btn-'+btn_type+' btn_input_selection" onclick="requestSetSource('+priority+');">'+btn_text+'</button>'; var btn = '<button id="srcBtn'+i+'" type="button" '+btn_state+' class="btn btn-'+btn_type+' btn_input_selection" onclick="requestSetSource('+priority+');">'+btn_text+'</button>';
if((compId == "EFFECT" || compId == "COLOR") && priority < 254) if((compId == "EFFECT" || compId == "COLOR") && priority < 254)
btn += '<button type="button" class="btn btn-sm btn-danger" style="margin-left:10px;" onclick="requestPriorityClear('+priority+');"><i class="fa fa-close"></button>'; btn += '<button type="button" class="btn btn-sm btn-danger" style="margin-left:10px;" onclick="requestPriorityClear('+priority+');"><i class="fa fa-close"></button>';
if(btn_type != 'default') if(btn_type != 'default')
$('.sstbody').append(createTableRow([origin, owner, priority, btn], false, true)); $('.sstbody').append(createTableRow([origin, owner, priority, btn], false, true));
} }
@ -182,15 +184,15 @@ $(document).ready(function() {
var btn_call_state = (clearAll? "enabled" : "disabled"); var btn_call_state = (clearAll? "enabled" : "disabled");
$('#auto_btn').html('<button id="srcBtn'+i+'" type="button" '+btn_auto_state+' class="btn '+btn_auto_color+'" style="margin-right:5px;display:inline-block;" onclick="requestSetSource(\'auto\');">'+$.i18n('remote_input_label_autoselect')+' ('+btn_auto_text+')</button>'); $('#auto_btn').html('<button id="srcBtn'+i+'" type="button" '+btn_auto_state+' class="btn '+btn_auto_color+'" style="margin-right:5px;display:inline-block;" onclick="requestSetSource(\'auto\');">'+$.i18n('remote_input_label_autoselect')+' ('+btn_auto_text+')</button>');
$('#auto_btn').append('<button type="button" '+btn_call_state+' class="btn btn-danger" style="display:inline-block;" onclick="requestClearAll();">'+$.i18n('remote_input_clearall')+'</button>'); $('#auto_btn').append('<button type="button" '+btn_call_state+' class="btn btn-danger" style="display:inline-block;" onclick="requestClearAll();">'+$.i18n('remote_input_clearall')+'</button>');
var max_width=100; var max_width=100;
$('.btn_input_selection').each(function() { $('.btn_input_selection').each(function() {
if ($(this).innerWidth() > max_width) if ($(this).innerWidth() > max_width)
max_width = $(this).innerWidth(); max_width = $(this).innerWidth();
}); });
$('.btn_input_selection').css("min-width",max_width+"px"); $('.btn_input_selection').css("min-width",max_width+"px");
} }
function updateLedMapping() function updateLedMapping()
{ {
mapping = serverInfo.ledMAppingType; mapping = serverInfo.ledMAppingType;
@ -219,7 +221,7 @@ $(document).ready(function() {
comp_name = components[idx].name; comp_name = components[idx].name;
comp_btn_id = "comp_btn_"+comp_name; comp_btn_id = "comp_btn_"+comp_name;
comp_goff = serverInfo.hyperion.off? "disabled" : "enabled"; comp_goff = serverInfo.hyperion.off? "disabled" : "enabled";
// create btn if not there // create btn if not there
if ($("#"+comp_btn_id).length == 0) if ($("#"+comp_btn_id).length == 0)
{ {
@ -236,7 +238,7 @@ $(document).ready(function() {
} }
} }
} }
function updateEffectlist() function updateEffectlist()
{ {
var newEffects = serverInfo.effects; var newEffects = serverInfo.effects;
@ -245,7 +247,7 @@ $(document).ready(function() {
$('#effect_select').html('<option value="__none__"></option>'); $('#effect_select').html('<option value="__none__"></option>');
var usrEffArr = []; var usrEffArr = [];
var sysEffArr = []; var sysEffArr = [];
for(i = 0; i < newEffects.length; i++) { for(i = 0; i < newEffects.length; i++) {
var effectName = newEffects[i].name; var effectName = newEffects[i].name;
if(!/^\:/.test(newEffects[i].file)){ if(!/^\:/.test(newEffects[i].file)){
@ -260,20 +262,36 @@ $(document).ready(function() {
oldEffects = newEffects; 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('<button type="button" id="vModeBtn_'+videoModes[ix]+'" class="btn '+btn_style+'" style="margin:3px;min-width:200px" onclick="requestVideoMode(\''+videoModes[ix]+'\');">'+$.i18n('remote_videoMode_'+videoModes[ix])+'</button><br/>');
}
}
// colorpicker and effect // colorpicker and effect
if (getStorage('rmcpcolor') != null) if (getStorage('rmcpcolor') != null)
{ {
cpcolor = getStorage('rmcpcolor'); cpcolor = getStorage('rmcpcolor');
rgb = hexToRgb(cpcolor); rgb = hexToRgb(cpcolor);
} }
if (getStorage('rmduration') != null) if (getStorage('rmduration') != null)
{ {
$("#remote_duration").val(getStorage('rmduration')); $("#remote_duration").val(getStorage('rmduration'));
duration = getStorage('rmduration'); duration = getStorage('rmduration');
} }
createCP('cp2', cpcolor, function(rgbT,hex){ createCP('cp2', cpcolor, function(rgbT,hex){
rgb = rgbT; rgb = rgbT;
sendColor() sendColor()
@ -284,7 +302,7 @@ $(document).ready(function() {
requestPriorityClear(); requestPriorityClear();
$("#effect_select").val("__none__"); $("#effect_select").val("__none__");
}); });
$("#remote_duration").off().on("change", function(){ $("#remote_duration").off().on("change", function(){
duration = valValue(this.id,this.value,this.min,this.max); duration = valValue(this.id,this.value,this.min,this.max);
setStorage('rmduration', duration); setStorage('rmduration', duration);
@ -293,26 +311,26 @@ $(document).ready(function() {
$("#effect_select").off().on("change", function(event) { $("#effect_select").off().on("change", function(event) {
sendEffect(); sendEffect();
}); });
$("#remote_input_reseff, #remote_input_rescol").off().on("click", function(){ $("#remote_input_reseff, #remote_input_rescol").off().on("click", function(){
if(this.id == "remote_input_rescol") if(this.id == "remote_input_rescol")
sendColor(); sendColor();
else else
sendEffect(); sendEffect();
}); });
$("#remote_input_img").change(function(){ $("#remote_input_img").change(function(){
readImg(this, function(src,width,height){ readImg(this, function(src,width,height){
console.log(src,width,height) console.log(src,width,height)
requestSetImage(src,width,height,duration) requestSetImage(src,width,height,duration)
}); });
}); });
//force first update //force first update
updateRemote(); updateRemote();
// interval updates // interval updates
$(hyperion).on("cmd-serverinfo",updateRemote); $(hyperion).on("cmd-serverinfo",updateRemote);
removeOverlay(); removeOverlay();
}); });

View File

@ -40,8 +40,9 @@ function connectionLostDetection(type)
window.clearInterval(i); window.clearInterval(i);
if(type == 'restart') if(type == 'restart')
{ {
$("body").html($("#container_restart").html()); $("body").html($("#container_restart").html());
restartAction(); // setTimeout delay for probably slower systems, some browser don't execute THIS action
setTimeout(restartAction,250);
} }
else else
{ {
@ -222,17 +223,17 @@ function requestClearAll()
} }
function requestPlayEffect(effectName, duration) function requestPlayEffect(effectName, duration)
{ {
sendToHyperion("effect", "", '"effect":{"name":"'+effectName+'"},"priority":'+webPrio+',"duration":'+validateDuration(duration)+',"origin":"'+webOrigin+'"'); sendToHyperion("effect", "", '"effect":{"name":"'+effectName+'"},"priority":'+webPrio+',"duration":'+validateDuration(duration)+',"origin":"'+webOrigin+'"');
} }
function requestSetColor(r,g,b,duration) function requestSetColor(r,g,b,duration)
{ {
sendToHyperion("color", "", '"color":['+r+','+g+','+b+'], "priority":'+webPrio+',"duration":'+validateDuration(duration)+',"origin":"'+webOrigin+'"'); sendToHyperion("color", "", '"color":['+r+','+g+','+b+'], "priority":'+webPrio+',"duration":'+validateDuration(duration)+',"origin":"'+webOrigin+'"');
} }
function requestSetImage(data,width,height,duration) function requestSetImage(data,width,height,duration)
{ {
sendToHyperion("image", "", '"imagedata":"'+data+'", "imagewidth":'+width+',"imageheight":'+height+', "priority":'+webPrio+',"duration":'+validateDuration(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+'"'); sendToHyperion("processing", "", '"mappingType": "'+type+'"');
} }
function requestVideoMode(newMode)
{
sendToHyperion("videomode", "", '"videoMode": "'+newMode+'"');
}
function requestAdjustment(type, value, complete) function requestAdjustment(type, value, complete)
{ {
if(complete === true) if(complete === true)
sendToHyperion("adjustment", "", '"adjustment": '+type+''); sendToHyperion("adjustment", "", '"adjustment": '+type+'');
else else
sendToHyperion("adjustment", "", '"adjustment": {"'+type+'": '+value+'}'); sendToHyperion("adjustment", "", '"adjustment": {"'+type+'": '+value+'}');
} }

View File

@ -1,7 +1,7 @@
//clear priority and other tasks if people reload the page or lost connection while a wizard was active //clear priority and other tasks if people reload the page or lost connection while a wizard was active
$(hyperion).one("ready", function(event) { $(hyperion).one("ready", function(event) {
if(getStorage("wizardactive") === 'true') if(getStorage("wizardactive") === 'true')
{ {
requestPriorityClear(); requestPriorityClear();
setStorage("wizardactive", false); setStorage("wizardactive", false);
@ -12,7 +12,7 @@
} }
} }
}); });
function resetWizard() function resetWizard()
{ {
$("#wizard_modal").modal('hide'); $("#wizard_modal").modal('hide');
@ -27,7 +27,7 @@
sendToKodi("stop"); sendToKodi("stop");
step = 0; step = 0;
} }
//rgb byte order wizard //rgb byte order wizard
var wIntveralId; var wIntveralId;
var new_rgb_order; var new_rgb_order;
@ -59,14 +59,14 @@
$('#wizp2_body').append('<canvas id="wiz_canv_color" width="100" height="100" style="border-radius:60px;background-color:red; display:block; margin: 10px 0;border:4px solid grey;"></canvas><label>'+$.i18n('wiz_rgb_q')+'</label>'); $('#wizp2_body').append('<canvas id="wiz_canv_color" width="100" height="100" style="border-radius:60px;background-color:red; display:block; margin: 10px 0;border:4px solid grey;"></canvas><label>'+$.i18n('wiz_rgb_q')+'</label>');
$('#wizp2_body').append('<table class="table borderless" style="width:200px"><tbody><tr><td class="ltd"><label>'+$.i18n('wiz_rgb_qrend')+'</label></td><td class="itd"><select id="wiz_r_select" class="form-control wselect"></select></td></tr><tr><td class="ltd"><label>'+$.i18n('wiz_rgb_qgend')+'</label></td><td class="itd"><select id="wiz_g_select" class="form-control wselect"></select></td></tr></tbody></table>'); $('#wizp2_body').append('<table class="table borderless" style="width:200px"><tbody><tr><td class="ltd"><label>'+$.i18n('wiz_rgb_qrend')+'</label></td><td class="itd"><select id="wiz_r_select" class="form-control wselect"></select></td></tr><tr><td class="ltd"><label>'+$.i18n('wiz_rgb_qgend')+'</label></td><td class="itd"><select id="wiz_g_select" class="form-control wselect"></select></td></tr></tbody></table>');
$('#wizp2_footer').html('<button type="button" class="btn btn-primary" id="btn_wiz_save"><i class="fa fa-fw fa-save"></i>'+$.i18n('general_btn_saverestart')+'</button><button type="button" class="btn btn-primary" id="btn_wiz_checkok" style="display:none" data-dismiss="modal"><i class="fa fa-fw fa-check"></i>'+$.i18n('general_btn_ok')+'</button><button type="button" class="btn btn-danger" id="btn_wiz_abort"><i class="fa fa-fw fa-close"></i>'+$.i18n('general_btn_cancel')+'</button>') $('#wizp2_footer').html('<button type="button" class="btn btn-primary" id="btn_wiz_save"><i class="fa fa-fw fa-save"></i>'+$.i18n('general_btn_saverestart')+'</button><button type="button" class="btn btn-primary" id="btn_wiz_checkok" style="display:none" data-dismiss="modal"><i class="fa fa-fw fa-check"></i>'+$.i18n('general_btn_ok')+'</button><button type="button" class="btn btn-danger" id="btn_wiz_abort"><i class="fa fa-fw fa-close"></i>'+$.i18n('general_btn_cancel')+'</button>')
//open modal //open modal
$("#wizard_modal").modal({ $("#wizard_modal").modal({
backdrop : "static", backdrop : "static",
keyboard: false, keyboard: false,
show: true show: true
}); });
//listen for continue //listen for continue
$('#btn_wiz_cont').off().on('click',function() { $('#btn_wiz_cont').off().on('click',function() {
beginWizardRGB(); beginWizardRGB();
@ -76,7 +76,7 @@
} }
function beginWizardRGB() function beginWizardRGB()
{ {
$("#wiz_switchtime_select").off().on('change',function() { $("#wiz_switchtime_select").off().on('change',function() {
clearInterval(wIntveralId); clearInterval(wIntveralId);
var time = $("#wiz_switchtime_select").val(); var time = $("#wiz_switchtime_select").val();
@ -88,19 +88,19 @@
var redS = $("#wiz_r_select").val(); var redS = $("#wiz_r_select").val();
var greenS = $("#wiz_g_select").val(); var greenS = $("#wiz_g_select").val();
var blueS = rgb_order.toString().replace(/,/g,"").replace(redS, "").replace(greenS,""); var blueS = rgb_order.toString().replace(/,/g,"").replace(redS, "").replace(greenS,"");
for (var i = 0; i<rgb_order.length; i++) for (var i = 0; i<rgb_order.length; i++)
{ {
if (redS == rgb_order[i]) if (redS == rgb_order[i])
$('#wiz_g_select option[value='+rgb_order[i]+']').attr('disabled',true); $('#wiz_g_select option[value='+rgb_order[i]+']').attr('disabled',true);
else else
$('#wiz_g_select option[value='+rgb_order[i]+']').attr('disabled',false); $('#wiz_g_select option[value='+rgb_order[i]+']').attr('disabled',false);
if (greenS == rgb_order[i]) if (greenS == rgb_order[i])
$('#wiz_r_select option[value='+rgb_order[i]+']').attr('disabled',true); $('#wiz_r_select option[value='+rgb_order[i]+']').attr('disabled',true);
else else
$('#wiz_r_select option[value='+rgb_order[i]+']').attr('disabled',false); $('#wiz_r_select option[value='+rgb_order[i]+']').attr('disabled',false);
} }
if(redS != 'null' && greenS != 'null') if(redS != 'null' && greenS != 'null')
{ {
$('#btn_wiz_save').attr('disabled',false); $('#btn_wiz_save').attr('disabled',false);
@ -114,9 +114,9 @@
else else
rgb_order[i] = blueS; rgb_order[i] = blueS;
} }
rgb_order = rgb_order.toString().replace(/,/g,""); rgb_order = rgb_order.toString().replace(/,/g,"");
if(redS == "r" && greenS == "g") if(redS == "r" && greenS == "g")
{ {
$('#btn_wiz_save').toggle(false); $('#btn_wiz_save').toggle(false);
@ -132,14 +132,14 @@
else else
$('#btn_wiz_save').attr('disabled',true); $('#btn_wiz_save').attr('disabled',true);
}); });
$("#wiz_switchtime_select").append(createSelOpt('5','5'),createSelOpt('10','10'),createSelOpt('15','15'),createSelOpt('30','30')); $("#wiz_switchtime_select").append(createSelOpt('5','5'),createSelOpt('10','10'),createSelOpt('15','15'),createSelOpt('30','30'));
$("#wiz_switchtime_select").trigger('change'); $("#wiz_switchtime_select").trigger('change');
$("#wiz_r_select").append(createSelOpt("null", ""),createSelOpt('r', $.i18n('general_col_red')),createSelOpt('g', $.i18n('general_col_green')),createSelOpt('b', $.i18n('general_col_blue'))); $("#wiz_r_select").append(createSelOpt("null", ""),createSelOpt('r', $.i18n('general_col_red')),createSelOpt('g', $.i18n('general_col_green')),createSelOpt('b', $.i18n('general_col_blue')));
$("#wiz_g_select").html($("#wiz_r_select").html()); $("#wiz_g_select").html($("#wiz_r_select").html());
$("#wiz_r_select").trigger('change'); $("#wiz_r_select").trigger('change');
requestSetColor('255','0','0'); requestSetColor('255','0','0');
setTimeout(requestSetSource, 100, 'auto'); setTimeout(requestSetSource, 100, 'auto');
setStorage("wizardactive", true); setStorage("wizardactive", true);
@ -158,9 +158,9 @@
setTimeout(initRestart, 100); setTimeout(initRestart, 100);
}); });
} }
$('#btn_wizard_byteorder').off().on('click',startWizardRGB); $('#btn_wizard_byteorder').off().on('click',startWizardRGB);
//color calibration wizard //color calibration wizard
var kodiAddress = document.location.hostname+':8080'; var kodiAddress = document.location.hostname+':8080';
var wiz_editor; var wiz_editor;
@ -174,28 +174,28 @@
var vidAddress = "https://sourceforge.net/projects/hyperion-project/files/resources/vid/"; var vidAddress = "https://sourceforge.net/projects/hyperion-project/files/resources/vid/";
var picnr = 0; var picnr = 0;
var availVideos = ["Sweet_Cocoon","Caminandes_2_GranDillama","Caminandes_3_Llamigos"]; var availVideos = ["Sweet_Cocoon","Caminandes_2_GranDillama","Caminandes_3_Llamigos"];
if(getStorage("kodiAddress") != null) if(getStorage("kodiAddress") != null)
kodiAddress = getStorage("kodiAddress"); kodiAddress = getStorage("kodiAddress");
function switchPicture(pictures) function switchPicture(pictures)
{ {
if(typeof pictures[picnr] === 'undefined') if(typeof pictures[picnr] === 'undefined')
picnr = 0; picnr = 0;
sendToKodi('playP',pictures[picnr]); sendToKodi('playP',pictures[picnr]);
picnr++; picnr++;
} }
function sendToKodi(type, content, cb) function sendToKodi(type, content, cb)
{ {
var command; var command;
if(type == "playP") if(type == "playP")
content = imgAddress+content+'.png'; content = imgAddress+content+'.png';
if(type == "playV") if(type == "playV")
content = vidAddress+content; content = vidAddress+content;
if(type == "msg") if(type == "msg")
command = '{"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title": "'+$.i18n('wiz_cc_title')+'", "message": "'+content+'", "image":"info", "displaytime":5000 },"id":"1"}'; command = '{"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title": "'+$.i18n('wiz_cc_title')+'", "message": "'+content+'", "image":"info", "displaytime":5000 },"id":"1"}';
else if (type == "stop") else if (type == "stop")
@ -222,13 +222,13 @@
.fail( function( jqXHR, textStatus ) { .fail( function( jqXHR, textStatus ) {
if ( jqXHR.status != 200 && type == "msg") if ( jqXHR.status != 200 && type == "msg")
cb("error") cb("error")
}); });
} }
function performAction() function performAction()
{ {
var h; var h;
if(step == 1) if(step == 1)
{ {
$('#wiz_cc_desc').html($.i18n('wiz_cc_chooseid')); $('#wiz_cc_desc').html($.i18n('wiz_cc_chooseid'));
@ -237,7 +237,7 @@
} }
else else
$('#btn_wiz_back').attr("disabled", false) $('#btn_wiz_back').attr("disabled", false)
if(step == 2) if(step == 2)
{ {
updateWEditor(["white"]); updateWEditor(["white"]);
@ -273,7 +273,7 @@
h = $.i18n('wiz_cc_adjustit',$.i18n('edt_conf_color_red_title')); h = $.i18n('wiz_cc_adjustit',$.i18n('edt_conf_color_red_title'));
if(withKodi) if(withKodi)
{ {
h += '<br/>'+$.i18n('wiz_cc_kodishould',$.i18n('edt_conf_color_red_title')); h += '<br/>'+$.i18n('wiz_cc_kodishould',$.i18n('edt_conf_color_red_title'));
sendToKodi('playP',"red"); sendToKodi('playP',"red");
} }
else else
@ -286,7 +286,7 @@
h = $.i18n('wiz_cc_adjustit',$.i18n('edt_conf_color_green_title')); h = $.i18n('wiz_cc_adjustit',$.i18n('edt_conf_color_green_title'));
if(withKodi) if(withKodi)
{ {
h += '<br/>'+$.i18n('wiz_cc_kodishould',$.i18n('edt_conf_color_green_title')); h += '<br/>'+$.i18n('wiz_cc_kodishould',$.i18n('edt_conf_color_green_title'));
sendToKodi('playP',"green"); sendToKodi('playP',"green");
} }
else else
@ -377,17 +377,17 @@
h += '<p>'+$.i18n('wiz_cc_testintrowok')+' <a href="https://sourceforge.net/projects/hyperion-project/files/resources/vid/" target="_blank">'+$.i18n('wiz_cc_link')+'</a></p>'; h += '<p>'+$.i18n('wiz_cc_testintrowok')+' <a href="https://sourceforge.net/projects/hyperion-project/files/resources/vid/" target="_blank">'+$.i18n('wiz_cc_link')+'</a></p>';
h += '<p>'+$.i18n('wiz_cc_summary')+'</p>'; h += '<p>'+$.i18n('wiz_cc_summary')+'</p>';
$('#wiz_cc_desc').html(h); $('#wiz_cc_desc').html(h);
$('.videobtn').off().on('click', function(e){ $('.videobtn').off().on('click', function(e){
if(e.target.id == "stop") if(e.target.id == "stop")
sendToKodi("stop"); sendToKodi("stop");
else else
sendToKodi("playV",e.target.id+'.mp4'); sendToKodi("playV",e.target.id+'.mp4');
$(this).attr("disabled", true); $(this).attr("disabled", true);
setTimeout(function(){$('.videobtn').attr("disabled", false)},10000); setTimeout(function(){$('.videobtn').attr("disabled", false)},10000);
}); });
$('#btn_wiz_next').attr("disabled", true); $('#btn_wiz_next').attr("disabled", true);
$('#btn_wiz_save').toggle(true); $('#btn_wiz_save').toggle(true);
} }
@ -397,7 +397,7 @@
$('#btn_wiz_save').toggle(false); $('#btn_wiz_save').toggle(false);
} }
} }
function updateWEditor(el, all) function updateWEditor(el, all)
{ {
for (var key in cobj) for (var key in cobj)
@ -408,7 +408,7 @@
$('#editor_container_wiz [data-schemapath*=".'+profile+'.'+key+'"]').toggle(false); $('#editor_container_wiz [data-schemapath*=".'+profile+'.'+key+'"]').toggle(false);
} }
} }
function startWizardCC() function startWizardCC()
{ {
//create html //create html
@ -417,14 +417,14 @@
$('#wizp1_footer').html('<button type="button" class="btn btn-primary" id="btn_wiz_cont" disabled="disabled"><i class="fa fa-fw fa-check"></i>'+$.i18n('general_btn_continue')+'</button><button type="button" class="btn btn-danger" data-dismiss="modal"><i class="fa fa-fw fa-close"></i>'+$.i18n('general_btn_cancel')+'</button>'); $('#wizp1_footer').html('<button type="button" class="btn btn-primary" id="btn_wiz_cont" disabled="disabled"><i class="fa fa-fw fa-check"></i>'+$.i18n('general_btn_continue')+'</button><button type="button" class="btn btn-danger" data-dismiss="modal"><i class="fa fa-fw fa-close"></i>'+$.i18n('general_btn_cancel')+'</button>');
$('#wizp2_body').html('<div id="wiz_cc_desc" style="font-weight:bold"></div><div id="editor_container_wiz"></div>'); $('#wizp2_body').html('<div id="wiz_cc_desc" style="font-weight:bold"></div><div id="editor_container_wiz"></div>');
$('#wizp2_footer').html('<button type="button" class="btn btn-primary" id="btn_wiz_back"><i class="fa fa-fw fa-chevron-left"></i>'+$.i18n('general_btn_back')+'</button><button type="button" class="btn btn-primary" id="btn_wiz_next">'+$.i18n('general_btn_next')+'<i style="margin-left:4px;"class="fa fa-fw fa-chevron-right"></i></button><button type="button" class="btn btn-warning" id="btn_wiz_save" style="display:none"><i class="fa fa-fw fa-save"></i>'+$.i18n('general_btn_saverestart')+'</button><button type="button" class="btn btn-danger" id="btn_wiz_abort"><i class="fa fa-fw fa-close"></i>'+$.i18n('general_btn_cancel')+'</button>') $('#wizp2_footer').html('<button type="button" class="btn btn-primary" id="btn_wiz_back"><i class="fa fa-fw fa-chevron-left"></i>'+$.i18n('general_btn_back')+'</button><button type="button" class="btn btn-primary" id="btn_wiz_next">'+$.i18n('general_btn_next')+'<i style="margin-left:4px;"class="fa fa-fw fa-chevron-right"></i></button><button type="button" class="btn btn-warning" id="btn_wiz_save" style="display:none"><i class="fa fa-fw fa-save"></i>'+$.i18n('general_btn_saverestart')+'</button><button type="button" class="btn btn-danger" id="btn_wiz_abort"><i class="fa fa-fw fa-close"></i>'+$.i18n('general_btn_cancel')+'</button>')
//open modal //open modal
$("#wizard_modal").modal({ $("#wizard_modal").modal({
backdrop : "static", backdrop : "static",
keyboard: false, keyboard: false,
show: true show: true
}); });
$('#wiz_cc_kodiip').off().on('change',function() { $('#wiz_cc_kodiip').off().on('change',function() {
kodiAddress = $(this).val(); kodiAddress = $(this).val();
setStorage("kodiAddress", kodiAddress); setStorage("kodiAddress", kodiAddress);
@ -439,62 +439,62 @@
$('#kodi_status').html('<p style="color:green;font-weight:bold;margin-top:5px">'+$.i18n('wiz_cc_kodicon')+'</p>'); $('#kodi_status').html('<p style="color:green;font-weight:bold;margin-top:5px">'+$.i18n('wiz_cc_kodicon')+'</p>');
withKodi = true; withKodi = true;
} }
$('#btn_wiz_cont').attr('disabled', false); $('#btn_wiz_cont').attr('disabled', false);
}); });
}); });
//listen for continue //listen for continue
$('#btn_wiz_cont').off().on('click',function() { $('#btn_wiz_cont').off().on('click',function() {
beginWizardCC(); beginWizardCC();
$('#wizp1').toggle(false); $('#wizp1').toggle(false);
$('#wizp2').toggle(true); $('#wizp2').toggle(true);
}); });
$('#wiz_cc_kodiip').trigger("change") $('#wiz_cc_kodiip').trigger("change")
colorLength = serverConfig.color.channelAdjustment; colorLength = serverConfig.color.channelAdjustment;
cobj = schema.color.properties.channelAdjustment.items.properties; cobj = schema.color.properties.channelAdjustment.items.properties;
websAddress = document.location.hostname+':'+serverConfig.webConfig.port; websAddress = document.location.hostname+':'+serverConfig.webConfig.port;
imgAddress = 'http://'+websAddress+'/img/cc/'; imgAddress = 'http://'+websAddress+'/img/cc/';
setStorage("wizardactive", true); setStorage("wizardactive", true);
//check profile count //check profile count
if(colorLength.length > 1) if(colorLength.length > 1)
{ {
$('#multi_cali').html('<p style="font-weight:bold;">'+$.i18n('wiz_cc_morethanone')+'</p><select id="wiz_select" class="form-control" style="width:200px;margin:auto"></select>'); $('#multi_cali').html('<p style="font-weight:bold;">'+$.i18n('wiz_cc_morethanone')+'</p><select id="wiz_select" class="form-control" style="width:200px;margin:auto"></select>');
for(var i = 0; i<colorLength.length; i++) for(var i = 0; i<colorLength.length; i++)
$('#wiz_select').append(createSelOpt(i,i+1+' ('+colorLength[i].id+')')); $('#wiz_select').append(createSelOpt(i,i+1+' ('+colorLength[i].id+')'));
$('#wiz_select').off().on('change', function(){ $('#wiz_select').off().on('change', function(){
profile = $(this).val(); profile = $(this).val();
}); });
} }
//prepare editor //prepare editor
wiz_editor = createJsonEditor('editor_container_wiz', { wiz_editor = createJsonEditor('editor_container_wiz', {
color : schema.color color : schema.color
}, true, true); }, true, true);
$('#editor_container_wiz h4').toggle(false); $('#editor_container_wiz h4').toggle(false);
$('#editor_container_wiz .btn-group').toggle(false); $('#editor_container_wiz .btn-group').toggle(false);
$('#editor_container_wiz [data-schemapath="root.color.imageToLedMappingType"]').toggle(false); $('#editor_container_wiz [data-schemapath="root.color.imageToLedMappingType"]').toggle(false);
for(var i = 0; i<colorLength.length; i++) for(var i = 0; i<colorLength.length; i++)
$('#editor_container_wiz [data-schemapath*="root.color.channelAdjustment.'+i+'."]').toggle(false); $('#editor_container_wiz [data-schemapath*="root.color.channelAdjustment.'+i+'."]').toggle(false);
} }
function beginWizardCC() function beginWizardCC()
{ {
$('#btn_wiz_next').off().on('click',function() { $('#btn_wiz_next').off().on('click',function() {
step++; step++;
performAction(); performAction();
}); });
$('#btn_wiz_back').off().on('click',function() { $('#btn_wiz_back').off().on('click',function() {
step--; step--;
performAction(); performAction();
}); });
$('#btn_wiz_abort').off().on('click', resetWizard); $('#btn_wiz_abort').off().on('click', resetWizard);
$('#btn_wiz_save').off().on('click',function() { $('#btn_wiz_save').off().on('click',function() {
@ -509,13 +509,13 @@
delete temp.leds delete temp.leds
requestAdjustment(JSON.stringify(temp),"",true); requestAdjustment(JSON.stringify(temp),"",true);
}); });
step++ step++
performAction(); performAction();
} }
$('#btn_wizard_colorcalibration').off().on('click', startWizardCC); $('#btn_wizard_colorcalibration').off().on('click', startWizardCC);
//hue wizard //hue wizard
var hueIPs = []; var hueIPs = [];
var hueIPsinc = 0; var hueIPsinc = 0;
@ -525,7 +525,7 @@
var huePosLeft = {hscan: {maximum: 0.15,minimum: 0},index: 1,vscan: {maximum: 0.85,minimum: 0.15}}; var huePosLeft = {hscan: {maximum: 0.15,minimum: 0},index: 1,vscan: {maximum: 0.85,minimum: 0.15}};
var huePosRight = {hscan: {maximum: 1,minimum: 0.85},index: 3,vscan: {maximum: 0.85,minimum: 0.15}}; var huePosRight = {hscan: {maximum: 1,minimum: 0.85},index: 3,vscan: {maximum: 0.85,minimum: 0.15}};
var huePosEntire = {hscan: {maximum: 1.0,minimum: 0.0},index: 0,vscan: {maximum: 1.0,minimum: 0.0}}; var huePosEntire = {hscan: {maximum: 1.0,minimum: 0.0},index: 0,vscan: {maximum: 1.0,minimum: 0.0}};
function startWizardPhilipsHue() function startWizardPhilipsHue()
{ {
//create html //create html
@ -558,7 +558,7 @@
function checkHueBridge(cb,hueUser){ function checkHueBridge(cb,hueUser){
var usr = ""; var usr = "";
if(typeof hueUser != "undefined") if(typeof hueUser != "undefined")
usr = hueUser; usr = hueUser;
@ -578,8 +578,8 @@
}) })
.fail( function( jqXHR, textStatus ) { .fail( function( jqXHR, textStatus ) {
cb(false); cb(false);
}); });
} }
function checkUserResult(reply){ function checkUserResult(reply){
if(reply) if(reply)
@ -594,18 +594,18 @@
$('#wiz_hue_create_user').toggle(true); $('#wiz_hue_create_user').toggle(true);
} }
}; };
function checkBridgeResult(reply){ function checkBridgeResult(reply){
if(reply) if(reply)
{ {
//abort checking, first reachable result is used //abort checking, first reachable result is used
$('#wiz_hue_ipstate').html(""); $('#wiz_hue_ipstate').html("");
$('#ip').val(hueIPs[hueIPsinc].internalipaddress) $('#ip').val(hueIPs[hueIPsinc].internalipaddress)
//now check hue user on this bridge //now check hue user on this bridge
$('#usrcont').toggle(true); $('#usrcont').toggle(true);
checkHueBridge(checkUserResult,$('#user').val() ? $('#user').val() : "newdeveloper"); checkHueBridge(checkUserResult,$('#user').val() ? $('#user').val() : "newdeveloper");
} }
else else
{ {
//increment and check again //increment and check again
@ -618,14 +618,14 @@
{ {
$('#usrcont').toggle(false); $('#usrcont').toggle(false);
$('#wiz_hue_ipstate').html($.i18n('wiz_hue_failure_ip')); $('#wiz_hue_ipstate').html($.i18n('wiz_hue_failure_ip'));
} }
} }
}; };
function assignHuePos(id, pos, inc) function assignHuePos(id, pos, inc)
{ {
var i = null; var i = null;
if(pos == "top") if(pos == "top")
i = huePosTop; i = huePosTop;
else if(pos == "bottom") else if(pos == "bottom")
@ -636,11 +636,11 @@
i = huePosRight; i = huePosRight;
else else
i = huePosEntire; i = huePosEntire;
i.index = inc; i.index = inc;
return i; return i;
} }
function identHueId(id, off) function identHueId(id, off)
{ {
var on = true; var on = true;
@ -656,7 +656,7 @@
data: ' {"on":'+on+', "sat":254, "bri":254,"hue":47000}' data: ' {"on":'+on+', "sat":254, "bri":254,"hue":47000}'
}) })
} }
function getHueIPs(){ function getHueIPs(){
$('#wiz_hue_ipstate').html($.i18n('wiz_hue_searchb')); $('#wiz_hue_ipstate').html($.i18n('wiz_hue_searchb'));
$.ajax({ $.ajax({
@ -676,11 +676,17 @@
}) })
.fail( function( jqXHR, textStatus ) { .fail( function( jqXHR, textStatus ) {
$('#wiz_hue_ipstate').html($.i18n('wiz_hue_failure_ip')); $('#wiz_hue_ipstate').html($.i18n('wiz_hue_failure_ip'));
}); });
}; };
function beginWizardHue() function beginWizardHue()
{ {
var usr = conf_editor.getEditor("root.specificOptions.username").getValue();
if(usr != "")
{
$('#user').val(usr);
}
//check if ip is empty/reachable/search for bridge //check if ip is empty/reachable/search for bridge
if(conf_editor.getEditor("root.specificOptions.output").getValue() == "") if(conf_editor.getEditor("root.specificOptions.output").getValue() == "")
getHueIPs(); getHueIPs();
@ -690,33 +696,30 @@
$('#ip').val(ip); $('#ip').val(ip);
hueIPs.push({internalipaddress : ip}); hueIPs.push({internalipaddress : ip});
checkHueBridge(checkBridgeResult); checkHueBridge(checkBridgeResult);
var usr = conf_editor.getEditor("root.specificOptions.username").getValue();
$('#user').val(usr);
} }
$('#retry_bridge').off().on('click', function(){ $('#retry_bridge').off().on('click', function(){
hueIPs[0].internalipaddress = $('#ip').val(); hueIPs[0].internalipaddress = $('#ip').val();
hueIPsinc = 0; hueIPsinc = 0;
checkHueBridge(checkBridgeResult); checkHueBridge(checkBridgeResult);
}); });
$('#retry_usr').off().on('click', function(){ $('#retry_usr').off().on('click', function(){
checkHueBridge(checkUserResult,$('#user').val() ? $('#user').val() : "newdeveloper"); checkHueBridge(checkUserResult,$('#user').val() ? $('#user').val() : "newdeveloper");
}); });
$('#wiz_hue_create_user').off().on('click',function() { $('#wiz_hue_create_user').off().on('click',function() {
createHueUser(); createHueUser();
}); });
$('#btn_wiz_save').off().on("click", function(){ $('#btn_wiz_save').off().on("click", function(){
var hueLedConfig = []; var hueLedConfig = [];
var finalLightIds = []; var finalLightIds = [];
//create hue led config //create hue led config
var incC = 0; var incC = 0;
for(key in lightIDs) for(key in lightIDs)
{ {
if($('#hue_'+key).val() != "disabled") if($('#hue_'+key).val() != "disabled")
{ {
hueLedConfig.push(assignHuePos(key, $('#hue_'+key).val(), incC)); hueLedConfig.push(assignHuePos(key, $('#hue_'+key).val(), incC));
@ -724,9 +727,9 @@
incC++; incC++;
} }
} }
serverConfig.leds = hueLedConfig; serverConfig.leds = hueLedConfig;
//Adjust gamma, brightness and compensation //Adjust gamma, brightness and compensation
var c = serverConfig.color.channelAdjustment[0]; var c = serverConfig.color.channelAdjustment[0];
c.gammaBlue = 1.0; c.gammaBlue = 1.0;
@ -734,7 +737,7 @@
c.gammaGreen = 1.0; c.gammaGreen = 1.0;
c.brightness = 100; c.brightness = 100;
c.brightnessCompensation = 0; c.brightnessCompensation = 0;
//device config //device config
var d = serverConfig.device; var d = serverConfig.device;
d.output = $('#ip').val(); d.output = $('#ip').val();
@ -743,14 +746,14 @@
d.type = "philipshue"; d.type = "philipshue";
d.transitiontime = 1; d.transitiontime = 1;
d.switchOffOnBlack = true; d.switchOffOnBlack = true;
//smoothing off //smoothing off
serverConfig.smoothing.enable = false; serverConfig.smoothing.enable = false;
requestWriteConfig(serverConfig, true); requestWriteConfig(serverConfig, true);
setTimeout(initRestart,200); setTimeout(initRestart,200);
}); });
$('#btn_wiz_abort').off().on('click', resetWizard); $('#btn_wiz_abort').off().on('click', resetWizard);
} }
@ -775,7 +778,7 @@
$("#connectionTime").html(connectionRetries); $("#connectionTime").html(connectionRetries);
if(connectionRetries == 0) { if(connectionRetries == 0) {
abortConnection(UserInterval); abortConnection(UserInterval);
} }
else else
{ {
if (typeof r[0].error != 'undefined') { if (typeof r[0].error != 'undefined') {
@ -813,16 +816,16 @@
$('#wh_topcontainer').toggle(false); $('#wh_topcontainer').toggle(false);
$('#hue_ids_t, #btn_wiz_save').toggle(true); $('#hue_ids_t, #btn_wiz_save').toggle(true);
lightIDs = r; lightIDs = r;
for(var lightid in r) for(var lightid in r)
{ {
$('.lidsb').append(createTableRow([lightid+' ('+r[lightid].name+')', '<select id="hue_'+lightid+'" class="hue_sel_watch form-control"><option value="disabled">'+$.i18n('wiz_hue_ids_disabled')+'</option><option value="top">'+$.i18n('conf_leds_layout_cl_top')+'</option><option value="bottom">'+$.i18n('conf_leds_layout_cl_bottom')+'</option><option value="left">'+$.i18n('conf_leds_layout_cl_left')+'</option><option value="right">'+$.i18n('conf_leds_layout_cl_right')+'</option><option value="entire">'+$.i18n('wiz_hue_ids_entire')+'</option></select>','<button class="btn btn-sm btn-primary" onClick=identHueId('+lightid+')>'+$.i18n('wiz_hue_blinkblue',lightid)+'</button>'])); $('.lidsb').append(createTableRow([lightid+' ('+r[lightid].name+')', '<select id="hue_'+lightid+'" class="hue_sel_watch form-control"><option value="disabled">'+$.i18n('wiz_hue_ids_disabled')+'</option><option value="top">'+$.i18n('conf_leds_layout_cl_top')+'</option><option value="bottom">'+$.i18n('conf_leds_layout_cl_bottom')+'</option><option value="left">'+$.i18n('conf_leds_layout_cl_left')+'</option><option value="right">'+$.i18n('conf_leds_layout_cl_right')+'</option><option value="entire">'+$.i18n('wiz_hue_ids_entire')+'</option></select>','<button class="btn btn-sm btn-primary" onClick=identHueId('+lightid+')>'+$.i18n('wiz_hue_blinkblue',lightid)+'</button>']));
} }
$('.hue_sel_watch').bind("change", function(){ $('.hue_sel_watch').bind("change", function(){
var cC = 0; var cC = 0;
for(key in lightIDs) for(key in lightIDs)
{ {
if($('#hue_'+key).val() != "disabled") if($('#hue_'+key).val() != "disabled")
{ {
cC++; cC++;
@ -830,7 +833,7 @@
} }
cC == 0 ? $('#btn_wiz_save').attr("disabled",true) : $('#btn_wiz_save').attr("disabled",false); cC == 0 ? $('#btn_wiz_save').attr("disabled",true) : $('#btn_wiz_save').attr("disabled",false);
}); });
$('.hue_sel_watch').trigger('change'); $('.hue_sel_watch').trigger('change');
} }
else else
@ -847,4 +850,4 @@
$('#wizp2').toggle(true); $('#wizp2').toggle(true);
$('#wizp3').toggle(false); $('#wizp3').toggle(false);
$("#wiz_hue_usrstate").html($.i18n('wiz_hue_failure_connection')); $("#wiz_hue_usrstate").html($.i18n('wiz_hue_failure_connection'));
} }

View File

@ -4,15 +4,13 @@
{ {
/// geenral Settings /// general Settings
/// * 'name' : The user friendly name of the hyperion instance (used for network things) /// * 'name' : The user friendly name of the hyperion instance (used for network things)
/// * 'showOptHelp' : Show option expanations at the webui. Highly recommended for beginners. /// * '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" : "general" :
{ {
"name" : "MyHyperionConfig", "name" : "MyHyperionConfig",
"showOptHelp" : true, "showOptHelp" : true
"configVersion" : 2
}, },
/// set log level: silent warn verbose debug /// set log level: silent warn verbose debug
"logger" : "logger" :
@ -20,26 +18,24 @@
"level" : "warn" "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) /// * '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 /// * '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) /// 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] /// * [device type specific configuration]
/// * 'colorOrder' : The order of the color bytes ('rgb', 'rbg', 'bgr', etc.). /// * '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 /// * '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" : "device" :
{ {
"type" : "file", "type" : "file",
"output" : "/dev/null", "output" : "/dev/null",
"rate" : 1000000, "rate" : 1000000,
"colorOrder" : "rgb", "colorOrder" : "rgb",
"rewriteTime": 0, "rewriteTime": 0
"latchTime" : 10
}, },
/// Color manipulation configuration used to tune the output colors to specific surroundings. /// Color manipulation configuration used to tune the output colors to specific surroundings.
/// The configuration contains a list of color-transforms. Each transform contains the /// The configuration contains a list of color-transforms. Each transform contains the
/// following fields: /// following fields:
/// * 'imageToLedMappingType' : multicolor_mean - every led has it's own calculatedmean color /// * '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 /// 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 /// * '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. /// (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 /// * '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')
/// * '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) /// * 'backlightThreshold' : Minimum brightness (backlight)
@ -84,7 +80,7 @@
}, },
/// smoothing /// 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: /// parameters:
/// - 'enable' Enable or disable the smoothing (true/false) /// - 'enable' Enable or disable the smoothing (true/false)
/// - 'type' The type of smoothing algorithm ('linear' or 'none') /// - 'type' The type of smoothing algorithm ('linear' or 'none')
@ -112,7 +108,6 @@
/// * frameDecimation : Frame decimation factor [default=2] /// * frameDecimation : Frame decimation factor [default=2]
/// * sizeDecimation : Size decimation factor [default=8] /// * sizeDecimation : Size decimation factor [default=8]
/// * priority : Hyperion priority channel [default=900] /// * 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] /// * useKodiChecker : Enable/disable V4L2 according kodichecker sate if set to true [default=false]
/// * cropLeft : Cropping from the left [default=0] /// * cropLeft : Cropping from the left [default=0]
/// * cropRight : Cropping from the right [default=0] /// * cropRight : Cropping from the right [default=0]
@ -138,7 +133,6 @@
"frameDecimation" : 2, "frameDecimation" : 2,
"sizeDecimation" : 8, "sizeDecimation" : 8,
"priority" : 240, "priority" : 240,
"mode" : "2D",
"useKodiChecker" : false, "useKodiChecker" : false,
"cropLeft" : 0, "cropLeft" : 0,
"cropRight" : 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 /// * enable : true if the framegrabber (platform grabber) should be activated
/// * type : type of grabber. (auto|osx|dispmanx|amlogic|x11|framebuffer) [auto] /// * type : type of grabber. (auto|osx|dispmanx|amlogic|x11|framebuffer) [auto]
/// * width : The width of the grabbed frames [pixels] /// * width : The width of the grabbed frames [pixels]
/// * height : The height of the grabbed frames [pixels] /// * height : The height of the grabbed frames [pixels]
/// * frequency_Hz : The frequency of the frame grab [Hz] /// * 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! /// * 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! /// * ATTENTION : Power-of-Two resolution is not supported and leads to unexpected behaviour!
"framegrabber" : "framegrabber" :
{ {
// for all type of grabbers // for all type of grabbers
@ -170,27 +164,25 @@
"type" : "framebuffer", "type" : "framebuffer",
"frequency_Hz" : 10, "frequency_Hz" : 10,
"priority" : 250, "priority" : 250,
"cropLeft" : 0,
"cropRight" : 0,
"cropTop" : 0,
"cropBottom" : 0,
// valid for grabber: osx|dispmanx|amlogic|framebuffer // valid for grabber: osx|dispmanx|amlogic|framebuffer
"width" : 96, "width" : 96,
"height" : 96, "height" : 96,
// valid for x11 // valid for x11
"useXGetImage" : false, "useXGetImage" : false,
"horizontalPixelDecimation" : 8, "horizontalPixelDecimation" : 8,
"verticalPixelDecimation" : 8, "verticalPixelDecimation" : 8,
// valid for dispmanx and x11
"cropLeft" : 0,
"cropRight" : 0,
"cropTop" : 0,
"cropBottom" : 0,
// valid for framebuffer // valid for framebuffer
"device" : "/dev/fb0" "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 /// * enable : true if the detector should be activated
/// * threshold : Value below which a pixel is regarded as black (value between 0 and 100 [%]) /// * 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) /// * unknownFrameCnt : Number of frames without any detection before the border is set to 0 (default 600)
@ -209,7 +201,7 @@
"mode" : "default" "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 /// * enable : enable/disable Kodi-Checker
/// * kodiAddress : The IP address of the Kodi-host /// * kodiAddress : The IP address of the Kodi-host
/// * kodiTcpPort : The TCP-port of the Kodi-server /// * 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" /// * 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 /// * 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 /// * enable3DDetection : Flag indicating that the frame-grabber should switch to a 3D compatible modus if a 3D video is playing
"kodiVideoChecker" : "kodiVideoChecker" :
{ {
"enable" : true, "enable" : true,
"kodiAddress" : "127.0.0.1", "kodiAddress" : "127.0.0.1",
@ -249,7 +241,7 @@
"effect" : "Rainbow swirl fast", "effect" : "Rainbow swirl fast",
"duration_ms" : 3000 "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. /// 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 /// * enable : if true, background effect is enabled
/// * type : choose between "color" or "effect" /// * type : choose between "color" or "effect"
@ -263,11 +255,11 @@
"effect" : "Warm mood blobs" "effect" : "Warm mood blobs"
}, },
/// The configuration of the Json/Proto forwarder. Forward messages to multiple instances of Hyperion on same and/or other hosts /// 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 /// 'proto' is mostly used for video streams and 'json' for effects
/// * enable : Enable or disable the forwarder (true/false) /// * 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"] /// * 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"] /// * 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! /// 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) /// 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" : "forwarder" :
@ -294,7 +286,7 @@
/// The configuration of the boblight server which enables the boblight remote interface /// The configuration of the boblight server which enables the boblight remote interface
/// * enable : Enable or disable the boblight server (true/false) /// * enable : Enable or disable the boblight server (true/false)
/// * port : Port at which the boblight server is started /// * 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" : "boblightServer" :
{ {
"enable" : false, "enable" : false,
@ -330,10 +322,10 @@
"port" : 8099 "port" : 8099
}, },
/// The configuration of the effect engine, contains the following items: /// The configuration of the effect engine, contains the following items:
/// * paths : An array with absolute/relative location(s) of directories with effects /// * paths : An array with absolute/relative location(s) of directories with effects
/// * disable : An array with effect names that shouldn't be loaded /// * disable : An array with effect names that shouldn't be loaded
"effects" : "effects" :
{ {
"paths" : "paths" :
[ [
@ -346,7 +338,7 @@
"X-Mas" "X-Mas"
] ]
}, },
/// Recreate and save led layouts made with web config. These values are just helpers for ui, not for Hyperion. /// Recreate and save led layouts made with web config. These values are just helpers for ui, not for Hyperion.
"ledConfig" : "ledConfig" :
{ {
@ -363,17 +355,17 @@
"overlap" : 0, "overlap" : 0,
"edgegap" : 0 "edgegap" : 0
}, },
/// The configuration for each individual led. This contains the specification of the area /// 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 /// averaged of an input image for each led to determine its color. Each item in the list
/// contains the following fields: /// 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. /// 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) /// (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) /// (minimum and maximum inclusive)
"leds": "leds":
[ [
{ {

View File

@ -2,8 +2,7 @@
"general" : "general" :
{ {
"name" : "My Hyperion Config", "name" : "My Hyperion Config",
"showOptHelp" : true, "showOptHelp" : true
"configVersion" : 2
}, },
"logger" : "logger" :
{ {
@ -16,8 +15,7 @@
"output" : "/dev/null", "output" : "/dev/null",
"rate" : 1000000, "rate" : 1000000,
"colorOrder" : "rgb", "colorOrder" : "rgb",
"rewriteTime": 5000, "rewriteTime": 5000
"latchTime" : 10
}, },
"color" : "color" :
@ -69,7 +67,6 @@
"frameDecimation" : 2, "frameDecimation" : 2,
"sizeDecimation" : 8, "sizeDecimation" : 8,
"priority" : 240, "priority" : 240,
"mode" : "2D",
"useKodiChecker" : false, "useKodiChecker" : false,
"cropLeft" : 0, "cropLeft" : 0,
"cropRight" : 0, "cropRight" : 0,
@ -137,7 +134,7 @@
"effect" : "Rainbow swirl fast", "effect" : "Rainbow swirl fast",
"duration_ms" : 3000 "duration_ms" : 3000
}, },
"backgroundEffect" : "backgroundEffect" :
{ {
"enable" : true, "enable" : true,
@ -162,14 +159,14 @@
{ {
"port" : 19445 "port" : 19445
}, },
"boblightServer" : "boblightServer" :
{ {
"enable" : false, "enable" : false,
"port" : 19333, "port" : 19333,
"priority" : 201 "priority" : 201
}, },
"udpListener" : "udpListener" :
{ {
"enable" : false, "enable" : false,
@ -189,7 +186,8 @@
"effects" : "effects" :
{ {
"paths" : ["../custom-effects"] "paths" : ["../custom-effects"],
"disable": [""]
}, },
"ledConfig" : "ledConfig" :
@ -207,7 +205,7 @@
"overlap" : 0, "overlap" : 0,
"edgegap" : 0 "edgegap" : 0
}, },
"leds": "leds":
[ [
{ {

View File

@ -9,8 +9,6 @@
"candles" : "all", "candles" : "all",
"smoothing-custom-settings" : true, "smoothing-custom-settings" : true,
"smoothing-time_ms" : 500, "smoothing-time_ms" : 500,
"smoothing-updateDelay" : 0, "smoothing-updateFrequency" : 20.0
"smoothing-updateFrequency" : 20.0,
"smoothing-pause" : false
} }
} }

View File

@ -11,6 +11,9 @@
"baseChange" : true, "baseChange" : true,
"baseColorRangeLeft" : 333, "baseColorRangeLeft" : 333,
"baseColorRangeRight" : 151, "baseColorRangeRight" : 151,
"baseColorChangeRate" : 2.0 "baseColorChangeRate" : 2.0,
"smoothing-custom-settings" : true,
"smoothing-time_ms" : 200,
"smoothing-updateFrequency" : 25.0
} }
} }

View File

@ -10,6 +10,9 @@
"custom-colors":[], "custom-colors":[],
"random-center":false, "random-center":false,
"custom-colors2":[], "custom-colors2":[],
"enable-second":false "enable-second":false,
"smoothing-custom-settings" : true,
"smoothing-time_ms" : 200,
"smoothing-updateFrequency" : 25.0
} }
} }

View File

@ -7,8 +7,6 @@
"saturation" : 1.0, "saturation" : 1.0,
"smoothing-custom-settings" : true, "smoothing-custom-settings" : true,
"smoothing-time_ms" : 200, "smoothing-time_ms" : 200,
"smoothing-updateDelay" : 0, "smoothing-updateFrequency" : 20.0
"smoothing-updateFrequency" : 20.0,
"smoothing-pause" : false
} }
} }

View File

@ -71,14 +71,14 @@
"smoothing-custom-settings" : "smoothing-custom-settings" :
{ {
"type" : "boolean", "type" : "boolean",
"title" : "edt_eff_smooth_custom_title", "title" : "edt_eff_smooth_custom",
"default" : false, "default" : false,
"propertyOrder" : 7 "propertyOrder" : 7
}, },
"smoothing-time_ms" : "smoothing-time_ms" :
{ {
"type" : "integer", "type" : "integer",
"title" : "edt_eff_smooth_time_ms_title", "title" : "edt_eff_smooth_time_ms",
"minimum" : 25, "minimum" : 25,
"maximum": 600, "maximum": 600,
"default" : 200, "default" : 200,
@ -93,7 +93,7 @@
"smoothing-updateFrequency" : "smoothing-updateFrequency" :
{ {
"type" : "number", "type" : "number",
"title" : "edt_eff_smooth_updateFrequency_title", "title" : "edt_eff_smooth_updateFrequency",
"minimum" : 1.0, "minimum" : 1.0,
"maximum" : 100.0, "maximum" : 100.0,
"default" : 25.0, "default" : 25.0,
@ -104,33 +104,6 @@
} }
}, },
"propertyOrder" : 9 "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 "additionalProperties": false

View File

@ -98,6 +98,43 @@
} }
}, },
"propertyOrder" : 8 "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 "additionalProperties": false

View File

@ -24,14 +24,14 @@
"smoothing-custom-settings" : "smoothing-custom-settings" :
{ {
"type" : "boolean", "type" : "boolean",
"title" : "edt_eff_smooth_custom_title", "title" : "edt_eff_smooth_custom",
"default" : false, "default" : false,
"propertyOrder" : 3 "propertyOrder" : 3
}, },
"smoothing-time_ms" : "smoothing-time_ms" :
{ {
"type" : "integer", "type" : "integer",
"title" : "edt_eff_smooth_time_ms_title", "title" : "edt_eff_smooth_time_ms",
"minimum" : 25, "minimum" : 25,
"maximum": 600, "maximum": 600,
"default" : 200, "default" : 200,
@ -46,7 +46,7 @@
"smoothing-updateFrequency" : "smoothing-updateFrequency" :
{ {
"type" : "number", "type" : "number",
"title" : "edt_eff_smooth_updateFrequency_title", "title" : "edt_eff_smooth_updateFrequency",
"minimum" : 1.0, "minimum" : 1.0,
"maximum" : 100.0, "maximum" : 100.0,
"default" : 25.0, "default" : 25.0,
@ -57,33 +57,6 @@
} }
}, },
"propertyOrder" : 5 "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 "additionalProperties": false

View File

@ -145,6 +145,43 @@
} }
}, },
"propertyOrder" : 12 "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 "additionalProperties": false

View File

@ -57,7 +57,7 @@ EffectEngine::~EffectEngine()
const std::list<ActiveEffectDefinition> &EffectEngine::getActiveEffects() const std::list<ActiveEffectDefinition> &EffectEngine::getActiveEffects()
{ {
_availableActiveEffects.clear(); _availableActiveEffects.clear();
for (Effect * effect : _activeEffects) for (Effect * effect : _activeEffects)
{ {
ActiveEffectDefinition activeEffectDefinition; ActiveEffectDefinition activeEffectDefinition;
@ -68,19 +68,19 @@ const std::list<ActiveEffectDefinition> &EffectEngine::getActiveEffects()
activeEffectDefinition.args = effect->getArgs(); activeEffectDefinition.args = effect->getArgs();
_availableActiveEffects.push_back(activeEffectDefinition); _availableActiveEffects.push_back(activeEffectDefinition);
} }
return _availableActiveEffects; return _availableActiveEffects;
} }
bool EffectEngine::loadEffectDefinition(const QString &path, const QString &effectConfigFile, EffectDefinition & effectDefinition) bool EffectEngine::loadEffectDefinition(const QString &path, const QString &effectConfigFile, EffectDefinition & effectDefinition)
{ {
Logger * log = Logger::getInstance("EFFECTENGINE"); Logger * log = Logger::getInstance("EFFECTENGINE");
QString fileName = path + QDir::separator() + effectConfigFile; QString fileName = path + QDir::separator() + effectConfigFile;
QJsonParseError error; QJsonParseError error;
// ---------- Read the effect json config file ---------- // ---------- Read the effect json config file ----------
QFile file(fileName); QFile file(fileName);
if (!file.open(QIODevice::ReadOnly)) if (!file.open(QIODevice::ReadOnly))
{ {
@ -90,12 +90,12 @@ bool EffectEngine::loadEffectDefinition(const QString &path, const QString &effe
QByteArray fileContent = file.readAll(); QByteArray fileContent = file.readAll();
QJsonDocument configEffect = QJsonDocument::fromJson(fileContent, &error); QJsonDocument configEffect = QJsonDocument::fromJson(fileContent, &error);
if (error.error != QJsonParseError::NoError) if (error.error != QJsonParseError::NoError)
{ {
// report to the user the failure and their locations in the document. // report to the user the failure and their locations in the document.
int errorLine(0), errorColumn(0); int errorLine(0), errorColumn(0);
for( int i=0, count=qMin( error.offset,fileContent.size()); i<count; ++i ) for( int i=0, count=qMin( error.offset,fileContent.size()); i<count; ++i )
{ {
++errorColumn; ++errorColumn;
@ -105,31 +105,31 @@ bool EffectEngine::loadEffectDefinition(const QString &path, const QString &effe
++errorLine; ++errorLine;
} }
} }
Error( log, "Error while reading effect: '%s' at Line: '%i' , Column: %i",QSTRING_CSTR( error.errorString()), errorLine, errorColumn); Error( log, "Error while reading effect: '%s' at Line: '%i' , Column: %i",QSTRING_CSTR( error.errorString()), errorLine, errorColumn);
} }
file.close(); file.close();
// ---------- Read the effect json schema file ---------- // ---------- Read the effect json schema file ----------
Q_INIT_RESOURCE(EffectEngine); Q_INIT_RESOURCE(EffectEngine);
QFile schema(":effect-schema"); QFile schema(":effect-schema");
if (!schema.open(QIODevice::ReadOnly)) if (!schema.open(QIODevice::ReadOnly))
{ {
Error( log, "Schema not found: %s", QSTRING_CSTR(schema.errorString())); Error( log, "Schema not found: %s", QSTRING_CSTR(schema.errorString()));
return false; return false;
} }
QByteArray schemaContent = schema.readAll(); QByteArray schemaContent = schema.readAll();
QJsonDocument configSchema = QJsonDocument::fromJson(schemaContent, &error); QJsonDocument configSchema = QJsonDocument::fromJson(schemaContent, &error);
if (error.error != QJsonParseError::NoError) if (error.error != QJsonParseError::NoError)
{ {
// report to the user the failure and their locations in the document. // report to the user the failure and their locations in the document.
int errorLine(0), errorColumn(0); int errorLine(0), errorColumn(0);
for( int i=0, count=qMin( error.offset,schemaContent.size()); i<count; ++i ) for( int i=0, count=qMin( error.offset,schemaContent.size()); i<count; ++i )
{ {
++errorColumn; ++errorColumn;
@ -139,14 +139,14 @@ bool EffectEngine::loadEffectDefinition(const QString &path, const QString &effe
++errorLine; ++errorLine;
} }
} }
Error( log, "ERROR: Json schema wrong: '%s' at Line: '%i' , Column: %i", QSTRING_CSTR(error.errorString()), errorLine, errorColumn); Error( log, "ERROR: Json schema wrong: '%s' at Line: '%i' , Column: %i", QSTRING_CSTR(error.errorString()), errorLine, errorColumn);
} }
schema.close(); schema.close();
// ---------- validate effect config with effect schema ---------- // ---------- validate effect config with effect schema ----------
QJsonSchemaChecker schemaChecker; QJsonSchemaChecker schemaChecker;
schemaChecker.setSchema(configSchema.object()); schemaChecker.setSchema(configSchema.object());
if (!schemaChecker.validate(configEffect.object()).first) if (!schemaChecker.validate(configEffect.object()).first)
@ -160,14 +160,14 @@ bool EffectEngine::loadEffectDefinition(const QString &path, const QString &effe
} }
// ---------- setup the definition ---------- // ---------- setup the definition ----------
effectDefinition.file = fileName; effectDefinition.file = fileName;
QJsonObject config = configEffect.object(); QJsonObject config = configEffect.object();
QString scriptName = config["script"].toString(); QString scriptName = config["script"].toString();
effectDefinition.name = config["name"].toString(); effectDefinition.name = config["name"].toString();
if (scriptName.isEmpty()) if (scriptName.isEmpty())
return false; return false;
QFile fileInfo(scriptName); QFile fileInfo(scriptName);
if (scriptName.mid(0, 1) == ":" ) if (scriptName.mid(0, 1) == ":" )
@ -181,23 +181,19 @@ bool EffectEngine::loadEffectDefinition(const QString &path, const QString &effe
? effectDefinition.script = path + QDir::separator() + scriptName ? effectDefinition.script = path + QDir::separator() + scriptName
: effectDefinition.script = scriptName; : effectDefinition.script = scriptName;
} }
effectDefinition.args = config["args"].toObject(); effectDefinition.args = config["args"].toObject();
effectDefinition.smoothCfg = SMOOTHING_MODE_PAUSE; effectDefinition.smoothCfg = SMOOTHING_MODE_PAUSE;
if (effectDefinition.args["smoothing-custom-settings"].toBool()) if (effectDefinition.args["smoothing-custom-settings"].toBool())
{ {
bool pause = effectDefinition.args["smoothing-pause"].toBool(); effectDefinition.smoothCfg = _hyperion->addSmoothingConfig(
if (pause) effectDefinition.args["smoothing-time_ms"].toInt(),
{ effectDefinition.args["smoothing-updateFrequency"].toDouble(),
effectDefinition.smoothCfg = _hyperion->addSmoothingConfig(pause); 0 );
} }
else else
{ {
effectDefinition.smoothCfg = _hyperion->addSmoothingConfig( effectDefinition.smoothCfg = _hyperion->addSmoothingConfig(true);
effectDefinition.args["smoothing-time_ms"].toInt(),
effectDefinition.args["smoothing-updateFrequency"].toDouble(),
effectDefinition.args["smoothing-updateDelay"].toInt() );
}
} }
return 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) bool EffectEngine::loadEffectSchema(const QString &path, const QString &effectSchemaFile, EffectSchema & effectSchema)
{ {
Logger * log = Logger::getInstance("EFFECTENGINE"); Logger * log = Logger::getInstance("EFFECTENGINE");
QString fileName = path + "schema/" + QDir::separator() + effectSchemaFile; QString fileName = path + "schema/" + QDir::separator() + effectSchemaFile;
QJsonParseError error; QJsonParseError error;
// ---------- Read the effect schema file ---------- // ---------- Read the effect schema file ----------
QFile file(fileName); QFile file(fileName);
if (!file.open(QIODevice::ReadOnly)) if (!file.open(QIODevice::ReadOnly))
{ {
@ -220,12 +216,12 @@ bool EffectEngine::loadEffectSchema(const QString &path, const QString &effectSc
QByteArray fileContent = file.readAll(); QByteArray fileContent = file.readAll();
QJsonDocument schemaEffect = QJsonDocument::fromJson(fileContent, &error); QJsonDocument schemaEffect = QJsonDocument::fromJson(fileContent, &error);
if (error.error != QJsonParseError::NoError) if (error.error != QJsonParseError::NoError)
{ {
// report to the user the failure and their locations in the document. // report to the user the failure and their locations in the document.
int errorLine(0), errorColumn(0); int errorLine(0), errorColumn(0);
for( int i=0, count=qMin( error.offset,fileContent.size()); i<count; ++i ) for( int i=0, count=qMin( error.offset,fileContent.size()); i<count; ++i )
{ {
++errorColumn; ++errorColumn;
@ -235,28 +231,28 @@ bool EffectEngine::loadEffectSchema(const QString &path, const QString &effectSc
++errorLine; ++errorLine;
} }
} }
Error( log, "Error while reading effect schema: '%s' at Line: '%i' , Column: %i", QSTRING_CSTR(error.errorString()), errorLine, errorColumn); Error( log, "Error while reading effect schema: '%s' at Line: '%i' , Column: %i", QSTRING_CSTR(error.errorString()), errorLine, errorColumn);
return false; return false;
} }
file.close(); file.close();
// ---------- setup the definition ---------- // ---------- setup the definition ----------
QJsonObject tempSchemaEffect = schemaEffect.object(); QJsonObject tempSchemaEffect = schemaEffect.object();
QString scriptName = tempSchemaEffect["script"].toString(); QString scriptName = tempSchemaEffect["script"].toString();
effectSchema.schemaFile = fileName; effectSchema.schemaFile = fileName;
fileName = path + QDir::separator() + scriptName; fileName = path + QDir::separator() + scriptName;
QFile pyFile(fileName); QFile pyFile(fileName);
if (scriptName.isEmpty() || !pyFile.open(QIODevice::ReadOnly)) if (scriptName.isEmpty() || !pyFile.open(QIODevice::ReadOnly))
{ {
fileName = path + "schema/" + QDir::separator() + effectSchemaFile; fileName = path + "schema/" + QDir::separator() + effectSchemaFile;
Error( log, "Python script '%s' in effect schema '%s' could not be loaded", QSTRING_CSTR(scriptName), QSTRING_CSTR(fileName)); Error( log, "Python script '%s' in effect schema '%s' could not be loaded", QSTRING_CSTR(scriptName), QSTRING_CSTR(fileName));
return false; return false;
} }
pyFile.close(); pyFile.close();
effectSchema.pyFile = (scriptName.mid(0, 1) == ":" ) ? ":/effects/"+scriptName.mid(1) : path + QDir::separator() + scriptName; effectSchema.pyFile = (scriptName.mid(0, 1) == ":" ) ? ":/effects/"+scriptName.mid(1) : path + QDir::separator() + scriptName;
@ -270,11 +266,11 @@ void EffectEngine::readEffects()
// clear all lists // clear all lists
_availableEffects.clear(); _availableEffects.clear();
_effectSchemas.clear(); _effectSchemas.clear();
// read all effects // read all effects
const QJsonArray & paths = _effectConfig["paths"].toArray(); const QJsonArray & paths = _effectConfig["paths"].toArray();
const QJsonArray & disabledEfx = _effectConfig["disable"].toArray(); const QJsonArray & disabledEfx = _effectConfig["disable"].toArray();
QStringList efxPathList; QStringList efxPathList;
efxPathList << ":/effects/"; efxPathList << ":/effects/";
QStringList disableList; QStringList disableList;
@ -327,7 +323,7 @@ void EffectEngine::readEffects()
} }
} }
Info(_log, "%d effects loaded from directory %s", efxCount, QSTRING_CSTR(path)); Info(_log, "%d effects loaded from directory %s", efxCount, QSTRING_CSTR(path));
// collect effect schemas // collect effect schemas
efxCount = 0; efxCount = 0;
directory = path + "schema/"; directory = path + "schema/";
@ -349,7 +345,7 @@ void EffectEngine::readEffects()
{ {
_availableEffects.push_back(item); _availableEffects.push_back(item);
} }
ErrorIf(_availableEffects.size()==0, _log, "no effects found, check your effect directories"); ErrorIf(_availableEffects.size()==0, _log, "no effects found, check your effect directories");
} }

View File

@ -12,16 +12,19 @@
"type": "string", "type": "string",
"title" : "edt_conf_effp_paths_itemtitle" "title" : "edt_conf_effp_paths_itemtitle"
}, },
"minItems" : 1,
"propertyOrder" : 1 "propertyOrder" : 1
}, },
"disable" : "disable" :
{ {
"type" : "array", "type" : "array",
"title" : "edt_conf_effp_disable_title", "title" : "edt_conf_effp_disable_title",
"default" : [""],
"items" : { "items" : {
"type": "string", "type": "string",
"title" : "edt_conf_effp_disable_itemtitle" "title" : "edt_conf_effp_disable_itemtitle"
}, },
"required" : true,
"propertyOrder" : 2 "propertyOrder" : 2
} }
}, },

View File

@ -21,14 +21,7 @@
"default" : true, "default" : true,
"required" : true, "required" : true,
"propertyOrder" : 2 "propertyOrder" : 2
},
"configVersion" :
{
"type" : "integer",
"default" : 2,
"minimum" : 1,
"access" : "system",
"required" : true
} }
} },
"additionalProperties" : false
} }

View File

@ -1,11 +1,13 @@
{ {
"type":"array", "type":"array",
"required" : true,
"title" : "edt_conf_v4l2_heading_title", "title" : "edt_conf_v4l2_heading_title",
"minItems": 1, "minItems": 1,
"maxItems": 2, "maxItems": 2,
"items": "items":
{ {
"type" : "object", "type" : "object",
"required" : true,
"title" : "edt_conf_v4l2_heading_title", "title" : "edt_conf_v4l2_heading_title",
"properties" : "properties" :
{ {
@ -14,6 +16,7 @@
"type" : "boolean", "type" : "boolean",
"title" : "edt_conf_general_enable_title", "title" : "edt_conf_general_enable_title",
"default" : false, "default" : false,
"required" : true,
"propertyOrder" : 1 "propertyOrder" : 1
}, },
"device" : "device" :
@ -21,6 +24,7 @@
"type" : "string", "type" : "string",
"title" : "edt_conf_v4l2_device_title", "title" : "edt_conf_v4l2_device_title",
"default" : "auto", "default" : "auto",
"required" : true,
"propertyOrder" : 2 "propertyOrder" : 2
}, },
"input" : "input" :
@ -29,6 +33,7 @@
"title" : "edt_conf_v4l2_input_title", "title" : "edt_conf_v4l2_input_title",
"minimum" : 0, "minimum" : 0,
"default" : 0, "default" : 0,
"required" : true,
"propertyOrder" : 3 "propertyOrder" : 3
}, },
"standard" : "standard" :
@ -40,6 +45,7 @@
"options" : { "options" : {
"enum_titles" : ["edt_conf_enum_PAL", "edt_conf_enum_NTSC"] "enum_titles" : ["edt_conf_enum_PAL", "edt_conf_enum_NTSC"]
}, },
"required" : true,
"propertyOrder" : 4 "propertyOrder" : 4
}, },
"width" : "width" :
@ -49,6 +55,7 @@
"minimum" : 0, "minimum" : 0,
"default" : 0, "default" : 0,
"append" : "edt_append_pixel", "append" : "edt_append_pixel",
"required" : true,
"propertyOrder" : 5 "propertyOrder" : 5
}, },
"height" : "height" :
@ -58,6 +65,7 @@
"minimum" : 0, "minimum" : 0,
"default" : 0, "default" : 0,
"append" : "edt_append_pixel", "append" : "edt_append_pixel",
"required" : true,
"propertyOrder" : 6 "propertyOrder" : 6
}, },
"frameDecimation" : "frameDecimation" :
@ -66,6 +74,7 @@
"title" : "edt_conf_v4l2_frameDecimation_title", "title" : "edt_conf_v4l2_frameDecimation_title",
"minimum" : 0, "minimum" : 0,
"default" : 2, "default" : 2,
"required" : true,
"propertyOrder" : 7 "propertyOrder" : 7
}, },
"sizeDecimation" : "sizeDecimation" :
@ -74,6 +83,7 @@
"title" : "Size decimation", "title" : "Size decimation",
"minimum" : 0, "minimum" : 0,
"default" : 6, "default" : 6,
"required" : true,
"propertyOrder" : 8 "propertyOrder" : 8
}, },
"priority" : "priority" :
@ -83,22 +93,16 @@
"maximum" : 253, "maximum" : 253,
"title" : "edt_conf_general_priority_title", "title" : "edt_conf_general_priority_title",
"default" : 240, "default" : 240,
"required" : true,
"propertyOrder" : 9 "propertyOrder" : 9
}, },
"mode" :
{
"type" : "string",
"title" : "edt_conf_v4l2_mode_title",
"enum" : ["2D","3DSBS","3DTAB"],
"default" : "2D",
"propertyOrder" : 10
},
"useKodiChecker" : "useKodiChecker" :
{ {
"type" : "boolean", "type" : "boolean",
"title" : "edt_conf_v4l2_useKodiChecker_title", "title" : "edt_conf_v4l2_useKodiChecker_title",
"default" : false, "default" : false,
"propertyOrder" : 11 "required" : true,
"propertyOrder" : 10
}, },
"cropLeft" : "cropLeft" :
{ {
@ -107,7 +111,8 @@
"minimum" : 0, "minimum" : 0,
"default" : 0, "default" : 0,
"append" : "edt_append_pixel", "append" : "edt_append_pixel",
"propertyOrder" : 12 "required" : true,
"propertyOrder" : 11
}, },
"cropRight" : "cropRight" :
{ {
@ -116,7 +121,8 @@
"minimum" : 0, "minimum" : 0,
"default" : 0, "default" : 0,
"append" : "edt_append_pixel", "append" : "edt_append_pixel",
"propertyOrder" : 13 "required" : true,
"propertyOrder" : 12
}, },
"cropTop" : "cropTop" :
{ {
@ -125,7 +131,8 @@
"minimum" : 0, "minimum" : 0,
"default" : 0, "default" : 0,
"append" : "edt_append_pixel", "append" : "edt_append_pixel",
"propertyOrder" : 14 "required" : true,
"propertyOrder" : 13
}, },
"cropBottom" : "cropBottom" :
{ {
@ -134,14 +141,16 @@
"minimum" : 0, "minimum" : 0,
"default" : 0, "default" : 0,
"append" : "edt_append_pixel", "append" : "edt_append_pixel",
"propertyOrder" : 15 "required" : true,
"propertyOrder" : 14
}, },
"signalDetection" : "signalDetection" :
{ {
"type" : "boolean", "type" : "boolean",
"title" : "edt_conf_v4l2_signalDetection_title", "title" : "edt_conf_v4l2_signalDetection_title",
"default" : false, "default" : false,
"propertyOrder" : 16 "required" : true,
"propertyOrder" : 15
}, },
"redSignalThreshold" : "redSignalThreshold" :
{ {
@ -156,7 +165,8 @@
"signalDetection": true "signalDetection": true
} }
}, },
"propertyOrder" : 17 "required" : true,
"propertyOrder" : 16
}, },
"greenSignalThreshold" : "greenSignalThreshold" :
{ {
@ -171,7 +181,8 @@
"signalDetection": true "signalDetection": true
} }
}, },
"propertyOrder" : 18 "required" : true,
"propertyOrder" : 17
}, },
"blueSignalThreshold" : "blueSignalThreshold" :
{ {
@ -186,7 +197,8 @@
"signalDetection": true "signalDetection": true
} }
}, },
"propertyOrder" : 19 "required" : true,
"propertyOrder" : 18
}, },
"sDVOffsetMin" : "sDVOffsetMin" :
{ {
@ -201,7 +213,8 @@
"signalDetection": true "signalDetection": true
} }
}, },
"propertyOrder" : 20 "required" : true,
"propertyOrder" : 19
}, },
"sDVOffsetMax" : "sDVOffsetMax" :
{ {
@ -216,7 +229,8 @@
"signalDetection": true "signalDetection": true
} }
}, },
"propertyOrder" : 21 "required" : true,
"propertyOrder" : 20
}, },
"sDHOffsetMin" : "sDHOffsetMin" :
{ {
@ -231,7 +245,8 @@
"signalDetection": true "signalDetection": true
} }
}, },
"propertyOrder" : 22 "required" : true,
"propertyOrder" : 21
}, },
"sDHOffsetMax" : "sDHOffsetMax" :
{ {
@ -246,7 +261,8 @@
"signalDetection": true "signalDetection": true
} }
}, },
"propertyOrder" : 23 "required" : true,
"propertyOrder" : 22
} }
}, },
"additionalProperties" : false "additionalProperties" : false

View File

@ -10,7 +10,7 @@
"username": { "username": {
"type": "string", "type": "string",
"title":"edt_dev_spec_username_title", "title":"edt_dev_spec_username_title",
"default": "newdeveloper", "default": "",
"propertyOrder" : 2 "propertyOrder" : 2
}, },
"transitiontime": { "transitiontime": {

View File

@ -65,14 +65,14 @@ HyperionDaemon::HyperionDaemon(QString configFile, QObject *parent)
else if (level == "verbose") Logger::setLogLevel(Logger::INFO); else if (level == "verbose") Logger::setLogLevel(Logger::INFO);
else if (level == "debug") Logger::setLogLevel(Logger::DEBUG); else if (level == "debug") Logger::setLogLevel(Logger::DEBUG);
else Error(Logger::getInstance("LOGGER"), "log level '%s' used in config is unknown. valid: silent warn verbose debug", level.c_str()); else Error(Logger::getInstance("LOGGER"), "log level '%s' used in config is unknown. valid: silent warn verbose debug", level.c_str());
} }
} }
else else
{ {
WarningIf(_qconfig.contains("logger"), Logger::getInstance("LOGGER"), "Logger settings overridden by command line argument"); WarningIf(_qconfig.contains("logger"), Logger::getInstance("LOGGER"), "Logger settings overridden by command line argument");
} }
_hyperion = Hyperion::initInstance(_qconfig, configFile); _hyperion = Hyperion::initInstance(_qconfig, configFile);
Info(_log, "Hyperion initialized"); Info(_log, "Hyperion initialized");
@ -140,12 +140,12 @@ void HyperionDaemon::run()
void HyperionDaemon::loadConfig(const QString & configFile) void HyperionDaemon::loadConfig(const QString & configFile)
{ {
Info(_log, "Selected configuration file: %s", QSTRING_CSTR(configFile)); Info(_log, "Selected configuration file: %s", QSTRING_CSTR(configFile));
// make sure the resources are loaded (they may be left out after static linking) // make sure the resources are loaded (they may be left out after static linking)
Q_INIT_RESOURCE(resource); Q_INIT_RESOURCE(resource);
// read the json schema from the resource // read the json schema from the resource
QString schemaFile = ":/hyperion-schema"; QString schemaFile = ":/hyperion-schema";
QJsonObject schemaJson; QJsonObject schemaJson;
try try
@ -162,11 +162,11 @@ void HyperionDaemon::loadConfig(const QString & configFile)
_qconfig = QJsonFactory::readConfig(configFile); _qconfig = QJsonFactory::readConfig(configFile);
QPair<bool, bool> validate = schemaChecker.validate(_qconfig); QPair<bool, bool> validate = schemaChecker.validate(_qconfig);
if (!validate.first && validate.second) if (!validate.first && validate.second)
{ {
Warning(_log,"Errors have been found in the configuration file. Automatic correction is applied"); Warning(_log,"Errors have been found in the configuration file. Automatic correction is applied");
_qconfig = schemaChecker.getAutoCorrectedConfig(_qconfig); _qconfig = schemaChecker.getAutoCorrectedConfig(_qconfig);
if (!QJsonFactory::writeJson(configFile, _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")); Info(_log,"Inital background effect '%s' %s", QSTRING_CSTR(bgEffectConfig), ((result == 0) ? "started" : "failed"));
} }
} }
#undef FGCONFIG_ARRAY #undef FGCONFIG_ARRAY
#undef BGCONFIG_ARRAY #undef BGCONFIG_ARRAY
} }
@ -409,7 +409,6 @@ void HyperionDaemon::createSystemFrameGrabber()
#else #else
QString type = grabberConfig["type"].toString("auto"); QString type = grabberConfig["type"].toString("auto");
#endif #endif
// auto eval of type // auto eval of type
if ( type == "auto" ) if ( type == "auto" )
@ -430,7 +429,7 @@ void HyperionDaemon::createSystemFrameGrabber()
type = "amlogic"; type = "amlogic";
} }
// x11 -> if DISPLAY is set // x11 -> if DISPLAY is set
else if (getenv("DISPLAY") != NULL ) else if (getenv("DISPLAY") != NULL )
{ {
type = "x11"; type = "x11";
} }
@ -441,7 +440,7 @@ void HyperionDaemon::createSystemFrameGrabber()
} }
Info( _log, "set screen capture device to '%s'", QSTRING_CSTR(type)); Info( _log, "set screen capture device to '%s'", QSTRING_CSTR(type));
} }
bool grabberCompState = grabberConfig["enable"].toBool(true); bool grabberCompState = grabberConfig["enable"].toBool(true);
if (type == "") { Info( _log, "screen capture device disabled"); grabberCompState = false; } if (type == "") { Info( _log, "screen capture device disabled"); grabberCompState = false; }
else if (type == "framebuffer") createGrabberFramebuffer(grabberConfig); else if (type == "framebuffer") createGrabberFramebuffer(grabberConfig);
@ -450,7 +449,7 @@ void HyperionDaemon::createSystemFrameGrabber()
else if (type == "osx") createGrabberOsx(grabberConfig); else if (type == "osx") createGrabberOsx(grabberConfig);
else if (type == "x11") createGrabberX11(grabberConfig); else if (type == "x11") createGrabberX11(grabberConfig);
else { Warning( _log, "unknown framegrabber type '%s'", QSTRING_CSTR(type)); grabberCompState = false; } else { Warning( _log, "unknown framegrabber type '%s'", QSTRING_CSTR(type)); grabberCompState = false; }
// _hyperion->getComponentRegister().componentStateChanged(hyperion::COMP_GRABBER, grabberCompState); // _hyperion->getComponentRegister().componentStateChanged(hyperion::COMP_GRABBER, grabberCompState);
_hyperion->setComponentState(hyperion::COMP_GRABBER, grabberCompState ); _hyperion->setComponentState(hyperion::COMP_GRABBER, grabberCompState );
} }
@ -539,7 +538,7 @@ void HyperionDaemon::createGrabberOsx(const QJsonObject & grabberConfig)
_osxGrabber = new OsxWrapper( _osxGrabber = new OsxWrapper(
grabberConfig["display"].toInt(0), grabberConfig["display"].toInt(0),
_grabber_width, _grabber_height, _grabber_frequency, _grabber_priority); _grabber_width, _grabber_height, _grabber_frequency, _grabber_priority);
QObject::connect(_osxGrabber, SIGNAL(emitImage(int, const Image<ColorRgb>&, const int)), _protoServer, SLOT(sendImageToProtoSlaves(int, const Image<ColorRgb>&, const int)) ); QObject::connect(_osxGrabber, SIGNAL(emitImage(int, const Image<ColorRgb>&, const int)), _protoServer, SLOT(sendImageToProtoSlaves(int, const Image<ColorRgb>&, const int)) );
_osxGrabber->start(); _osxGrabber->start();
@ -556,7 +555,7 @@ void HyperionDaemon::createGrabberV4L2()
bool v4lConfigured = _qconfig.contains("grabberV4L2"); bool v4lConfigured = _qconfig.contains("grabberV4L2");
bool v4lStarted = false; bool v4lStarted = false;
unsigned v4lEnableCount = 0; unsigned v4lEnableCount = 0;
if (_qconfig["grabberV4L2"].isArray()) if (_qconfig["grabberV4L2"].isArray())
{ {
const QJsonArray & v4lArray = _qconfig["grabberV4L2"].toArray(); const QJsonArray & v4lArray = _qconfig["grabberV4L2"].toArray();
@ -583,7 +582,6 @@ void HyperionDaemon::createGrabberV4L2()
grabberConfig["blueSignalThreshold"].toDouble(0.0)/100.0, grabberConfig["blueSignalThreshold"].toDouble(0.0)/100.0,
grabberConfig["priority"].toInt(890), grabberConfig["priority"].toInt(890),
grabberConfig["useKodiChecker"].toBool(false)); grabberConfig["useKodiChecker"].toBool(false));
grabber->setVideoMode(parse3DMode(grabberConfig["mode"].toString("2D")));
grabber->setCropping( grabber->setCropping(
grabberConfig["cropLeft"].toInt(0), grabberConfig["cropLeft"].toInt(0),
grabberConfig["cropRight"].toInt(0), grabberConfig["cropRight"].toInt(0),