Trouble with progress control in WindowXML
#1
I suspect this is me being a complete idiot, but I can't just figure out what I'm doing wrong.

I'm working on a window that just shows me what's playing on my Logitech Media Server. I want to add a minimal progress bar showing the position of the track but it's going a bit weird.

I want to limit the progress bar to the "Now Playing" section, but it's just disappearing off the edge of the screen:
Image

The relevant control group from my xml file is this:
Code:
<control type="group">

         <left>80</left>
         <top>500</top>
         <width>800</width>
         <height>120</height>
         <visible>true</visible>

         <control type="image">
           <width>100%</width>
           <height>100%</height>
           <texture>squeezeinfo-bg.png</texture>
           <visible>true</visible>
         </control>

         <control type="image">
           <left>10</left>
           <top>10</top>
           <width>100</width>
           <height>100</height>
           <texture>$INFO[Window.Property(SQUEEZE_NP_ICON)]</texture>
           <visible>true</visible>
         </control>

         <control type="label">
           <height>25</height>
           <width>580</width>
           <left>120</left>
           <top>10</top>
           <font>font2</font>
           <label>Now Playing:</label>
         </control>

         <control type="label">
           <height>25</height>
           <width>580</width>
           <left>120</left>
           <top>35</top>
           <font>font2</font>
           <label>$INFO[Window.Property(SQUEEZE_NP_TITLE)]</label>
         </control>

         <control type="label">
           <height>25</height>
           <width>580</width>
           <left>120</left>
           <top>60</top>
           <font>font2</font>
           <label>$INFO[Window.Property(SQUEEZE_NP_ARTIST)]</label>
         </control>

         <control type="label">
           <height>25</height>
           <width>580</width>
           <left>120</left>
           <top>85</top>
           <font>font2</font>
           <label>$INFO[Window.Property(SQUEEZE_NP_ALBUM)]</label>
         </control>

         <control type="progress" id="1">
           <left>0</left>
           <top>115</top>
           <width>800</width>
           <height>5</height>
           <visible>true</visible>
           <reveal>false</reveal>
           <midtexture>prog-body.png</midtexture>
           <righttexture>prog-end.png</righttexture>
           <texturebg>transparent.png</texturebg>
           <lefttexture>prog-body.png</lefttexture>
           <overlaytexture>transparent.png</overlaytexture>
           <info>$INFO[Window.Property(SQUEEZE_PROGRESS)]</info>
         </control>

   </control>

I've tried different values for the info tag (50, 50%, 0.5) but it always goes off the edge of the screen.

Can anyone see something obvious that I'm doing wrong?

I've posted this in the addon section because I'm launching the window from a python script which subclasses WindowXML.

And, yes, I do know the layout's pretty ugly at the moment...
BBC Live Football Scores: Football scores notifications service.
script.squeezeinfo: shows what's playing on your Logitech Media Server
Reply
#2
(2017-02-04, 20:24)el_Paraguayo Wrote: I suspect this is me being a complete idiot, but I can't just figure out what I'm doing wrong.

I'm working on a window that just shows me what's playing on my Logitech Media Server. I want to add a minimal progress bar showing the position of the track but it's going a bit weird.

I want to limit the progress bar to the "Now Playing" section, but it's just disappearing off the edge of the screen:
Image

The relevant control group from my xml file is this:
Code:
<control type="group">

         <left>80</left>
         <top>500</top>
         <width>800</width>
         <height>120</height>
         <visible>true</visible>

         <control type="image">
           <width>100%</width>
           <height>100%</height>
           <texture>squeezeinfo-bg.png</texture>
           <visible>true</visible>
         </control>

         <control type="image">
           <left>10</left>
           <top>10</top>
           <width>100</width>
           <height>100</height>
           <texture>$INFO[Window.Property(SQUEEZE_NP_ICON)]</texture>
           <visible>true</visible>
         </control>

         <control type="label">
           <height>25</height>
           <width>580</width>
           <left>120</left>
           <top>10</top>
           <font>font2</font>
           <label>Now Playing:</label>
         </control>

         <control type="label">
           <height>25</height>
           <width>580</width>
           <left>120</left>
           <top>35</top>
           <font>font2</font>
           <label>$INFO[Window.Property(SQUEEZE_NP_TITLE)]</label>
         </control>

         <control type="label">
           <height>25</height>
           <width>580</width>
           <left>120</left>
           <top>60</top>
           <font>font2</font>
           <label>$INFO[Window.Property(SQUEEZE_NP_ARTIST)]</label>
         </control>

         <control type="label">
           <height>25</height>
           <width>580</width>
           <left>120</left>
           <top>85</top>
           <font>font2</font>
           <label>$INFO[Window.Property(SQUEEZE_NP_ALBUM)]</label>
         </control>

         <control type="progress" id="1">
           <left>0</left>
           <top>115</top>
           <width>800</width>
           <height>5</height>
           <visible>true</visible>
           <reveal>false</reveal>
           <midtexture>prog-body.png</midtexture>
           <righttexture>prog-end.png</righttexture>
           <texturebg>transparent.png</texturebg>
           <lefttexture>prog-body.png</lefttexture>
           <overlaytexture>transparent.png</overlaytexture>
           <info>$INFO[Window.Property(SQUEEZE_PROGRESS)]</info>
         </control>

   </control>

I've tried different values for the info tag (50, 50%, 0.5) but it always goes off the edge of the screen.

Can anyone see something obvious that I'm doing wrong?

I've posted this in the addon section because I'm launching the window from a python script which subclasses WindowXML.

And, yes, I do know the layout's pretty ugly at the moment...


I can be wrong, but i do not believe you can just use anything for the info tag but has to be one of these http://kodi.wiki/view/InfoLabels. I have tried this in the past with no luck. I ended up making my own custom progress bar using images.

Hopefully someone with more experience can chime in on this.
Reply
#3
since you're asking in the python section, why don't you update the progress value from within your addon, instead of defining an <info> tag in the xml file?
http://mirrors.xbmc.org/docs/python-docs...olProgress
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#4
Using "setPercent" doesn't work either.

Interesting, I tried using getPercent with a value hard coded in the xml file and that just caused kodi to crash instantly.
BBC Live Football Scores: Football scores notifications service.
script.squeezeinfo: shows what's playing on your Logitech Media Server
Reply
#5
Actually, setPercent does work but makes me think that I may have got the textures wrong in the xml file.

If I run a loop from 0 to 100 and use the setPercent method, my bar decreases from right to left.

The prog-body.png texture is the darker blue shade, prog-end.png is the lighter blue shade. What I thought would happen is that I would have a dark blue blue bar, with a light blue tip! Have I misunderstood how this control works?

(Happy for this to be moved into the skinning subforum if it's better suited there now.)
BBC Live Football Scores: Football scores notifications service.
script.squeezeinfo: shows what's playing on your Logitech Media Server
Reply
#6
Ok. Working now.
I just needed the following textures:
Code:
<texturebg>transparent.png</texturebg>
<midtexture>prog-body.png</midtexture>
I removed the others and it works well enough.

I can't do the light blue tip but that's not fatal for me.
BBC Live Football Scores: Football scores notifications service.
script.squeezeinfo: shows what's playing on your Logitech Media Server
Reply
#7
Working progress bar:
Image

Thanks for the help.
BBC Live Football Scores: Football scores notifications service.
script.squeezeinfo: shows what's playing on your Logitech Media Server
Reply

Logout Mark Read Team Forum Stats Members Help
Trouble with progress control in WindowXML0