mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Merge remote-tracking branch 'hyperion-project/master' into h801
This commit is contained in:
commit
c008f6c1bb
@ -22,6 +22,6 @@ before_install:
|
|||||||
- ./.travis/travis_install.sh
|
- ./.travis/travis_install.sh
|
||||||
script:
|
script:
|
||||||
- ./.travis/travis_build.sh
|
- ./.travis/travis_build.sh
|
||||||
after_success:
|
|
||||||
- ./test/testrunner.sh
|
- ./test/testrunner.sh
|
||||||
|
after_success:
|
||||||
- ./.travis/travis_deploy.sh
|
- ./.travis/travis_deploy.sh
|
@ -4,7 +4,7 @@
|
|||||||
sf_upload()
|
sf_upload()
|
||||||
{
|
{
|
||||||
/usr/bin/expect <<-EOD
|
/usr/bin/expect <<-EOD
|
||||||
spawn scp $1 $2 hyperionsf37@frs.sourceforge.net:/home/frs/project/hyperion-project/dev/$3
|
spawn scp $1 hyperionsf37@frs.sourceforge.net:/home/frs/project/hyperion-project/dev/$2
|
||||||
expect "*(yes/no)*"
|
expect "*(yes/no)*"
|
||||||
send "yes\r"
|
send "yes\r"
|
||||||
expect "*password:*"
|
expect "*password:*"
|
||||||
@ -13,7 +13,7 @@ sf_upload()
|
|||||||
EOD
|
EOD
|
||||||
}
|
}
|
||||||
|
|
||||||
deploylist="hyperion-2.0.0-Linux-x86.deb hyperion-2.0.0-Linux-x86.tar.gz"
|
deploylist="hyperion-2.0.0-Linux-x86.tar.gz"
|
||||||
|
|
||||||
if [[ $TRAVIS_OS_NAME == 'linux' ]]; then
|
if [[ $TRAVIS_OS_NAME == 'linux' ]]; then
|
||||||
cd $TRAVIS_BUILD_DIR/build
|
cd $TRAVIS_BUILD_DIR/build
|
||||||
|
@ -1,15 +1,22 @@
|
|||||||
<div id="wrapper">
|
<div id="wrapper">
|
||||||
<nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom:0">
|
<div class="container" style="margin:20px auto;max-width:600px;">
|
||||||
<div class="navbar-header">
|
<center>
|
||||||
<a class="navbar-brand" href="/"><img src="img/hyperion/hyperionlogo.png" alt="Redefine ambient light!" height="55"></a>
|
<img src="img/hyperion/hyperionlostconnection.png" alt="Redefine ambient light!">
|
||||||
</div>
|
<div>
|
||||||
</nav>
|
<h2>Lost connection to Hyperion service!<h1>
|
||||||
|
<hr>
|
||||||
<div class="container" style="margin-top:50px">
|
<h4>Possible reasons:</h4>
|
||||||
<div class="panel panel-danger" style="box-shadow: 10px 10px 5px #BBBBBB;">
|
<p>1. Hyperion restarts</p>
|
||||||
<div class="panel-heading"><i class="fa fa-exclamation-triangle"></i> Connection to Hyperion Service lost!</div>
|
<p>2. You perform an update</p>
|
||||||
<div class="panel-body"><a href="/">reconnect</a></div>
|
<p>3. An older browser session</p>
|
||||||
|
<p>3. Hyperion isn't running</p>
|
||||||
|
<hr>
|
||||||
|
<i class="fa fa-refresh fa-spin" style="font-size:50px"></i>
|
||||||
|
<h4>This page will be automatically refreshed.</h4>
|
||||||
|
<h4>We reconnect again after Hyperion is available.</h4>
|
||||||
|
<a href="/">If not, click me</a>
|
||||||
</div>
|
</div>
|
||||||
|
</center>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -49,8 +49,15 @@ table.borderless td,table.borderless th{border: none !important;}
|
|||||||
.introd{padding-left:14px;border-left:5px solid #0088cc;}
|
.introd{padding-left:14px;border-left:5px solid #0088cc;}
|
||||||
.introd h4{line-height:25px;}
|
.introd h4{line-height:25px;}
|
||||||
|
|
||||||
|
/*backported bootstrap 4 forms-label alignment*/
|
||||||
|
.col-form-label {
|
||||||
|
padding-top: .5rem;
|
||||||
|
padding-bottom: .5rem;
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.overlay {
|
.overlay {
|
||||||
background-image: url('/img/hyperion/hyperionlogo.png');
|
background-image: url('/img/hyperion/hyperionwhitelogo.png');
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-position: center center;
|
background-position: center center;
|
||||||
background-color: rgba(1, 1, 1, 0.7);
|
background-color: rgba(1, 1, 1, 0.7);
|
||||||
|
BIN
assets/webconfig/img/hyperion/hyperionlostconnection.png
Normal file
BIN
assets/webconfig/img/hyperion/hyperionlostconnection.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
BIN
assets/webconfig/img/hyperion/hyperionwhitelogo.png
Normal file
BIN
assets/webconfig/img/hyperion/hyperionwhitelogo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
@ -98,6 +98,7 @@
|
|||||||
</button>
|
</button>
|
||||||
|
|
||||||
<a class="navbar-brand" href="/"><img src="img/hyperion/hyperionlogo.png" alt="Redefine ambient light!" height="55"></a>
|
<a class="navbar-brand" href="/"><img src="img/hyperion/hyperionlogo.png" alt="Redefine ambient light!" height="55"></a>
|
||||||
|
<a class="navbar-brand" href="/"><img src="img/hyperion/hyperionlostconnection.png" alt="Redefine ambient light!" style="display:none;"></a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!-- /.navbar-header -->
|
<!-- /.navbar-header -->
|
||||||
|
@ -23,20 +23,6 @@ $(hyperion).one("cmd-config-getschema", function(event) {
|
|||||||
parsedConfSchemaJSON = event.response.result;
|
parsedConfSchemaJSON = event.response.result;
|
||||||
|
|
||||||
schema = parsedConfSchemaJSON.properties;
|
schema = parsedConfSchemaJSON.properties;
|
||||||
blackborderdetector = schema.blackborderdetector;
|
|
||||||
color = schema.color;
|
|
||||||
effects = schema.effects;
|
|
||||||
forwarder = schema.forwarder;
|
|
||||||
initialEffect = schema.initialEffect;
|
|
||||||
kodiVideoChecker = schema.kodiVideoChecker;
|
|
||||||
smoothing = schema.smoothing;
|
|
||||||
logger = schema.logger;
|
|
||||||
jsonServer = schema.jsonServer;
|
|
||||||
protoServer = schema.protoServer;
|
|
||||||
boblightServer = schema.boblightServer;
|
|
||||||
udpListener = schema.udpListener;
|
|
||||||
webConfig = schema.webConfig;
|
|
||||||
|
|
||||||
var element = document.getElementById('editor_container');
|
var element = document.getElementById('editor_container');
|
||||||
|
|
||||||
var general_conf_editor = new JSONEditor(element,{
|
var general_conf_editor = new JSONEditor(element,{
|
||||||
@ -50,19 +36,19 @@ $(hyperion).one("cmd-config-getschema", function(event) {
|
|||||||
schema: {
|
schema: {
|
||||||
title:'',
|
title:'',
|
||||||
properties: {
|
properties: {
|
||||||
blackborderdetector,
|
blackborderdetector: schema.blackborderdetector,
|
||||||
color,
|
color : schema.color,
|
||||||
effects,
|
effects : schema.effects,
|
||||||
forwarder,
|
forwarder : schema.forwarder,
|
||||||
initialEffect,
|
initialEffect : schema.initialEffect,
|
||||||
kodiVideoChecker,
|
kodiVideoChecker : schema.kodiVideoChecker,
|
||||||
smoothing,
|
smoothing : schema.smoothing,
|
||||||
logger,
|
logger : schema.logger,
|
||||||
jsonServer,
|
jsonServer : schema.jsonServer,
|
||||||
protoServer,
|
protoServer : schema.protoServer,
|
||||||
boblightServer,
|
boblightServer : schema.boblightServer,
|
||||||
udpListener,
|
udpListener : schema.udpListener,
|
||||||
webConfig
|
webConfig : schema.webConfig
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -80,7 +66,7 @@ $(hyperion).one("cmd-config-getschema", function(event) {
|
|||||||
// });
|
// });
|
||||||
|
|
||||||
//Alternative Function with submit button to get Values
|
//Alternative Function with submit button to get Values
|
||||||
$('btn_submit').off().on('click',function() {
|
$('#btn_submit').off().on('click',function() {
|
||||||
console.log(general_conf_editor.getValue());
|
console.log(general_conf_editor.getValue());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -20,15 +20,14 @@ function removeAdvanced(obj,searchStack)
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
var grabber_conf_editor = null;
|
||||||
$(hyperion).one("cmd-config-getschema", function(event) {
|
$(hyperion).one("cmd-config-getschema", function(event) {
|
||||||
parsedConfSchemaJSON = event.response.result;
|
parsedConfSchemaJSON = event.response.result;
|
||||||
schema = parsedConfSchemaJSON.properties;
|
schema = parsedConfSchemaJSON.properties;
|
||||||
schema_framegrabber = schema.framegrabber;
|
|
||||||
schema_grabberv4l2 = schema["grabber-v4l2"];
|
|
||||||
|
|
||||||
var element = document.getElementById('editor_container');
|
var element = document.getElementById('editor_container');
|
||||||
|
|
||||||
var grabber_conf_editor = new JSONEditor(element,{
|
grabber_conf_editor = new JSONEditor(element,{
|
||||||
theme: 'bootstrap3',
|
theme: 'bootstrap3',
|
||||||
iconlib: "fontawesome4",
|
iconlib: "fontawesome4",
|
||||||
disable_collapse: 'true',
|
disable_collapse: 'true',
|
||||||
@ -39,8 +38,8 @@ $(hyperion).one("cmd-config-getschema", function(event) {
|
|||||||
schema: {
|
schema: {
|
||||||
title:'',
|
title:'',
|
||||||
properties: {
|
properties: {
|
||||||
schema_framegrabber,
|
framegrabber: schema.framegrabber,
|
||||||
schema_grabberv4l2,
|
grabberV4L2 : schema["grabberV4L2"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -59,7 +58,7 @@ $(document).ready( function() {
|
|||||||
|
|
||||||
document.getElementById('btn_submit').addEventListener('click',function() {
|
document.getElementById('btn_submit').addEventListener('click',function() {
|
||||||
// Get the value from the editor
|
// Get the value from the editor
|
||||||
//console.log(general_conf_editor.getValue());
|
console.log(grabber_conf_editor.getValue());
|
||||||
});
|
});
|
||||||
// $("[type='checkbox']").bootstrapSwitch();
|
// $("[type='checkbox']").bootstrapSwitch();
|
||||||
});
|
});
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
$(document).ready( function() {
|
$(document).ready( function() {
|
||||||
$("#main-nav").hide();
|
$("#main-nav").hide();
|
||||||
$("#page-content").hide();
|
|
||||||
$("#loading_overlay").addClass("overlay");
|
$("#loading_overlay").addClass("overlay");
|
||||||
loadContentTo("#container_connection_lost","connection_lost");
|
loadContentTo("#container_connection_lost","connection_lost");
|
||||||
initWebSocket();
|
initWebSocket();
|
||||||
@ -62,7 +61,6 @@ $(document).ready( function() {
|
|||||||
});
|
});
|
||||||
$("#loading_overlay").removeClass("overlay");
|
$("#loading_overlay").removeClass("overlay");
|
||||||
$("#main-nav").show('slide', {direction: 'left'}, 1000);
|
$("#main-nav").show('slide', {direction: 'left'}, 1000);
|
||||||
$("#page-content").show('slide', {direction: 'down'}, 2000);
|
|
||||||
|
|
||||||
}); // end cmd-serverinfo
|
}); // end cmd-serverinfo
|
||||||
|
|
||||||
|
@ -153,8 +153,8 @@ $(document).ready(function() {
|
|||||||
schema: {
|
schema: {
|
||||||
title:' ',
|
title:' ',
|
||||||
properties: {
|
properties: {
|
||||||
generalOptions,
|
generalOptions : generalOptions,
|
||||||
specificOptions,
|
specificOptions : specificOptions,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -96,6 +96,7 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
$('#cp2').colorpicker().on('changeColor', function(e) {
|
$('#cp2').colorpicker().on('changeColor', function(e) {
|
||||||
color = e.color.toRGB();
|
color = e.color.toRGB();
|
||||||
|
$("#effect_select").val("__none__");
|
||||||
requestSetColor(color.r, color.g, color.b);
|
requestSetColor(color.r, color.g, color.b);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -106,7 +107,10 @@ $(document).ready(function() {
|
|||||||
efx = $(this).val();
|
efx = $(this).val();
|
||||||
if(efx != "__none__")
|
if(efx != "__none__")
|
||||||
{
|
{
|
||||||
requestPlayEffect(efx);
|
requestPriorityClear();
|
||||||
|
$(hyperion).one("cmd-clear", function(event) {
|
||||||
|
setTimeout(function() {requestPlayEffect(efx)}, 100);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1938,6 +1938,7 @@ JSONEditor.defaults.editors.string = JSONEditor.AbstractEditor.extend({
|
|||||||
var self = this, i;
|
var self = this, i;
|
||||||
if(!this.options.compact) this.header = this.label = this.theme.getFormInputLabel(this.getTitle());
|
if(!this.options.compact) this.header = this.label = this.theme.getFormInputLabel(this.getTitle());
|
||||||
if(this.schema.description) this.description = this.theme.getFormInputDescription(this.schema.description);
|
if(this.schema.description) this.description = this.theme.getFormInputDescription(this.schema.description);
|
||||||
|
if(this.schema.append) this.append = this.theme.getFormInputAppend(this.schema.append);
|
||||||
|
|
||||||
this.format = this.schema.format;
|
this.format = this.schema.format;
|
||||||
if(!this.format && this.schema.media && this.schema.media.type) {
|
if(!this.format && this.schema.media && this.schema.media.type) {
|
||||||
@ -2122,7 +2123,7 @@ JSONEditor.defaults.editors.string = JSONEditor.AbstractEditor.extend({
|
|||||||
|
|
||||||
if(this.format) this.input.setAttribute('data-schemaformat',this.format);
|
if(this.format) this.input.setAttribute('data-schemaformat',this.format);
|
||||||
|
|
||||||
this.control = this.theme.getFormControl(this.label, this.input, this.description);
|
this.control = this.theme.getFormControl(this.label, this.input, this.description, this.append);
|
||||||
this.container.appendChild(this.control);
|
this.container.appendChild(this.control);
|
||||||
|
|
||||||
// Any special formatting that needs to happen after the input is added to the dom
|
// Any special formatting that needs to happen after the input is added to the dom
|
||||||
@ -2717,6 +2718,12 @@ JSONEditor.defaults.editors.object = JSONEditor.AbstractEditor.extend({
|
|||||||
this.container.appendChild(this.description);
|
this.container.appendChild(this.description);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Appends
|
||||||
|
if(this.schema.append) {
|
||||||
|
this.append = this.theme.getAppend(this.schema.append);
|
||||||
|
this.container.appendChild(this.append);
|
||||||
|
}
|
||||||
|
|
||||||
// Validation error placeholder area
|
// Validation error placeholder area
|
||||||
this.error_holder = document.createElement('div');
|
this.error_holder = document.createElement('div');
|
||||||
this.container.appendChild(this.error_holder);
|
this.container.appendChild(this.error_holder);
|
||||||
@ -3313,6 +3320,10 @@ JSONEditor.defaults.editors.array = JSONEditor.AbstractEditor.extend({
|
|||||||
if(this.schema.description) {
|
if(this.schema.description) {
|
||||||
this.description = this.theme.getDescription(this.schema.description);
|
this.description = this.theme.getDescription(this.schema.description);
|
||||||
this.container.appendChild(this.description);
|
this.container.appendChild(this.description);
|
||||||
|
}
|
||||||
|
if(this.schema.append) {
|
||||||
|
this.append = this.theme.getAppend(this.schema.append);
|
||||||
|
this.container.appendChild(this.append);
|
||||||
}
|
}
|
||||||
this.error_holder = document.createElement('div');
|
this.error_holder = document.createElement('div');
|
||||||
this.container.appendChild(this.error_holder);
|
this.container.appendChild(this.error_holder);
|
||||||
@ -3988,6 +3999,10 @@ JSONEditor.defaults.editors.table = JSONEditor.defaults.editors.array.extend({
|
|||||||
if(this.schema.description) {
|
if(this.schema.description) {
|
||||||
this.description = this.theme.getDescription(this.schema.description);
|
this.description = this.theme.getDescription(this.schema.description);
|
||||||
this.container.appendChild(this.description);
|
this.container.appendChild(this.description);
|
||||||
|
}
|
||||||
|
if(this.schema.append) {
|
||||||
|
this.append = this.theme.getAppend(this.schema.append);
|
||||||
|
this.container.appendChild(this.append);
|
||||||
}
|
}
|
||||||
this.panel = this.theme.getIndentedPanel();
|
this.panel = this.theme.getIndentedPanel();
|
||||||
this.container.appendChild(this.panel);
|
this.container.appendChild(this.panel);
|
||||||
@ -4974,6 +4989,7 @@ JSONEditor.defaults.editors.select = JSONEditor.AbstractEditor.extend({
|
|||||||
var self = this;
|
var self = this;
|
||||||
if(!this.options.compact) this.header = this.label = this.theme.getFormInputLabel(this.getTitle());
|
if(!this.options.compact) this.header = this.label = this.theme.getFormInputLabel(this.getTitle());
|
||||||
if(this.schema.description) this.description = this.theme.getFormInputDescription(this.schema.description);
|
if(this.schema.description) this.description = this.theme.getFormInputDescription(this.schema.description);
|
||||||
|
if(this.schema.append) this.append = this.theme.getFormInputAppend(this.schema.append);
|
||||||
|
|
||||||
if(this.options.compact) this.container.className += ' compact';
|
if(this.options.compact) this.container.className += ' compact';
|
||||||
|
|
||||||
@ -5320,6 +5336,7 @@ JSONEditor.defaults.editors.selectize = JSONEditor.AbstractEditor.extend({
|
|||||||
var self = this;
|
var self = this;
|
||||||
if(!this.options.compact) this.header = this.label = this.theme.getFormInputLabel(this.getTitle());
|
if(!this.options.compact) this.header = this.label = this.theme.getFormInputLabel(this.getTitle());
|
||||||
if(this.schema.description) this.description = this.theme.getFormInputDescription(this.schema.description);
|
if(this.schema.description) this.description = this.theme.getFormInputDescription(this.schema.description);
|
||||||
|
if(this.schema.append) this.append = this.theme.getFormInputAppend(this.schema.append);
|
||||||
|
|
||||||
if(this.options.compact) this.container.className += ' compact';
|
if(this.options.compact) this.container.className += ' compact';
|
||||||
|
|
||||||
@ -5547,6 +5564,7 @@ JSONEditor.defaults.editors.multiselect = JSONEditor.AbstractEditor.extend({
|
|||||||
var self = this, i;
|
var self = this, i;
|
||||||
if(!this.options.compact) this.header = this.label = this.theme.getFormInputLabel(this.getTitle());
|
if(!this.options.compact) this.header = this.label = this.theme.getFormInputLabel(this.getTitle());
|
||||||
if(this.schema.description) this.description = this.theme.getFormInputDescription(this.schema.description);
|
if(this.schema.description) this.description = this.theme.getFormInputDescription(this.schema.description);
|
||||||
|
if(this.schema.append) this.append = this.theme.getFormInputAppend(this.schema.append);
|
||||||
|
|
||||||
if((!this.schema.format && this.option_keys.length < 8) || this.schema.format === "checkbox") {
|
if((!this.schema.format && this.option_keys.length < 8) || this.schema.format === "checkbox") {
|
||||||
this.input_type = 'checkboxes';
|
this.input_type = 'checkboxes';
|
||||||
@ -6025,6 +6043,9 @@ JSONEditor.defaults.editors.arraySelectize = JSONEditor.AbstractEditor.extend({
|
|||||||
if(this.schema.description) {
|
if(this.schema.description) {
|
||||||
this.description = this.theme.getDescription(this.schema.description);
|
this.description = this.theme.getDescription(this.schema.description);
|
||||||
}
|
}
|
||||||
|
if(this.schema.append) {
|
||||||
|
this.append = this.theme.getAppend(this.schema.append);
|
||||||
|
}
|
||||||
|
|
||||||
this.input = document.createElement('select');
|
this.input = document.createElement('select');
|
||||||
this.input.setAttribute('multiple', 'multiple');
|
this.input.setAttribute('multiple', 'multiple');
|
||||||
@ -6307,6 +6328,11 @@ JSONEditor.AbstractTheme = Class.extend({
|
|||||||
el.innerHTML = text;
|
el.innerHTML = text;
|
||||||
return el;
|
return el;
|
||||||
},
|
},
|
||||||
|
getAppend: function(text) {
|
||||||
|
var el = document.createElement('p');
|
||||||
|
el.innerHTML = text;
|
||||||
|
return el;
|
||||||
|
},
|
||||||
getCheckboxDescription: function(text) {
|
getCheckboxDescription: function(text) {
|
||||||
return this.getDescription(text);
|
return this.getDescription(text);
|
||||||
},
|
},
|
||||||
@ -6518,7 +6544,13 @@ JSONEditor.defaults.themes.bootstrap2 = JSONEditor.AbstractTheme.extend({
|
|||||||
el.textContent = text;
|
el.textContent = text;
|
||||||
return el;
|
return el;
|
||||||
},
|
},
|
||||||
getFormControl: function(label, input, description) {
|
getFormInputAppend: function(text) {
|
||||||
|
var el = document.createElement('div');
|
||||||
|
el.className = 'input-group-addon';
|
||||||
|
el.textContent = text;
|
||||||
|
return el;
|
||||||
|
},
|
||||||
|
getFormControl: function(label, input, description, append) {
|
||||||
var ret = document.createElement('div');
|
var ret = document.createElement('div');
|
||||||
ret.className = 'control-group';
|
ret.className = 'control-group';
|
||||||
|
|
||||||
@ -6676,26 +6708,35 @@ JSONEditor.defaults.themes.bootstrap3 = JSONEditor.AbstractTheme.extend({
|
|||||||
}
|
}
|
||||||
return el;
|
return el;
|
||||||
},
|
},
|
||||||
getFormControl: function(label, input, description) {
|
getFormControl: function(label, input, description, append) {
|
||||||
var group = document.createElement('div');
|
var group = document.createElement('div');
|
||||||
|
var subgroup = document.createElement('div');
|
||||||
|
|
||||||
if(label && input.type === 'checkbox') {
|
if (append){
|
||||||
group.className += ' checkbox';
|
group.className += ' form-group';
|
||||||
label.appendChild(input);
|
if(label) {
|
||||||
label.style.fontSize = '14px';
|
label.className += ' col-form-label col-md-2';
|
||||||
group.style.marginTop = '0';
|
|
||||||
group.appendChild(label);
|
group.appendChild(label);
|
||||||
input.style.position = 'relative';
|
}
|
||||||
input.style.cssFloat = 'left';
|
group.appendChild(subgroup);
|
||||||
|
subgroup.className += 'col-md-10 input-group';
|
||||||
|
subgroup.appendChild(input);
|
||||||
|
subgroup.appendChild(append);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
group.className += ' form-group';
|
group.className += ' form-group';
|
||||||
if(label) {
|
if(label) {
|
||||||
label.className += ' control-label';
|
label.className += ' col-form-label col-md-2';
|
||||||
group.appendChild(label);
|
group.appendChild(label);
|
||||||
}
|
}
|
||||||
group.appendChild(input);
|
group.appendChild(subgroup);
|
||||||
|
subgroup.className += ' input-group col-md-10';
|
||||||
|
subgroup.appendChild(input);
|
||||||
|
if (input.type === 'checkbox'){
|
||||||
|
label.style.fontWeight = 'bold';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(description) group.appendChild(description);
|
if(description) group.appendChild(description);
|
||||||
|
|
||||||
@ -6713,6 +6754,12 @@ JSONEditor.defaults.themes.bootstrap3 = JSONEditor.AbstractTheme.extend({
|
|||||||
el.innerHTML = text;
|
el.innerHTML = text;
|
||||||
return el;
|
return el;
|
||||||
},
|
},
|
||||||
|
getFormInputAppend: function(text) {
|
||||||
|
var el = document.createElement('div');
|
||||||
|
el.className = 'input-group-addon';
|
||||||
|
el.textContent = text;
|
||||||
|
return el;
|
||||||
|
},
|
||||||
getHeaderButtonHolder: function() {
|
getHeaderButtonHolder: function() {
|
||||||
var el = this.getButtonHolder();
|
var el = this.getButtonHolder();
|
||||||
el.style.marginLeft = '10px';
|
el.style.marginLeft = '10px';
|
||||||
|
@ -16,8 +16,6 @@ echo create $outfile
|
|||||||
tar --create --verbose --gzip --absolute-names --show-transformed-names \
|
tar --create --verbose --gzip --absolute-names --show-transformed-names \
|
||||||
--file "$outfile" \
|
--file "$outfile" \
|
||||||
--transform "s:$builddir/bin/:hyperion/bin/:" \
|
--transform "s:$builddir/bin/:hyperion/bin/:" \
|
||||||
--transform "s:$repodir/effects/:hyperion/effects/:" \
|
|
||||||
--transform "s:$repodir/config/:hyperion/config/:" \
|
|
||||||
--transform "s:$repodir/bin/hyperion.init.sh:hyperion/init.d/hyperion.init.sh:" \
|
--transform "s:$repodir/bin/hyperion.init.sh:hyperion/init.d/hyperion.init.sh:" \
|
||||||
--transform "s://:/:g" \
|
--transform "s://:/:g" \
|
||||||
"$builddir/bin/hyperiond" \
|
"$builddir/bin/hyperiond" \
|
||||||
@ -25,6 +23,4 @@ tar --create --verbose --gzip --absolute-names --show-transformed-names \
|
|||||||
"$builddir/bin/hyperion-v4l2" \
|
"$builddir/bin/hyperion-v4l2" \
|
||||||
"$builddir/bin/gpio2spi" \
|
"$builddir/bin/gpio2spi" \
|
||||||
"$builddir/bin/dispmanx2png" \
|
"$builddir/bin/dispmanx2png" \
|
||||||
"$repodir/effects/"* \
|
|
||||||
"$repodir/bin/hyperion.init.sh" \
|
"$repodir/bin/hyperion.init.sh" \
|
||||||
"$repodir/config/hyperion.config.json"
|
|
||||||
|
@ -20,8 +20,12 @@ install_file()
|
|||||||
echo "--- hyperion ambient light postinstall ---"
|
echo "--- hyperion ambient light postinstall ---"
|
||||||
echo "- install configuration template"
|
echo "- install configuration template"
|
||||||
mkdir -p /etc/hyperion
|
mkdir -p /etc/hyperion
|
||||||
install_file /usr/share/hyperion/config/hyperion.config.json.default /etc/hyperion/hyperion.config.json
|
|
||||||
|
|
||||||
|
if [ ! -e "/etc/hyperion/hyperion.config.json" ]
|
||||||
|
then
|
||||||
|
echo "install default config to /etc/hyperion"
|
||||||
|
/usr/bin/hyperiond --export-config /etc/hyperion/hyperion.config.json
|
||||||
|
fi
|
||||||
|
|
||||||
HYPERION_RUNNING=false
|
HYPERION_RUNNING=false
|
||||||
pgrep hyperiond > /dev/null 2>&1 && HYPERION_RUNNING=true
|
pgrep hyperiond > /dev/null 2>&1 && HYPERION_RUNNING=true
|
||||||
|
@ -168,7 +168,7 @@
|
|||||||
/// * redSignalThreshold : Signal threshold for the red channel between 0.0 and 1.0 [default=0.0]
|
/// * redSignalThreshold : Signal threshold for the red channel between 0.0 and 1.0 [default=0.0]
|
||||||
/// * greenSignalThreshold : Signal threshold for the green channel between 0.0 and 1.0 [default=0.0]
|
/// * greenSignalThreshold : Signal threshold for the green channel between 0.0 and 1.0 [default=0.0]
|
||||||
/// * blueSignalThreshold : Signal threshold for the blue channel between 0.0 and 1.0 [default=0.0]
|
/// * blueSignalThreshold : Signal threshold for the blue channel between 0.0 and 1.0 [default=0.0]
|
||||||
"grabber-v4l2" :
|
"grabberV4L2" :
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"enable" : false,
|
"enable" : false,
|
||||||
@ -364,7 +364,7 @@
|
|||||||
[
|
[
|
||||||
"/storage/hyperion/effects",
|
"/storage/hyperion/effects",
|
||||||
"/usr/share/hyperion/effects"
|
"/usr/share/hyperion/effects"
|
||||||
]
|
],
|
||||||
"disable" :
|
"disable" :
|
||||||
[
|
[
|
||||||
"Rainbow swirl",
|
"Rainbow swirl",
|
||||||
|
@ -96,7 +96,7 @@
|
|||||||
"continuousOutput" : true
|
"continuousOutput" : true
|
||||||
},
|
},
|
||||||
|
|
||||||
"grabber-v4l2" :
|
"grabberV4L2" :
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"enable" : false,
|
"enable" : false,
|
||||||
@ -194,7 +194,7 @@
|
|||||||
|
|
||||||
"webConfig" :
|
"webConfig" :
|
||||||
{
|
{
|
||||||
"enable" : true,
|
"enable" : true
|
||||||
},
|
},
|
||||||
|
|
||||||
"effects" :
|
"effects" :
|
||||||
|
@ -3,8 +3,9 @@
|
|||||||
"script" : "rainbow-swirl.py",
|
"script" : "rainbow-swirl.py",
|
||||||
"args" :
|
"args" :
|
||||||
{
|
{
|
||||||
"rotation-time" : 3.0,
|
"rotation-time" : 4.0,
|
||||||
"brightness" : 1.0,
|
"center_x" : 0.5,
|
||||||
|
"center_y" : 0.5,
|
||||||
"reverse" : false
|
"reverse" : false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,8 @@
|
|||||||
"args" :
|
"args" :
|
||||||
{
|
{
|
||||||
"rotation-time" : 20.0,
|
"rotation-time" : 20.0,
|
||||||
"brightness" : 1.0,
|
"center_x" : 0.5,
|
||||||
|
"center_y" : 0.5,
|
||||||
"reverse" : false
|
"reverse" : false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,39 +1,37 @@
|
|||||||
import hyperion
|
import hyperion, time
|
||||||
import time
|
|
||||||
import colorsys
|
|
||||||
|
|
||||||
# Get the parameters
|
# Get the parameters
|
||||||
rotationTime = float(hyperion.args.get('rotation-time', 3.0))
|
rotationTime = float(hyperion.args.get('rotation-time', 3.0))
|
||||||
brightness = float(hyperion.args.get('brightness', 1.0))
|
|
||||||
saturation = float(hyperion.args.get('saturation', 1.0))
|
|
||||||
reverse = bool(hyperion.args.get('reverse', False))
|
reverse = bool(hyperion.args.get('reverse', False))
|
||||||
|
centerX = float(hyperion.args.get('center_x', 0.5))
|
||||||
|
centerY = float(hyperion.args.get('center_y', 0.5))
|
||||||
|
|
||||||
# Check parameters
|
sleepTime = max(0.1, rotationTime) / 360
|
||||||
rotationTime = max(0.1, rotationTime)
|
angle = 0
|
||||||
brightness = max(0.0, min(brightness, 1.0))
|
centerX = int(round(hyperion.imageWidth)*centerX)
|
||||||
saturation = max(0.0, min(saturation, 1.0))
|
centerY = int(round(float(hyperion.imageHeight)*centerY))
|
||||||
|
increment = -1 if reverse else 1
|
||||||
|
|
||||||
# Initialize the led data
|
# table of stop colors for rainbow gradient, first is the position, next rgb, all values 0-255
|
||||||
ledData = bytearray()
|
rainbowColors = bytearray([
|
||||||
for i in range(hyperion.ledCount):
|
0 ,255,0 ,0,
|
||||||
hue = float(i)/hyperion.ledCount
|
25 ,255,230,0,
|
||||||
rgb = colorsys.hsv_to_rgb(hue, saturation, brightness)
|
63 ,255,255,0,
|
||||||
ledData += bytearray((int(255*rgb[0]), int(255*rgb[1]), int(255*rgb[2])))
|
100,0 ,255,0,
|
||||||
|
127,0 ,255,200,
|
||||||
|
159,0 ,255,255,
|
||||||
|
191,0 ,0 ,255,
|
||||||
|
224,255,0 ,255,
|
||||||
|
255,255,0 ,127,
|
||||||
|
])
|
||||||
|
|
||||||
# Calculate the sleep time and rotation increment
|
# effect loop
|
||||||
increment = 3
|
|
||||||
sleepTime = rotationTime / hyperion.ledCount
|
|
||||||
while sleepTime < 0.05:
|
|
||||||
increment *= 2
|
|
||||||
sleepTime *= 2
|
|
||||||
increment %= hyperion.ledCount
|
|
||||||
|
|
||||||
# Switch direction if needed
|
|
||||||
if reverse:
|
|
||||||
increment = -increment
|
|
||||||
|
|
||||||
# Start the write data loop
|
|
||||||
while not hyperion.abort():
|
while not hyperion.abort():
|
||||||
hyperion.setColor(ledData)
|
angle += increment
|
||||||
ledData = ledData[-increment:] + ledData[:-increment]
|
if angle > 360: angle=0
|
||||||
|
if angle < 0: angle=360
|
||||||
|
|
||||||
|
hyperion.imageCanonicalGradient(centerX, centerY, angle, rainbowColors)
|
||||||
|
|
||||||
|
hyperion.imageShow()
|
||||||
time.sleep(sleepTime)
|
time.sleep(sleepTime)
|
||||||
|
@ -42,6 +42,7 @@ public:
|
|||||||
QString value(Parser &parser);
|
QString value(Parser &parser);
|
||||||
std::string getStdString(Parser &parser);
|
std::string getStdString(Parser &parser);
|
||||||
std::wstring getStdWString(Parser &parser);
|
std::wstring getStdWString(Parser &parser);
|
||||||
|
const char* getCString(Parser &parser);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#ifndef HYPERION_COMMANDLINEPARSER_H
|
#pragma once
|
||||||
#define HYPERION_COMMANDLINEPARSER_H
|
|
||||||
|
|
||||||
#include <QtCore>
|
#include <QtCore>
|
||||||
#include <QtGui>
|
#include <QtGui>
|
||||||
@ -71,50 +70,75 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
Parser(QString description=QString())
|
Parser(QString description=QString())
|
||||||
{if(description.size())setApplicationDescription(description);};
|
{
|
||||||
|
if(description.size())setApplicationDescription(description);
|
||||||
|
};
|
||||||
|
|
||||||
QCommandLineOption addHelpOption()
|
QCommandLineOption addHelpOption()
|
||||||
{ return _parser.addHelpOption(); }
|
{
|
||||||
|
return _parser.addHelpOption();
|
||||||
|
};
|
||||||
|
|
||||||
bool addOption(Option &option);
|
bool addOption(Option &option);
|
||||||
bool addOption(Option *option);
|
bool addOption(Option *option);
|
||||||
void addPositionalArgument(const QString &name, const QString &description, const QString &syntax = QString())
|
void addPositionalArgument(const QString &name, const QString &description, const QString &syntax = QString())
|
||||||
{ _parser.addPositionalArgument(name, description, syntax); }
|
{
|
||||||
|
_parser.addPositionalArgument(name, description, syntax);
|
||||||
|
};
|
||||||
|
|
||||||
QCommandLineOption addVersionOption()
|
QCommandLineOption addVersionOption()
|
||||||
{ return _parser.addVersionOption(); }
|
{
|
||||||
|
return _parser.addVersionOption();
|
||||||
|
};
|
||||||
|
|
||||||
QString applicationDescription() const
|
QString applicationDescription() const
|
||||||
{ return _parser.applicationDescription(); }
|
{ return _parser.applicationDescription(); }
|
||||||
|
|
||||||
void clearPositionalArguments()
|
void clearPositionalArguments()
|
||||||
{ _parser.clearPositionalArguments(); }
|
{ _parser.clearPositionalArguments(); }
|
||||||
|
|
||||||
QString helpText() const
|
QString helpText() const
|
||||||
{ return _parser.helpText(); }
|
{ return _parser.helpText(); }
|
||||||
|
|
||||||
bool isSet(const QString &name) const
|
bool isSet(const QString &name) const
|
||||||
{ return _parser.isSet(name); }
|
{ return _parser.isSet(name); }
|
||||||
|
|
||||||
bool isSet(const Option &option) const
|
bool isSet(const Option &option) const
|
||||||
{ return _parser.isSet(option); }
|
{ return _parser.isSet(option); }
|
||||||
|
|
||||||
bool isSet(const Option *option) const
|
bool isSet(const Option *option) const
|
||||||
{ return _parser.isSet(*option); }
|
{ return _parser.isSet(*option); }
|
||||||
|
|
||||||
QStringList optionNames() const
|
QStringList optionNames() const
|
||||||
{ return _parser.optionNames(); }
|
{ return _parser.optionNames(); }
|
||||||
|
|
||||||
QStringList positionalArguments() const
|
QStringList positionalArguments() const
|
||||||
{ return _parser.positionalArguments(); }
|
{ return _parser.positionalArguments(); }
|
||||||
|
|
||||||
void setApplicationDescription(const QString &description)
|
void setApplicationDescription(const QString &description)
|
||||||
{ _parser.setApplicationDescription(description); }
|
{ _parser.setApplicationDescription(description); }
|
||||||
|
|
||||||
void setSingleDashWordOptionMode(QCommandLineParser::SingleDashWordOptionMode singleDashWordOptionMode)
|
void setSingleDashWordOptionMode(QCommandLineParser::SingleDashWordOptionMode singleDashWordOptionMode)
|
||||||
{ _parser.setSingleDashWordOptionMode(singleDashWordOptionMode); }
|
{ _parser.setSingleDashWordOptionMode(singleDashWordOptionMode); }
|
||||||
|
|
||||||
void showHelp(int exitCode = 0)
|
void showHelp(int exitCode = 0)
|
||||||
{ _parser.showHelp(exitCode); }
|
{ _parser.showHelp(exitCode); }
|
||||||
|
|
||||||
QStringList unknownOptionNames() const
|
QStringList unknownOptionNames() const
|
||||||
{ return _parser.unknownOptionNames(); }
|
{ return _parser.unknownOptionNames(); }
|
||||||
|
|
||||||
QString value(const QString &optionName) const
|
QString value(const QString &optionName) const
|
||||||
{ return _parser.value(optionName); }
|
{ return _parser.value(optionName); }
|
||||||
|
|
||||||
QString value(const Option &option) const
|
QString value(const Option &option) const
|
||||||
{ return _parser.value(option); }
|
{ return _parser.value(option); }
|
||||||
|
|
||||||
QStringList values(const QString &optionName) const
|
QStringList values(const QString &optionName) const
|
||||||
{ return _parser.values(optionName); }
|
{ return _parser.values(optionName); }
|
||||||
|
|
||||||
QStringList values(const Option &option) const
|
QStringList values(const Option &option) const
|
||||||
{ return _parser.values(option); }
|
{ return _parser.values(option); }
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //HYPERION_COMMANDLINEPARSER_H
|
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
// QT includes
|
// QT includes
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
#include <QSize>
|
||||||
|
|
||||||
// hyperion-utils includes
|
// hyperion-utils includes
|
||||||
#include <utils/Image.h>
|
#include <utils/Image.h>
|
||||||
@ -86,6 +87,8 @@ public:
|
|||||||
///
|
///
|
||||||
unsigned getLedCount() const;
|
unsigned getLedCount() const;
|
||||||
|
|
||||||
|
QSize getLedGridSize() const { return _ledGridSize; }
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the current priority
|
/// Returns the current priority
|
||||||
///
|
///
|
||||||
@ -292,6 +295,7 @@ public:
|
|||||||
|
|
||||||
static LinearColorSmoothing * createColorSmoothing(const Json::Value & smoothingConfig, LedDevice* leddevice);
|
static LinearColorSmoothing * createColorSmoothing(const Json::Value & smoothingConfig, LedDevice* leddevice);
|
||||||
static MessageForwarder * createMessageForwarder(const Json::Value & forwarderConfig);
|
static MessageForwarder * createMessageForwarder(const Json::Value & forwarderConfig);
|
||||||
|
static QSize getLedLayoutGridSize(const Json::Value& ledsConfig);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
/// Signal which is emitted when a priority channel is actively cleared
|
/// Signal which is emitted when a priority channel is actively cleared
|
||||||
@ -390,4 +394,6 @@ private:
|
|||||||
int _currentSourcePriority;
|
int _currentSourcePriority;
|
||||||
|
|
||||||
QByteArray _configHash;
|
QByteArray _configHash;
|
||||||
|
|
||||||
|
QSize _ledGridSize;
|
||||||
};
|
};
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace FileUtils {
|
namespace FileUtils {
|
||||||
|
|
||||||
std::string getBaseName( std::string sourceFile);
|
std::string getBaseName( std::string sourceFile);
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace Process {
|
namespace Process {
|
||||||
|
@ -24,3 +24,8 @@ std::wstring Option::getStdWString(Parser &parser)
|
|||||||
return value(parser).toStdWString();
|
return value(parser).toStdWString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char* Option::getCString(Parser &parser)
|
||||||
|
{
|
||||||
|
return value(parser).toLocal8Bit().constData();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -48,6 +48,8 @@ add_library(effectengine
|
|||||||
${EffectEngineSOURCES}
|
${EffectEngineSOURCES}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
qt5_use_modules(effectengine Core Gui)
|
||||||
|
|
||||||
target_link_libraries(effectengine
|
target_link_libraries(effectengine
|
||||||
hyperion
|
hyperion
|
||||||
jsoncpp
|
jsoncpp
|
||||||
|
@ -8,16 +8,27 @@
|
|||||||
// Qt includes
|
// Qt includes
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
#include <Qt>
|
||||||
|
#include <QLinearGradient>
|
||||||
|
#include <QConicalGradient>
|
||||||
|
#include <QRadialGradient>
|
||||||
|
#include <QRect>
|
||||||
|
|
||||||
// effect engin eincludes
|
// effect engin eincludes
|
||||||
#include "Effect.h"
|
#include "Effect.h"
|
||||||
#include <utils/Logger.h>
|
#include <utils/Logger.h>
|
||||||
|
#include <hyperion/Hyperion.h>
|
||||||
|
|
||||||
// Python method table
|
// Python method table
|
||||||
PyMethodDef Effect::effectMethods[] = {
|
PyMethodDef Effect::effectMethods[] = {
|
||||||
{"setColor", Effect::wrapSetColor, METH_VARARGS, "Set a new color for the leds."},
|
{"setColor", Effect::wrapSetColor, METH_VARARGS, "Set a new color for the leds."},
|
||||||
{"setImage", Effect::wrapSetImage, METH_VARARGS, "Set a new image to process and determine new led colors."},
|
{"setImage", Effect::wrapSetImage, METH_VARARGS, "Set a new image to process and determine new led colors."},
|
||||||
{"abort", Effect::wrapAbort, METH_NOARGS, "Check if the effect should abort execution."},
|
{"abort", Effect::wrapAbort, METH_NOARGS, "Check if the effect should abort execution."},
|
||||||
|
{"imageShow", Effect::wrapImageShow, METH_NOARGS, "set current effect image to hyperion core."},
|
||||||
|
{"imageCanonicalGradient", Effect::wrapImageCanonicalGradient, METH_VARARGS, ""},
|
||||||
|
{"imageRadialGradient" , Effect::wrapImageRadialGradient, METH_VARARGS, ""},
|
||||||
|
// {"imageSetPixel",Effect::wrapImageShow, METH_VARARGS, "set pixel color of image"},
|
||||||
|
// {"imageGetPixel",Effect::wrapImageShow, METH_VARARGS, "get pixel color of image"},
|
||||||
{NULL, NULL, 0, NULL}
|
{NULL, NULL, 0, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -70,6 +81,12 @@ Effect::Effect(PyThreadState * mainThreadState, int priority, int timeout, const
|
|||||||
// disable the black border detector for effects
|
// disable the black border detector for effects
|
||||||
_imageProcessor->enableBlackBorderDetector(false);
|
_imageProcessor->enableBlackBorderDetector(false);
|
||||||
|
|
||||||
|
// init effect image for image based effects, size is based on led layout
|
||||||
|
_imageSize = Hyperion::getInstance()->getLedGridSize();
|
||||||
|
_image = new QImage(_imageSize, QImage::Format_ARGB32_Premultiplied);
|
||||||
|
_image->fill(Qt::black);
|
||||||
|
_painter = new QPainter(_image);
|
||||||
|
|
||||||
// connect the finished signal
|
// connect the finished signal
|
||||||
connect(this, SIGNAL(finished()), this, SLOT(effectFinished()));
|
connect(this, SIGNAL(finished()), this, SLOT(effectFinished()));
|
||||||
Q_INIT_RESOURCE(EffectEngine);
|
Q_INIT_RESOURCE(EffectEngine);
|
||||||
@ -77,6 +94,8 @@ Effect::Effect(PyThreadState * mainThreadState, int priority, int timeout, const
|
|||||||
|
|
||||||
Effect::~Effect()
|
Effect::~Effect()
|
||||||
{
|
{
|
||||||
|
delete _painter;
|
||||||
|
delete _image;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Effect::run()
|
void Effect::run()
|
||||||
@ -96,6 +115,12 @@ void Effect::run()
|
|||||||
// add ledCount variable to the interpreter
|
// add ledCount variable to the interpreter
|
||||||
PyObject_SetAttrString(module, "ledCount", Py_BuildValue("i", _imageProcessor->getLedCount()));
|
PyObject_SetAttrString(module, "ledCount", Py_BuildValue("i", _imageProcessor->getLedCount()));
|
||||||
|
|
||||||
|
// add imageWidth variable to the interpreter
|
||||||
|
PyObject_SetAttrString(module, "imageWidth", Py_BuildValue("i", _imageSize.width()));
|
||||||
|
|
||||||
|
// add imageHeight variable to the interpreter
|
||||||
|
PyObject_SetAttrString(module, "imageHeight", Py_BuildValue("i", _imageSize.height()));
|
||||||
|
|
||||||
// add a args variable to the interpreter
|
// add a args variable to the interpreter
|
||||||
PyObject_SetAttrString(module, "args", json2python(_args));
|
PyObject_SetAttrString(module, "args", json2python(_args));
|
||||||
|
|
||||||
@ -357,6 +382,207 @@ PyObject* Effect::wrapAbort(PyObject *self, PyObject *)
|
|||||||
return Py_BuildValue("i", effect->_abortRequested ? 1 : 0);
|
return Py_BuildValue("i", effect->_abortRequested ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PyObject* Effect::wrapImageShow(PyObject *self, PyObject *args)
|
||||||
|
{
|
||||||
|
Effect * effect = getEffect();
|
||||||
|
|
||||||
|
// determine the timeout
|
||||||
|
int timeout = effect->_timeout;
|
||||||
|
if (timeout > 0)
|
||||||
|
{
|
||||||
|
timeout = effect->_endTime - QDateTime::currentMSecsSinceEpoch();
|
||||||
|
|
||||||
|
// we are done if the time has passed
|
||||||
|
if (timeout <= 0)
|
||||||
|
{
|
||||||
|
return Py_BuildValue("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int width = effect->_imageSize.width();
|
||||||
|
int height = effect->_imageSize.height();
|
||||||
|
QImage * qimage = effect->_image;
|
||||||
|
|
||||||
|
Image<ColorRgb> image(width, height);
|
||||||
|
QByteArray binaryImage;
|
||||||
|
|
||||||
|
for (int i = 0; i <qimage->height(); ++i)
|
||||||
|
{
|
||||||
|
const QRgb * scanline = reinterpret_cast<const QRgb *>(qimage->scanLine(i));
|
||||||
|
for (int j = 0; j < qimage->width(); ++j)
|
||||||
|
{
|
||||||
|
binaryImage.append((char) qRed(scanline[j]));
|
||||||
|
binaryImage.append((char) qGreen(scanline[j]));
|
||||||
|
binaryImage.append((char) qBlue(scanline[j]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
memcpy(image.memptr(), binaryImage.data(), binaryImage.size());
|
||||||
|
effect->_imageProcessor->process(image, effect->_colors);
|
||||||
|
effect->setColors(effect->_priority, effect->_colors, timeout, false);
|
||||||
|
|
||||||
|
return Py_BuildValue("");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PyObject* Effect::wrapImageCanonicalGradient(PyObject *self, PyObject *args)
|
||||||
|
{
|
||||||
|
Effect * effect = getEffect();
|
||||||
|
|
||||||
|
int argCount = PyTuple_Size(args);
|
||||||
|
PyObject * bytearray = nullptr;
|
||||||
|
int centerX, centerY, angle;
|
||||||
|
int startX = 0;
|
||||||
|
int startY = 0;
|
||||||
|
int width = effect->_imageSize.width();
|
||||||
|
int height = effect->_imageSize.height();
|
||||||
|
|
||||||
|
bool argsOK = false;
|
||||||
|
|
||||||
|
if ( argCount == 8 && PyArg_ParseTuple(args, "iiiiiiiO", &startX, &startY, &width, &height, ¢erX, ¢erY, &angle, &bytearray) )
|
||||||
|
{
|
||||||
|
argsOK = true;
|
||||||
|
}
|
||||||
|
if ( argCount == 4 && PyArg_ParseTuple(args, "iiiO", ¢erX, ¢erY, &angle, &bytearray) )
|
||||||
|
{
|
||||||
|
argsOK = true;
|
||||||
|
}
|
||||||
|
angle = std::max(std::min(angle,360),0);
|
||||||
|
|
||||||
|
if (argsOK)
|
||||||
|
{
|
||||||
|
if (PyByteArray_Check(bytearray))
|
||||||
|
{
|
||||||
|
int length = PyByteArray_Size(bytearray);
|
||||||
|
if (length % 4 == 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
QPainter * painter = effect->_painter;
|
||||||
|
QRect myQRect(startX,startY,width,height);
|
||||||
|
QConicalGradient gradient(QPoint(centerX,centerY), angle );
|
||||||
|
char * data = PyByteArray_AS_STRING(bytearray);
|
||||||
|
|
||||||
|
for (int idx=0; idx<length; idx+=4)
|
||||||
|
{
|
||||||
|
gradient.setColorAt(
|
||||||
|
((uint8_t)data[idx])/255.0,
|
||||||
|
QColor(
|
||||||
|
(uint8_t)(data[idx+1]),
|
||||||
|
(uint8_t)(data[idx+2]),
|
||||||
|
(uint8_t)(data[idx+3])
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
gradient.setSpread(QGradient::RepeatSpread);
|
||||||
|
painter->fillRect(myQRect, gradient);
|
||||||
|
|
||||||
|
return Py_BuildValue("");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PyErr_SetString(PyExc_RuntimeError, "Length of bytearray argument should multiple of 4");
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PyErr_SetString(PyExc_RuntimeError, "Argument 8 is not a bytearray");
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PyObject* Effect::wrapImageRadialGradient(PyObject *self, PyObject *args)
|
||||||
|
{
|
||||||
|
Effect * effect = getEffect();
|
||||||
|
|
||||||
|
int argCount = PyTuple_Size(args);
|
||||||
|
PyObject * bytearray = nullptr;
|
||||||
|
int centerX, centerY, radius, focalX, focalY, focalRadius;
|
||||||
|
int startX = 0;
|
||||||
|
int startY = 0;
|
||||||
|
int width = effect->_imageSize.width();
|
||||||
|
int height = effect->_imageSize.height();
|
||||||
|
|
||||||
|
bool argsOK = false;
|
||||||
|
|
||||||
|
if ( argCount == 11 && PyArg_ParseTuple(args, "iiiiiiiiiiO", &startX, &startY, &width, &height, ¢erX, ¢erY, &radius, &focalX, &focalY, &focalRadius, &bytearray) )
|
||||||
|
{
|
||||||
|
argsOK = true;
|
||||||
|
}
|
||||||
|
if ( argCount == 8 && PyArg_ParseTuple(args, "iiiiiiiO", &startX, &startY, &width, &height, ¢erX, ¢erY, &radius, &bytearray) )
|
||||||
|
{
|
||||||
|
argsOK = true;
|
||||||
|
focalX = centerX;
|
||||||
|
focalY = centerY;
|
||||||
|
focalRadius = radius;
|
||||||
|
}
|
||||||
|
if ( argCount == 7 && PyArg_ParseTuple(args, "iiiiiiO", ¢erX, ¢erY, &radius, &focalX, &focalY, &focalRadius, &bytearray) )
|
||||||
|
{
|
||||||
|
argsOK = true;
|
||||||
|
}
|
||||||
|
if ( argCount == 4 && PyArg_ParseTuple(args, "iiiO", ¢erX, ¢erY, &radius, &bytearray) )
|
||||||
|
{
|
||||||
|
argsOK = true;
|
||||||
|
focalX = centerX;
|
||||||
|
focalY = centerY;
|
||||||
|
focalRadius = radius;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (argsOK)
|
||||||
|
{
|
||||||
|
if (PyByteArray_Check(bytearray))
|
||||||
|
{
|
||||||
|
int length = PyByteArray_Size(bytearray);
|
||||||
|
if (length % 4 == 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
QPainter * painter = effect->_painter;
|
||||||
|
QRect myQRect(startX,startY,width,height);
|
||||||
|
QRadialGradient gradient(QPoint(centerX,centerY), std::max(radius,0) );
|
||||||
|
char * data = PyByteArray_AS_STRING(bytearray);
|
||||||
|
|
||||||
|
for (int idx=0; idx<length; idx+=4)
|
||||||
|
{
|
||||||
|
gradient.setColorAt(
|
||||||
|
((uint8_t)data[idx])/255.0,
|
||||||
|
QColor(
|
||||||
|
(uint8_t)(data[idx+1]),
|
||||||
|
(uint8_t)(data[idx+2]),
|
||||||
|
(uint8_t)(data[idx+3])
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
//gradient.setSpread(QGradient::ReflectSpread);
|
||||||
|
painter->fillRect(myQRect, gradient);
|
||||||
|
|
||||||
|
return Py_BuildValue("");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PyErr_SetString(PyExc_RuntimeError, "Length of bytearray argument should multiple of 4");
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PyErr_SetString(PyExc_RuntimeError, "Last argument is not a bytearray");
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Effect * Effect::getEffect()
|
Effect * Effect::getEffect()
|
||||||
{
|
{
|
||||||
// extract the module from the runtime
|
// extract the module from the runtime
|
||||||
|
@ -5,6 +5,9 @@
|
|||||||
|
|
||||||
// Qt includes
|
// Qt includes
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
|
#include <QSize>
|
||||||
|
#include <QImage>
|
||||||
|
#include <QPainter>
|
||||||
|
|
||||||
// Hyperion includes
|
// Hyperion includes
|
||||||
#include <hyperion/ImageProcessor.h>
|
#include <hyperion/ImageProcessor.h>
|
||||||
@ -52,6 +55,10 @@ private:
|
|||||||
static PyObject* wrapSetColor(PyObject *self, PyObject *args);
|
static PyObject* wrapSetColor(PyObject *self, PyObject *args);
|
||||||
static PyObject* wrapSetImage(PyObject *self, PyObject *args);
|
static PyObject* wrapSetImage(PyObject *self, PyObject *args);
|
||||||
static PyObject* wrapAbort(PyObject *self, PyObject *args);
|
static PyObject* wrapAbort(PyObject *self, PyObject *args);
|
||||||
|
static PyObject* wrapImageShow(PyObject *self, PyObject *args);
|
||||||
|
static PyObject* wrapImageCanonicalGradient(PyObject *self, PyObject *args);
|
||||||
|
static PyObject* wrapImageRadialGradient(PyObject *self, PyObject *args);
|
||||||
|
|
||||||
static Effect * getEffect();
|
static Effect * getEffect();
|
||||||
|
|
||||||
#if PY_MAJOR_VERSION >= 3
|
#if PY_MAJOR_VERSION >= 3
|
||||||
@ -84,5 +91,10 @@ private:
|
|||||||
|
|
||||||
/// Buffer for colorData
|
/// Buffer for colorData
|
||||||
std::vector<ColorRgb> _colors;
|
std::vector<ColorRgb> _colors;
|
||||||
|
|
||||||
|
QSize _imageSize;
|
||||||
|
|
||||||
|
QImage * _image;
|
||||||
|
QPainter * _painter;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -423,6 +423,7 @@ LedString Hyperion::createLedString(const Json::Value& ledsConfig, const ColorOr
|
|||||||
LedString ledString;
|
LedString ledString;
|
||||||
const std::string deviceOrderStr = colorOrderToString(deviceOrder);
|
const std::string deviceOrderStr = colorOrderToString(deviceOrder);
|
||||||
int maxLedId = ledsConfig.size();
|
int maxLedId = ledsConfig.size();
|
||||||
|
|
||||||
for (const Json::Value& ledConfig : ledsConfig)
|
for (const Json::Value& ledConfig : ledsConfig)
|
||||||
{
|
{
|
||||||
Led led;
|
Led led;
|
||||||
@ -499,6 +500,51 @@ LedString Hyperion::createLedStringClone(const Json::Value& ledsConfig, const Co
|
|||||||
return ledString;
|
return ledString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QSize Hyperion::getLedLayoutGridSize(const Json::Value& ledsConfig)
|
||||||
|
{
|
||||||
|
std::vector<int> midPointsX;
|
||||||
|
std::vector<int> midPointsY;
|
||||||
|
|
||||||
|
for (const Json::Value& ledConfig : ledsConfig)
|
||||||
|
{
|
||||||
|
if ( ledConfig.get("clone",-1).asInt() < 0 )
|
||||||
|
{
|
||||||
|
const Json::Value& hscanConfig = ledConfig["hscan"];
|
||||||
|
const Json::Value& vscanConfig = ledConfig["vscan"];
|
||||||
|
double minX_frac = std::max(0.0, std::min(1.0, hscanConfig["minimum"].asDouble()));
|
||||||
|
double maxX_frac = std::max(0.0, std::min(1.0, hscanConfig["maximum"].asDouble()));
|
||||||
|
double minY_frac = std::max(0.0, std::min(1.0, vscanConfig["minimum"].asDouble()));
|
||||||
|
double maxY_frac = std::max(0.0, std::min(1.0, vscanConfig["maximum"].asDouble()));
|
||||||
|
// Fix if the user swapped min and max
|
||||||
|
if (minX_frac > maxX_frac)
|
||||||
|
{
|
||||||
|
std::swap(minX_frac, maxX_frac);
|
||||||
|
}
|
||||||
|
if (minY_frac > maxY_frac)
|
||||||
|
{
|
||||||
|
std::swap(minY_frac, maxY_frac);
|
||||||
|
}
|
||||||
|
|
||||||
|
// calculate mid point and make grid calculation
|
||||||
|
midPointsX.push_back( int(1000.0*(minX_frac + maxX_frac) / 2.0) );
|
||||||
|
midPointsY.push_back( int(1000.0*(minY_frac + maxY_frac) / 2.0) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// remove duplicates
|
||||||
|
std::sort(midPointsX.begin(), midPointsX.end());
|
||||||
|
midPointsX.erase(std::unique(midPointsX.begin(), midPointsX.end()), midPointsX.end());
|
||||||
|
std::sort(midPointsY.begin(), midPointsY.end());
|
||||||
|
midPointsY.erase(std::unique(midPointsY.begin(), midPointsY.end()), midPointsY.end());
|
||||||
|
|
||||||
|
QSize gridSize( midPointsX.size(), midPointsY.size() );
|
||||||
|
Debug(Logger::getInstance("Core"), "led layout grid: %dx%d", gridSize.width(), gridSize.height());
|
||||||
|
|
||||||
|
return gridSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
LinearColorSmoothing * Hyperion::createColorSmoothing(const Json::Value & smoothingConfig, LedDevice* leddevice)
|
LinearColorSmoothing * Hyperion::createColorSmoothing(const Json::Value & smoothingConfig, LedDevice* leddevice)
|
||||||
{
|
{
|
||||||
Logger * log = Logger::getInstance("Core");
|
Logger * log = Logger::getInstance("Core");
|
||||||
@ -578,6 +624,7 @@ Hyperion::Hyperion(const Json::Value &jsonConfig, const std::string configFile)
|
|||||||
, _hwLedCount(_ledString.leds().size())
|
, _hwLedCount(_ledString.leds().size())
|
||||||
, _sourceAutoSelectEnabled(true)
|
, _sourceAutoSelectEnabled(true)
|
||||||
, _configHash()
|
, _configHash()
|
||||||
|
, _ledGridSize(getLedLayoutGridSize(jsonConfig["leds"]))
|
||||||
{
|
{
|
||||||
registerPriority("Off", PriorityMuxer::LOWEST_PRIORITY);
|
registerPriority("Off", PriorityMuxer::LOWEST_PRIORITY);
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
"name" :
|
"name" :
|
||||||
{
|
{
|
||||||
"type" : "string",
|
"type" : "string",
|
||||||
|
"title" : "Configuration name",
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"propertyOrder" : 1
|
"propertyOrder" : 1
|
||||||
},
|
},
|
||||||
@ -48,6 +49,7 @@
|
|||||||
"colorOrder" :
|
"colorOrder" :
|
||||||
{
|
{
|
||||||
"type" : "string",
|
"type" : "string",
|
||||||
|
"title" : "RGB byte order",
|
||||||
"enum" : ["rgb", "bgr", "rbg", "brg", "gbr", "grb"],
|
"enum" : ["rgb", "bgr", "rbg", "brg", "gbr", "grb"],
|
||||||
"propertyOrder" : 3
|
"propertyOrder" : 3
|
||||||
}
|
}
|
||||||
@ -397,6 +399,7 @@
|
|||||||
"minimum" : 25,
|
"minimum" : 25,
|
||||||
"maximum": 600,
|
"maximum": 600,
|
||||||
"default" : 200,
|
"default" : 200,
|
||||||
|
"append" : "ms",
|
||||||
"propertyOrder" : 3
|
"propertyOrder" : 3
|
||||||
},
|
},
|
||||||
"updateFrequency" :
|
"updateFrequency" :
|
||||||
@ -406,6 +409,7 @@
|
|||||||
"minimum" : 1.000,
|
"minimum" : 1.000,
|
||||||
"maximum" : 100.000,
|
"maximum" : 100.000,
|
||||||
"default" : 25.000,
|
"default" : 25.000,
|
||||||
|
"append" : "Hz",
|
||||||
"propertyOrder" : 4
|
"propertyOrder" : 4
|
||||||
},
|
},
|
||||||
"updateDelay" :
|
"updateDelay" :
|
||||||
@ -415,6 +419,7 @@
|
|||||||
"minimum" : 0,
|
"minimum" : 0,
|
||||||
"maximum": 2048,
|
"maximum": 2048,
|
||||||
"default" : 0,
|
"default" : 0,
|
||||||
|
"append" : "ms",
|
||||||
"propertyOrder" : 5
|
"propertyOrder" : 5
|
||||||
},
|
},
|
||||||
"continuousOutput" :
|
"continuousOutput" :
|
||||||
@ -427,12 +432,14 @@
|
|||||||
},
|
},
|
||||||
"additionalProperties" : false
|
"additionalProperties" : false
|
||||||
},
|
},
|
||||||
"grabber-v4l2" :
|
"grabberV4L2" :
|
||||||
{
|
{
|
||||||
"type":"array",
|
"type":"array",
|
||||||
|
"title" : "USB Grabber",
|
||||||
"items":
|
"items":
|
||||||
{
|
{
|
||||||
"type" : "object",
|
"type" : "object",
|
||||||
|
"title" : "USB Grabber",
|
||||||
"properties" :
|
"properties" :
|
||||||
{
|
{
|
||||||
"enable" :
|
"enable" :
|
||||||
@ -469,6 +476,7 @@
|
|||||||
"type" : "integer",
|
"type" : "integer",
|
||||||
"title" : "Width",
|
"title" : "Width",
|
||||||
"default" : -1,
|
"default" : -1,
|
||||||
|
"append" : "Pixel",
|
||||||
"propertyOrder" : 5
|
"propertyOrder" : 5
|
||||||
},
|
},
|
||||||
"height" :
|
"height" :
|
||||||
@ -476,6 +484,7 @@
|
|||||||
"type" : "integer",
|
"type" : "integer",
|
||||||
"title" : "Height",
|
"title" : "Height",
|
||||||
"default" : -1,
|
"default" : -1,
|
||||||
|
"append" : "Pixel",
|
||||||
"propertyOrder" : 6
|
"propertyOrder" : 6
|
||||||
},
|
},
|
||||||
"frameDecimation" :
|
"frameDecimation" :
|
||||||
@ -520,6 +529,7 @@
|
|||||||
"title" : "Crop left",
|
"title" : "Crop left",
|
||||||
"minimum" : 0,
|
"minimum" : 0,
|
||||||
"default" : 0,
|
"default" : 0,
|
||||||
|
"append" : "Pixel",
|
||||||
"propertyOrder" : 12
|
"propertyOrder" : 12
|
||||||
},
|
},
|
||||||
"cropRight" :
|
"cropRight" :
|
||||||
@ -528,6 +538,7 @@
|
|||||||
"title" : "Crop right",
|
"title" : "Crop right",
|
||||||
"minimum" : 0,
|
"minimum" : 0,
|
||||||
"default" : 0,
|
"default" : 0,
|
||||||
|
"append" : "Pixel",
|
||||||
"propertyOrder" : 13
|
"propertyOrder" : 13
|
||||||
},
|
},
|
||||||
"cropTop" :
|
"cropTop" :
|
||||||
@ -536,6 +547,7 @@
|
|||||||
"title" : "Crop top",
|
"title" : "Crop top",
|
||||||
"minimum" : 0,
|
"minimum" : 0,
|
||||||
"default" : 0,
|
"default" : 0,
|
||||||
|
"append" : "Pixel",
|
||||||
"propertyOrder" : 14
|
"propertyOrder" : 14
|
||||||
},
|
},
|
||||||
"cropBottom" :
|
"cropBottom" :
|
||||||
@ -544,6 +556,7 @@
|
|||||||
"title" : "Crop bottom",
|
"title" : "Crop bottom",
|
||||||
"minimum" : 0,
|
"minimum" : 0,
|
||||||
"default" : 0,
|
"default" : 0,
|
||||||
|
"append" : "Pixel",
|
||||||
"propertyOrder" : 15
|
"propertyOrder" : 15
|
||||||
},
|
},
|
||||||
"redSignalThreshold" :
|
"redSignalThreshold" :
|
||||||
@ -553,6 +566,7 @@
|
|||||||
"minimum" : 0.0,
|
"minimum" : 0.0,
|
||||||
"maximum" : 1.0,
|
"maximum" : 1.0,
|
||||||
"default" : 0.1,
|
"default" : 0.1,
|
||||||
|
"append" : "%",
|
||||||
"propertyOrder" : 16
|
"propertyOrder" : 16
|
||||||
},
|
},
|
||||||
"greenSignalThreshold" :
|
"greenSignalThreshold" :
|
||||||
@ -562,6 +576,7 @@
|
|||||||
"minimum" : 0.0,
|
"minimum" : 0.0,
|
||||||
"maximum" : 1.0,
|
"maximum" : 1.0,
|
||||||
"default" : 0.1,
|
"default" : 0.1,
|
||||||
|
"append" : "%",
|
||||||
"propertyOrder" : 17
|
"propertyOrder" : 17
|
||||||
},
|
},
|
||||||
"blueSignalThreshold" :
|
"blueSignalThreshold" :
|
||||||
@ -571,6 +586,7 @@
|
|||||||
"minimum" : 0.0,
|
"minimum" : 0.0,
|
||||||
"maximum" : 1.0,
|
"maximum" : 1.0,
|
||||||
"default" : 0.1,
|
"default" : 0.1,
|
||||||
|
"append" : "%",
|
||||||
"propertyOrder" : 18
|
"propertyOrder" : 18
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -601,20 +617,23 @@
|
|||||||
{
|
{
|
||||||
"type" : "integer",
|
"type" : "integer",
|
||||||
"title" : "Width",
|
"title" : "Width",
|
||||||
"default" : 96
|
"default" : 96,
|
||||||
|
"append" : "Pixel"
|
||||||
},
|
},
|
||||||
"height" :
|
"height" :
|
||||||
{
|
{
|
||||||
"type" : "integer",
|
"type" : "integer",
|
||||||
"title" : "Height",
|
"title" : "Height",
|
||||||
"default" : 96
|
"default" : 96,
|
||||||
|
"append" : "Pixel"
|
||||||
},
|
},
|
||||||
"frequency_Hz" :
|
"frequency_Hz" :
|
||||||
{
|
{
|
||||||
"type" : "integer",
|
"type" : "integer",
|
||||||
"title" : "Frequency",
|
"title" : "Frequency",
|
||||||
"minimum" : 0,
|
"minimum" : 0,
|
||||||
"default" : 10
|
"default" : 10,
|
||||||
|
"append" : "Hz"
|
||||||
},
|
},
|
||||||
"priority" :
|
"priority" :
|
||||||
{
|
{
|
||||||
@ -628,28 +647,32 @@
|
|||||||
"type" : "integer",
|
"type" : "integer",
|
||||||
"title" : "Crop left",
|
"title" : "Crop left",
|
||||||
"minimum" : 0,
|
"minimum" : 0,
|
||||||
"default" : 0
|
"default" : 0,
|
||||||
|
"append" : "Pixel"
|
||||||
},
|
},
|
||||||
"cropRight" :
|
"cropRight" :
|
||||||
{
|
{
|
||||||
"type" : "integer",
|
"type" : "integer",
|
||||||
"title" : "Crop right",
|
"title" : "Crop right",
|
||||||
"minimum" : 0,
|
"minimum" : 0,
|
||||||
"default" : 0
|
"default" : 0,
|
||||||
|
"append" : "Pixel"
|
||||||
},
|
},
|
||||||
"cropTop" :
|
"cropTop" :
|
||||||
{
|
{
|
||||||
"type" : "integer",
|
"type" : "integer",
|
||||||
"title" : "Crop top",
|
"title" : "Crop top",
|
||||||
"minimum" : 0,
|
"minimum" : 0,
|
||||||
"default" : 0
|
"default" : 0,
|
||||||
|
"append" : "Pixel"
|
||||||
},
|
},
|
||||||
"cropBottom" :
|
"cropBottom" :
|
||||||
{
|
{
|
||||||
"type" : "integer",
|
"type" : "integer",
|
||||||
"title" : "Crop bottom",
|
"title" : "Crop bottom",
|
||||||
"minimum" : 0,
|
"minimum" : 0,
|
||||||
"default" : 0
|
"default" : 0,
|
||||||
|
"append" : "Pixel"
|
||||||
},
|
},
|
||||||
"useXGetImage" :
|
"useXGetImage" :
|
||||||
{
|
{
|
||||||
@ -707,6 +730,7 @@
|
|||||||
"minimum" : 0.0,
|
"minimum" : 0.0,
|
||||||
"maximum" : 1.0,
|
"maximum" : 1.0,
|
||||||
"default" : 0.05,
|
"default" : 0.05,
|
||||||
|
"append" : "%",
|
||||||
"propertyOrder" : 2
|
"propertyOrder" : 2
|
||||||
},
|
},
|
||||||
"unknownFrameCnt" :
|
"unknownFrameCnt" :
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/">
|
<qresource prefix="/">
|
||||||
<file alias="hyperion-schema">hyperion.schema.json</file>
|
<file alias="hyperion-schema">hyperion.schema.json</file>
|
||||||
|
<file alias="hyperion_default.config">../../config/hyperion.config.json.default</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
"type": "integer",
|
"type": "integer",
|
||||||
"title":"Delay after connect",
|
"title":"Delay after connect",
|
||||||
"default": 250,
|
"default": 250,
|
||||||
|
"append" : "ms",
|
||||||
"propertyOrder" : 3
|
"propertyOrder" : 3
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
"type": "integer",
|
"type": "integer",
|
||||||
"title":"Delay after connect",
|
"title":"Delay after connect",
|
||||||
"default": 250,
|
"default": 250,
|
||||||
|
"append" : "ms",
|
||||||
"propertyOrder" : 3
|
"propertyOrder" : 3
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
"type": "integer",
|
"type": "integer",
|
||||||
"title":"Delay after connect",
|
"title":"Delay after connect",
|
||||||
"default": 250,
|
"default": 250,
|
||||||
|
"append" : "ms",
|
||||||
"propertyOrder" : 3
|
"propertyOrder" : 3
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -23,8 +23,9 @@
|
|||||||
},
|
},
|
||||||
"transitiontime": {
|
"transitiontime": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"title":"Transistion time (x100ms)",
|
"title":"Transistion time",
|
||||||
"default" : 1,
|
"default" : 1,
|
||||||
|
"append" : "x100ms",
|
||||||
"propertyOrder" : 4
|
"propertyOrder" : 4
|
||||||
},
|
},
|
||||||
"switchOffOnBlack": {
|
"switchOffOnBlack": {
|
||||||
|
@ -109,7 +109,7 @@ void QJsonSchemaChecker::validate(const QJsonValue & value, const QJsonObject &s
|
|||||||
else if (attribute == "id")
|
else if (attribute == "id")
|
||||||
; // references have already been collected
|
; // references have already been collected
|
||||||
else if (attribute == "title" || attribute == "description" || attribute == "default" || attribute == "format"
|
else if (attribute == "title" || attribute == "description" || attribute == "default" || attribute == "format"
|
||||||
|| attribute == "defaultProperties" || attribute == "propertyOrder")
|
|| attribute == "defaultProperties" || attribute == "propertyOrder" || attribute == "append")
|
||||||
; // nothing to do.
|
; // nothing to do.
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -37,11 +37,11 @@ int main(int argc, char ** argv)
|
|||||||
IntOption & argFps = parser.add<IntOption> ('f', "framerate", "Capture frame rate [default: %1]", "10");
|
IntOption & argFps = parser.add<IntOption> ('f', "framerate", "Capture frame rate [default: %1]", "10");
|
||||||
IntOption & argWidth = parser.add<IntOption> (0x0, "width", "Width of the captured image [default: %1]", "160", 160, 4096);
|
IntOption & argWidth = parser.add<IntOption> (0x0, "width", "Width of the captured image [default: %1]", "160", 160, 4096);
|
||||||
IntOption & argHeight = parser.add<IntOption> (0x0, "height", "Height of the captured image [default: %1]", "160", 160, 4096);
|
IntOption & argHeight = parser.add<IntOption> (0x0, "height", "Height of the captured image [default: %1]", "160", 160, 4096);
|
||||||
BooleanOption & argScreenshot = parser.add<BooleanOption> (0x0, "screenshot", "Take a single screenshot, save it to file and quit");
|
BooleanOption & argScreenshot = parser.add<BooleanOption>(0x0, "screenshot", "Take a single screenshot, save it to file and quit");
|
||||||
Option & argAddress = parser.add<Option> ('a', "address", "Set the address of the hyperion server [default: %1]", "127.0.0.1:19445");
|
Option & argAddress = parser.add<Option> ('a', "address", "Set the address of the hyperion server [default: %1]", "127.0.0.1:19445");
|
||||||
IntOption & argPriority = parser.add<IntOption> ('p', "priority", "Use the provided priority channel (the lower the number, the higher the priority) [default: %1]", "800");
|
IntOption & argPriority = parser.add<IntOption> ('p', "priority", "Use the provided priority channel (the lower the number, the higher the priority) [default: %1]", "800");
|
||||||
BooleanOption & argSkipReply = parser.add<BooleanOption> (0x0, "skip-reply", "Do not receive and check reply messages from Hyperion");
|
BooleanOption & argSkipReply = parser.add<BooleanOption>(0x0, "skip-reply", "Do not receive and check reply messages from Hyperion");
|
||||||
BooleanOption & argHelp = parser.add<BooleanOption> ('h', "help", "Show this help message and exit");
|
BooleanOption & argHelp = parser.add<BooleanOption>('h', "help", "Show this help message and exit");
|
||||||
|
|
||||||
// parse all options
|
// parse all options
|
||||||
parser.process(app);
|
parser.process(app);
|
||||||
|
@ -37,19 +37,19 @@ int main(int argc, char ** argv)
|
|||||||
IntOption & argWidth = parser.add<IntOption> (0x0, "width", "Width of the captured image [default: %1]", "64", 32, 4096);
|
IntOption & argWidth = parser.add<IntOption> (0x0, "width", "Width of the captured image [default: %1]", "64", 32, 4096);
|
||||||
IntOption & argHeight = parser.add<IntOption> (0x0, "height", "Height of the captured image [default: %1]", "64", 32, 4096);
|
IntOption & argHeight = parser.add<IntOption> (0x0, "height", "Height of the captured image [default: %1]", "64", 32, 4096);
|
||||||
|
|
||||||
BooleanOption & argScreenshot = parser.add<BooleanOption> (0x0, "screenshot", "Take a single screenshot, save it to file and quit");
|
BooleanOption & argScreenshot = parser.add<BooleanOption>(0x0, "screenshot", "Take a single screenshot, save it to file and quit");
|
||||||
Option & argAddress = parser.add<Option> ('a', "address", "Set the address of the hyperion server [default: %1]", "127.0.0.1:19445");
|
Option & argAddress = parser.add<Option> ('a', "address", "Set the address of the hyperion server [default: %1]", "127.0.0.1:19445");
|
||||||
IntOption & argPriority = parser.add<IntOption> ('p', "priority", "Use the provided priority channel (the lower the number, the higher the priority) [default: %1]", "800");
|
IntOption & argPriority = parser.add<IntOption> ('p', "priority", "Use the provided priority channel (the lower the number, the higher the priority) [default: %1]", "800");
|
||||||
BooleanOption & argSkipReply = parser.add<BooleanOption> (0x0, "skip-reply", "Do not receive and check reply messages from Hyperion");
|
BooleanOption & argSkipReply = parser.add<BooleanOption>(0x0, "skip-reply", "Do not receive and check reply messages from Hyperion");
|
||||||
BooleanOption & argHelp = parser.add<BooleanOption> ('h', "help", "Show this help message and exit");
|
BooleanOption & argHelp = parser.add<BooleanOption>('h', "help", "Show this help message and exit");
|
||||||
|
|
||||||
IntOption & argCropLeft = parser.add<IntOption> (0x0, "crop-left", "pixels to remove on left after grabbing");
|
IntOption & argCropLeft = parser.add<IntOption> (0x0, "crop-left", "pixels to remove on left after grabbing");
|
||||||
IntOption & argCropRight = parser.add<IntOption> (0x0, "crop-right", "pixels to remove on right after grabbing");
|
IntOption & argCropRight = parser.add<IntOption> (0x0, "crop-right", "pixels to remove on right after grabbing");
|
||||||
IntOption & argCropTop = parser.add<IntOption> (0x0, "crop-top", "pixels to remove on top after grabbing");
|
IntOption & argCropTop = parser.add<IntOption> (0x0, "crop-top", "pixels to remove on top after grabbing");
|
||||||
IntOption & argCropBottom = parser.add<IntOption> (0x0, "crop-bottom", "pixels to remove on bottom after grabbing");
|
IntOption & argCropBottom = parser.add<IntOption> (0x0, "crop-bottom", "pixels to remove on bottom after grabbing");
|
||||||
|
|
||||||
BooleanOption & arg3DSBS = parser.add<BooleanOption> (0x0, "3DSBS", "Interpret the incoming video stream as 3D side-by-side");
|
BooleanOption & arg3DSBS = parser.add<BooleanOption>(0x0, "3DSBS", "Interpret the incoming video stream as 3D side-by-side");
|
||||||
BooleanOption & arg3DTAB = parser.add<BooleanOption> (0x0, "3DTAB", "Interpret the incoming video stream as 3D top-and-bottom");
|
BooleanOption & arg3DTAB = parser.add<BooleanOption>(0x0, "3DTAB", "Interpret the incoming video stream as 3D top-and-bottom");
|
||||||
|
|
||||||
// parse all options
|
// parse all options
|
||||||
parser.process(app);
|
parser.process(app);
|
||||||
|
@ -31,11 +31,11 @@ int main(int argc, char ** argv)
|
|||||||
IntOption & argFps = parser.add<IntOption> ('f', "framerate", "Capture frame rate [default: %1]", "10");
|
IntOption & argFps = parser.add<IntOption> ('f', "framerate", "Capture frame rate [default: %1]", "10");
|
||||||
IntOption & argWidth = parser.add<IntOption> (0x0, "width", "Width of the captured image [default: %1]", "160", 160, 4096);
|
IntOption & argWidth = parser.add<IntOption> (0x0, "width", "Width of the captured image [default: %1]", "160", 160, 4096);
|
||||||
IntOption & argHeight = parser.add<IntOption> (0x0, "height", "Height of the captured image [default: %1]", "160", 160, 4096);
|
IntOption & argHeight = parser.add<IntOption> (0x0, "height", "Height of the captured image [default: %1]", "160", 160, 4096);
|
||||||
BooleanOption & argScreenshot = parser.add<BooleanOption> (0x0, "screenshot", "Take a single screenshot, save it to file and quit");
|
BooleanOption & argScreenshot = parser.add<BooleanOption>(0x0, "screenshot", "Take a single screenshot, save it to file and quit");
|
||||||
Option & argAddress = parser.add<Option> ('a', "address", "Set the address of the hyperion server [default: %1]", "127.0.0.1:19445");
|
Option & argAddress = parser.add<Option> ('a', "address", "Set the address of the hyperion server [default: %1]", "127.0.0.1:19445");
|
||||||
IntOption & argPriority = parser.add<IntOption> ('p', "priority", "Use the provided priority channel (the lower the number, the higher the priority) [default: %1]", "800");
|
IntOption & argPriority = parser.add<IntOption> ('p', "priority", "Use the provided priority channel (the lower the number, the higher the priority) [default: %1]", "800");
|
||||||
BooleanOption & argSkipReply = parser.add<BooleanOption> (0x0, "skip-reply", "Do not receive and check reply messages from Hyperion");
|
BooleanOption & argSkipReply = parser.add<BooleanOption>(0x0, "skip-reply", "Do not receive and check reply messages from Hyperion");
|
||||||
BooleanOption & argHelp = parser.add<BooleanOption> ('h', "help", "Show this help message and exit");
|
BooleanOption & argHelp = parser.add<BooleanOption>('h', "help", "Show this help message and exit");
|
||||||
|
|
||||||
// parse all options
|
// parse all options
|
||||||
parser.process(app);
|
parser.process(app);
|
||||||
|
@ -31,11 +31,11 @@ int main(int argc, char ** argv)
|
|||||||
IntOption & argFps = parser.add<IntOption> ('f', "framerate", "Capture frame rate [default: %1]", "10", 1, 600);
|
IntOption & argFps = parser.add<IntOption> ('f', "framerate", "Capture frame rate [default: %1]", "10", 1, 600);
|
||||||
IntOption & argWidth = parser.add<IntOption> (0x0, "width", "Width of the captured image [default: %1]", "160", 160, 4096);
|
IntOption & argWidth = parser.add<IntOption> (0x0, "width", "Width of the captured image [default: %1]", "160", 160, 4096);
|
||||||
IntOption & argHeight = parser.add<IntOption> (0x0, "height", "Height of the captured image [default: %1]", "160", 160, 4096);
|
IntOption & argHeight = parser.add<IntOption> (0x0, "height", "Height of the captured image [default: %1]", "160", 160, 4096);
|
||||||
BooleanOption & argScreenshot = parser.add<BooleanOption> (0x0, "screenshot", "Take a single screenshot, save it to file and quit");
|
BooleanOption & argScreenshot = parser.add<BooleanOption>(0x0, "screenshot", "Take a single screenshot, save it to file and quit");
|
||||||
Option & argAddress = parser.add<Option> ('a', "address", "Set the address of the hyperion server [default: %1]", "127.0.0.1:19445");
|
Option & argAddress = parser.add<Option> ('a', "address", "Set the address of the hyperion server [default: %1]", "127.0.0.1:19445");
|
||||||
IntOption & argPriority = parser.add<IntOption> ('p', "priority", "Use the provided priority channel (the lower the number, the higher the priority) [default: %1]", "800");
|
IntOption & argPriority = parser.add<IntOption> ('p', "priority", "Use the provided priority channel (the lower the number, the higher the priority) [default: %1]", "800");
|
||||||
BooleanOption & argSkipReply = parser.add<BooleanOption> (0x0, "skip-reply", "Do not receive and check reply messages from Hyperion");
|
BooleanOption & argSkipReply = parser.add<BooleanOption>(0x0, "skip-reply", "Do not receive and check reply messages from Hyperion");
|
||||||
BooleanOption & argHelp = parser.add<BooleanOption> ('h', "help", "Show this help message and exit");
|
BooleanOption & argHelp = parser.add<BooleanOption>('h', "help", "Show this help message and exit");
|
||||||
|
|
||||||
// parse all arguments
|
// parse all arguments
|
||||||
parser.process(app);
|
parser.process(app);
|
||||||
|
@ -62,9 +62,9 @@ int main(int argc, char * argv[])
|
|||||||
ImageOption & argImage = parser.add<ImageOption> ('i', "image" , "Set the leds to the colors according to the given image file");
|
ImageOption & argImage = parser.add<ImageOption> ('i', "image" , "Set the leds to the colors according to the given image file");
|
||||||
Option & argEffect = parser.add<Option> ('e', "effect" , "Enable the effect with the given name");
|
Option & argEffect = parser.add<Option> ('e', "effect" , "Enable the effect with the given name");
|
||||||
Option & argEffectArgs = parser.add<Option> (0x0, "effectArgs", "Arguments to use in combination with the specified effect. Should be a Json object string.", "");
|
Option & argEffectArgs = parser.add<Option> (0x0, "effectArgs", "Arguments to use in combination with the specified effect. Should be a Json object string.", "");
|
||||||
BooleanOption & argServerInfo = parser.add<BooleanOption> ('l', "list" , "List server info and active effects with priority and duration");
|
BooleanOption & argServerInfo = parser.add<BooleanOption>('l', "list" , "List server info and active effects with priority and duration");
|
||||||
BooleanOption & argClear = parser.add<BooleanOption> ('x', "clear" , "Clear data for the priority channel provided by the -p option");
|
BooleanOption & argClear = parser.add<BooleanOption>('x', "clear" , "Clear data for the priority channel provided by the -p option");
|
||||||
BooleanOption & argClearAll = parser.add<BooleanOption> (0x0, "clearall" , "Clear data for all active priority channels");
|
BooleanOption & argClearAll = parser.add<BooleanOption>(0x0, "clearall" , "Clear data for all active priority channels");
|
||||||
Option & argEnableComponent = parser.add<Option> ('E', "enable" , "Enable the Component with the given name. Available Components are [SMOOTHING, BLACKBORDER, KODICHECKER, FORWARDER, UDPLISTENER, BOBLIGHT_SERVER, GRABBER, V4L]");
|
Option & argEnableComponent = parser.add<Option> ('E', "enable" , "Enable the Component with the given name. Available Components are [SMOOTHING, BLACKBORDER, KODICHECKER, FORWARDER, UDPLISTENER, BOBLIGHT_SERVER, GRABBER, V4L]");
|
||||||
Option & argDisableComponent = parser.add<Option> ('D', "disable" , "Disable the Component with the given name. Available Components are [SMOOTHING, BLACKBORDER, KODICHECKER, FORWARDER, UDPLISTENER, BOBLIGHT_SERVER, GRABBER, V4L]");
|
Option & argDisableComponent = parser.add<Option> ('D', "disable" , "Disable the Component with the given name. Available Components are [SMOOTHING, BLACKBORDER, KODICHECKER, FORWARDER, UDPLISTENER, BOBLIGHT_SERVER, GRABBER, V4L]");
|
||||||
Option & argId = parser.add<Option> ('q', "qualifier" , "Identifier(qualifier) of the transform to set");
|
Option & argId = parser.add<Option> ('q', "qualifier" , "Identifier(qualifier) of the transform to set");
|
||||||
@ -73,28 +73,28 @@ int main(int argc, char * argv[])
|
|||||||
DoubleOption & argSaturationL = parser.add<DoubleOption> ('u', "saturationL", "Set the HSL saturation gain of the leds");
|
DoubleOption & argSaturationL = parser.add<DoubleOption> ('u', "saturationL", "Set the HSL saturation gain of the leds");
|
||||||
DoubleOption & argLuminance = parser.add<DoubleOption> ('m', "luminance" , "Set the HSL luminance gain of the leds");
|
DoubleOption & argLuminance = parser.add<DoubleOption> ('m', "luminance" , "Set the HSL luminance gain of the leds");
|
||||||
DoubleOption & argLuminanceMin= parser.add<DoubleOption> ('n', "luminanceMin" , "Set the HSL luminance minimum of the leds (backlight)");
|
DoubleOption & argLuminanceMin= parser.add<DoubleOption> ('n', "luminanceMin" , "Set the HSL luminance minimum of the leds (backlight)");
|
||||||
ColorOption & argGamma = parser.add<ColorOption>('g', "gamma" , "Set the gamma of the leds (requires colors in hex format as RRGGBB)");
|
ColorOption & argGamma = parser.add<ColorOption> ('g', "gamma" , "Set the gamma of the leds (requires colors in hex format as RRGGBB)");
|
||||||
ColorOption & argThreshold = parser.add<ColorOption>('t', "threshold" , "Set the threshold of the leds (requires colors in hex format as RRGGBB)");
|
ColorOption & argThreshold = parser.add<ColorOption> ('t', "threshold" , "Set the threshold of the leds (requires colors in hex format as RRGGBB)");
|
||||||
ColorOption & argBlacklevel = parser.add<ColorOption>('b', "blacklevel", "!DEPRECATED! Will be removed soon! Set the blacklevel of the leds (requires colors in hex format as RRGGBB which are normally between 0.0 and 1.0)");
|
ColorOption & argBlacklevel = parser.add<ColorOption> ('b', "blacklevel", "!DEPRECATED! Will be removed soon! Set the blacklevel of the leds (requires colors in hex format as RRGGBB which are normally between 0.0 and 1.0)");
|
||||||
ColorOption & argWhitelevel = parser.add<ColorOption>('w', "whitelevel", "!DEPRECATED! Will be removed soon! Set the whitelevel of the leds (requires colors in hex format as RRGGBB which are normally between 0.0 and 1.0)");
|
ColorOption & argWhitelevel = parser.add<ColorOption> ('w', "whitelevel", "!DEPRECATED! Will be removed soon! Set the whitelevel of the leds (requires colors in hex format as RRGGBB which are normally between 0.0 and 1.0)");
|
||||||
BooleanOption & argPrint = parser.add<BooleanOption>(0x0, "print" , "Print the json input and output messages on stdout");
|
BooleanOption & argPrint = parser.add<BooleanOption>(0x0, "print" , "Print the json input and output messages on stdout");
|
||||||
BooleanOption & argHelp = parser.add<BooleanOption>('h', "help" , "Show this help message and exit");
|
BooleanOption & argHelp = parser.add<BooleanOption>('h', "help" , "Show this help message and exit");
|
||||||
Option & argIdC = parser.add<Option> ('y', "qualifier-c" , "!DEPRECATED! Will be removed soon! Identifier(qualifier) of the correction to set");
|
Option & argIdC = parser.add<Option> ('y', "qualifier-c" , "!DEPRECATED! Will be removed soon! Identifier(qualifier) of the correction to set");
|
||||||
ColorOption & argCorrection = parser.add<ColorOption>('Y', "correction" , "!DEPRECATED! Will be removed soon! Set the correction of the leds (requires colors in hex format as RRGGBB)");
|
ColorOption & argCorrection = parser.add<ColorOption> ('Y', "correction" , "!DEPRECATED! Will be removed soon! Set the correction of the leds (requires colors in hex format as RRGGBB)");
|
||||||
Option & argIdT = parser.add<Option> ('z', "qualifier-t" , "Identifier(qualifier) of the temperature correction to set");
|
Option & argIdT = parser.add<Option> ('z', "qualifier-t" , "Identifier(qualifier) of the temperature correction to set");
|
||||||
ColorOption & argTemperature= parser.add<ColorOption>('Z', "temperature" , "Set the temperature correction of the leds (requires colors in hex format as RRGGBB)");
|
ColorOption & argTemperature = parser.add<ColorOption> ('Z', "temperature" , "Set the temperature correction of the leds (requires colors in hex format as RRGGBB)");
|
||||||
Option & argIdA = parser.add<Option> ('j', "qualifier-a" , "Identifier(qualifier) of the adjustment to set");
|
Option & argIdA = parser.add<Option> ('j', "qualifier-a" , "Identifier(qualifier) of the adjustment to set");
|
||||||
ColorOption & argRAdjust = parser.add<ColorOption>('R', "redAdjustment" , "Set the adjustment of the red color (requires colors in hex format as RRGGBB)");
|
ColorOption & argRAdjust = parser.add<ColorOption> ('R', "redAdjustment" , "Set the adjustment of the red color (requires colors in hex format as RRGGBB)");
|
||||||
ColorOption & argGAdjust = parser.add<ColorOption>('G', "greenAdjustment", "Set the adjustment of the green color (requires colors in hex format as RRGGBB)");
|
ColorOption & argGAdjust = parser.add<ColorOption> ('G', "greenAdjustment", "Set the adjustment of the green color (requires colors in hex format as RRGGBB)");
|
||||||
ColorOption & argBAdjust = parser.add<ColorOption>('B', "blueAdjustment", "Set the adjustment of the blue color (requires colors in hex format as RRGGBB)");
|
ColorOption & argBAdjust = parser.add<ColorOption> ('B', "blueAdjustment", "Set the adjustment of the blue color (requires colors in hex format as RRGGBB)");
|
||||||
IntOption & argSource = parser.add<IntOption> (0x0, "sourceSelect" , "Set current active priority channel and deactivate auto source switching");
|
IntOption & argSource = parser.add<IntOption> (0x0, "sourceSelect" , "Set current active priority channel and deactivate auto source switching");
|
||||||
BooleanOption & argSourceAuto = parser.add<BooleanOption>(0x0, "sourceAutoSelect", "Enables auto source, if disabled prio by manual selecting input source");
|
BooleanOption & argSourceAuto = parser.add<BooleanOption>(0x0, "sourceAutoSelect", "Enables auto source, if disabled prio by manual selecting input source");
|
||||||
BooleanOption & argSourceOff = parser.add<BooleanOption>(0x0, "sourceOff", "select no source, this results in leds activly set to black (=off)");
|
BooleanOption & argSourceOff = parser.add<BooleanOption>(0x0, "sourceOff", "select no source, this results in leds activly set to black (=off)");
|
||||||
BooleanOption & argConfigGet = parser.add<BooleanOption>(0x0, "configGet" , "Print the current loaded Hyperion configuration file");
|
BooleanOption & argConfigGet = parser.add<BooleanOption>(0x0, "configGet" , "Print the current loaded Hyperion configuration file");
|
||||||
Option & argSchemaGet = parser.add<Option>(0x0, "schemaGet" , "Print the json schema for Hyperion configuration");
|
Option & argSchemaGet = parser.add<Option> (0x0, "schemaGet" , "Print the json schema for Hyperion configuration");
|
||||||
Option & argConfigSet = parser.add<Option>('W', "configSet", "Write to the actual loaded configuration file. Should be a Json object string.");
|
Option & argConfigSet = parser.add<Option> ('W', "configSet", "Write to the actual loaded configuration file. Should be a Json object string.");
|
||||||
Option & argCreate = parser.add<Option>(0x0, "createkeys", "Create non exist Json Entry(s) in the actual loaded configuration file. Argument to use in combination with configSet.");
|
Option & argCreate = parser.add<Option> (0x0, "createkeys", "Create non exist Json Entry(s) in the actual loaded configuration file. Argument to use in combination with configSet.");
|
||||||
Option & argOverwriteConfig = parser.add<Option>(0x0, "overwrite", "Overwrite the actual loaded configuration file with the Json object string from configSet. Argument to use in combination with configSet.");
|
Option & argOverwriteConfig = parser.add<Option> (0x0, "overwrite", "Overwrite the actual loaded configuration file with the Json object string from configSet. Argument to use in combination with configSet.");
|
||||||
|
|
||||||
// parse all _options
|
// parse all _options
|
||||||
parser.process(app);
|
parser.process(app);
|
||||||
|
@ -53,8 +53,8 @@ int main(int argc, char** argv)
|
|||||||
// create the option parser and initialize all parameters
|
// create the option parser and initialize all parameters
|
||||||
Parser parser("V4L capture application for Hyperion");
|
Parser parser("V4L capture application for Hyperion");
|
||||||
|
|
||||||
Option & argDevice = parser.add<Option> ('d', "device", "The device to use [default: %1]", "/dev/video0");
|
Option & argDevice = parser.add<Option> ('d', "device", "The device to use [default: %1]", "auto");
|
||||||
SwitchOption<VideoStandard> & argVideoStandard = parser.add<SwitchOption<VideoStandard>>('v', "video-standard", "The used video standard. Valid values are PAL, NTSC or no-change. [default: %1]", "no-change");
|
SwitchOption<VideoStandard> & argVideoStandard= parser.add<SwitchOption<VideoStandard>>('v', "video-standard", "The used video standard. Valid values are PAL, NTSC or no-change. [default: %1]", "no-change");
|
||||||
SwitchOption<PixelFormat> & argPixelFormat = parser.add<SwitchOption<PixelFormat>> (0x0, "pixel-format", "The use pixel format. Valid values are YUYV, UYVY, RGB32 or no-change. [default: %1]", "no-change");
|
SwitchOption<PixelFormat> & argPixelFormat = parser.add<SwitchOption<PixelFormat>> (0x0, "pixel-format", "The use pixel format. Valid values are YUYV, UYVY, RGB32 or no-change. [default: %1]", "no-change");
|
||||||
IntOption & argInput = parser.add<IntOption> (0x0, "input", "Input channel (optional)", "-1");
|
IntOption & argInput = parser.add<IntOption> (0x0, "input", "Input channel (optional)", "-1");
|
||||||
IntOption & argWidth = parser.add<IntOption> (0x0, "width", "Try to set the width of the video input [default: %1]", "-1");
|
IntOption & argWidth = parser.add<IntOption> (0x0, "width", "Try to set the width of the video input [default: %1]", "-1");
|
||||||
@ -67,17 +67,17 @@ int main(int argc, char** argv)
|
|||||||
IntOption & argCropBottom = parser.add<IntOption> (0x0, "crop-bottom", "Number of pixels to crop from the bottom of the picture before decimation (overrides --crop-height)");
|
IntOption & argCropBottom = parser.add<IntOption> (0x0, "crop-bottom", "Number of pixels to crop from the bottom of the picture before decimation (overrides --crop-height)");
|
||||||
IntOption & argSizeDecimation = parser.add<IntOption> ('s', "size-decimator", "Decimation factor for the output size [default=%1]", "1");
|
IntOption & argSizeDecimation = parser.add<IntOption> ('s', "size-decimator", "Decimation factor for the output size [default=%1]", "1");
|
||||||
IntOption & argFrameDecimation = parser.add<IntOption> ('f', "frame-decimator", "Decimation factor for the video frames [default=%1]", "1");
|
IntOption & argFrameDecimation = parser.add<IntOption> ('f', "frame-decimator", "Decimation factor for the video frames [default=%1]", "1");
|
||||||
BooleanOption & argScreenshot = parser.add<BooleanOption> (0x0, "screenshot", "Take a single screenshot, save it to file and quit");
|
BooleanOption & argScreenshot = parser.add<BooleanOption>(0x0, "screenshot", "Take a single screenshot, save it to file and quit");
|
||||||
DoubleOption & argSignalThreshold = parser.add<DoubleOption> ('t', "signal-threshold", "The signal threshold for detecting the presence of a signal. Value should be between 0.0 and 1.0.", QString(), 0.0, 1.0);
|
DoubleOption & argSignalThreshold = parser.add<DoubleOption> ('t', "signal-threshold", "The signal threshold for detecting the presence of a signal. Value should be between 0.0 and 1.0.", QString(), 0.0, 1.0);
|
||||||
DoubleOption & argRedSignalThreshold = parser.add<DoubleOption> (0x0, "red-threshold", "The red signal threshold. Value should be between 0.0 and 1.0. (overrides --signal-threshold)");
|
DoubleOption & argRedSignalThreshold = parser.add<DoubleOption> (0x0, "red-threshold", "The red signal threshold. Value should be between 0.0 and 1.0. (overrides --signal-threshold)");
|
||||||
DoubleOption & argGreenSignalThreshold = parser.add<DoubleOption> (0x0, "green-threshold", "The green signal threshold. Value should be between 0.0 and 1.0. (overrides --signal-threshold)");
|
DoubleOption & argGreenSignalThreshold= parser.add<DoubleOption> (0x0, "green-threshold", "The green signal threshold. Value should be between 0.0 and 1.0. (overrides --signal-threshold)");
|
||||||
DoubleOption & argBlueSignalThreshold = parser.add<DoubleOption> (0x0, "blue-threshold", "The blue signal threshold. Value should be between 0.0 and 1.0. (overrides --signal-threshold)");
|
DoubleOption & argBlueSignalThreshold = parser.add<DoubleOption> (0x0, "blue-threshold", "The blue signal threshold. Value should be between 0.0 and 1.0. (overrides --signal-threshold)");
|
||||||
BooleanOption & arg3DSBS = parser.add<BooleanOption> (0x0, "3DSBS", "Interpret the incoming video stream as 3D side-by-side");
|
BooleanOption & arg3DSBS = parser.add<BooleanOption>(0x0, "3DSBS", "Interpret the incoming video stream as 3D side-by-side");
|
||||||
BooleanOption & arg3DTAB = parser.add<BooleanOption> (0x0, "3DTAB", "Interpret the incoming video stream as 3D top-and-bottom");
|
BooleanOption & arg3DTAB = parser.add<BooleanOption>(0x0, "3DTAB", "Interpret the incoming video stream as 3D top-and-bottom");
|
||||||
Option & argAddress = parser.add<Option> ('a', "address", "Set the address of the hyperion server [default: %1]", "127.0.0.1:19445");
|
Option & argAddress = parser.add<Option> ('a', "address", "Set the address of the hyperion server [default: %1]", "127.0.0.1:19445");
|
||||||
IntOption & argPriority = parser.add<IntOption> ('p', "priority", "Use the provided priority channel (the lower the number, the higher the priority) [default: %1]", "800");
|
IntOption & argPriority = parser.add<IntOption> ('p', "priority", "Use the provided priority channel (the lower the number, the higher the priority) [default: %1]", "800");
|
||||||
BooleanOption & argSkipReply = parser.add<BooleanOption> (0x0, "skip-reply", "Do not receive and check reply messages from Hyperion");
|
BooleanOption & argSkipReply = parser.add<BooleanOption>(0x0, "skip-reply", "Do not receive and check reply messages from Hyperion");
|
||||||
BooleanOption & argHelp = parser.add<BooleanOption> ('h', "help", "Show this help message and exit");
|
BooleanOption & argHelp = parser.add<BooleanOption>('h', "help", "Show this help message and exit");
|
||||||
|
|
||||||
argVideoStandard.addSwitch("pal", VIDEOSTANDARD_PAL);
|
argVideoStandard.addSwitch("pal", VIDEOSTANDARD_PAL);
|
||||||
argVideoStandard.addSwitch("ntsc", VIDEOSTANDARD_NTSC);
|
argVideoStandard.addSwitch("ntsc", VIDEOSTANDARD_NTSC);
|
||||||
|
@ -33,7 +33,7 @@ int main(int argc, char ** argv)
|
|||||||
Parser parser("X11 capture application for Hyperion");
|
Parser parser("X11 capture application for Hyperion");
|
||||||
|
|
||||||
IntOption & argFps = parser.add<IntOption> ('f', "framerate", "Capture frame rate [default: %1]", "10");
|
IntOption & argFps = parser.add<IntOption> ('f', "framerate", "Capture frame rate [default: %1]", "10");
|
||||||
BooleanOption & argXGetImage = parser.add<BooleanOption> ('x', "xgetimage", "Use XGetImage instead of XRender");
|
BooleanOption & argXGetImage = parser.add<BooleanOption>('x', "xgetimage", "Use XGetImage instead of XRender");
|
||||||
IntOption & argCropWidth = parser.add<IntOption> (0x0, "crop-width", "Number of pixels to crop from the left and right sides of the picture before decimation [default: %1]", "0");
|
IntOption & argCropWidth = parser.add<IntOption> (0x0, "crop-width", "Number of pixels to crop from the left and right sides of the picture before decimation [default: %1]", "0");
|
||||||
IntOption & argCropHeight = parser.add<IntOption> (0x0, "crop-height", "Number of pixels to crop from the top and the bottom of the picture before decimation [default: %1]", "0");
|
IntOption & argCropHeight = parser.add<IntOption> (0x0, "crop-height", "Number of pixels to crop from the top and the bottom of the picture before decimation [default: %1]", "0");
|
||||||
IntOption & argCropLeft = parser.add<IntOption> (0x0, "crop-left", "Number of pixels to crop from the left of the picture before decimation (overrides --crop-width)");
|
IntOption & argCropLeft = parser.add<IntOption> (0x0, "crop-left", "Number of pixels to crop from the left of the picture before decimation (overrides --crop-width)");
|
||||||
@ -41,11 +41,11 @@ int main(int argc, char ** argv)
|
|||||||
IntOption & argCropTop = parser.add<IntOption> (0x0, "crop-top", "Number of pixels to crop from the top of the picture before decimation (overrides --crop-height)");
|
IntOption & argCropTop = parser.add<IntOption> (0x0, "crop-top", "Number of pixels to crop from the top of the picture before decimation (overrides --crop-height)");
|
||||||
IntOption & argCropBottom = parser.add<IntOption> (0x0, "crop-bottom", "Number of pixels to crop from the bottom of the picture before decimation (overrides --crop-height)");
|
IntOption & argCropBottom = parser.add<IntOption> (0x0, "crop-bottom", "Number of pixels to crop from the bottom of the picture before decimation (overrides --crop-height)");
|
||||||
IntOption & argSizeDecimation = parser.add<IntOption> ('s', "size-decimator", "Decimation factor for the output size [default=%1]", "8");
|
IntOption & argSizeDecimation = parser.add<IntOption> ('s', "size-decimator", "Decimation factor for the output size [default=%1]", "8");
|
||||||
BooleanOption & argScreenshot = parser.add<BooleanOption> (0x0, "screenshot", "Take a single screenshot, save it to file and quit");
|
BooleanOption & argScreenshot = parser.add<BooleanOption>(0x0, "screenshot", "Take a single screenshot, save it to file and quit");
|
||||||
Option & argAddress = parser.add<Option> ('a', "address", "Set the address of the hyperion server [default: %1]", "127.0.0.1:19445");
|
Option & argAddress = parser.add<Option> ('a', "address", "Set the address of the hyperion server [default: %1]", "127.0.0.1:19445");
|
||||||
IntOption & argPriority = parser.add<IntOption> ('p', "priority", "Use the provided priority channel (the lower the number, the higher the priority) [default: %1]", "800");
|
IntOption & argPriority = parser.add<IntOption> ('p', "priority", "Use the provided priority channel (the lower the number, the higher the priority) [default: %1]", "800");
|
||||||
BooleanOption & argSkipReply = parser.add<BooleanOption> (0x0, "skip-reply", "Do not receive and check reply messages from Hyperion");
|
BooleanOption & argSkipReply = parser.add<BooleanOption>(0x0, "skip-reply", "Do not receive and check reply messages from Hyperion");
|
||||||
BooleanOption & argHelp = parser.add<BooleanOption> ('h', "help", "Show this help message and exit");
|
BooleanOption & argHelp = parser.add<BooleanOption>('h', "help", "Show this help message and exit");
|
||||||
|
|
||||||
// parse all options
|
// parse all options
|
||||||
parser.process(app);
|
parser.process(app);
|
||||||
|
@ -41,5 +41,3 @@ endif ()
|
|||||||
|
|
||||||
install ( TARGETS hyperiond DESTINATION "share/hyperion/bin/" COMPONENT "${PLATFORM}" )
|
install ( TARGETS hyperiond DESTINATION "share/hyperion/bin/" COMPONENT "${PLATFORM}" )
|
||||||
install ( DIRECTORY ${CMAKE_SOURCE_DIR}/bin/service DESTINATION "share/hyperion/" COMPONENT "${PLATFORM}" )
|
install ( DIRECTORY ${CMAKE_SOURCE_DIR}/bin/service DESTINATION "share/hyperion/" COMPONENT "${PLATFORM}" )
|
||||||
install ( DIRECTORY ${CMAKE_SOURCE_DIR}/config DESTINATION "share/hyperion/" COMPONENT "${PLATFORM}" )
|
|
||||||
install ( DIRECTORY ${CMAKE_SOURCE_DIR}/assets/webconfig DESTINATION "share/hyperion/" COMPONENT "${PLATFORM}" )
|
|
||||||
|
@ -548,13 +548,13 @@ void HyperionDaemon::createGrabberOsx(const QJsonObject & grabberConfig)
|
|||||||
void HyperionDaemon::createGrabberV4L2()
|
void HyperionDaemon::createGrabberV4L2()
|
||||||
{
|
{
|
||||||
// construct and start the v4l2 grabber if the configuration is present
|
// construct and start the v4l2 grabber if the configuration is present
|
||||||
bool v4lConfigured = _qconfig.contains("grabber-v4l2");
|
bool v4lConfigured = _qconfig.contains("grabberV4L2");
|
||||||
bool v4lStarted = false;
|
bool v4lStarted = false;
|
||||||
unsigned v4lEnableCount = 0;
|
unsigned v4lEnableCount = 0;
|
||||||
|
|
||||||
if (_qconfig["grabber-v4l2"].isArray())
|
if (_qconfig["grabberV4L2"].isArray())
|
||||||
{
|
{
|
||||||
const QJsonArray & v4lArray = _qconfig["grabber-v4l2"].toArray();
|
const QJsonArray & v4lArray = _qconfig["grabberV4L2"].toArray();
|
||||||
for ( signed idx=0; idx<v4lArray.size(); idx++)
|
for ( signed idx=0; idx<v4lArray.size(); idx++)
|
||||||
{
|
{
|
||||||
const QJsonObject & grabberConfig = v4lArray.at(idx).toObject();
|
const QJsonObject & grabberConfig = v4lArray.at(idx).toObject();
|
||||||
|
@ -13,6 +13,9 @@
|
|||||||
#include <QLocale>
|
#include <QLocale>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include <QResource>
|
||||||
|
#include <QDir>
|
||||||
|
#include <QStringList>
|
||||||
|
|
||||||
#include "HyperionConfig.h"
|
#include "HyperionConfig.h"
|
||||||
|
|
||||||
@ -67,10 +70,13 @@ int main(int argc, char** argv)
|
|||||||
parser.addHelpOption();
|
parser.addHelpOption();
|
||||||
|
|
||||||
BooleanOption & versionOption = parser.add<BooleanOption>(0x0, "version", "Show version information");
|
BooleanOption & versionOption = parser.add<BooleanOption>(0x0, "version", "Show version information");
|
||||||
IntOption & parentOption = parser.add<IntOption>('p', "parent", "pid of parent hyperiond"); // 2^22 is the max for Linux
|
IntOption & parentOption = parser.add<IntOption> ('p', "parent", "pid of parent hyperiond"); // 2^22 is the max for Linux
|
||||||
BooleanOption & silentOption = parser.add<BooleanOption>('s', "silent", "do not print any outputs");
|
BooleanOption & silentOption = parser.add<BooleanOption>('s', "silent", "do not print any outputs");
|
||||||
BooleanOption & verboseOption = parser.add<BooleanOption>('v', "verbose", "Increase verbosity");
|
BooleanOption & verboseOption = parser.add<BooleanOption>('v', "verbose", "Increase verbosity");
|
||||||
BooleanOption & debugOption = parser.add<BooleanOption>('d', "debug", "Show debug messages");
|
BooleanOption & debugOption = parser.add<BooleanOption>('d', "debug", "Show debug messages");
|
||||||
|
Option & exportConfigOption = parser.add<Option> (0x0, "export-config", "export default config to file");
|
||||||
|
Option & exportEfxOption = parser.add<Option> (0x0, "export-effects", "export effects to given path");
|
||||||
|
|
||||||
parser.addPositionalArgument("config-files", QCoreApplication::translate("main", "Configuration files"), "[files...]");
|
parser.addPositionalArgument("config-files", QCoreApplication::translate("main", "Configuration files"), "[files...]");
|
||||||
|
|
||||||
parser.process(app);
|
parser.process(app);
|
||||||
@ -112,6 +118,54 @@ int main(int argc, char** argv)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (parser.isSet(exportConfigOption))
|
||||||
|
{
|
||||||
|
Q_INIT_RESOURCE(resource);
|
||||||
|
if (QFile::copy(":/hyperion_default.config",exportConfigOption.value(parser)))
|
||||||
|
{
|
||||||
|
Info(log, "export complete.");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
Error(log, "can not export to %s",exportConfigOption.getCString(parser));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (parser.isSet(exportEfxOption))
|
||||||
|
{
|
||||||
|
Q_INIT_RESOURCE(EffectEngine);
|
||||||
|
QDir directory(":/effects/");
|
||||||
|
QDir destDir(exportEfxOption.value(parser));
|
||||||
|
if (directory.exists() && destDir.exists())
|
||||||
|
{
|
||||||
|
std::cout << "extract to folder: " << std::endl;
|
||||||
|
QStringList filenames = directory.entryList(QStringList() << "*.json", QDir::Files, QDir::Name | QDir::IgnoreCase);
|
||||||
|
foreach (const QString & filename, filenames)
|
||||||
|
{
|
||||||
|
if (QFile::exists(destDir.dirName()+"/"+filename))
|
||||||
|
{
|
||||||
|
QFile::remove(destDir.dirName()+"/"+filename);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::cout << "Extract: " << filename.toStdString() << " ... ";
|
||||||
|
if (QFile::copy(QString(":/effects/")+filename, destDir.dirName()+"/"+filename))
|
||||||
|
{
|
||||||
|
std::cout << "ok" << std::endl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::cout << "error, aborting" << std::endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Error(log, "can not export to %s",exportEfxOption.getCString(parser));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (configFiles.size() == 0)
|
if (configFiles.size() == 0)
|
||||||
{
|
{
|
||||||
Error(log, "Missing required configuration file. Usage: hyperiond <options ...> [config.file ...]");
|
Error(log, "Missing required configuration file. Usage: hyperiond <options ...> [config.file ...]");
|
||||||
@ -139,7 +193,7 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
if ( argvId < 0)
|
if ( argvId < 0)
|
||||||
{
|
{
|
||||||
Error(log, "No valid config found");
|
Warning(log, "No valid config found");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user