diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a519648..7ca3c166 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Support gaps on Matrix Layout (#1696) + ### Changed ### Removed diff --git a/assets/webconfig/content/conf_leds.html b/assets/webconfig/content/conf_leds.html index e249f630..5e961851 100755 --- a/assets/webconfig/content/conf_leds.html +++ b/assets/webconfig/content/conf_leds.html @@ -327,7 +327,7 @@ - + +
%h
+ + + + + + + + +
%v
+ + + + + + + + +
%h
+ + + + + + + + +
%v
+ + + + + + + diff --git a/assets/webconfig/i18n/de.json b/assets/webconfig/i18n/de.json index aa64787d..56848b0a 100644 --- a/assets/webconfig/i18n/de.json +++ b/assets/webconfig/i18n/de.json @@ -115,6 +115,10 @@ "conf_leds_layout_cl_topright": "Oben Rechts (Ecke)", "conf_leds_layout_cl_vleddepth": "Vertikale LED-Tiefe", "conf_leds_layout_frame": "Klassisches Layout (Rahmen)", + "conf_leds_layout_gapbottom": "Abstand von unten", + "conf_leds_layout_gapleft": "Abstand von links", + "conf_leds_layout_gapright": "Abstand von rechts", + "conf_leds_layout_gaptop": "Abstand von oben", "conf_leds_layout_generatedconf": "Generierte/Aktuelle LED-Konfiguration", "conf_leds_layout_generation_error": "LED Layout wurde nicht erzeugt", "conf_leds_layout_generation_success": "LED-Layout erfolgreich erstellt", @@ -969,7 +973,9 @@ "general_speech_en": "Englisch", "general_speech_es": "Spanisch", "general_speech_fr": "Französisch", + "general_speech_he": "Hebräisch", "general_speech_hu": "Ungarisch", + "general_speech_id": "Indonesisch", "general_speech_it": "Italienisch", "general_speech_ja": "Japanisch", "general_speech_nb": "Norwegisch (Bokmål)", @@ -980,6 +986,7 @@ "general_speech_ru": "Russisch", "general_speech_sv": "Schwedisch", "general_speech_tr": "Türkisch", + "general_speech_uk": "Ukrainisch", "general_speech_vi": "Vietnamesisch", "general_speech_zh-CN": "Chinesisch (vereinfacht)", "general_webui_title": "Hyperion - Web Konfiguration", diff --git a/assets/webconfig/i18n/en.json b/assets/webconfig/i18n/en.json index 4ad9278a..63155f2a 100644 --- a/assets/webconfig/i18n/en.json +++ b/assets/webconfig/i18n/en.json @@ -117,6 +117,10 @@ "conf_leds_layout_cl_topright": "Top Right (Corner)", "conf_leds_layout_cl_vleddepth": "Vertical LED depth", "conf_leds_layout_frame": "Classic Layout (LED Frame)", + "conf_leds_layout_gapleft": "Left gap", + "conf_leds_layout_gapright": "Right gap", + "conf_leds_layout_gaptop": "Top gap", + "conf_leds_layout_gapbottom": "Bottom gap", "conf_leds_layout_generatedconf": "Generated/Current LED Configuration", "conf_leds_layout_generation_success": "LED Layout generated sucessfully", "conf_leds_layout_generation_error": "LED Layout was not generated", diff --git a/assets/webconfig/i18n/fr.json b/assets/webconfig/i18n/fr.json index 55504413..7965ed38 100644 --- a/assets/webconfig/i18n/fr.json +++ b/assets/webconfig/i18n/fr.json @@ -52,7 +52,7 @@ "conf_helptable_option": "Option", "conf_leds_config_error": "Erreur dans la configuration de la disposition", "conf_leds_config_warning": "Verifiez la configuration de la disposition des LEDs", - "conf_leds_contr_label_contrtype": "Type de contrôleur : ", + "conf_leds_contr_label_contrtype": "Type de contrôleur: ", "conf_leds_device_info_log": "Si vos LED ne fonctionnent pas, vérifiez ici s'il y a des erreurs :", "conf_leds_device_intro": "Hyperion prend en charge de nombreux contrôleurs pour transmettre des données à votre appareil cible. Sélectionnez un contrôleur LED dans la liste triée et configurez-le. Nous avons choisi les meilleurs paramètres par défaut pour chaque appareil.", "conf_leds_error_get_properties_text": "Erreur lors de l'obtention des propriétés de l'appareil. Veuillez vérifier les éléments de configuration.", @@ -82,6 +82,7 @@ "conf_leds_layout_cl_bottomright": "Bas droit (Coin)", "conf_leds_layout_cl_cornergap": "Écart aux coins", "conf_leds_layout_cl_edgegap": "Écart aux bords", + "conf_leds_layout_cl_entertainment": "Espace de divertissement", "conf_leds_layout_cl_gaglength": "Taille de l'écart", "conf_leds_layout_cl_gappos": "Position de l'écart", "conf_leds_layout_cl_hleddepth": "Profondeur LED horizontale", @@ -193,34 +194,34 @@ "dashboard_alert_message_disabled": "Cette instance est actuellement désactivée ! Pour l'utiliser à nouveau, activez-la dans le tableau de bord.", "dashboard_alert_message_disabled_t": "Instance matérielle LED désactivée", "dashboard_componentbox_label_comp": "Composant", - "dashboard_componentbox_label_status": "Etat", + "dashboard_componentbox_label_status": "État", "dashboard_componentbox_label_title": "Etat des composants", - "dashboard_infobox_label_currenthyp": "Votre version d'Hyperion : ", + "dashboard_infobox_label_currenthyp": "Votre version Hyperion : ", "dashboard_infobox_label_disableh": "Désactiver l'instance : $1", "dashboard_infobox_label_enableh": "Activer l'instance : $1", - "dashboard_infobox_label_instance": "Instance", + "dashboard_infobox_label_instance": "Instance:", "dashboard_infobox_label_latesthyp": "Dernière version d'Hyperion : ", - "dashboard_infobox_label_platform": "Plateforme", + "dashboard_infobox_label_platform": "Plateforme:", "dashboard_infobox_label_port_boblight": "Serveur Boblight :", "dashboard_infobox_label_port_flat": "Flatbuffer:", "dashboard_infobox_label_port_json": "Server-JSON:", "dashboard_infobox_label_port_proto": "Protobuffer:", "dashboard_infobox_label_ports": "Ports", "dashboard_infobox_label_ports_websocket": "WebSocket (ws|wss):", - "dashboard_infobox_label_smartacc": "Accès simplifié", - "dashboard_infobox_label_statush": "Statut d'Hyperion : ", + "dashboard_infobox_label_smartacc": "Accès Intelligent", + "dashboard_infobox_label_statush": "Statut Hyperion : ", "dashboard_infobox_label_title": "Information", "dashboard_infobox_label_watchedversionbranch": "Branche surveillée :", "dashboard_infobox_message_updatesuccess": "Vous utilisez la dernière version d'Hyperion.", "dashboard_infobox_message_updatewarning": "Une nouvelle version d'Hyperion est disponible ! ($1)", - "dashboard_label_intro": "Ce dashboard vous donne une vue rapide sur l'état d'Hyperion.", + "dashboard_label_intro": "Ce dashboard vous donne une vue rapide sur l'état Hyperion", "dashboard_message_default_password": "La WebUI utilise le mot de passe par défaut. Nous recommandons de le modifier.", "dashboard_message_default_password_t": "Utilisation du mot de passe par défaut pour la WebUI", "dashboard_message_do_not_show_again": "Ne plus afficher ce message", "dashboard_message_global_setting": "Les réglages sur cette page sont indépendantes des instances. Tout changement sera global a toutes les instances.", "dashboard_message_global_setting_t": "Réglage global", "dashboard_newsbox_label_title": "Hyperion - Blog", - "dashboard_newsbox_noconn": "Impossible d'accéder au blog d'Hyperion. Votre connexion internet fonctionne-t-elle ?", + "dashboard_newsbox_noconn": "Impossible d'accéder au blog Hyperion. Votre connexion internet est fonctionnel ?", "dashboard_newsbox_readmore": "Lire plus", "dashboard_newsbox_visitblog": "Visiter le Blog d'Hyperion", "edt_append_degree": "°", @@ -271,6 +272,7 @@ "edt_conf_bb_unknownFrameCnt_title": "image inconnu", "edt_conf_bge_heading_title": "Effet/Couleur d'arrière-plan", "edt_conf_bobls_heading_title": "Serveur Boblight", + "edt_conf_cec_event_title": "Évenement CEC", "edt_conf_color_accuracyLevel_expl": "Niveau de précision de l'évaluation des couleurs dominantes. Un niveau plus élevé permet d'obtenir des résultats plus précis, mais nécessite également une plus grande puissance de traitement. Doit être combiné avec un traitement réduit des pixels.", "edt_conf_color_accuracyLevel_title": "Niveau d'exactitude", "edt_conf_color_backlightColored_expl": "Ajouter des couleurs à votre rétroéclairage", @@ -333,6 +335,10 @@ "edt_conf_enum_PAL": "PAL", "edt_conf_enum_SECAM": "SECAM", "edt_conf_enum_VERTICAL": "Verticale", + "edt_conf_enum_action_idle": "Inactif", + "edt_conf_enum_action_restart": "Redémarrer", + "edt_conf_enum_action_resume": "Continuer", + "edt_conf_enum_action_suspend": "Suspendre", "edt_conf_enum_automatic": "Automatique", "edt_conf_enum_bbclassic": "Classique", "edt_conf_enum_bbdefault": "Defaut", @@ -341,6 +347,8 @@ "edt_conf_enum_bgr": "BGR", "edt_conf_enum_bottom_up": "De bas en haut", "edt_conf_enum_brg": "BRG", + "edt_conf_enum_cec_key_f1_blue": "Bouton bleu enfoncé", + "edt_conf_enum_cec_key_f2_red": "Bouton rouge enfoncé", "edt_conf_enum_color": "Couleur", "edt_conf_enum_custom": "Personnalisation", "edt_conf_enum_decay": "Décroissance", @@ -468,6 +476,8 @@ "edt_conf_net_localApiAuth_title": "Authentification de l'API locale", "edt_conf_net_restirctedInternetAccessAPI_expl": "Vous pouvez limiter l'accès à l'API via l'internet à certaines IP.", "edt_conf_net_restirctedInternetAccessAPI_title": "Limité aux IP", + "edt_conf_os_events_suspendEnable_expl": "Écoute les événements de suspension/reprise du système d'exploitation", + "edt_conf_os_events_suspendOnLockEnable_title": "Suspendre lorsqu'il est verrouillé", "edt_conf_pbs_heading_title": "Serveur Protocol Buffers", "edt_conf_pbs_timeout_expl": "Si aucune donnée n'est reçue dans la période de temps donnée, le composant sera désactivé.", "edt_conf_pbs_timeout_title": "Temps écoulé", @@ -488,6 +498,7 @@ "edt_conf_smooth_updateDelay_title": "Changer le retard", "edt_conf_smooth_updateFrequency_expl": "Le vitesse de sortie pour le contrôleur led.", "edt_conf_smooth_updateFrequency_title": "Charger la fréquence", + "edt_conf_time_event_title": "Temps", "edt_conf_v4l2_blueSignalThreshold_expl": "Assombrie les valeurs bleues faibles (reconnues comme noires)", "edt_conf_v4l2_blueSignalThreshold_title": "Seuil de signal bleu", "edt_conf_v4l2_cecDetection_expl": "Si cette option est activée, la capture USB sera temporairement désactivée lorsque l'événement CEC standby sera reçu du bus HDMI.", @@ -556,8 +567,11 @@ "edt_conf_webc_keyPassPhrase_title": "Mot de passe de clé", "edt_conf_webc_keyPath_expl": "Chemin vers la clé (doit être au format PEM, chiffrée avec RSA)", "edt_conf_webc_keyPath_title": "Chemin de clé privée", + "edt_conf_webc_port_title": "Port HTTP", "edt_conf_webc_sslport_expl": "Port HTTPS du serveur web", "edt_conf_webc_sslport_title": "Port HTTPS", + "edt_dev_auth_key_title": "Jeton Autorisation", + "edt_dev_auth_key_title_info": "Jeton d'autorisation requis pour avoir accès au matériel", "edt_dev_enum_sub_min_cool_adjust": "Soustraire le blanc froid", "edt_dev_enum_sub_min_warm_adjust": "Soustraire le blanc chaud", "edt_dev_enum_subtract_minimum": "Soustraire le minimum", @@ -675,6 +689,7 @@ "edt_dev_spec_transistionTime_title": "Temps de transition", "edt_dev_spec_uid_title": "UID", "edt_dev_spec_universe_title": "Univers", + "edt_dev_spec_useAPIv2_title": "Utliser API v2", "edt_dev_spec_useEntertainmentAPI_title": "Utiliser l'API Hue Entertainment", "edt_dev_spec_useOrbSmoothing_title": "Utiliser le lissage orb", "edt_dev_spec_useRgbwProtocol_title": "Utiliser le protocole RGBW", @@ -745,6 +760,7 @@ "edt_eff_ledlist": "Liste de LED", "edt_eff_ledtest_header": "Test LED", "edt_eff_ledtest_header_desc": "sortie tournante: rouge, verte, blanche, noire", + "edt_eff_ledtest_seq_header": "Séquence d'essais LED", "edt_eff_length": "Longueur", "edt_eff_lightclock_header": "Horloge lumineuse", "edt_eff_lightclock_header_desc": "Une véritable horloge lumineuse ! Ajustez les couleurs des heures, des minutes et des secondes. Un marqueur 3/6/9/12 heures est également disponible. Si l'horloge est erronée, vous devez vérifier l'horloge de votre système.", @@ -866,9 +882,9 @@ "general_btn_grantAccess": "Donner l'accès", "general_btn_iswitch": "Basculer", "general_btn_next": "Suivant", - "general_btn_off": "Off", + "general_btn_off": "Désactivation", "general_btn_ok": "OK", - "general_btn_on": "On", + "general_btn_on": "Activation", "general_btn_overwrite": "Remplacer", "general_btn_rename": "Renommer", "general_btn_restarthyperion": "Redémarrer Hyperion", @@ -887,7 +903,7 @@ "general_comp_BLACKBORDER": "Détection des bandes noires", "general_comp_BOBLIGHTSERVER": "Serveur Boblight", "general_comp_FLATBUFSERVER": "Serveur Flatbuffers", - "general_comp_FORWARDER": "Transfert", + "general_comp_FORWARDER": "Transition", "general_comp_GRABBER": "Capture d'écran", "general_comp_LEDDEVICE": "Périphérique LED", "general_comp_PROTOSERVER": "Serveur Protocol Buffers", @@ -912,6 +928,7 @@ "general_speech_en": "Anglais", "general_speech_es": "Espagnol", "general_speech_fr": "Français", + "general_speech_he": "Hébreu", "general_speech_hu": "Hongrois", "general_speech_it": "Italien", "general_speech_ja": "Japonais", @@ -970,6 +987,8 @@ "main_menu_dashboard_token": "Tableau de bord", "main_menu_effect_conf_token": "Effets", "main_menu_effectsconfigurator_token": "Configurateur d'effets", + "main_menu_event_services_token": "Services Évènements", + "main_menu_events": "Services Évènements", "main_menu_general_conf_token": "Général", "main_menu_grabber_conf_token": "Capture matérielle", "main_menu_input_selection_token": "Sélection de l'entrée", @@ -1082,6 +1101,7 @@ "wiz_cololight_noprops": "Récupération des propriétés du périphérique impossible. Définissez manuellement le nombre de LED physiques", "wiz_cololight_title": "Assistant Cololight", "wiz_guideyou": "Le $1 vous guidera à travers les réglages. Cliquez sur le bouton !", + "wiz_hue_blinkblue": "Laisse-le s'éclairer", "wiz_hue_clientkey": "Clé Client :", "wiz_hue_create_user": "Créer un nouvel utilisateur", "wiz_hue_desc1": "Il recherche automatiquement un Hue Bridge, au cas où il n'en trouverait pas, vous devez fournir l'adresse IP et appuyer sur le bouton actualiser à droite. Maintenant, vous avez besoin d'un ID utilisateur, si vous n'en avez pas, créez-en un nouveau.", @@ -1114,6 +1134,9 @@ "wiz_identify_tip": "Identifier le dispositif configuré en l'allumant", "wiz_ids_disabled": "Désactivé", "wiz_ids_entire": "Image entière", + "wiz_layout": "Générer une mise en page", + "wiz_nanoleaf_press_onoff_button": "Veuillez appuyer sur le bouton Marche/Arrêt de votre appareil Nanoleaf pendant 5 à 7 secondes.", + "wiz_nanoleaf_user_auth_intro": "L'assistant vous aide à générer un jeton d'autorisation utilisateur requis pour permettre à Hyperion d'accéder à l'appareil.", "wiz_noLights": "Pas de $1 trouvé! Veuillez connecter les lumières au réseau ou configurez les manuellement.", "wiz_pos": "Position/État", "wiz_rgb_expl": "Le point coloré change de couleur (rouge, vert) toutes les x secondes, en même temps que vos LEDs passent à cette couleur. Répondez aux questions en bas pour vérifier/corriger votre ordre d'octets.", diff --git a/assets/webconfig/i18n/sv.json b/assets/webconfig/i18n/sv.json index b768e74b..2bf66b95 100644 --- a/assets/webconfig/i18n/sv.json +++ b/assets/webconfig/i18n/sv.json @@ -78,10 +78,10 @@ "conf_leds_layout_checkp1": "Den svartfärgade lysdioden är den första lysdioden. Detta är den punkt där data matas.", "conf_leds_layout_checkp2": "Layouten är utsikten från att stå framför TV:n, inte bakom den.", "conf_leds_layout_checkp3": "Se till att riktningen är korrekt inställd, den andra och tredje lysdioden är markerade med grått för att visa dataflödet.", - "conf_leds_layout_checkp4": "Processgap: Om du behöver ett gap, ignorera det när du anger LED topp/botten/höger/vänster och skriv sedan in under gap length hur många lysdioder du vill ta bort. Ändra nu mellanrummet för att placera mellanrummet på rätt plats.", - "conf_leds_layout_cl_bottom": "Under", - "conf_leds_layout_cl_bottomleft": "Nedre vänstra hörnet", - "conf_leds_layout_cl_bottomright": "Nedre högra hörnet", + "conf_leds_layout_checkp4": "Fallmellanrum: För att skapa ett mellanrum, ignorera det först när du definierar Övre/Nedre/Vänster/Höger och ställ sedan in din mellanrums längd för att ta bort ett antal LED-lampor. Modifiera mellanrumspositionen tills den matchar.", + "conf_leds_layout_cl_bottom": "Nedre", + "conf_leds_layout_cl_bottomleft": "Nedre vänster (hörn)", + "conf_leds_layout_cl_bottomright": "Nedre höger (hörn)", "conf_leds_layout_cl_cornergap": "Hörnavstånd", "conf_leds_layout_cl_edgegap": "Ramavstånd", "conf_leds_layout_cl_entertainment": "Underhållningsområde", @@ -115,6 +115,10 @@ "conf_leds_layout_cl_topright": "Övre högra hörnet", "conf_leds_layout_cl_vleddepth": "Vertikalt LED-djup", "conf_leds_layout_frame": "Klassisk layout (ram)", + "conf_leds_layout_gapbottom": "Nedre mellanrum", + "conf_leds_layout_gapleft": "Vänster mellanrum", + "conf_leds_layout_gapright": "Höger mellanrum", + "conf_leds_layout_gaptop": "Övre mellanrum", "conf_leds_layout_generatedconf": "Genererad/aktuell LED-konfiguration", "conf_leds_layout_generation_error": "LED-layout genererades inte", "conf_leds_layout_generation_success": "LED-layout genererad framgångsrikt", @@ -541,7 +545,7 @@ "edt_conf_v4l2_cecDetection_expl": "USB-insamling är tillfälligt inaktiverad när en CEC-standbysignal tas emot från HDMI-bussen.", "edt_conf_v4l2_cecDetection_title": "CEC-detektering", "edt_conf_v4l2_cropBottom_expl": "Antal pixlar på under som ska tas bort från bilden.", - "edt_conf_v4l2_cropBottom_title": "Beskär under", + "edt_conf_v4l2_cropBottom_title": "Beskär nedre", "edt_conf_v4l2_cropHeightValidation_error": "Beskärningstopp + Beskärningsbotten kan inte vara större än höjd ($1)", "edt_conf_v4l2_cropLeft_expl": "Antal pixlar till vänster som ska tas bort från bilden.", "edt_conf_v4l2_cropLeft_title": "Beskär vänster", @@ -850,7 +854,7 @@ "edt_eff_traces_header": "Färgspår", "edt_eff_traces_header_desc": "Kräver en ny design", "edt_eff_trails_header": "Stjärnfall", - "edt_eff_trails_header_desc": "I olika färger, gör en önskan!", + "edt_eff_trails_header_desc": "Färgade stjärnor som faller från toppen till botten.", "edt_eff_url": "Bildadress", "edt_eff_waves_header": "Vågor", "edt_eff_waves_header_desc": "Skapa vågor av färg! Blanda dina favoritfärger och välj en mittpunkt.", @@ -969,7 +973,9 @@ "general_speech_en": "Engelska", "general_speech_es": "Spanska", "general_speech_fr": "Franska", + "general_speech_he": "Hebreiska", "general_speech_hu": "Ungerska", + "general_speech_id": "Indonesiska", "general_speech_it": "Italienska", "general_speech_ja": "Japanska", "general_speech_nb": "Norska (Bokmål)", @@ -980,6 +986,7 @@ "general_speech_ru": "Ryska", "general_speech_sv": "Svenska", "general_speech_tr": "Turkiska", + "general_speech_uk": "Ukrainska", "general_speech_vi": "Vietnamesiska", "general_speech_zh-CN": "Kinesiska (förenklad)", "general_webui_title": "Hyperion - Webbkonfiguration", @@ -1183,7 +1190,7 @@ "wiz_nanoleaf_user_auth_title": "Guiden för generering av auktorisationsnyckel", "wiz_noLights": "Inga $1s hittades! Anslut $1s till nätverket eller konfigurera dem manuellt.", "wiz_pos": "Position/status", - "wiz_rgb_expl": "Färgpunkten ändrar färg (röd, grön) var x sekund, samtidigt ändrar dina lysdioder färg. Svara på frågorna nedan för att kontrollera/korrigera din RGB-byteordning.", + "wiz_rgb_expl": "Färgpricken byter färg (röd, grön) varje x sekunder, samtidigt som dina LED-lampor också byter färg. Besvara frågorna längst ner för att kontrollera/korrigera byteordningen.", "wiz_rgb_intro1": "Den här guiden hjälper dig att hitta rätt byteordning för dina lysdioder. Klicka på Fortsätt för att börja.", "wiz_rgb_intro2": "När behöver du denna assistent? För initial konfiguration eller om dina lysdioder ska vara röda, till exempel, men de är blå eller gröna.", "wiz_rgb_q": "Vilken färg visar dina lysdioder när den färgade pricken överst...", diff --git a/assets/webconfig/js/content_leds.js b/assets/webconfig/js/content_leds.js index c457262b..0432524a 100755 --- a/assets/webconfig/js/content_leds.js +++ b/assets/webconfig/js/content_leds.js @@ -468,17 +468,18 @@ function createClassicLeds() { aceEdt.set(finalLedArray); } -function createMatrixLayout(ledshoriz, ledsvert, cabling, start, direction) { +function createMatrixLayout(ledshoriz, ledsvert, cabling, start, direction, gap) { // Big thank you to RanzQ (Juha Rantanen) from Github for this script // https://raw.githubusercontent.com/RanzQ/hyperion-audio-effects/master/matrix-config.js - var parallel = false - var leds = [] - var hblock = 1.0 / ledshoriz - var vblock = 1.0 / ledsvert + let parallel = false; + const leds = []; + + const hblock = (1.0 - gap.left - gap.right) / ledshoriz; + const vblock = (1.0 - gap.top - gap.bottom) / ledsvert; if (cabling == "parallel") { - parallel = true + parallel = true; } /** @@ -487,10 +488,10 @@ function createMatrixLayout(ledshoriz, ledsvert, cabling, start, direction) { * @param {Number} y Vertical position in matrix */ function addLed(x, y) { - var hscanMin = x * hblock - var hscanMax = (x + 1) * hblock - var vscanMin = y * vblock - var vscanMax = (y + 1) * vblock + let hscanMin = gap.left + (x * hblock); + let hscanMax = gap.left + (x + 1) * hblock; + let vscanMin = gap.top + y * vblock; + let vscanMax = gap.top + (y + 1) * vblock; hscanMin = round(hscanMin); hscanMax = round(hscanMax); @@ -502,43 +503,41 @@ function createMatrixLayout(ledshoriz, ledsvert, cabling, start, direction) { hmax: hscanMax, vmin: vscanMin, vmax: vscanMax - }) + }); } - var startYX = start.split('-') - var startX = startYX[1] === 'right' ? ledshoriz - 1 : 0 - var startY = startYX[0] === 'bottom' ? ledsvert - 1 : 0 - var endX = startX === 0 ? ledshoriz - 1 : 0 - var endY = startY === 0 ? ledsvert - 1 : 0 - var forward = startX < endX + const startYX = start.split('-'); + let startX = startYX[1] === 'right' ? ledshoriz - 1 : 0; + let startY = startYX[0] === 'bottom' ? ledsvert - 1 : 0; + let endX = startX === 0 ? ledshoriz - 1 : 0; + let endY = startY === 0 ? ledsvert - 1 : 0; + let forward = startX < endX; + let downward = startY < endY; - var downward = startY < endY - - var x, y + let x, y; if (direction === 'vertical') { for (x = startX; forward && x <= endX || !forward && x >= endX; x += forward ? 1 : -1) { for (y = startY; downward && y <= endY || !downward && y >= endY; y += downward ? 1 : -1) { - - addLed(x, y) + addLed(x, y); } if (!parallel) { - downward = !downward - var tmp = startY - startY = endY - endY = tmp + downward = !downward; + const tmp = startY; + startY = endY; + endY = tmp; } } } else { for (y = startY; downward && y <= endY || !downward && y >= endY; y += downward ? 1 : -1) { for (x = startX; forward && x <= endX || !forward && x >= endX; x += forward ? 1 : -1) { - addLed(x, y) + addLed(x, y); } if (!parallel) { - forward = !forward - var tmp = startX - startX = endX - endX = tmp + forward = !forward; + const tmp = startX; + startX = endX; + endX = tmp; } } } @@ -551,13 +550,20 @@ function createMatrixLeds() { // https://raw.githubusercontent.com/RanzQ/hyperion-audio-effects/master/matrix-config.js //get values - var ledshoriz = parseInt($("#ip_ma_ledshoriz").val()); - var ledsvert = parseInt($("#ip_ma_ledsvert").val()); - var cabling = $("#ip_ma_cabling").val(); - var direction = $("#ip_ma_direction").val(); - var start = $("#ip_ma_start").val(); + const ledshoriz = parseInt($("#ip_ma_ledshoriz").val()); + const ledsvert = parseInt($("#ip_ma_ledsvert").val()); + const cabling = $("#ip_ma_cabling").val(); + const direction = $("#ip_ma_direction").val(); + const start = $("#ip_ma_start").val(); + const gap = { + //gap values % -> float + left: parseInt($("#ip_ma_gapleft").val()) / 100, + right: parseInt($("#ip_ma_gapright").val()) / 100, + top: parseInt($("#ip_ma_gaptop").val()) / 100, + bottom: parseInt($("#ip_ma_gapbottom").val()) / 100, + }; - nonBlacklistLedArray = createMatrixLayout(ledshoriz, ledsvert, cabling, start, direction); + nonBlacklistLedArray = createMatrixLayout(ledshoriz, ledsvert, cabling, start, direction, gap); finalLedArray = blackListLeds(nonBlacklistLedArray, ledBlacklist); createLedPreview(finalLedArray); @@ -797,6 +803,35 @@ $(document).ready(function () { $('.ledMAconstr').on("change", function () { valValue(this.id, this.value, this.min, this.max); + + // top/bottom and left/right must not overlap + switch (this.id) { + case "ip_ma_gapleft": + let left = 100 - parseInt($("#ip_ma_gapright").val()); + if (this.value > left) { + $(this).val(left); + } + break; + case "ip_ma_gapright": + let right = 100 - parseInt($("#ip_ma_gapleft").val()); + if (this.value > right) { + $(this).val(right); + } + break; + case "ip_ma_gaptop": + let top = 100 - parseInt($("#ip_ma_gapbottom").val()); + if (this.value > top) { + $(this).val(top); + } + break; + case "ip_ma_gapbottom": + let bottom = 100 - parseInt($("#ip_ma_gaptop").val()); + if (this.value > bottom) { + $(this).val(bottom); + } + break; + default: + } createMatrixLeds(); }); diff --git a/cmake/package-scripts/postinst b/cmake/package-scripts/postinst index d1832220..f24e6ac6 100644 --- a/cmake/package-scripts/postinst +++ b/cmake/package-scripts/postinst @@ -26,13 +26,6 @@ install_file() echo "--- Hyperion ambient light postinstall ---" -#check system -CPU_RPI=`grep -m1 -c 'BCM2708\|BCM2709\|BCM2710\|BCM2835\|BCM2836\|BCM2837\|BCM2711' /proc/cpuinfo` -CPU_X32X64=`uname -m | grep 'x86_32\|i686\|x86_64' | wc -l` - -#Check for a bootloader as Berryboot -BOOT_BERRYBOOT=$(grep -m1 -c '\(/var/media\|/media/pi\)/berryboot' /etc/mtab) - #get current system ip NET_IP=`hostname -I | cut -d " " -f1` @@ -128,25 +121,6 @@ fi rm -r /usr/share/hyperion/desktop 2>/dev/null rm -r /usr/share/hyperion/icons 2>/dev/null -#Check, if dtparam=spi=on is in place -if [ $CPU_RPI -eq 1 ]; then - BOOT_DIR="/boot" - if [ $BOOT_BERRYBOOT -eq 1 ]; then - BOOT_DIR=$(sed -ne "s#/dev/mmcblk0p1 \([^ ]*\) vfat rw,.*#\1#p" /etc/mtab) - fi - if [ -z "$BOOT_DIR" -o ! -f "$BOOT_DIR/config.txt" ]; then - echo '---> Warning: RPi using BERRYBOOT found but can not locate where config.txt is to enable SPI. (BOOT_DIR='"$BOOT_DIR)" - SPIOK=1 # Not sure if OK, but don't ask to reboot - else - SPIOK=`grep '^\dtparam=spi=on' "$BOOT_DIR/config.txt" | wc -l` - if [ $SPIOK -ne 1 ]; then - echo '---> Raspberry Pi found, but SPI is not set, we write "dtparam=spi=on" to '"$BOOT_DIR/config.txt" - sed -i '$a dtparam=spi=on' "$BOOT_DIR/config.txt" - REBOOTMESSAGE="echo Please reboot your Raspberry Pi, we inserted dtparam=spi=on to $BOOT_DIR/config.txt" - fi - fi -fi - echo ${START_MSG} echo "-----------------------------------------------------------------------------" @@ -171,7 +145,7 @@ if [ -e /opt/hyperion/ ] then echo echo "---------------------------------------------------------------------------------" - echo "- It seemd that you have an older version of hyperion installed in /opt/hyperion -" + echo "- It seems that you have an older version of hyperion installed in /opt/hyperion -" echo "- please remove it to avoid problems -" echo "---------------------------------------------------------------------------------" fi diff --git a/include/blackborder/BlackBorderDetector.h b/include/blackborder/BlackBorderDetector.h index 77438f4c..66aaa32c 100644 --- a/include/blackborder/BlackBorderDetector.h +++ b/include/blackborder/BlackBorderDetector.h @@ -110,7 +110,7 @@ namespace hyperion } // Construct result - BlackBorder detectedBorder; + BlackBorder detectedBorder{}; detectedBorder.unknown = firstNonBlackXPixelIndex == -1 || firstNonBlackYPixelIndex == -1; detectedBorder.horizontalSize = firstNonBlackYPixelIndex; detectedBorder.verticalSize = firstNonBlackXPixelIndex; @@ -167,7 +167,7 @@ namespace hyperion } // Construct result - BlackBorder detectedBorder; + BlackBorder detectedBorder{}; detectedBorder.unknown = firstNonBlackXPixelIndex == -1 || firstNonBlackYPixelIndex == -1; detectedBorder.horizontalSize = firstNonBlackYPixelIndex; detectedBorder.verticalSize = firstNonBlackXPixelIndex; @@ -224,7 +224,7 @@ namespace hyperion } // Construct result - BlackBorder detectedBorder; + BlackBorder detectedBorder{}; detectedBorder.unknown = firstNonBlackXPixelIndex == -1 || firstNonBlackYPixelIndex == -1; detectedBorder.horizontalSize = firstNonBlackYPixelIndex; detectedBorder.verticalSize = firstNonBlackXPixelIndex; @@ -267,7 +267,7 @@ namespace hyperion } // Construct result - BlackBorder detectedBorder; + BlackBorder detectedBorder{}; detectedBorder.unknown = firstNonBlackYPixelIndex == -1; detectedBorder.horizontalSize = firstNonBlackYPixelIndex; detectedBorder.verticalSize = 0; diff --git a/include/grabber/amlogic/AmlogicWrapper.h b/include/grabber/amlogic/AmlogicWrapper.h index 3f763f5c..5e355dff 100644 --- a/include/grabber/amlogic/AmlogicWrapper.h +++ b/include/grabber/amlogic/AmlogicWrapper.h @@ -18,12 +18,11 @@ public: /// /// Constructs the Amlogic frame grabber /// - /// @param[in] grabWidth The width of the grabbed image [pixels] - /// @param[in] grabHeight The height of the grabbed images [pixels] - /// @param[in] pixelDecimation Decimation factor for image [pixels] + /// @param[in] updateRate_Hz The image grab rate [Hz] + /// @param[in] pixelDecimation Decimation factor for image [pixels]/// /// - AmlogicWrapper(int pixelDecimation=GrabberWrapper::DEFAULT_PIXELDECIMATION, - int updateRate_Hz=GrabberWrapper::DEFAULT_RATE_HZ); + AmlogicWrapper(int updateRate_Hz=GrabberWrapper::DEFAULT_RATE_HZ, + int pixelDecimation=GrabberWrapper::DEFAULT_PIXELDECIMATION); /// /// Constructs the Amlogic frame grabber from configuration settings diff --git a/libsrc/grabber/amlogic/AmlogicWrapper.cpp b/libsrc/grabber/amlogic/AmlogicWrapper.cpp index d568e999..6c3b302c 100644 --- a/libsrc/grabber/amlogic/AmlogicWrapper.cpp +++ b/libsrc/grabber/amlogic/AmlogicWrapper.cpp @@ -1,14 +1,15 @@ #include -AmlogicWrapper::AmlogicWrapper(int pixelDecimation, int updateRate_Hz) +AmlogicWrapper::AmlogicWrapper(int updateRate_Hz, int pixelDecimation) : GrabberWrapper(GRABBERTYPE, &_grabber, updateRate_Hz) - , _grabber() + , _grabber() { _grabber.setPixelDecimation(pixelDecimation); } AmlogicWrapper::AmlogicWrapper(const QJsonDocument& grabberConfig) - : GrabberWrapper(GRABBERTYPE, &_grabber) + : AmlogicWrapper(GrabberWrapper::DEFAULT_RATE_HZ, + GrabberWrapper::DEFAULT_PIXELDECIMATION) { this->handleSettingsUpdate(settings::SYSTEMCAPTURE, grabberConfig); } diff --git a/libsrc/grabber/directx/DirectXWrapper.cpp b/libsrc/grabber/directx/DirectXWrapper.cpp index c0ba4ecc..1d5d905e 100644 --- a/libsrc/grabber/directx/DirectXWrapper.cpp +++ b/libsrc/grabber/directx/DirectXWrapper.cpp @@ -6,14 +6,17 @@ DirectXWrapper::DirectXWrapper( int updateRate_Hz, int cropLeft, int cropRight, int cropTop, int cropBottom ) : GrabberWrapper(GRABBERTYPE, &_grabber, updateRate_Hz) - , _grabber(display, cropLeft, cropRight, cropTop, cropBottom) + , _grabber(display, cropLeft, cropRight, cropTop, cropBottom) { _grabber.setPixelDecimation(pixelDecimation); } DirectXWrapper::DirectXWrapper(const QJsonDocument& grabberConfig) - : GrabberWrapper(GRABBERTYPE, &_grabber) + : DirectXWrapper(GrabberWrapper::DEFAULT_RATE_HZ, + 0, + GrabberWrapper::DEFAULT_PIXELDECIMATION, + 0,0,0,0) { this->handleSettingsUpdate(settings::SYSTEMCAPTURE, grabberConfig); } diff --git a/libsrc/grabber/dispmanx/DispmanxWrapper.cpp b/libsrc/grabber/dispmanx/DispmanxWrapper.cpp index 32824762..0194a4f1 100644 --- a/libsrc/grabber/dispmanx/DispmanxWrapper.cpp +++ b/libsrc/grabber/dispmanx/DispmanxWrapper.cpp @@ -12,7 +12,8 @@ DispmanxWrapper::DispmanxWrapper( int updateRate_Hz, } DispmanxWrapper::DispmanxWrapper(const QJsonDocument& grabberConfig) - : GrabberWrapper(GRABBERTYPE, &_grabber) + : DispmanxWrapper(GrabberWrapper::DEFAULT_RATE_HZ, + GrabberWrapper::DEFAULT_PIXELDECIMATION) { this->handleSettingsUpdate(settings::SYSTEMCAPTURE, grabberConfig); } diff --git a/libsrc/grabber/framebuffer/FramebufferWrapper.cpp b/libsrc/grabber/framebuffer/FramebufferWrapper.cpp index 2588afed..1797e513 100644 --- a/libsrc/grabber/framebuffer/FramebufferWrapper.cpp +++ b/libsrc/grabber/framebuffer/FramebufferWrapper.cpp @@ -4,13 +4,15 @@ FramebufferWrapper::FramebufferWrapper( int updateRate_Hz, int deviceIdx, int pixelDecimation) : GrabberWrapper(GRABBERTYPE, &_grabber, updateRate_Hz) - , _grabber(deviceIdx) + , _grabber(deviceIdx) { _grabber.setPixelDecimation(pixelDecimation); } FramebufferWrapper::FramebufferWrapper(const QJsonDocument& grabberConfig) - : GrabberWrapper(GRABBERTYPE, &_grabber) + : FramebufferWrapper(GrabberWrapper::DEFAULT_RATE_HZ, + 0, + GrabberWrapper::DEFAULT_PIXELDECIMATION) { this->handleSettingsUpdate(settings::SYSTEMCAPTURE, grabberConfig); } diff --git a/libsrc/grabber/osx/OsxWrapper.cpp b/libsrc/grabber/osx/OsxWrapper.cpp index 86058d4f..d9bb51b8 100644 --- a/libsrc/grabber/osx/OsxWrapper.cpp +++ b/libsrc/grabber/osx/OsxWrapper.cpp @@ -5,13 +5,15 @@ OsxWrapper::OsxWrapper( int updateRate_Hz, int pixelDecimation ) : GrabberWrapper(GRABBERTYPE, &_grabber, updateRate_Hz) - , _grabber(display) + , _grabber(display) { _grabber.setPixelDecimation(pixelDecimation); } OsxWrapper::OsxWrapper(const QJsonDocument& grabberConfig) - : GrabberWrapper(GRABBERTYPE, &_grabber) + : OsxWrapper(GrabberWrapper::DEFAULT_RATE_HZ, + kCGDirectMainDisplay, + GrabberWrapper::DEFAULT_PIXELDECIMATION) { this->handleSettingsUpdate(settings::SYSTEMCAPTURE, grabberConfig); } diff --git a/libsrc/grabber/qt/QtWrapper.cpp b/libsrc/grabber/qt/QtWrapper.cpp index d4560676..1cb8287d 100644 --- a/libsrc/grabber/qt/QtWrapper.cpp +++ b/libsrc/grabber/qt/QtWrapper.cpp @@ -6,13 +6,16 @@ QtWrapper::QtWrapper( int updateRate_Hz, int cropLeft, int cropRight, int cropTop, int cropBottom ) : GrabberWrapper(GRABBERTYPE, &_grabber, updateRate_Hz) - , _grabber(display, cropLeft, cropRight, cropTop, cropBottom) + , _grabber(display, cropLeft, cropRight, cropTop, cropBottom) { _grabber.setPixelDecimation(pixelDecimation); } QtWrapper::QtWrapper(const QJsonDocument& grabberConfig) - : GrabberWrapper(GRABBERTYPE, &_grabber) + : QtWrapper(GrabberWrapper::DEFAULT_RATE_HZ, + 0, + GrabberWrapper::DEFAULT_PIXELDECIMATION, + 0,0,0,0) { this->handleSettingsUpdate(settings::SYSTEMCAPTURE, grabberConfig); } diff --git a/libsrc/grabber/x11/X11Wrapper.cpp b/libsrc/grabber/x11/X11Wrapper.cpp index d8df3cee..df2c5c51 100644 --- a/libsrc/grabber/x11/X11Wrapper.cpp +++ b/libsrc/grabber/x11/X11Wrapper.cpp @@ -4,14 +4,16 @@ X11Wrapper::X11Wrapper( int updateRate_Hz, int pixelDecimation, int cropLeft, int cropRight, int cropTop, int cropBottom) : GrabberWrapper(GRABBERTYPE, &_grabber, updateRate_Hz) - , _grabber(cropLeft, cropRight, cropTop, cropBottom) - , _init(false) + , _grabber(cropLeft, cropRight, cropTop, cropBottom) + , _init(false) { _grabber.setPixelDecimation(pixelDecimation); } X11Wrapper::X11Wrapper(const QJsonDocument& grabberConfig) - : GrabberWrapper(GRABBERTYPE, &_grabber) + : X11Wrapper(GrabberWrapper::DEFAULT_RATE_HZ, + GrabberWrapper::DEFAULT_PIXELDECIMATION, + 0,0,0,0) { this->handleSettingsUpdate(settings::SYSTEMCAPTURE, grabberConfig); } diff --git a/libsrc/grabber/xcb/XcbWrapper.cpp b/libsrc/grabber/xcb/XcbWrapper.cpp index aa3db000..c9d4abd4 100644 --- a/libsrc/grabber/xcb/XcbWrapper.cpp +++ b/libsrc/grabber/xcb/XcbWrapper.cpp @@ -11,7 +11,9 @@ XcbWrapper::XcbWrapper( int updateRate_Hz, } XcbWrapper::XcbWrapper(const QJsonDocument& grabberConfig) - : GrabberWrapper(GRABBERTYPE, &_grabber) + : XcbWrapper(GrabberWrapper::DEFAULT_RATE_HZ, + GrabberWrapper::DEFAULT_PIXELDECIMATION, + 0,0,0,0) { this->handleSettingsUpdate(settings::SYSTEMCAPTURE, grabberConfig); } diff --git a/libsrc/hyperion/schema/schema-ledConfig.json b/libsrc/hyperion/schema/schema-ledConfig.json index 3232063c..3a3c6809 100644 --- a/libsrc/hyperion/schema/schema-ledConfig.json +++ b/libsrc/hyperion/schema/schema-ledConfig.json @@ -144,6 +144,30 @@ "start": { "type": "string", "enum": [ "top-left", "top-right", "bottom-left", "bottom-right" ] + }, + "gapleft": { + "type": "integer", + "minimum": 0, + "maximum": 100, + "default": 0 + }, + "gapright": { + "type": "integer", + "minimum": 0, + "maximum": 100, + "default": 0 + }, + "gaptop": { + "type": "integer", + "minimum": 0, + "maximum": 100, + "default": 0 + }, + "gapbottom": { + "type": "integer", + "minimum": 0, + "maximum": 100, + "default": 0 } }, "additionalProperties": false diff --git a/src/hyperiond/hyperiond.cpp b/src/hyperiond/hyperiond.cpp index ded48905..6c71475d 100644 --- a/src/hyperiond/hyperiond.cpp +++ b/src/hyperiond/hyperiond.cpp @@ -294,8 +294,7 @@ void HyperionDaemon::startNetworkServices() _jsonServer->thread()->start(); _webserver->thread()->start(); _sslWebserver->thread()->start(); - -#ifdef ENABLE_MDNS +#if defined(ENABLE_MDNS) _mDNSProvider->thread()->start(); #endif _ssdp->thread()->start(); @@ -316,8 +315,7 @@ void HyperionDaemon::stopNetworkServices() #if defined(ENABLE_FLATBUF_SERVER) _flatBufferServer.reset(nullptr); #endif - -#ifdef ENABLE_MDNS +#if defined(ENABLE_MDNS) _mDNSProvider.reset(nullptr); #endif _ssdp.reset(nullptr);