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 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>
<script src="/js/content_remote.js" ></script>

View File

@ -95,7 +95,7 @@
"conf_general_impexp_expbtn" : "Exportieren",
"conf_helptable_option" : "Option",
"conf_helptable_expl" : "Erklärung",
"conf_effect_path_intro" : "Definiere weitere Effekt-Pfade, wenn nötig.",
"conf_effect_path_intro" : "Hier kannst du Ordner angeben, die beim Laden von Effekten berücksichtig werden sollen. Zusätzlich können Effekte anhand ihres Namens deaktiviert werden um sie aus Listen zu löschen.",
"conf_effect_fgeff_intro" : "Definiere einen Start Effekt/Farbe, dieser wird angezeigt, wenn Hyperion startet für die angegebene Dauer.",
"conf_effect_bgeff_intro" : "Definiere einen Hintergrund Effekt/Farbe. Dieser wird aktiv, wenn Hyperion sich im Leerlauf befindet. Wird immer mit Priorität 255 gestartet.",
"conf_leds_device_intro" : "Wähle eine Methode zur Steuerung deiner LEDs aus, sie sind unterteilt in verschiedene Kategorien. Neben den allgemeinen Optionen die für alle gültig sind, gibt es auch spezfische die sich unterscheiden je nach Wahl.",
@ -188,6 +188,11 @@
"remote_effects_label_effects" : "Effekt:",
"remote_adjustment_label" : "Farbanpassung",
"remote_adjustment_intro" : "Verändere live Farbe/Helligkeit/Kompensation. $1",
"remote_videoMode_label" : "Video Modus",
"remote_videoMode_intro" : "Wähle zwischen verschiedenen Video Modi um neben 2D auch 3D Filme zu genießen. Unterstützt werden alle Aufnahmearten. $1",
"remote_videoMode_3DSBS" : "3DSBS",
"remote_videoMode_3DTAB" : "3DTAB",
"remote_videoMode_2D" : "2D",
"remote_input_label" : "Quellenauswahl",
"remote_input_intro" : "Hyperion nutzt ein Prioritätensystem um die Quelle zu wählen. Alles was du setzt hat eine Priorität (Effekte/Farben/Plattform Aufnahme/USB Aufnahme und Netzwerkquellen). Standardmäßig nutzt Hyperion die Quelle mit der niedrigsten Priorität. Hier kannst du aktiv Einfluss darauf nehmen. $1",
"remote_input_label_autoselect" : "Automatische Auswahl",
@ -283,7 +288,6 @@
"infoDialog_writeconf_error_text" : "Das speichern der Konfiguration ist fehlgeschlagen.",
"infoDialog_import_jsonerror_text" : "Die ausgewählte Konfigurations-Datei \"$1\" ist keine .json Datei oder ist beschädigt! Fehlermeldung: ($2)",
"infoDialog_import_hyperror_text" : "Die ausgewählte Konfigurations-Datei \"$1\" kann nicht importiert werden. Sie ist nicht kompatibel mit Hyperion 2.0 und höher!",
"infoDialog_import_reverror_text" : "Die Version deiner Konfigurations-Datei \"$1\" stimmt nicht mit deiner Hyperion Version überein (Datei: $2, Hyperion: $3). Du kannst nur übereinstimmende Versionen importieren!",
"infoDialog_import_comperror_text" : "Dein Browser unterstützt leider keinen Import. Bitte versuche es mit einem anderen Browser erneut.",
"infoDialog_import_confirm_title" : "Bestätige Import",
"infoDialog_import_confirm_text" : "Bist du sicher, dass du die Konfigurations-Datei \"$1\" importieren möchtest? Diese Aktion kann nicht rückgängig gemacht werden!",
@ -490,8 +494,6 @@
"edt_conf_v4l2_frameDecimation_expl" : "Der Faktor der Bildverkleinerung",
"edt_conf_v4l2_sizeDecimation_title" : "Größenänderung",
"edt_conf_v4l2_sizeDecimation_expl" : "Der Faktor der Größenänderung",
"edt_conf_v4l2_mode_title" : "Modus",
"edt_conf_v4l2_mode_expl" : "Modus der USB Aufnahme",
"edt_conf_v4l2_useKodiChecker_title" : "Nutze Kodi Überwachung",
"edt_conf_v4l2_useKodiChecker_expl" : "Starte/Stoppe Aufnahme mithilfe der Kodi Überwachung.",
"edt_conf_v4l2_cropLeft_title" : "Entferne links",
@ -539,10 +541,14 @@
"edt_conf_bb_heading_title" : "Schwarze Balken Erkennung",
"edt_conf_bb_threshold_title" : "Schwelle",
"edt_conf_bb_threshold_expl" : "Wenn die Erkennung nicht funktioniert, erhöhe die Schwelle um auf 'graues' schwarz zu reagieren.",
"edt_conf_bb_unknownFrameCnt_title" : "unknownFrameCnt",
"edt_conf_bb_borderFrameCnt_title" : "borderFrameCnt",
"edt_conf_bb_maxInconsistentCnt_title" : "maxInconsistentCn",
"edt_conf_bb_blurRemoveCnt_title" : "blurRemoveCnt",
"edt_conf_bb_unknownFrameCnt_title" : "Unbekannte Bilder",
"edt_conf_bb_unknownFrameCnt_expl" : "Anzahl an Bildern die negativ sind, welche den Rand auf 0 zurücksetzen.",
"edt_conf_bb_borderFrameCnt_title" : "Randbilder",
"edt_conf_bb_borderFrameCnt_expl" : "Anzahl an Bildern bis ein neuer Rand festgelegt wird.",
"edt_conf_bb_maxInconsistentCnt_title" : "Inkosistente Bilder",
"edt_conf_bb_maxInconsistentCnt_expl" : "Anzahl der zu ignorierenden Bilder bis ein neuer Rand überprüft wird.",
"edt_conf_bb_blurRemoveCnt_title" : "Unscharfe Pixel",
"edt_conf_bb_blurRemoveCnt_expl" : "Anzahl an Pixeln, die zusätzlich vom Rand abgeschnitten werden.",
"edt_conf_bb_mode_title" : "Modus",
"edt_conf_bb_mode_expl" : "Algorithmus zur Auswertung. (siehe Wiki)",
"edt_conf_kodic_heading_title" : "Kodi Überwachung",
@ -599,15 +605,14 @@
"edt_conf_effp_paths_expl" : "Es können mehrere Ordner definiert werden die Effekte enthalten. Der Effekt Konfigurator speichert immer im Ersten Ordner.",
"edt_conf_effp_paths_itemtitle" : "Pfad",
"edt_conf_effp_disable_title" : "Deaktivierte Effekte",
"edt_conf_effp_disable_expl" : "Trage hier die Namen der Effekte ein, die in Effektlisten nicht mehr zur Auswahl stehen sollen.",
"edt_conf_effp_disable_itemtitle" : "Effekt",
"edt_conf_log_heading_title" : "Protokoll",
"edt_conf_log_level_title" : "Protokollstufe",
"edt_conf_log_level_expl" : "Abhängig der Stufe sind weniger oder mehr Meldungen sichtbar.",
"edt_eff_smooth_custom_title" : "Aktivere Glättung",
"edt_eff_smooth_time_ms_title" : "Glättung: Zeit",
"edt_eff_smooth_updateFrequency_title" : "Glättung: Aktualisierungsfrequenz",
"edt_eff_smooth_updateDelay_title" : "Glättung: Aktualisierungsverzögerung",
"edt_eff_smooth_pause_title" : "Glättung pausieren",
"edt_eff_smooth_custom" : "Aktivere Glättung",
"edt_eff_smooth_time_ms" : "Glättung: Zeit",
"edt_eff_smooth_updateFrequency" : "Glättung: Aktualisierungsfrequenz",
"edt_eff_candle_header" : "Kerze",
"edt_eff_candle_header_desc" : "Flackerndes Kerzenlicht",
"edt_eff_police_header" : "Polizei",
@ -618,7 +623,7 @@
"edt_eff_knightrider_header" : "Knight Rider",
"edt_eff_knightrider_header_desc" : "K.I.T.T ist zurück! Der Front-Scanner des bekannten Autos, diesmal nicht nur in rot.",
"edt_eff_lightclock_header" : "Lichtuhr",
"edt_eff_lightclock_header_desc" : "Eine echte Uhr als Licht! Passe die Farben von Stunden, Minuten, Sekunden deinen Vorstellungen an. Optional können 3/6/9/12 Uhr Markierungen aktiviert werden. Sollte die Uhr eine falsche Zeit anzeigen, überprüfe die Uhrzeit deines Systems.",
"edt_eff_lightclock_header_desc" : "Eine echte Uhr als Licht! Passe die Farben von Stunden, Minuten, Sekunden deinen Vorstellungen an. Optional können 3/6/9/12 Uhr Markierungen aktiviert werden. Sollte die Uhr eine falsche Zeit anzeigen, überprüfe die Uhrzeit deines Systems.",
"edt_eff_pacman_header" : "Pac-Man",
"edt_eff_moodblobs_header" : "Stimmungskugeln",
"edt_eff_swirl_header" : "Farbwirbel",

View File

@ -95,7 +95,7 @@
"conf_general_impexp_expbtn" : "Export",
"conf_helptable_option" : "Option",
"conf_helptable_expl" : "Explanation",
"conf_effect_path_intro" : "Define more effect paths if necessary.",
"conf_effect_path_intro" : "Load effects from the defined paths. Additional you can disable single effects by name to hide them from all effect lists.",
"conf_effect_fgeff_intro" : "Define a booteffect or color, which is shown during Hyperion startup for the defined duration.",
"conf_effect_bgeff_intro" : "Define a background effect/color, which is shown during Hyperion \"idle\". Sarts always with priority channel 255.",
"conf_leds_device_intro" : "Hyperion supports a lot of controllers to transmit data to your target device. Select a LED controller out of the sorted list and configure it. We have chosen the best default settings for each device.",
@ -188,6 +188,11 @@
"remote_effects_label_effects" : "Effect:",
"remote_adjustment_label" : "Color adjustment",
"remote_adjustment_intro" : "Modifiy color/brightness/compensation during runtime. $1",
"remote_videoMode_label" : "Video mode",
"remote_videoMode_intro" : "Switch between different video modes to enjoy 3D movies! Supported are all capture devices. $1",
"remote_videoMode_3DSBS" : "3DSBS",
"remote_videoMode_3DTAB" : "3DTAB",
"remote_videoMode_2D" : "2D",
"remote_input_label" : "Source Selection",
"remote_input_intro" : "Hyperion uses a priority system to select a source. Everything you set has a priority (Effect/Color/Platform capture/USB capture and network sources). By default, Hyperion select sources depending on priority (lowest number reflects the current active source). Now you have the opportunity to select sources on your own. $1",
"remote_input_label_autoselect" : "Auto Selection",
@ -283,7 +288,6 @@
"infoDialog_writeconf_error_text" : "Saving your configuration failed.",
"infoDialog_import_jsonerror_text" : "The selected configuration file \"$1\" is no .json file or it's corrupted. Error message: ($2)",
"infoDialog_import_hyperror_text" : "The selected configuration file \"$1\" can't be imported. It's not compatible with Hyperion 2.0 and higher!",
"infoDialog_import_reverror_text" : "The revision of your configuration file \"$1\" doesnt match the current Hyperion version you run (File: $2, Hyperion: $3). You could just import matching configurations!",
"infoDialog_import_comperror_text" : "Sad! Your browser doesn't support a import. Please try again with another browser.",
"infoDialog_import_confirm_title" : "Confirm import",
"infoDialog_import_confirm_text" : "Are you sure to import \"$1\"? This process can't be reverted!",
@ -491,8 +495,6 @@
"edt_conf_v4l2_frameDecimation_expl" : "The factor of frame decimation",
"edt_conf_v4l2_sizeDecimation_title" : "Size decimation",
"edt_conf_v4l2_sizeDecimation_expl" : "The factor of size decimation",
"edt_conf_v4l2_mode_title" : "Mode",
"edt_conf_v4l2_mode_expl" : "Modus of USB capture",
"edt_conf_v4l2_useKodiChecker_title" : "Use Kodi Watch",
"edt_conf_v4l2_useKodiChecker_expl" : "Start/stop capturing with Kodi Watch results.",
"edt_conf_v4l2_cropLeft_title" : "Crop left",
@ -540,10 +542,14 @@
"edt_conf_bb_heading_title" : "Blackbar detector",
"edt_conf_bb_threshold_title" : "Threshold",
"edt_conf_bb_threshold_expl" : "If the detection doesn't work, higher the threshold to adjust on 'greyish' black",
"edt_conf_bb_unknownFrameCnt_title" : "unknownFrameCnt",
"edt_conf_bb_borderFrameCnt_title" : "borderFrameCnt",
"edt_conf_bb_maxInconsistentCnt_title" : "maxInconsistentCn",
"edt_conf_bb_blurRemoveCnt_title" : "blurRemoveCnt",
"edt_conf_bb_unknownFrameCnt_title" : "Unknown frames",
"edt_conf_bb_unknownFrameCnt_expl" : "Number of frames without any detection before the border is set to 0.",
"edt_conf_bb_borderFrameCnt_title" : "Border frames",
"edt_conf_bb_borderFrameCnt_expl" : "Number of frames before a consistent detected border gets set.",
"edt_conf_bb_maxInconsistentCnt_title" : "Inconsistent frames",
"edt_conf_bb_maxInconsistentCnt_expl" : "Number of inconsistent frames that are ignored before a new border gets a chance to proof consistency.",
"edt_conf_bb_blurRemoveCnt_title" : "Blur pixel",
"edt_conf_bb_blurRemoveCnt_expl" : "Number of pixels that get removed from the detected border to cut away blur.",
"edt_conf_bb_mode_title" : "Mode",
"edt_conf_bb_mode_expl" : "Algorithm for processing. (see Wiki)",
"edt_conf_kodic_heading_title" : "Kodi Watch",
@ -599,16 +605,15 @@
"edt_conf_effp_paths_title" : "Effect Path(s)",
"edt_conf_effp_paths_expl" : "You could define more folders that contain effects. The effect configurator will always save inside the first folder.",
"edt_conf_effp_paths_itemtitle" : "Path",
"edt_conf_effp_disable_title" : "Disabed Effects",
"edt_conf_effp_disable_title" : "Disabled Effects",
"edt_conf_effp_disable_expl" : "Add effect names here to disable/hide them from all effect lists.",
"edt_conf_effp_disable_itemtitle" : "Effect",
"edt_conf_log_heading_title" : "Logging",
"edt_conf_log_level_title" : "Log-Level",
"edt_conf_log_level_expl" : "Depending on loglevel you see less or more messages in your log.",
"edt_eff_smooth_custom_title" : "Enable smoothing",
"edt_eff_smooth_time_ms_title" : "Smoothing time",
"edt_eff_smooth_updateFrequency_title" : "Smoothing update frequency",
"edt_eff_smooth_updateDelay_title" : "Smoothing update delay",
"edt_eff_smooth_pause_title" : "Pause smoothing",
"edt_eff_smooth_custom" : "Enable smoothing",
"edt_eff_smooth_time_ms" : "Smoothing time",
"edt_eff_smooth_updateFrequency" : "Smoothing update frequency",
"edt_eff_candle_header" : "Candle",
"edt_eff_candle_header_desc" : "Shimmering candles",
"edt_eff_police_header" : "Police",
@ -620,7 +625,7 @@
"edt_eff_knightrider_header" : "Knight Rider",
"edt_eff_knightrider_header_desc" : "K.I.T.T is back! The front-scanner of the well known car, this time not just in red.",
"edt_eff_lightclock_header" : "Light Clock",
"edt_eff_lightclock_header_desc" : "A real clock as light! Adjsut the colors of hours, minute, seconds. A optional 3/6/9/12 o'clock marker is also available. In case the clock is wrong, you need to check your system clock.",
"edt_eff_lightclock_header_desc" : "A real clock as light! Adjsut the colors of hours, minute, seconds. A optional 3/6/9/12 o'clock marker is also available. In case the clock is wrong, you need to check your system clock.",
"edt_eff_pacman_header" : "Pac-Man",
"edt_eff_moodblobs_header" : "Mood Blobs",
"edt_eff_swirl_header" : "Color Swirl",

View File

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

View File

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

View File

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

View File

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

View File

@ -1,18 +1,18 @@
$(document).ready(function() {
performTranslation();
var oldEffects = [];
var cpcolor = '#B500FF';
var mappingList = serverSchema.properties.color.properties.imageToLedMappingType.enum;
var duration = 0;
var rgb = {r:255,g:0,b:0};
//create html
createTable('ssthead', 'sstbody', 'sstcont');
$('.ssthead').html(createTableRow([$.i18n('remote_input_origin'), $.i18n('remote_input_owner'), $.i18n('remote_input_priority'), $.i18n('remote_input_status')], true, true));
createTable('crthead', 'crtbody', 'adjust_content', true);
//create introduction
if(showOptHelp)
{
@ -21,12 +21,13 @@ $(document).ready(function() {
createHint("intro", $.i18n('remote_adjustment_intro', $.i18n('remote_losthint')), "adjust_content");
createHint("intro", $.i18n('remote_components_intro', $.i18n('remote_losthint')), "comp_intro");
createHint("intro", $.i18n('remote_maptype_intro', $.i18n('remote_losthint')), "maptype_intro");
createHint("intro", $.i18n('remote_videoMode_intro', $.i18n('remote_losthint')), "videomode_intro");
}
//color adjustment
var sColor = sortProperties(serverSchema.properties.color.properties.channelAdjustment.items.properties)
var values = serverInfo.adjustment[0]
for(key in sColor)
{
if(sColor[key].key != "id" && sColor[key].key != "leds")
@ -47,18 +48,18 @@ $(document).ready(function() {
{
property = '<div class="checkbox"><input id="cr_'+sColor[key].key+'" type="checkbox" value="'+value+'"/><label></label></div>';
$('.crtbody').append(createTableRow([title, property], false, true));
$('#cr_'+sColor[key].key).off().on('change', function(e){
requestAdjustment(e.target.id.substr(e.target.id.indexOf("_") + 1), e.currentTarget.checked);
});
}
else
{
if(sColor[key].key == "brightness" || sColor[key].key == "brightnessCompensation" || sColor[key].key == "backlightThreshold")
if(sColor[key].key == "brightness" || sColor[key].key == "brightnessCompensation" || sColor[key].key == "backlightThreshold")
property = '<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
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));
$('#cr_'+sColor[key].key).off().on('change', function(e){
valValue(this.id,this.value,this.min,this.max);
@ -79,12 +80,12 @@ $(document).ready(function() {
});
}
}
function sendColor()
{
requestSetColor(rgb.r, rgb.g, rgb.b,duration);
}
function updateRemote()
{
if ($('#componentsbutton').length == 0)
@ -95,13 +96,14 @@ $(document).ready(function() {
{
updateInputSelect();
updateLedMapping();
updateVideoMode();
updateComponents();
updateEffectlist();
}
}
function updateInputSelect()
{
{
$('.sstbody').html("");
var data = "";
var prios = serverInfo.priorities
@ -114,7 +116,7 @@ $(document).ready(function() {
origin = origin.split("@");
var ip = origin[1];
origin = origin[0];
var owner = prios[i].owner;
var active = prios[i].active;
var visible = prios[i].visible;
@ -127,7 +129,7 @@ $(document).ready(function() {
if (active)
btn_type = "primary";
if(priority > 254)
continue;
if(priority < 254 && (compId == "EFFECT" || compId == "COLOR") )
@ -164,15 +166,15 @@ $(document).ready(function() {
owner = $.i18n('general_comp_UDPLISTENER');
break;
}
if(duration && compId != "GRABBER" && compId != "PROTOSERVER")
owner += '<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>';
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>';
if(btn_type != 'default')
$('.sstbody').append(createTableRow([origin, owner, priority, btn], false, true));
}
@ -182,15 +184,15 @@ $(document).ready(function() {
var btn_call_state = (clearAll? "enabled" : "disabled");
$('#auto_btn').html('<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>');
var max_width=100;
$('.btn_input_selection').each(function() {
if ($(this).innerWidth() > max_width)
max_width = $(this).innerWidth();
});
$('.btn_input_selection').css("min-width",max_width+"px");
$('.btn_input_selection').css("min-width",max_width+"px");
}
function updateLedMapping()
{
mapping = serverInfo.ledMAppingType;
@ -219,7 +221,7 @@ $(document).ready(function() {
comp_name = components[idx].name;
comp_btn_id = "comp_btn_"+comp_name;
comp_goff = serverInfo.hyperion.off? "disabled" : "enabled";
// create btn if not there
if ($("#"+comp_btn_id).length == 0)
{
@ -236,7 +238,7 @@ $(document).ready(function() {
}
}
}
function updateEffectlist()
{
var newEffects = serverInfo.effects;
@ -245,7 +247,7 @@ $(document).ready(function() {
$('#effect_select').html('<option value="__none__"></option>');
var usrEffArr = [];
var sysEffArr = [];
for(i = 0; i < newEffects.length; i++) {
var effectName = newEffects[i].name;
if(!/^\:/.test(newEffects[i].file)){
@ -260,20 +262,36 @@ $(document).ready(function() {
oldEffects = newEffects;
}
}
function updateVideoMode()
{
videoModes = ["2D","3DSBS","3DTAB"];
currVideoMode = serverInfo.grabbers.videomode;
$('#videomodebtns').html("");
for(var ix = 0; ix < videoModes.length; ix++)
{
if(currVideoMode == videoModes[ix])
btn_style = 'btn-success';
else
btn_style = 'btn-primary';
$('#videomodebtns').append('<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
if (getStorage('rmcpcolor') != null)
{
cpcolor = getStorage('rmcpcolor');
rgb = hexToRgb(cpcolor);
}
if (getStorage('rmduration') != null)
{
$("#remote_duration").val(getStorage('rmduration'));
duration = getStorage('rmduration');
}
createCP('cp2', cpcolor, function(rgbT,hex){
rgb = rgbT;
sendColor()
@ -284,7 +302,7 @@ $(document).ready(function() {
requestPriorityClear();
$("#effect_select").val("__none__");
});
$("#remote_duration").off().on("change", function(){
duration = valValue(this.id,this.value,this.min,this.max);
setStorage('rmduration', duration);
@ -293,26 +311,26 @@ $(document).ready(function() {
$("#effect_select").off().on("change", function(event) {
sendEffect();
});
$("#remote_input_reseff, #remote_input_rescol").off().on("click", function(){
if(this.id == "remote_input_rescol")
sendColor();
else
sendEffect();
});
$("#remote_input_img").change(function(){
readImg(this, function(src,width,height){
console.log(src,width,height)
requestSetImage(src,width,height,duration)
});
});
//force first update
updateRemote();
updateRemote();
// interval updates
$(hyperion).on("cmd-serverinfo",updateRemote);
removeOverlay();
removeOverlay();
});

View File

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

View File

@ -1,7 +1,7 @@
//clear priority and other tasks if people reload the page or lost connection while a wizard was active
$(hyperion).one("ready", function(event) {
if(getStorage("wizardactive") === 'true')
$(hyperion).one("ready", function(event) {
if(getStorage("wizardactive") === 'true')
{
requestPriorityClear();
setStorage("wizardactive", false);
@ -12,7 +12,7 @@
}
}
});
function resetWizard()
{
$("#wizard_modal").modal('hide');
@ -27,7 +27,7 @@
sendToKodi("stop");
step = 0;
}
//rgb byte order wizard
var wIntveralId;
var new_rgb_order;
@ -59,14 +59,14 @@
$('#wizp2_body').append('<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_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
$("#wizard_modal").modal({
backdrop : "static",
keyboard: false,
show: true
});
//listen for continue
$('#btn_wiz_cont').off().on('click',function() {
beginWizardRGB();
@ -76,7 +76,7 @@
}
function beginWizardRGB()
{
{
$("#wiz_switchtime_select").off().on('change',function() {
clearInterval(wIntveralId);
var time = $("#wiz_switchtime_select").val();
@ -88,19 +88,19 @@
var redS = $("#wiz_r_select").val();
var greenS = $("#wiz_g_select").val();
var blueS = rgb_order.toString().replace(/,/g,"").replace(redS, "").replace(greenS,"");
for (var i = 0; i<rgb_order.length; 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
$('#wiz_g_select option[value='+rgb_order[i]+']').attr('disabled',false);
if (greenS == rgb_order[i])
$('#wiz_r_select option[value='+rgb_order[i]+']').attr('disabled',true);
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')
{
$('#btn_wiz_save').attr('disabled',false);
@ -114,9 +114,9 @@
else
rgb_order[i] = blueS;
}
rgb_order = rgb_order.toString().replace(/,/g,"");
if(redS == "r" && greenS == "g")
{
$('#btn_wiz_save').toggle(false);
@ -132,14 +132,14 @@
else
$('#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").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_g_select").html($("#wiz_r_select").html());
$("#wiz_r_select").trigger('change');
requestSetColor('255','0','0');
setTimeout(requestSetSource, 100, 'auto');
setStorage("wizardactive", true);
@ -158,9 +158,9 @@
setTimeout(initRestart, 100);
});
}
$('#btn_wizard_byteorder').off().on('click',startWizardRGB);
//color calibration wizard
var kodiAddress = document.location.hostname+':8080';
var wiz_editor;
@ -174,28 +174,28 @@
var vidAddress = "https://sourceforge.net/projects/hyperion-project/files/resources/vid/";
var picnr = 0;
var availVideos = ["Sweet_Cocoon","Caminandes_2_GranDillama","Caminandes_3_Llamigos"];
if(getStorage("kodiAddress") != null)
kodiAddress = getStorage("kodiAddress");
function switchPicture(pictures)
{
{
if(typeof pictures[picnr] === 'undefined')
picnr = 0;
sendToKodi('playP',pictures[picnr]);
picnr++;
}
function sendToKodi(type, content, cb)
{
var command;
if(type == "playP")
content = imgAddress+content+'.png';
if(type == "playV")
content = vidAddress+content;
if(type == "msg")
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")
@ -222,13 +222,13 @@
.fail( function( jqXHR, textStatus ) {
if ( jqXHR.status != 200 && type == "msg")
cb("error")
});
});
}
function performAction()
{
var h;
if(step == 1)
{
$('#wiz_cc_desc').html($.i18n('wiz_cc_chooseid'));
@ -237,7 +237,7 @@
}
else
$('#btn_wiz_back').attr("disabled", false)
if(step == 2)
{
updateWEditor(["white"]);
@ -273,7 +273,7 @@
h = $.i18n('wiz_cc_adjustit',$.i18n('edt_conf_color_red_title'));
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");
}
else
@ -286,7 +286,7 @@
h = $.i18n('wiz_cc_adjustit',$.i18n('edt_conf_color_green_title'));
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");
}
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_summary')+'</p>';
$('#wiz_cc_desc').html(h);
$('.videobtn').off().on('click', function(e){
if(e.target.id == "stop")
sendToKodi("stop");
else
sendToKodi("playV",e.target.id+'.mp4');
$(this).attr("disabled", true);
setTimeout(function(){$('.videobtn').attr("disabled", false)},10000);
});
$('#btn_wiz_next').attr("disabled", true);
$('#btn_wiz_save').toggle(true);
}
@ -397,7 +397,7 @@
$('#btn_wiz_save').toggle(false);
}
}
function updateWEditor(el, all)
{
for (var key in cobj)
@ -408,7 +408,7 @@
$('#editor_container_wiz [data-schemapath*=".'+profile+'.'+key+'"]').toggle(false);
}
}
function startWizardCC()
{
//create html
@ -417,14 +417,14 @@
$('#wizp1_footer').html('<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_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
$("#wizard_modal").modal({
backdrop : "static",
keyboard: false,
show: true
});
$('#wiz_cc_kodiip').off().on('change',function() {
kodiAddress = $(this).val();
setStorage("kodiAddress", kodiAddress);
@ -439,62 +439,62 @@
$('#kodi_status').html('<p style="color:green;font-weight:bold;margin-top:5px">'+$.i18n('wiz_cc_kodicon')+'</p>');
withKodi = true;
}
$('#btn_wiz_cont').attr('disabled', false);
});
});
//listen for continue
$('#btn_wiz_cont').off().on('click',function() {
beginWizardCC();
$('#wizp1').toggle(false);
$('#wizp2').toggle(true);
});
$('#wiz_cc_kodiip').trigger("change")
colorLength = serverConfig.color.channelAdjustment;
cobj = schema.color.properties.channelAdjustment.items.properties;
websAddress = document.location.hostname+':'+serverConfig.webConfig.port;
imgAddress = 'http://'+websAddress+'/img/cc/';
setStorage("wizardactive", true);
//check profile count
if(colorLength.length > 1)
{
$('#multi_cali').html('<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++)
$('#wiz_select').append(createSelOpt(i,i+1+' ('+colorLength[i].id+')'));
$('#wiz_select').off().on('change', function(){
profile = $(this).val();
});
}
//prepare editor
wiz_editor = createJsonEditor('editor_container_wiz', {
color : schema.color
}, true, true);
$('#editor_container_wiz h4').toggle(false);
$('#editor_container_wiz .btn-group').toggle(false);
$('#editor_container_wiz [data-schemapath="root.color.imageToLedMappingType"]').toggle(false);
for(var i = 0; i<colorLength.length; i++)
$('#editor_container_wiz [data-schemapath*="root.color.channelAdjustment.'+i+'."]').toggle(false);
}
function beginWizardCC()
{
$('#btn_wiz_next').off().on('click',function() {
step++;
performAction();
});
$('#btn_wiz_back').off().on('click',function() {
step--;
performAction();
});
$('#btn_wiz_abort').off().on('click', resetWizard);
$('#btn_wiz_save').off().on('click',function() {
@ -509,13 +509,13 @@
delete temp.leds
requestAdjustment(JSON.stringify(temp),"",true);
});
step++
performAction();
}
$('#btn_wizard_colorcalibration').off().on('click', startWizardCC);
//hue wizard
var hueIPs = [];
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 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}};
function startWizardPhilipsHue()
{
//create html
@ -558,7 +558,7 @@
function checkHueBridge(cb,hueUser){
var usr = "";
if(typeof hueUser != "undefined")
usr = hueUser;
@ -578,8 +578,8 @@
})
.fail( function( jqXHR, textStatus ) {
cb(false);
});
}
});
}
function checkUserResult(reply){
if(reply)
@ -594,18 +594,18 @@
$('#wiz_hue_create_user').toggle(true);
}
};
function checkBridgeResult(reply){
if(reply)
{
//abort checking, first reachable result is used
$('#wiz_hue_ipstate').html("");
$('#ip').val(hueIPs[hueIPsinc].internalipaddress)
//now check hue user on this bridge
$('#usrcont').toggle(true);
checkHueBridge(checkUserResult,$('#user').val() ? $('#user').val() : "newdeveloper");
}
}
else
{
//increment and check again
@ -618,14 +618,14 @@
{
$('#usrcont').toggle(false);
$('#wiz_hue_ipstate').html($.i18n('wiz_hue_failure_ip'));
}
}
}
};
function assignHuePos(id, pos, inc)
{
var i = null;
if(pos == "top")
i = huePosTop;
else if(pos == "bottom")
@ -636,11 +636,11 @@
i = huePosRight;
else
i = huePosEntire;
i.index = inc;
return i;
}
function identHueId(id, off)
{
var on = true;
@ -656,7 +656,7 @@
data: ' {"on":'+on+', "sat":254, "bri":254,"hue":47000}'
})
}
function getHueIPs(){
$('#wiz_hue_ipstate').html($.i18n('wiz_hue_searchb'));
$.ajax({
@ -676,11 +676,17 @@
})
.fail( function( jqXHR, textStatus ) {
$('#wiz_hue_ipstate').html($.i18n('wiz_hue_failure_ip'));
});
});
};
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
if(conf_editor.getEditor("root.specificOptions.output").getValue() == "")
getHueIPs();
@ -690,33 +696,30 @@
$('#ip').val(ip);
hueIPs.push({internalipaddress : ip});
checkHueBridge(checkBridgeResult);
var usr = conf_editor.getEditor("root.specificOptions.username").getValue();
$('#user').val(usr);
}
$('#retry_bridge').off().on('click', function(){
hueIPs[0].internalipaddress = $('#ip').val();
hueIPsinc = 0;
checkHueBridge(checkBridgeResult);
});
$('#retry_usr').off().on('click', function(){
checkHueBridge(checkUserResult,$('#user').val() ? $('#user').val() : "newdeveloper");
});
$('#wiz_hue_create_user').off().on('click',function() {
createHueUser();
});
$('#btn_wiz_save').off().on("click", function(){
var hueLedConfig = [];
var finalLightIds = [];
//create hue led config
var incC = 0;
for(key in lightIDs)
{
{
if($('#hue_'+key).val() != "disabled")
{
hueLedConfig.push(assignHuePos(key, $('#hue_'+key).val(), incC));
@ -724,9 +727,9 @@
incC++;
}
}
serverConfig.leds = hueLedConfig;
//Adjust gamma, brightness and compensation
var c = serverConfig.color.channelAdjustment[0];
c.gammaBlue = 1.0;
@ -734,7 +737,7 @@
c.gammaGreen = 1.0;
c.brightness = 100;
c.brightnessCompensation = 0;
//device config
var d = serverConfig.device;
d.output = $('#ip').val();
@ -743,14 +746,14 @@
d.type = "philipshue";
d.transitiontime = 1;
d.switchOffOnBlack = true;
//smoothing off
serverConfig.smoothing.enable = false;
requestWriteConfig(serverConfig, true);
setTimeout(initRestart,200);
});
$('#btn_wiz_abort').off().on('click', resetWizard);
}
@ -775,7 +778,7 @@
$("#connectionTime").html(connectionRetries);
if(connectionRetries == 0) {
abortConnection(UserInterval);
}
}
else
{
if (typeof r[0].error != 'undefined') {
@ -813,16 +816,16 @@
$('#wh_topcontainer').toggle(false);
$('#hue_ids_t, #btn_wiz_save').toggle(true);
lightIDs = 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>']));
}
$('.hue_sel_watch').bind("change", function(){
var cC = 0;
for(key in lightIDs)
{
{
if($('#hue_'+key).val() != "disabled")
{
cC++;
@ -830,7 +833,7 @@
}
cC == 0 ? $('#btn_wiz_save').attr("disabled",true) : $('#btn_wiz_save').attr("disabled",false);
});
$('.hue_sel_watch').trigger('change');
}
else
@ -847,4 +850,4 @@
$('#wizp2').toggle(true);
$('#wizp3').toggle(false);
$("#wiz_hue_usrstate").html($.i18n('wiz_hue_failure_connection'));
}
}

View File

@ -4,15 +4,13 @@
{
/// geenral Settings
/// general Settings
/// * 'name' : The user friendly name of the hyperion instance (used for network things)
/// * 'showOptHelp' : Show option expanations at the webui. Highly recommended for beginners.
/// * 'configVersion' : Don't touch! It's an internal value regarding which validation schema for this config is used.
"general" :
{
"name" : "MyHyperionConfig",
"showOptHelp" : true,
"configVersion" : 2
"showOptHelp" : true
},
/// set log level: silent warn verbose debug
"logger" :
@ -20,26 +18,24 @@
"level" : "warn"
},
/// Device configuration contains the following fields:
/// Device configuration contains the following fields:
/// * 'name' : The user friendly name of the device (only used for display purposes)
/// * 'type' : The type of the device or leds (known types for now are
/// APA102, WS2801, P9813, LPD6803, LPD8806, ---------PWM---------, WS2812b (just RPi1), WS281X (RPi1, RPi2, RPi3), --------OTHER--------, PhilipsHUE, AtmoOrb, PiBlaster, Tinkerforge, FadeCandy, RawHID (USB), UDP, SEDU, TPM2, USBASP-WS2801, USBASP-WS2812, ------3rd PARTY------, Adalight, AdalightAPA102, Atmo, Lightpack, Multi-Lightpack, Paintpack, Test (file), None)
/// * [device type specific configuration]
/// * 'colorOrder' : The order of the color bytes ('rgb', 'rbg', 'bgr', etc.).
/// * 'rewriteTime': in ms. Data is resend to leds, if no new data is available in thistime. 0 means no refresh
/// * 'latchTime' : minimum time between led writes. 0 means no limit. default 10 means a rate of max 100Hz write time
"device" :
{
"type" : "file",
"output" : "/dev/null",
"rate" : 1000000,
"colorOrder" : "rgb",
"rewriteTime": 0,
"latchTime" : 10
"rewriteTime": 0
},
/// Color manipulation configuration used to tune the output colors to specific surroundings.
/// The configuration contains a list of color-transforms. Each transform contains the
/// Color manipulation configuration used to tune the output colors to specific surroundings.
/// The configuration contains a list of color-transforms. Each transform contains the
/// following fields:
/// * 'imageToLedMappingType' : multicolor_mean - every led has it's own calculatedmean color
/// unicolor_mean - every led has same color, color is the mean of whole image
@ -48,7 +44,7 @@
/// * 'leds' : The indices (or index ranges) of the leds to which this channel adjustment applies
/// (eg '0-5, 9, 11, 12-17'). The indices are zero based.
/// * 'black'/'white'/'red'/'green'/'blue'/'cyan'/'magenta'/'yellow' : Array of RGB to adjust the output color
/// * 'gammaRed'/'gammaGreen'/'gammaBlue' : Gamma value for each channel
/// * 'gammaRed'/'gammaGreen'/'gammaBlue' : Gamma value for each channel
/// * 'id' : The unique identifier of the channel adjustments (eg 'device_1')
/// * 'id' : The unique identifier of the channel adjustments (eg 'device_1')
/// * 'backlightThreshold' : Minimum brightness (backlight)
@ -84,7 +80,7 @@
},
/// smoothing
/// * 'smoothing' : Smoothing of the colors in the time-domain with the following tuning
/// * 'smoothing' : Smoothing of the colors in the time-domain with the following tuning
/// parameters:
/// - 'enable' Enable or disable the smoothing (true/false)
/// - 'type' The type of smoothing algorithm ('linear' or 'none')
@ -112,7 +108,6 @@
/// * frameDecimation : Frame decimation factor [default=2]
/// * sizeDecimation : Size decimation factor [default=8]
/// * priority : Hyperion priority channel [default=900]
/// * mode : 3D mode to use 2D/3DSBS/3DTAB (note: no autodetection) [default="2D"]
/// * useKodiChecker : Enable/disable V4L2 according kodichecker sate if set to true [default=false]
/// * cropLeft : Cropping from the left [default=0]
/// * cropRight : Cropping from the right [default=0]
@ -138,7 +133,6 @@
"frameDecimation" : 2,
"sizeDecimation" : 8,
"priority" : 240,
"mode" : "2D",
"useKodiChecker" : false,
"cropLeft" : 0,
"cropRight" : 0,
@ -155,14 +149,14 @@
}
],
/// The configuration for the frame-grabber, contains the following items:
/// The configuration for the frame-grabber, contains the following items:
/// * enable : true if the framegrabber (platform grabber) should be activated
/// * type : type of grabber. (auto|osx|dispmanx|amlogic|x11|framebuffer) [auto]
/// * width : The width of the grabbed frames [pixels]
/// * height : The height of the grabbed frames [pixels]
/// * frequency_Hz : The frequency of the frame grab [Hz]
/// * priority : The priority of the frame-gabber (Default=250) HINT: lower value result in HIGHER priority!
/// * ATTENTION : Power-of-Two resolution is not supported and leads to unexpected behaviour!
/// * priority : The priority of the frame-gabber (Default=250) HINT: lower value result in HIGHER priority!
/// * ATTENTION : Power-of-Two resolution is not supported and leads to unexpected behaviour!
"framegrabber" :
{
// for all type of grabbers
@ -170,27 +164,25 @@
"type" : "framebuffer",
"frequency_Hz" : 10,
"priority" : 250,
"cropLeft" : 0,
"cropRight" : 0,
"cropTop" : 0,
"cropBottom" : 0,
// valid for grabber: osx|dispmanx|amlogic|framebuffer
"width" : 96,
"height" : 96,
// valid for x11
"useXGetImage" : false,
"horizontalPixelDecimation" : 8,
"verticalPixelDecimation" : 8,
// valid for dispmanx and x11
"cropLeft" : 0,
"cropRight" : 0,
"cropTop" : 0,
"cropBottom" : 0,
// valid for framebuffer
"device" : "/dev/fb0"
},
/// The black border configuration, contains the following items:
/// The black border configuration, contains the following items:
/// * enable : true if the detector should be activated
/// * threshold : Value below which a pixel is regarded as black (value between 0 and 100 [%])
/// * unknownFrameCnt : Number of frames without any detection before the border is set to 0 (default 600)
@ -209,7 +201,7 @@
"mode" : "default"
},
/// The configuration of the Kodi connection used to enable and disable the frame-grabber. Contains the following fields:
/// The configuration of the Kodi connection used to enable and disable the frame-grabber. Contains the following fields:
/// * enable : enable/disable Kodi-Checker
/// * kodiAddress : The IP address of the Kodi-host
/// * kodiTcpPort : The TCP-port of the Kodi-server
@ -220,7 +212,7 @@
/// * grabPause : Flag indicating that the frame-grabber is on(true) at player state "pause"
/// * grabScreensaver : Flag indicating that the frame-grabber is on(true) when Kodi is on screensaver
/// * enable3DDetection : Flag indicating that the frame-grabber should switch to a 3D compatible modus if a 3D video is playing
"kodiVideoChecker" :
"kodiVideoChecker" :
{
"enable" : true,
"kodiAddress" : "127.0.0.1",
@ -249,7 +241,7 @@
"effect" : "Rainbow swirl fast",
"duration_ms" : 3000
},
/// backgroundEffect sets a background effect or color. It is used when all capture devices are stopped (with the help of the kodiVideChecker or manual via remote). Could be also selected via priorities selection.
/// * enable : if true, background effect is enabled
/// * type : choose between "color" or "effect"
@ -263,11 +255,11 @@
"effect" : "Warm mood blobs"
},
/// The configuration of the Json/Proto forwarder. Forward messages to multiple instances of Hyperion on same and/or other hosts
/// 'proto' is mostly used for video streams and 'json' for effects
/// The configuration of the Json/Proto forwarder. Forward messages to multiple instances of Hyperion on same and/or other hosts
/// 'proto' is mostly used for video streams and 'json' for effects
/// * enable : Enable or disable the forwarder (true/false)
/// * proto : Proto server adress and port of your target. Syntax:[IP:PORT] -> ["127.0.0.1:19447"] or more instances to forward ["127.0.0.1:19447","192.168.0.24:19449"]
/// * json : Json server adress and port of your target. Syntax:[IP:PORT] -> ["127.0.0.1:19446"] or more instances to forward ["127.0.0.1:19446","192.168.0.24:19448"]
/// * proto : Proto server adress and port of your target. Syntax:[IP:PORT] -> ["127.0.0.1:19447"] or more instances to forward ["127.0.0.1:19447","192.168.0.24:19449"]
/// * json : Json server adress and port of your target. Syntax:[IP:PORT] -> ["127.0.0.1:19446"] or more instances to forward ["127.0.0.1:19446","192.168.0.24:19448"]
/// HINT:If you redirect to "127.0.0.1" (localhost) you could start a second hyperion with another device/led config!
/// Be sure your client(s) is/are listening on the configured ports. The second Hyperion (if used) also needs to be configured! (HyperCon -> External -> Json Server/Proto Server)
"forwarder" :
@ -294,7 +286,7 @@
/// The configuration of the boblight server which enables the boblight remote interface
/// * enable : Enable or disable the boblight server (true/false)
/// * port : Port at which the boblight server is started
/// * priority : Priority of the boblight server (Default=201) HINT: lower value result in HIGHER priority!
/// * priority : Priority of the boblight server (Default=201) HINT: lower value result in HIGHER priority!
"boblightServer" :
{
"enable" : false,
@ -330,10 +322,10 @@
"port" : 8099
},
/// The configuration of the effect engine, contains the following items:
/// * paths : An array with absolute/relative location(s) of directories with effects
/// * disable : An array with effect names that shouldn't be loaded
"effects" :
/// The configuration of the effect engine, contains the following items:
/// * paths : An array with absolute/relative location(s) of directories with effects
/// * disable : An array with effect names that shouldn't be loaded
"effects" :
{
"paths" :
[
@ -346,7 +338,7 @@
"X-Mas"
]
},
/// Recreate and save led layouts made with web config. These values are just helpers for ui, not for Hyperion.
"ledConfig" :
{
@ -363,17 +355,17 @@
"overlap" : 0,
"edgegap" : 0
},
/// The configuration for each individual led. This contains the specification of the area
/// averaged of an input image for each led to determine its color. Each item in the list
/// The configuration for each individual led. This contains the specification of the area
/// averaged of an input image for each led to determine its color. Each item in the list
/// contains the following fields:
/// * index: The index of the led. This determines its location in the string of leds; zero
/// * index: The index of the led. This determines its location in the string of leds; zero
/// being the first led.
/// * hscan: The fractional part of the image along the horizontal used for the averaging
/// * hscan: The fractional part of the image along the horizontal used for the averaging
/// (minimum and maximum inclusive)
/// * vscan: The fractional part of the image along the vertical used for the averaging
/// * vscan: The fractional part of the image along the vertical used for the averaging
/// (minimum and maximum inclusive)
"leds":
[
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -71,14 +71,14 @@
"smoothing-custom-settings" :
{
"type" : "boolean",
"title" : "edt_eff_smooth_custom_title",
"title" : "edt_eff_smooth_custom",
"default" : false,
"propertyOrder" : 7
},
"smoothing-time_ms" :
{
"type" : "integer",
"title" : "edt_eff_smooth_time_ms_title",
"title" : "edt_eff_smooth_time_ms",
"minimum" : 25,
"maximum": 600,
"default" : 200,
@ -93,7 +93,7 @@
"smoothing-updateFrequency" :
{
"type" : "number",
"title" : "edt_eff_smooth_updateFrequency_title",
"title" : "edt_eff_smooth_updateFrequency",
"minimum" : 1.0,
"maximum" : 100.0,
"default" : 25.0,
@ -104,33 +104,6 @@
}
},
"propertyOrder" : 9
},
"smoothing-updateDelay" :
{
"type" : "integer",
"title" : "edt_eff_smooth_updateDelay_title",
"minimum" : 0,
"maximum": 2048,
"default" : 0,
"append" : "edt_append_ms",
"options": {
"dependencies": {
"smoothing-custom-settings": true
}
},
"propertyOrder" : 10
},
"smoothing-pause" :
{
"type" : "boolean",
"title" : "edt_eff_smooth_pause_title",
"default" : false,
"options": {
"dependencies": {
"smoothing-custom-settings": true
}
},
"propertyOrder" : 12
}
},
"additionalProperties": false

View File

@ -98,6 +98,43 @@
}
},
"propertyOrder" : 8
},
"smoothing-custom-settings" :
{
"type" : "boolean",
"title" : "edt_eff_smooth_custom",
"default" : false,
"propertyOrder" : 9
},
"smoothing-time_ms" :
{
"type" : "integer",
"title" : "edt_eff_smooth_time_ms",
"minimum" : 25,
"maximum": 600,
"default" : 200,
"append" : "edt_append_ms",
"options": {
"dependencies": {
"smoothing-custom-settings": true
}
},
"propertyOrder" : 10
},
"smoothing-updateFrequency" :
{
"type" : "number",
"title" : "edt_eff_smooth_updateFrequency",
"minimum" : 1.0,
"maximum" : 100.0,
"default" : 25.0,
"append" : "edt_append_hz",
"options": {
"dependencies": {
"smoothing-custom-settings": true
}
},
"propertyOrder" : 11
}
},
"additionalProperties": false

View File

@ -24,14 +24,14 @@
"smoothing-custom-settings" :
{
"type" : "boolean",
"title" : "edt_eff_smooth_custom_title",
"title" : "edt_eff_smooth_custom",
"default" : false,
"propertyOrder" : 3
},
"smoothing-time_ms" :
{
"type" : "integer",
"title" : "edt_eff_smooth_time_ms_title",
"title" : "edt_eff_smooth_time_ms",
"minimum" : 25,
"maximum": 600,
"default" : 200,
@ -46,7 +46,7 @@
"smoothing-updateFrequency" :
{
"type" : "number",
"title" : "edt_eff_smooth_updateFrequency_title",
"title" : "edt_eff_smooth_updateFrequency",
"minimum" : 1.0,
"maximum" : 100.0,
"default" : 25.0,
@ -57,33 +57,6 @@
}
},
"propertyOrder" : 5
},
"smoothing-updateDelay" :
{
"type" : "integer",
"title" : "edt_eff_smooth_updateDelay_title",
"minimum" : 0,
"maximum": 2048,
"default" : 0,
"append" : "edt_append_ms",
"options": {
"dependencies": {
"smoothing-custom-settings": true
}
},
"propertyOrder" : 6
},
"smoothing-pause" :
{
"type" : "boolean",
"title" : "edt_eff_smooth_pause_title",
"default" : false,
"options": {
"dependencies": {
"smoothing-custom-settings": true
}
},
"propertyOrder" : 7
}
},
"additionalProperties": false

View File

@ -145,6 +145,43 @@
}
},
"propertyOrder" : 12
},
"smoothing-custom-settings" :
{
"type" : "boolean",
"title" : "edt_eff_smooth_custom",
"default" : false,
"propertyOrder" : 13
},
"smoothing-time_ms" :
{
"type" : "integer",
"title" : "edt_eff_smooth_time_ms",
"minimum" : 25,
"maximum": 600,
"default" : 200,
"append" : "edt_append_ms",
"options": {
"dependencies": {
"smoothing-custom-settings": true
}
},
"propertyOrder" : 14
},
"smoothing-updateFrequency" :
{
"type" : "number",
"title" : "edt_eff_smooth_updateFrequency",
"minimum" : 1.0,
"maximum" : 100.0,
"default" : 25.0,
"append" : "edt_append_hz",
"options": {
"dependencies": {
"smoothing-custom-settings": true
}
},
"propertyOrder" : 15
}
},
"additionalProperties": false

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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