Converting skins to 1920x1080

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
jmarshall Offline
Team-XBMC Developer
Posts: 26,221
Joined: Oct 2003
Reputation: 178
Post: #31
@Sinnocence: Nice - does that handle the "400r" case as done above in the xlst?

On another note, is it possible with XSLT to transform say:

<tag>Blah Blah Blah $INFO[foo,bar, $LOCALIZE[1234]] Foo Gary</tag>

to:

<tag>"Blah Blah Blah " + Info(foo, "bar", " " + Localize(1234)) + " Foo Gary"</tag>

i.e. $INFO[] -> Info(), anything else (including whitespace) to be placed in quotes and separated via +. 2nd and third params in $INFO[] (including whitespace) to be placed in quotes. First param in $INFO[] to ignore whitespace. Doable, or pipe dream?

Cheers,
Jonathan

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
pecinko Offline
Donor
Posts: 3,820
Joined: Dec 2008
Reputation: 51
Location: Prague / Belgrade
Post: #32
jmarshall Wrote:@Sinnocence: Nice - does that handle the "400r" case as done above in the xlst?

On another note, is it possible with XSLT to transform say:

<tag>Blah Blah Blah $INFO[foo,bar, $LOCALIZE[1234]] Foo Gary</tag>

to:

<tag>"Blah Blah Blah " + Info(foo, "bar", " " + Localize(1234)) + " Foo Gary"</tag>

i.e. $INFO[] -> Info(), anything else (including whitespace) to be placed in quotes and separated via +. 2nd and third params in $INFO[] (including whitespace) to be placed in quotes. First param in $INFO[] to ignore whitespace. Doable, or pipe dream?

Cheers,
Jonathan

$ESCINFO please come back. Everything is forgiven....

My skins:

Amber
Quartz

find quote
jmarshall Offline
Team-XBMC Developer
Posts: 26,221
Joined: Oct 2003
Reputation: 178
Post: #33
OT: Heh - after the initial pain it should make lots of nice things much easier - after all, ya'll want Info(foo,Info(bar),foo) and posx + 5 type stuff, right? Wink

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
phil65 Online
Skilled Skinner
Posts: 4,700
Joined: Mar 2009
Reputation: 64
Location: Cologne, Germany
Post: #34
Updated again, attribute conversion should now work for "start=" and "end=" in slide animation elements and "center=" in rotate and zoom animation elements.

http://www.gtwf-koeln.de/xmlconvertgui.exe

What´s missing apart from border attribute in <texture>, <texturefocus> and <texturenofocus> ?

EDIT: doesn´t convert everything, have to check again

EDIT2: got it i think. exe updated
(This post was last modified: 2012-03-09 01:43 by phil65.)
find quote
phil65 Online
Skilled Skinner
Posts: 4,700
Joined: Mar 2009
Reputation: 64
Location: Cologne, Germany
Post: #35
i´ve fixed some bugs and let it process the aeon nox skin. it looks usable Smile
some small corrections, but it´s really almost complete.
find quote
phil65 Online
Skilled Skinner
Posts: 4,700
Joined: Mar 2009
Reputation: 64
Location: Cologne, Germany
Post: #36
Again an update, it seems as it would work perfectly for EVERYTHING now Smile
Please report if it works for you, too.
find quote
Sinnocence Offline
Donor
Posts: 97
Joined: Oct 2007
Reputation: 4
Post: #37
jmarshall Wrote:@Sinnocence: Nice - does that handle the "400r" case as done above in the xlst?

Apologies, I'm not familiar with the skin xmls & I never saw the 'r' comment - I was just trying to save someone else the headache putting the XSL together. I just took a look at the wiki (http://wiki.xbmc.org/index.php?title=Def...ntrol_tags) and it looks like the only alpha char used is 'r' (?). Below is a quick update to cater for this:
Code:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="xml" indents="yes"/>

<xsl:variable name="MULTIPLIER">1.5</xsl:variable>

  <!-- template (copies input file as-is) -->
  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>

  <!-- specific overrides -->
  <xsl:template match="posx|posy|width|height|textoffsetx|textoffsety|radiowidth|radioheight|radioposx|​radioposy|textwidth|border">
    <xsl:element name="{local-name()}">
        <xsl:choose>
           <xsl:when test="not(substring(., string-length(.))) = 'r')">
              <xsl:value-of select="round(number(.) * number($MULTIPLIER))"/>
           </xsl:when>
           <xsl:otherwise>
              <xsl:value-of select="round(number(substring-before(., 'r')) * number($MULTIPLIER))"/><xsl:text>r</xsl:text>
           </xsl:otherwise>
        </xsl:choose>
    </xsl:element>
  </xsl:template>

</xsl:stylesheet>


jmarshall Wrote:On another note, is it possible with XSLT to transform say:

<tag>Blah Blah Blah $INFO[foo,bar, $LOCALIZE[1234]] Foo Gary</tag>

to:

<tag>"Blah Blah Blah " + Info(foo, "bar", " " + Localize(1234)) + " Foo Gary"</tag>

i.e. $INFO[] -> Info(), anything else (including whitespace) to be placed in quotes and separated via +. 2nd and third params in $INFO[] (including whitespace) to be placed in quotes. First param in $INFO[] to ignore whitespace. Doable, or pipe dream?

That depends! It should be possible via (one very ugly) regex group substitution except that in your example the first and second parameters to $INFO look the same and are treated differently during/after convertion (one becomes a string literal). Is this a healthy example? I can't see any mention of this syntax change on the wiki to confirm but if you want to send on some concrete examples of the before & after then I'll take a look at this (and doing the 'r' substitution properly with regex also in case you guys add other chars in the future) if/when I get a few minutes.

[edit] if the first param to every function is left clean, and all other params get wrapped in quotes then that's pretty straight forward - but is this true of all of the new function definitions?[/edit]
(This post was last modified: 2012-03-09 09:04 by Sinnocence.)
find quote
Sharpe Offline
Skilled Skinner
Posts: 1,032
Joined: Jul 2006
Reputation: 13
Location: North West England
Post: #38
phil65 Wrote:Again an update, it seems as it would work perfectly for EVERYTHING now Smile
Please report if it works for you, too.

Works brilliantly - well done that's really cool.
find quote
ekim232 Offline
Posting Freak
Posts: 1,207
Joined: Nov 2008
Reputation: 5
Location: Chicago, IL
Post: #39
Works good for me also. This is very cool since I was converting a skin to 1080 at the moment (old version of Aeon). This will definitely save sometime on the coverflow view!
find quote
BigNoid Offline
Team-Kodi Member
Posts: 3,151
Joined: Jul 2010
Reputation: 102
Location: Below sea level
Post: #40
Most of it works, only the r value is not put back now. >499r< becomes >798< and it doesn't convert 31 xml with error "Cannot insert the node in the specified location". Used it on Aeon Nox
find quote
phil65 Online
Skilled Skinner
Posts: 4,700
Joined: Mar 2009
Reputation: 64
Location: Cologne, Germany
Post: #41
Big_Noid Wrote:Most of it works, only the r value is not put back now. >499r< becomes >798< and it doesn't convert 31 xml with error "Cannot insert the node in the specified location". Used it on Aeon Nox

hmm then i broke something i think. worked 100%. will check.
EDIT: just tested on DialogMuteBug from Aeon Nox. 40r becomes 60r, so everything´s corrrect. you´re using the newest version?
(This post was last modified: 2012-03-09 20:13 by phil65.)
find quote
BigNoid Offline
Team-Kodi Member
Posts: 3,151
Joined: Jul 2010
Reputation: 102
Location: Below sea level
Post: #42
I checked add header. Without it it does convert the 31 missing xml's but 'r' is still broken.

EDIT: used the link in post #34
find quote
phil65 Online
Skilled Skinner
Posts: 4,700
Joined: Mar 2009
Reputation: 64
Location: Cologne, Germany
Post: #43
updated, i hope everything works now.
only thing is that 240.5 becomes 360 for example and not 361.
the program just doesnt parse it correctly when it´s a double value, so i have to remove the last two chars and convert then.
will look at it again perhaps in the future.
find quote
Martijn Offline
Team Kodi
Posts: 11,606
Joined: Jul 2011
Reputation: 167
Location: Dawn of time
Post: #44
maybe put the link in the OP so it's easier to find Wink

Always read the XBMC online-manual, FAQ and search the forums before posting.
Do NOT e-mail Team-XBMC members asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting, make sure you read this first

For your mediacenter artwork go to
[Image: fanarttv.png]
find quote
phil65 Online
Skilled Skinner
Posts: 4,700
Joined: Mar 2009
Reputation: 64
Location: Cologne, Germany
Post: #45
Martijn Wrote:maybe put the link in the OP so it's easier to find Wink

Thx
find quote
Post Reply