[Approved] fadelabel text wrapping and button control with fadelabel (new features) (1 Viewer)

ltfearme

Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,751
    7,196
    Sydney
    Home Country
    Australia Australia
    One more request, I modified the MP-RSSTicker plugin so that it has a new skin propertry #rssseparator. This is so it can be used as the wrapstring for the rss fadelabel.

    I noticed an issue where StripWrapString could generate a ArgumentOutOfRange exception because the length is less than zero.

    I modified the code to demonstrate:

    Code:
    private void StripWrapString(GUILabelControl labelControl)
        {
          Log.Info("LabelControl.Label='{0}' _wrapString={1}", labelControl.Label, _wrapString);
          Log.Info("LabelControl.Label.Length='{0}' _wrapString.Length={1}", labelControl.Label.Length, _wrapString.Length);
          labelControl.Label = labelControl.Label.Substring(0, labelControl.Label.Length - _wrapString.Length);
          return;
        }

    [Info.][MPMain]: LabelControl.Label=' ::' _wrapString= #rssseparator
    [Info.][MPMain]: LabelControl.Label.Length='4' _wrapString.Length=14
    [Info.][MPMain]: render exception: System.ArgumentOutOfRangeException: Length cannot be less than zero.

    XML:
    Code:
    <control>
    	<description>RSS Items</description>
    	<type>fadelabel</type>
    	<id>1</id>
    	<width>1250</width>
    	<height>50</height>
    	<posY>695</posY>
    	<posX>120</posX>
    	<font>mediastream12tc</font>
    	<label>#rssfeed</label>
    	<wrapString> #rssseparator </wrapString>
    	<animation effect="slide" start="0,100" end="0,0" tween="quadratic" easing="in" time=" 400" delay="200">WindowOpen</animation>
    	<animation effect="slide" end="0,100" tween="quadratic" easing="in" time=" 400" delay="200">WindowClose</animation>
    	<visible>plugin.isenabled(MP-RSSTicker)</visible>
    </control>

    As you can see #seperator is not evaluated as a skinproperty before hitting this function.

    It Also probably would hurt putting a check for less than zero as well :)
     

    ajp8164

    Portal Pro
    January 9, 2008
    575
    1,166
    Atlanta, GA
    Home Country
    United States of America United States of America
    Damien,

    Do think it's good enough to put in a safety check and avoid the call to substring()? The real question is; does the next (or a subsequent) render loop execute with the property set as expected (e.g., is this is a timing problem)??

    -Andy
     

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,751
    7,196
    Sydney
    Home Country
    Australia Australia
    I think a safety check will be enough...the main reason why I saw this was because some people didnt select a feed for the RSS. There could be a timing issue as well...I haven't really looked into the code that much.

    If I find out some more information I will post back.
     

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,751
    7,196
    Sydney
    Home Country
    Australia Australia
    I noticed one more issue, I haven't done any investigation as yet but I suspect its probably a timing issue.

    If you use the <wrapString> property on the following control in the Settings plugin under Screen Setup->Scroll Speed you will notice that the text will not appear.

    Blue3wide->SettingsGUI:
    Code:
    <control>
            <description>TagLine value</description>
            <type>fadelabel</type>
            <id>25</id>
            <posX>355</posX>
            <posY>350</posY>
            <width>533</width>
            <label>-</label>
            <font>font13</font>
            <textcolor>FFB2D4F5</textcolor>
    	[B]<wrapString> | </wrapString>[/B]
    </control>
     

    Attachments

    • wrapStringNotDefined.jpg
      wrapStringNotDefined.jpg
      129.5 KB
    • wrapStringDefined.jpg
      wrapStringDefined.jpg
      131.9 KB

    ajp8164

    Portal Pro
    January 9, 2008
    575
    1,166
    Atlanta, GA
    Home Country
    United States of America United States of America
    Damien,

    You're right. This is (was) a problem. This is an instance where MP was sending a message to the label to updates it's value. I had not tested that condition. The attached patch will fix this problem. The patch file is really just a text file; easy enough to make changes though.

    I will not be submitting new patches that overlap the pending svn until we get a new baseline. At that time I'll roll all of my changes into a single "uber" update that fixes issues.

    Thanks for using this feature and reporting the problem. I am always happy to fix errors when they arise...

    -Andy
     

    Attachments

    • fade_label_fix.patch
      30.6 KB

    joz

    Portal Pro
    March 17, 2008
    1,353
    306
    Home Country
    Netherlands Netherlands
    I was just trying this out on my own streamedMP version and I'm not sure if there's anything I'm doing wrong but it's behaving a little bit weird atm.
    streamedMP has all these hidden menus with buttons in them so I figured lets try it out on one of those where the text's too long. Well it works completely normal when you have not selected that button, text does not scroll like it should, just looks the same as before, good.
    Now when I select it it starts scrolling after the specified delay also good but when I select another button again the button with the scrolling set on it will have it's text jump constantly like 1 pixel to the left and then back. So it's kinda vibrating there. Bug?!

    I'm on MP 1.1 beta, dunno if newest svn has other fixes that I do not have yet

    p.s.

    I know stuff scrolling towards the edges of the screen can sometimes get problematic (for example fadelabels with posx < 20 will flicker) that might contribute to this issue since the hidden menus are all the way to the right side of the screen.
     

    catavolt

    Design Group Manager
  • Team MediaPortal
  • August 13, 2007
    14,428
    10,455
    Königstein (Taunus)
    Home Country
    Germany Germany
    ...but when I select another button again the button with the scrolling set on it will have it's text jump constantly like 1 pixel to the left and then back. So it's kinda vibrating there. Bug?!

    ...I know stuff scrolling towards the edges of the screen can sometimes get problematic (for example fadelabels with posx < 20 will flicker) that might contribute to this issue since the hidden menus are all the way to the right side of the screen.

    Same problem here with my PureVision skins, although all buttons are in positions > 20 pixels. MP 1.1.0 w. latest SVN, Win7 64Bit
     

    ajp8164

    Portal Pro
    January 9, 2008
    575
    1,166
    Atlanta, GA
    Home Country
    United States of America United States of America
    @Joz/Catavolt -

    I too noticed this problem but it has been a while since I fixed it. I believe the version of MP you are using does contain this bug. I have an SVN build stream that contains the most recent, up to date changes/fixes. I am working with the MP team to see how/where to best post these SVN builds. I'l update this post when it's sorted.

    In the mean time please try this build and report back your results ;-)

    MediaPortalSetup_1.1.0_SVN23845_2009-10-12-18-44.exe

    :D


    I was just trying this out on my own streamedMP version and I'm not sure if there's anything I'm doing wrong but it's behaving a little bit weird atm.
    streamedMP has all these hidden menus with buttons in them so I figured lets try it out on one of those where the text's too long. Well it works completely normal when you have not selected that button, text does not scroll like it should, just looks the same as before, good.
    Now when I select it it starts scrolling after the specified delay also good but when I select another button again the button with the scrolling set on it will have it's text jump constantly like 1 pixel to the left and then back. So it's kinda vibrating there. Bug?!

    I'm on MP 1.1 beta, dunno if newest svn has other fixes that I do not have yet

    p.s.

    I know stuff scrolling towards the edges of the screen can sometimes get problematic (for example fadelabels with posx < 20 will flicker) that might contribute to this issue since the hidden menus are all the way to the right side of the screen.
     

    ajp8164

    Portal Pro
    January 9, 2008
    575
    1,166
    Atlanta, GA
    Home Country
    United States of America United States of America
    I have realized that there may be a frame timing issue that causes the fadelabel to jitter. If your horizontal scroll rate is too slow it will jitter. I have mine set to speed=3 and there is no jitter. I have not looked at what could be wrong in the logic yet but this is the root of the problem. So, for now increase your horizontal scroll rate ;-) and/or (and I haven't looked at this) check your max frames per second rate and perhaps increase that value.
     

    Users who are viewing this thread

    Top Bottom