Kodi Community Forum
Problem with "SubString" - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+--- Thread: Problem with "SubString" (/showthread.php?tid=260036)

Pages: 1 2


Problem with "SubString" - Rantanplan-1 - 2016-02-16

i try to hide the OSD while a Startup video is playing via:

Code:
<visible>!SubString(Player.path,Skin.String(Startup_Video_Path))</visible>

did also try:

Code:
<visible>!SubString(Player.path,Skin.String(Startup_Video_Path),left)</visible>

none of them work.

Have already checked both as Labels, and both return the expected values, so no Idea why this shuldnt work. Huh






---

EDIT:

As a Workaround i did also try to let the Video play in a overlaying Custom Window. But as u may gues this didnt work to.

Code:
<window type="dialog" id="57">
    
    <zorder>2</zorder>
    
    <!--
    <visible>true</visible>
    -->
    
    <controls>

        <!-- Video Window - Startup -->
        <control type="videowindow">
            <left>0</left>
            <top>0</top>
            <width>1920</width>
            <height>1080</height>
            <visible></visible>
        </control>
        

    </controls>

</window>


(Didnt waste to much time for this methode thil now...)


RE: Problem with "SubString" - Hitcher - 2016-02-16

Probably because you should be using
PHP Code:
Player.Folderpath 
Wink


RE: Problem with "SubString" - Rantanplan-1 - 2016-02-16

(2016-02-16, 18:06)Hitcher Wrote: Probably because you should be using
PHP Code:
Player.Folderpath 
Wink

Lol. looks like im lost without the wiki, but did already try this without sucess, in fact i did juse "Folderpath" already

So, No, doesnt do the trick.

I did show both (String and "Player,Folderpath" as labels and they return similar path structures.


RE: Problem with "SubString" - badaas - 2016-02-16

should it be $INFO[Skin.String(stringname)]?


RE: Problem with "SubString" - Hitcher - 2016-02-16

Ah yeah, missed that badass. It should be -

PHP Code:
<visible>!SubString(Player.Folderpath,$INFO[Skin.String(stringname)])</visible



RE: Problem with "SubString" - sualfred - 2016-02-16

Really?

I use a lot of lines such as "StringCompare(Container.FolderPath,Skin.String(4000-WidgetList-1))" without any $INFO[] tag.

Example:
Code:
<variable name="HeadingLabel">
        <value condition="!IsEmpty(Skin.String(1000-WidgetLabel-1)) + StringCompare(Container.FolderPath,Skin.String(1000-WidgetList-1))">$INFO[Skin.String(1000-WidgetLabel-1)]</value>
        <value condition="!IsEmpty(Skin.String(1000-WidgetLabel-2)) + StringCompare(Container.FolderPath,Skin.String(1000-WidgetList-2))">$INFO[Skin.String(1000-WidgetLabel-2)]</value>
        <value condition="!IsEmpty(Skin.String(1000-WidgetLabel-3)) + StringCompare(Container.FolderPath,Skin.String(1000-WidgetList-3))">$INFO[Skin.String(1000-WidgetLabel-3)]</value>
        <value condition="!IsEmpty(Skin.String(1000-WidgetLabel-4)) + StringCompare(Container.FolderPath,Skin.String(1000-WidgetList-4))">$INFO[Skin.String(1000-WidgetLabel-4)]</value>
        <value condition="!IsEmpty(Skin.String(1000-WidgetLabel-5)) + StringCompare(Container.FolderPath,Skin.String(1000-WidgetList-5))">$INFO[Skin.String(1000-WidgetLabel-5)]</value>
        <value condition="!IsEmpty(Skin.String(1000-WidgetLabel-6)) + StringCompare(Container.FolderPath,Skin.String(1000-WidgetList-6))">$INFO[Skin.String(1000-WidgetLabel-6)]</value>
...
</variable

That works well.


RE: Problem with "SubString" - Hitcher - 2016-02-17

Yeah you're totally right, only needed for $LOCALIZE[..].


RE: Problem with "SubString" - badaas - 2016-02-17

Meh, ah well... I reliinquish my skilled skinner title lol Wink


RE: Problem with "SubString" - Rantanplan-1 - 2016-02-17

(2016-02-16, 20:12)badaas Wrote: should it be $INFO[Skin.String(stringname)]?

Ha,..

This is against to what i learnd, BUT! exactly this did the Trick! (To try something like this, was totaly out of my Scope Smile )

Thanks.

However, seems this is only the case for "SubString" and $INFO[foo] seems not neded for StringCompare.
(Maybe a Bug or was this the case since ever?)


RE: Problem with "SubString" - sualfred - 2016-02-17

Dunno, but good to know Smile


RE: Problem with "SubString" - Rantanplan-1 - 2016-02-18

Sry. but still not solved!

by using "$INFO[] Hack"
Code:
<visible>!SubString(Player.Filenameandpath,extras/startupvideo.mp4,right) + !SubString($INFO[Skin.String(Startup_Video_Path)],Player.FolderPath)</visible>

The OSD is hidden while the startvideo is playing, but also hidden no mather which Video plays.


Could it be that SubString is broken? or simply not work with "Skin.String" in it? I've got other Problems wit "SubString" thogether with Skin.String on other places in the Skin!

Undecided


RE: Problem with "SubString" - ronie - 2016-02-18

stringcompare does support comparing two infolabels.
substring only supports comparing an infolabel to a textstring.

no bug, always been like that ;-)


RE: Problem with "SubString" - Rantanplan-1 - 2016-02-18

o.k.

So im out of Ideas.

any suggestions on how to hide the OSD while the Startup Video is playing?


RE: Problem with "SubString" - ronie - 2016-02-18

perhaps you can set a window property in Startup.xml
use this property as a visible condition in VideoOSD.xml
and clear the property when VideoFullScreen.xml unloads?


RE: Problem with "SubString" - Rantanplan-1 - 2016-02-18

yer could be a Idea but how to set the property if the conditon cant be a SbuString(String(blablub),Label

<onload condition=""

My Startup.xml looks like this:

Code:
<window>
    <!-- startup -->
    <onload>Skin.Reset(HideSettings)</onload>
    <!--
    <onload>ReplaceWindow($INFO[System.StartupWindow])</onload>
    -->
    <defaultcontrol always="true">10</defaultcontrol>
    
    <controls>

<control type="button" id="10">
            <description>trigger with startup Video</description>
            <onfocus condition="!IsEmpty(Skin.String(Startup_Video_Path)) + Skin.HasSetting(UseCustomStartupVideo)">XBMC.PlayMedia($INFO[Skin.String(Startup_Video_Path)])</onfocus>
            <onfocus condition="IsEmpty(Skin.String(Startup_Video_Path)) | !Skin.HasSetting(UseCustomStartupVideo)">XBMC.PlayMedia(special://skin/extras/startupvideo.mp4)</onfocus>
            <onfocus>ReplaceWindow($INFO[System.StartupWindow])</onfocus>
            <texturenofocus>-</texturenofocus>
            <texturefocus>-</texturefocus>
            <visible>!Skin.HasSetting(DontUseStartupVideo)</visible>
        </control>

    </controls>
    
</window>