Po čase studia skinu a úprav od @JiRo jsem si troufl na samostatné úpravy a tak jsem se rozhodl také pokračovat v tomto zajímavém tématu a hned zkraje do něj vkládám jeden delší dobu nevyřešený požadavek:
Zobrazení informace ve Full Screen
Tento požadavek se objevil na fóru už několikrát. Často šlo o možnost trvalého zobrazení času, nedávno se pak objevil zajímavý požadavek Vložení informací do obrazu.
Z logiky věci a základních principů GUI Kodi a jeho skinů je zřejmé, že místem pro vložení informací do full screen je soubor VideoFullScreen.xml. V případě tohoto souboru je však třeba postupovat poněkud jinak, než u většiny ostatních. Tento soubor je přímo navázán na Kodi Player, ale žádnou definici control bloku pro zobrazení full screen v něm nehledejte. Ta vazba je zajištěna přesně v opačném směru. Chceme-li tedy ve full screen zobrazit nějaké informace, musíme respektovat pravidla, podle kterých Kodi Palyer a GUI s definice ve VideoFullScreen.xml používá. Pravidlo pro všechny dodatečně umístěné definice zobrazení je to, že každý control blok musí mít definované Id s hodnotou 1.
Níže je uvedený příklad, kdy jsem do VideoFullScreen.xml vložil definici zkopírovanou z OSD overlay, která zajistí zobrazení aktuálního času, času ukončení přehrávání obsahu (je-li znám) a příznak stavu Mute, do které jsem ještě doplnil informaci o zbývajícím času do konce přehrávání. Nakonec jsme ještě přidal pro ilustraci i zobrazení RSS. Vypadá to pak takto:
[attachment=5116][attachment=5117]Obsahu definice souboru je doplněn control blokem začínající řádkem <control type="group" id="1"> <!-- Easy/SC+ -->:
Kód:
<?xml version="1.0" encoding="utf-8"?>
<!-- Easy/SC* -->
<window>
<defaultcontrol></defaultcontrol>
<controls>
<control type="group" id="0">
<control type="label" id="10">
<left>45</left>
<top>15</top>
<width>1770</width>
<height>100</height>
<label></label>
<font>font12</font>
<shadowcolor>black</shadowcolor>
</control>
<control type="label" id="11">
<left>45</left>
<top>45</top>
<width>1770</width>
<height>100</height>
<label></label>
<font>font12</font>
<shadowcolor>black</shadowcolor>
</control>
<control type="label" id="12">
<left>45</left>
<top>75</top>
<width>1770</width>
<height>100</height>
<label></label>
<font>font12</font>
<shadowcolor>black</shadowcolor>
</control>
</control>
<control type="group" id="1"> <!-- Easy/SC+ -->
<control type="group" id="1">
<visible>!Window.IsVisible(extendedprogressdialog)</visible>
<animation effect="fade" time="150">VisibleChange</animation>
<control type="label" id="1">
<font>font_clock</font>
<shadowcolor>text_shadow</shadowcolor>
<top>0</top>
<right>20</right>
<height>200</height>
<width>600</width>
<align>right</align>
<label>$INFO[System.Time]</label>
</control>
<control type="grouplist" id="1">
<right>24</right>
<top>74</top>
<width>800</width>
<height>100</height>
<align>right</align>
<itemgap>5</itemgap>
<orientation>horizontal</orientation>
<usecontrolcoords>true</usecontrolcoords>
<control type="label" id="1">
<label>$INFO[Player.TimeRemaining(hh:mm),Zbývá: ]</label>
<shadowcolor>text_shadow</shadowcolor>
<height>100</height>
<width>auto</width>
<visible>!String.isempty(Player.TimeRemaining)</visible>
<visible>Player.HasVideo + ![Player.HasGame | VideoPlayer.HasEpg]</visible>
</control>
<control type="label" id="1">
<label>$INFO[Player.FinishTime,$LOCALIZE[31080]: ]</label>
<shadowcolor>text_shadow</shadowcolor>
<height>100</height>
<width>auto</width>
<visible>!String.isempty(Player.Duration)</visible>
<visible>Player.HasVideo + ![Player.HasGame | VideoPlayer.HasEpg]</visible>
</control>
<control type="label" id="1">
<label>$INFO[PVR.EpgEventRemainingTime(hh:mm),Zbývá: ]</label>
<shadowcolor>text_shadow</shadowcolor>
<height>100</height>
<width>auto</width>
<visible>VideoPlayer.HasEpg</visible>
</control>
<control type="label" id="1">
<label>$INFO[PVR.EpgEventFinishTime,$LOCALIZE[31080]: ]</label>
<shadowcolor>text_shadow</shadowcolor>
<height>100</height>
<width>auto</width>
<visible>VideoPlayer.HasEpg</visible>
</control>
<control type="image" id="1">
<top>2</top>
<left>0</left>
<width>60</width>
<height>40</height>
<fadetime>300</fadetime>
<aspectratio aligny="center" align="right">keep</aspectratio>
<texture>dialogs/volume/mute.png</texture>
<visible>Player.Muted</visible>
</control>
</control>
<control type="image" id="1">
<left>0</left>
<bottom>0</bottom>
<width>110%</width>
<height>100</height>
<texture flipy="true">frame/InfoBar.png</texture>
</control>
<control type="group" id="1">
<depth>DepthBars</depth>
<bottom>0</bottom>
<height>30</height>
<aligny>top</aligny>
<animation effect="fade" start="0" end="100" time="300" delay="300">WindowOpen</animation>
<animation effect="fade" start="100" end="0" time="200">WindowClose</animation>
<control type="rss" id="1">
<animation effect="slide" end="0,90" time="300" tween="sine" easing="inout" condition="$EXP[infodialog_active]">conditional</animation>
<left>0</left>
<bottom>0</bottom>
<height>39</height>
<width>100%</width>
<font>font12</font>
<urlset>1</urlset>
<hitrect x="-100" y="0" w="1" h="1" />
<titlecolor>button_focus</titlecolor>
<textcolor>button_focus</textcolor>
<shadowcolor>text_shadow</shadowcolor>
<headlinecolor>FFC0C0C0</headlinecolor>
<animation effect="fade" time="300">VisibleChange</animation>
</control>
</control>
</control>
</control>
<control type="group" id="1">
<depth>DepthOSD+</depth>
<visible>Player.Caching + Integer.IsGreater(Player.CacheLevel,0)</visible>
<animation effect="fade" delay="300" time="200">Visible</animation>
<animation effect="fade" delay="200" time="150">Hidden</animation>
<centerleft>50%</centerleft>
<width>110</width>
<centertop>50%</centertop>
<height>110</height>
<control type="image" id="1">
<centerleft>50%</centerleft>
<centertop>50%</centertop>
<width>110</width>
<height>110</height>
<texture colordiffuse="BFFFFFFF">osd/buffer-bg.png</texture>
</control>
<control type="image" id="1">
<centerleft>50%</centerleft>
<centertop>50%</centertop>
<width>92</width>
<height>92</height>
<texture>dialogs/extendedprogress/loading-back.png</texture>
</control>
<control type="image" id="1">
<centerleft>50%</centerleft>
<centertop>50%</centertop>
<width>92</width>
<height>92</height>
<texture colordiffuse="button_focus">$INFO[Player.CacheLevel,dialogs/volume/progress/p,.png]</texture>
</control>
<control type="label" id="1">
<description>buffering value</description>
<label>$INFO[Player.CacheLevel]</label>
<centerleft>50%</centerleft>
<centertop>50%</centertop>
<width>200</width>
<height>200</height>
<aligny>center</aligny>
<align>center</align>
<font>font13</font>
</control>
</control>
</controls>
</window>
Pozn. Komentáře <!-- Easy/SC+ --> zavedl zakladatel tématu, @JiRo. Easy znamená, že je to úprava Easy modifikace základního vzhledu (to je privátní modifikace) SC označuje, že je to modifikace použitá (nebo použitá bude) ve Stream-Cinema.
Co se týče obsahu z hlediska zatížení CPU, tak zobrazení RSS klade na CPU vyšší nároky. Takže ho doporučuji používat pouze u HW s odpovídajícím výkonem.
Úpravu vyžadovanou ve výše uvedeném odkazu Vložení informací do obrazu popíši někdy příště...