Initial HyperDRM 0.6.0: webOS ambient light app and native service

This commit is contained in:
matze19999 committed 2026-10-06 13:28:45 +02:00
commit 376798d6ce
34 files changed
+2170

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
'use strict';
var pending=[];
function call(method,done,data){
if(typeof PalmServiceBridge==='undefined'){done({returnValue:false,errorText:'Diese App benötigt einen LG-TV mit installiertem nativem Dienst.'});return;}
var bridge=new PalmServiceBridge(),timer,finished=false;
function finish(value){if(finished)return;finished=true;clearTimeout(timer);var i=pending.indexOf(bridge);if(i>=0)pending.splice(i,1);done(value);}
bridge.onservicecallback=function(raw){try{finish(JSON.parse(raw));}catch(e){finish({returnValue:false,errorText:'Ungültige Antwort vom Dienst'});}};
pending.push(bridge);timer=setTimeout(function(){bridge.cancel();finish({returnValue:false,errorText:'Der Dienst antwortet nicht. Installation und Dienstprotokoll prüfen.'});},10000);
bridge.call('luna://org.webosbrew.histogramhyperion.service/'+method,JSON.stringify(data||{}));
}
function display(result){
if(typeof result.autostart==='boolean'){var toggle=document.getElementById('autostart');toggle.setAttribute('aria-checked',String(result.autostart));toggle.textContent='Autostart: '+(result.autostart?'Ein':'Aus');}
document.getElementById('error').textContent=result.errorText||result.error||'';
document.getElementById('status').textContent=result.returnValue===false?'Dienst nicht bereit':(result.running?'Aktiv':'Gestoppt')+' · '+(result.frames||0)+' bestätigte Farbausgaben';
if(result.colorValid)document.getElementById('status').textContent+=result.spatialOutput?' · '+result.ledCount+' LEDs aus 16 Farbbereichen':' · Gesendetes RGB: '+result.outputColor.join(', ');
else if(result.returnValue!==false)document.getElementById('status').textContent+=' · Keine aktuelle Farbausgabe';
if(result.blackBarDetection && result.running)document.getElementById('status').textContent+=result.letterboxDetected?' · Balken oben/unten erkannt':' · Vollbild-Erfassung';
if(result.spatialInterpolation)document.getElementById('status').textContent+=' · Feine Farbübergänge';
var box=document.getElementById('regions');box.textContent='';
(result.regions||[]).forEach(function(rgb,index){var e=document.createElement('div');e.className='swatch';e.style.backgroundColor='rgb('+rgb.join(',')+')';e.title='Histogramm '+index;box.appendChild(e);});
}
document.getElementById('start').onclick=function(){call('start',function(r){if(r.returnValue===false)display(r);else call('status',display);});};
document.getElementById('stop').onclick=function(){call('stop',function(){call('status',display);});};
document.getElementById('refresh').onclick=function(){call('status',display);};
call('status',display);setInterval(function(){if(!pending.length)call('status',display);},3000);
document.getElementById('start').focus();
document.getElementById('autostart').onclick=function(){var button=this;var enabled=button.getAttribute('aria-checked')!=='true';button.disabled=true;call('autostart',function(r){button.disabled=false;if(r.returnValue===false)document.getElementById('error').textContent=r.errorText;else call('status',display);},{enabled:enabled});};
+1
View File
@@ -0,0 +1 @@
{"id": "org.webosbrew.histogramhyperion", "version": "0.6.0", "vendor": "Local development", "type": "web", "main": "index.html", "title": "HyperDRM", "icon": "icon.png", "resolution": "1920x1080", "disableBackHistoryAPI": true, "largeIcon": "large-icon.png", "appDescription": "Ambient Light für webOS und Hyperion"}
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

+8
View File
@@ -0,0 +1,8 @@
<!doctype html><html lang="de"><meta charset="utf-8"><meta name="viewport" content="width=device-width"><title>HyperDRM</title>
<style>body{background:#101827;color:#f1f5ff;font:28px sans-serif;margin:70px;max-width:1400px}h1{font-size:52px;display:flex;align-items:center;gap:24px}h1 img{border-radius:20px}button{font:inherit;padding:20px 32px;margin:12px 12px 12px 0;background:#223654;color:white;border:2px solid #739be0;border-radius:12px}button:focus{outline:5px solid #66ddff}#regions{display:flex;flex-wrap:wrap;gap:8px}.swatch{width:64px;height:64px;border:1px solid #abc}p{line-height:1.5}#error{color:#ffbc99}small{color:#c0cbe0}</style>
<h1><img src="logo.png" alt="" width="104" height="104">HyperDRM</h1><p>Ambient Light f&uuml;r webOS und Hyperion.</p><p id="status">Dienst wird gepr&uuml;ft &hellip;</p><p id="error" role="alert"></p>
<button id="start">Starten</button><button id="stop">Stoppen</button><button id="refresh">Status pr&uuml;fen</button>
<button id="autostart" role="switch" aria-checked="false">Autostart: Aus</button><p><small>Startet den Dienst beim TV-Boot. Stoppen beendet nur die aktuelle Sitzung.</small></p>
<p><small>127.0.0.1:19444 &middot; Priorit&auml;t 149 &middot; 10 Abfragen pro Sekunde</small></p>
<div id="regions" aria-label="Histogrammfarben"></div><p><small>Das Hyperion-Layout bestimmt Anzahl und Positionen der LEDs. Die Farben stammen aus 16 LG-Histogrammbereichen mit interpolierten Randfarben. Nach einer Layout&auml;nderung den Dienst neu starten.</small></p>
<script src="app.js"></script></html>
Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB