2017-10-22, 11:43
v1.9
- banner size and position fix and offset for standalone json calls
- banner size and position fix and offset for standalone json calls
def _get_skin_resolution(self):
xmlFile = os.path.join(xbmc.translatePath("special://skin/"), "addon.xml")
xmldoc = minidom.parse(xmlFile)
res = xmldoc.getElementsByTagName("res")
xval = int(res[0].attributes["width"].value)
yval = int(res[0].attributes["height"].value)
return(xval, yval)
def _get_skin_resolution(self):
xval = xbmc.getInfoLabel('System.ScreenWidth')
yval = xbmc.getInfoLabel('System.ScreenHeight')
return int(xval), int(yval)
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<settings>
<category label="30000">
<setting id="on" label="30001" type="bool" default="true"/>
<setting id="changetime" label="30002" type="slider" default="30" range="5,5,120" option="int"/>
<setting id="cyclepause" label="30004" type="slider" default="30" range="0,10,240" option="int"/>
<setting id="bannerpos" label="30003" type="enum" lvalues="30011|30012" default="1"/>
<setting id="yoffset" label="30006" type="slider" default="15" range="0,5,40" option="int"/>
<setting id="random" label="30005" type="bool" default="false"/>
<setting id="single_file" label="Set just a single file for display" type="bool" default="false"/>
<setting id="image_file" label="Image file" type="file" default="" visible="eq(-1,true)"/>
</category>
</settings>
(2018-01-08, 22:14)DaLanik Wrote: You can use JSON call to display arbitrary image: https://forum.kodi.tv/showthread.php?tid...pid2641415
(2018-01-08, 12:38)twilight0 Wrote: Ok I can give you the requested changes directly here, no problem...Just tested with getInfoLabel('System.ScreenWidth') and it DOESN'T center the image correctly, while with my code it does... ??
1) default.py & standalone.py, latest addon version, line 99+
change to something like this:Code:def _get_skin_resolution(self):
xmlFile = os.path.join(xbmc.translatePath("special://skin/"), "addon.xml")
xmldoc = minidom.parse(xmlFile)
res = xmldoc.getElementsByTagName("res")
xval = int(res[0].attributes["width"].value)
yval = int(res[0].attributes["height"].value)
return(xval, yval)
Code:def _get_skin_resolution(self):
xval = xbmc.getInfoLabel('System.ScreenWidth')
yval = xbmc.getInfoLabel('System.ScreenHeight')
return int(xval), int(yval)
Reason: Skin's metadata provision has several resolutions and getting the first (with a slice) does not mean it will be correct for any given setup. Parenthesis is also redundant.
(2018-01-08, 20:29)twilight0 Wrote: I 'd like to be able to set that via a python command on another addon. It is possible however as it is now, but I was thinking this could be an alternative approach.Just tested with 1 image and it displays only 1 image. So the solution is to set "change banners every" to any value (probably best to highest), and "pause between banners" to 0.
(2018-01-08, 12:38)twilight0 Wrote: Second requested change:You can achieve this easily by making a transparent PNG/GIF and moving the image to the far left or right.
Ability to set a banner/thumbnail/logo/whatever at top left or top right corner corner. Spacing can be 20 or 30 pixels for example from each edge. It can also be a remote url, I suppose.
Finally, be able to set a single image via the settings:
Example of settings.xml
Additionally, I 'd like to provide Greek translation. But this when you complete your changes.Code:<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<settings>
<category label="30000">
<setting id="on" label="30001" type="bool" default="true"/>
<setting id="changetime" label="30002" type="slider" default="30" range="5,5,120" option="int"/>
<setting id="cyclepause" label="30004" type="slider" default="30" range="0,10,240" option="int"/>
<setting id="bannerpos" label="30003" type="enum" lvalues="30011|30012" default="1"/>
<setting id="yoffset" label="30006" type="slider" default="15" range="0,5,40" option="int"/>
<setting id="random" label="30005" type="bool" default="false"/>
<setting id="single_file" label="Set just a single file for display" type="bool" default="false"/>
<setting id="image_file" label="Image file" type="file" default="" visible="eq(-1,true)"/>
</category>
</settings>
(2018-01-09, 11:06)DaLanik Wrote: Just tested with getInfoLabel('System.ScreenWidth') and it DOESN'T center the image correctly, while with my code it does... ??
<extension point="xbmc.gui.skin" debugging="false">
<res width="1920" height="1440" aspect="4:3" default="false" folder="xml" />
<res width="1920" height="1280" aspect="3:2" default="false" folder="xml" />
<res width="1920" height="1200" aspect="16:10" default="false" folder="xml" />
<res width="1920" height="1080" aspect="16:9" default="true" folder="xml" />
<res width="2560" height="1080" aspect="21:9" default="false" folder="xml" />
</extension>
(2018-01-09, 11:21)DaLanik Wrote: Just tested with 1 image and it displays only 1 image. So the solution is to set "change banners every" to any value (probably best to highest), and "pause between banners" to 0.
(2018-01-09, 12:13)DaLanik Wrote: You can achieve this easily by making a transparent PNG/GIF and moving the image to the far left or right.
(2018-01-09, 16:36)twilight0 Wrote:No, you can still use the controls. I had problems with sizing and positioning the image and I'd hate to mess something with unnecessary changes(2018-01-09, 11:06)DaLanik Wrote: Just tested with getInfoLabel('System.ScreenWidth') and it DOESN'T center the image correctly, while with my code it does... ??
Ok, so here is an example of estuary's skin addon.xml:
Code:<extension point="xbmc.gui.skin" debugging="false">
<res width="1920" height="1440" aspect="4:3" default="false" folder="xml" />
<res width="1920" height="1280" aspect="3:2" default="false" folder="xml" />
<res width="1920" height="1200" aspect="16:10" default="false" folder="xml" />
<res width="1920" height="1080" aspect="16:9" default="true" folder="xml" />
<res width="2560" height="1080" aspect="21:9" default="false" folder="xml" />
</extension>
Imho, simply using the first res doesn't apply to all setups, unless I am wrong and special://skin has a runtime-modified addon xml with simply only the current width/height used.
(2018-01-09, 11:21)DaLanik Wrote: Just tested with 1 image and it displays only 1 image. So the solution is to set "change banners every" to any value (probably best to highest), and "pause between banners" to 0.
I 'll probably use this solution.
(2018-01-09, 12:13)DaLanik Wrote: You can achieve this easily by making a transparent PNG/GIF and moving the image to the far left or right.
I 've never thought about it, very good idea. I hope its not being drawed of the playback controls and users can't use them.