Building a skin from scratch - a tour - (3 Viewers)

mbuzina

Retired Team Member
  • Premium Supporter
  • April 11, 2005
    2,839
    726
    Germany
    Home Country
    Germany Germany
    My Music
    Or how to skin the first façade control. OK, to be honest, I was overwhelmed by the number of possible tags for the façade & its subcontrols. I just could not understand what it meant. So I started real slow, I created an empty page for mymusicsongs.xml (the file/folder view of mymusic) and set it to the default layout I created (header, footer, some background based on fanart/standard). Then I imported a non existing file named mymusic.common.facade.xml (yes, I delegated a problem ;-)

    But still no contents. So I had a look at DefaultWide. It has a file called common.facade.music.xml (I changed the order as I want all music related stuff to be close together in a directory). From that I thought I could start with the simplest view, the listview. And yes, DefaultWide only contained the following info on the list view:
    Code:
    <?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <window>
      <controls>
    	<control>
    	  <description>group element</description>
    	  <type>group</type>
    	  <visible>!Control.HasFocus(50)</visible>
    	  <animation effect="fade" start="0" end="100" time="200">WindowOpen</animation>
    	  <animation effect="fade" start="100" end="0" time="200">WindowClose</animation>
    	  <control>
    		<description>composite control consisting of a list control and a thumbnail panel</description>
    		<type>facadeview</type>
    		<id>50</id>
    		<control style="NoShadow">
    		  <description>listcontrol</description>
    		  <type>listcontrol</type>
    		  <id>50</id>
    		 
    		</control>
    	  </control>
      </controls>
    </window>

    Yes, that gave me a list control, but it looked ugly. So I had to dive into the references.xml and define my default list control. With a lot of tweaking I came to the following default:
    Code:
    	<control>
    		<description>default listcontrol</description>
    		<type>listcontrol</type>
    		<id>0</id>
    		<posX>0</posX>
    		<posY>130</posY>
    		<width>1240</width>
    		<height>672</height>
     
    		<textureFocus>hiddenMenu_overlay.png</textureFocus>
    		<textureNoFocus></textureNoFocus>
    		<textureHeight>52</textureHeight>
     
    		<IconXOff>10</IconXOff>
    		<IconYOff>8</IconYOff>
    		<itemWidth>40</itemWidth>
    		<itemHeight>40</itemHeight>
     
    		<font>largeFont</font>
    		<font2>largeFont</font2>
    		<font3>labelFont</font3>
    		<textcolor>FFB75700</textcolor>
    		<textcolor2>FF297BFD</textcolor2>
    		<textcolor3>FFB75700</textcolor3>
    		<textcolorNoFocus>FFFFFFFF</textcolorNoFocus>
    		<textcolorNoFocus2>FFFFFFFF</textcolorNoFocus2>
    		<textcolorNoFocus3>FFFFFFFF</textcolorNoFocus3>
    		<selectedColor>AAAAAAAA</selectedColor>
    		<selectedColor2>AAAAAAAA</selectedColor2>
    		<selectedColor3>AAAAAAAA</selectedColor3>
     
    		<textXOff>15</textXOff>
    		<textYOff>2</textYOff>
    		<textXOff2>1210</textXOff2>
    		<textYOff2>2</textYOff2>
    		<textXOff3>1240</textXOff3>
    		<textYOff3>2</textYOff3>
    		<textalign>left</textalign>
    		<textalign2>right</textalign2>
    		<textalign3>right</textalign3>
     
    		<textvisible1>True</textvisible1>
    		<textvisible2>True</textvisible2>
    		<textvisible3>False</textvisible3>
     
    		<shadedColor>AAffffff</shadedColor>
    		<remoteColor>FFFC7B19</remoteColor>
    		<downloadColor>fffc7b19</downloadColor>
    		<playedColor>FF00B7FF</playedColor>
     
    		<colordiffuse>ffffffff</colordiffuse>
     
    		<spaceBetweenItems>2</spaceBetweenItems>
    		<unfocusedAlpha applyToAll="true">255</unfocusedAlpha>
    		<scrollOffset>1</scrollOffset>
    		<scrollStartDelaySec>2</scrollStartDelaySec>
    		<loopDelay>5</loopDelay>
     
    		<suffix>|</suffix>
    		<folderPrefix />
    		<folderSuffix />
    		<spinCanFocus>False</spinCanFocus>
    		<spinUp>spin_up.png</spinUp>
    		<spinUpFocus>spin_up_focus.png</spinUpFocus>
    		<spinDown>spin_down.png</spinDown>
    		<spinDownFocus>spin_down_focus.png</spinDownFocus>
    		<spinWidth>40</spinWidth>
    		<spinHeight>40</spinHeight>
    		<spinPosX>1050</spinPosX>
    		<spinPosY>740</spinPosY>
    		<spinAlign>right</spinAlign>
    		<spinColor>00000000</spinColor>
    		<explicitlyEnableScrollLabel>yes</explicitlyEnableScrollLabel>
    		<dimColor>FFFFFFFF</dimColor>
     
    		<onleft>2</onleft>
    	</control>

    That was a start. Now I wanted a hidden menu. It should look a bit like the win 8 "charms bar", but be text based. I like to have headers in there and I wanted to have a very smooth transition moving the menu items separately with a little delay (to see this you need to test later on). After quite some fiddling with the ActionGroup (this could use some more documentation. More? It could use documentation). I found a solution. Still, my StackLayout did not move the items after invisible items up (even though I told it to do so, existing bug), but well, you can not have everything. Still sometimes the transition away from the menu halts in the middle (I have a half transparent menu) and only continues if I move the focus again (another bug?).

    After that I wanted some nice thumbpanel and while I was at it, lets add spinning CD and ClearArt support. Again I felt something missing (I had this before): I would like to have an animation trigger that triggers on change of focus (any focus change) or change of selection in the façade. I would like the spinning CD to come out of the cover if I keep an item selected for a second or so. Right now I am not even capable of animating if the CD is there or not (control.hasthumb does not work, control.hastext does not work what to do?). At least it rotates. So here is my current result:
    03-27-04.png
    03-27-10.png


    The empty hover pane is a placeholder for now playing. Another idea I have, that is not possible at the moment - Enlarge the façade / listview if nothing is playing and reduce it if something plays (and we need to show the Now Playing overlay). Not possible with the current skin engine.
     

    mbuzina

    Retired Team Member
  • Premium Supporter
  • April 11, 2005
    2,839
    726
    Germany
    Home Country
    Germany Germany
    Hmm, is #music.albumartist broken? It stays empty no matter what I select...
     

    Pog

    Retired Team Member
  • Premium Supporter
  • September 7, 2009
    401
    315
    Wicklow
    Home Country
    Ireland Ireland
    After that I wanted some nice thumbpanel and while I was at it, lets add spinning CD and ClearArt support. Again I felt something missing (I had this before): I would like to have an animation trigger that triggers on change of focus (any focus change) or change of selection in the façade. I would like the spinning CD to come out of the cover if I keep an item selected for a second or so. Right now I am not even capable of animating if the CD is there or not (control.hasthumb does not work, control.hastext does not work what to do?). At least it rotates. So here is my current result:


    Got something for you for change of selection/focus...

    Code:
    <control>
      <description>View Control - Selected Toggle</description>
      <type>label</type>
      <id>5544</id>
      <label>#(iif(neq(string.rtrim(#selectedindex,'1,3,5,7,9'),#selectedindex),'',' '))</label>
    </control>

    Each item focused in a list will now toggle a text flag. Use 2 anims to trigger on each toggle:
    Code:
    <animation effect="fade" time="400" delay="3000" start="0" end="100" reversible="false" condition="Control.HasText(5544)">conditional</animation>
    <animation effect="fade" time="400" delay="3000" start="0" end="100" reversible="false" condition="!Control.HasText(5544)">conditional</animation>

    Note: The view toggle works well for sequential items like listview/filmstrip/coverview, for icons a user can jump up/down lines of icons and if it is even to even or odd to odd the toggle will not trigger. To get around this you can use a double toggle and more anims.
     

    mbuzina

    Retired Team Member
  • Premium Supporter
  • April 11, 2005
    2,839
    726
    Germany
    Home Country
    Germany Germany
    So I will design my icon views to have an uneven number of covers per line ;-)

    Thanks for the tip, slot in CD looks much better. Do you have an idea to delay the change of a texture for a given time? I would like to animate the CD going into the cover again before changing CD & cover thumb - currently no real idea yet.
     

    Pog

    Retired Team Member
  • Premium Supporter
  • September 7, 2009
    401
    315
    Wicklow
    Home Country
    Ireland Ireland
    The texture (#selectedthumb) will change as soon as you focus on a different item. There might be a way of using an expression to write a skinsetting from within the toggle dummy control that saves the #selectedthumb so that it can be used later. The problem with that is you end up with lots of disk writes, it would be useful if the skin engine supported updating properties but that only works with <define> at the moment.

    BTW, #music.albumartist will only contain data when viewing albums and not songs or artists.
     

    mbuzina

    Retired Team Member
  • Premium Supporter
  • April 11, 2005
    2,839
    726
    Germany
    Home Country
    Germany Germany
    Next Up: Fun with animations on the musicOverlay
    I really got into the mood of animating, thanks to @Pog 's idea on alternating selection. I wanted to have a nice Music Overaly that shows the running album along with the spinning CD. But most of all I wanted to have a nice animation on track change.

    One big issue with that, there is no event you can listen to on track change. You have to do this manually. But how? Well I had the basic idea in my head earlier (check #currentplaytime & #currentremaining), but Pogs ideas pushed me all the way. I added the following hidden control:
    XML:
    <type>label</type>
    <id>5545</id>
    <label>#(switch(
    eq(#currentplaytime,'0:00'),'Yes',
    eq(#currentremaining,'0:05'),'Yes',
    eq(#currentremaining,'0:04'),'Yes',
    eq(#currentremaining,'0:03'),'Yes',
    eq(#currentremaining,'0:02'),'Yes',
    eq(#currentremaining,'0:01'),'Yes',
    eq(#currentremaining,'0:00'),'Yes',
    eq(1,1),''
    ))</label>
    </control>

    Now lets have a look at the animations for the CD itself, here is the code:
    XML:
    		<control Style="thumbStyle">
    			<type>image</type>
    			<id>0</id>
    			<zoom>true</zoom>
    			<posX>135</posX>
    			<posY>205</posY>
    			<width>250</width>
    			<height>250</height>
    			<texture>..\..\..\Thumbs\CDArt\Music\#Play.Current.Artist - #Play.Current.Album.png</texture>
    			<keepaspectratio>yes</keepaspectratio>
    			<centered>yes</centered>
    			<visible>player.hasmedia+[control.isvisible(10001)|control.isvisible(10002)|control.isvisible(10003)|control.isvisible(10004)|control.isvisible(10005)|control.isvisible(10006)|control.isvisible(10007)|control.isvisible(10008)|control.isvisible(10009)]</visible>
    			<!-- animations to place the overlay on BasicHome -->
    			<animation effect="slide" time="0" delay="11" start="0,0" end="0,0" condition="control.isvisible(10001)">conditional</animation>
    			<animation effect="fade" time="180" delay="20" start="0" end="100" reversible="false" condition="control.isvisible(10001)">conditional</animation>
    			<animation effect="slide" time="0" delay="11" start="0,0" end="0,284" condition="control.isvisible(10002)">conditional</animation>
    			<animation effect="fade" time="180" delay="20" start="0" end="100" reversible="false" condition="control.isvisible(10002)">conditional</animation>
    			<animation effect="slide" time="0" delay="11" start="0,0" end="0,570" condition="control.isvisible(10003)">conditional</animation>
    			<animation effect="fade" time="180" delay="20" start="0" end="100" reversible="false" condition="control.isvisible(10003)">conditional</animation>
     
    			<animation effect="slide" time="0" delay="11" start="0,0" end="840,0" condition="control.isvisible(10004)">conditional</animation>
    			<animation effect="fade" time="180" delay="20" start="0" end="100" reversible="false" condition="control.isvisible(10004)">conditional</animation>
    			<animation effect="slide" time="0" delay="11" start="0,0" end="840,284" condition="control.isvisible(10005)">conditional</animation>
    			<animation effect="fade" time="180" delay="20" start="0" end="100" reversible="false" condition="control.isvisible(10005)">conditional</animation>
    			<animation effect="slide" time="0" delay="11" start="0,0" end="840,570" condition="control.isvisible(10006)">conditional</animation>
    			<animation effect="fade" time="180" delay="20" start="0" end="100" reversible="false" condition="control.isvisible(10006)">conditional</animation>
     
    			<animation effect="slide" time="0" delay="11" start="0,0" end="1680,0" condition="control.isvisible(10007)">conditional</animation>
    			<animation effect="fade" time="180" delay="20" start="0" end="100" reversible="false" condition="control.isvisible(10007)">conditional</animation>
    			<animation effect="slide" time="0" delay="11" start="0,0" end="1680,284" condition="control.isvisible(10008)">conditional</animation>
    			<animation effect="fade" time="180" delay="20" start="0" end="100" reversible="false" condition="control.isvisible(10008)">conditional</animation>
    			<animation effect="slide" time="0" delay="11" start="0,0" end="1680,570" condition="control.isvisible(10009)">conditional</animation>
    			<animation effect="fade" time="180" delay="20" start="0" end="100" reversible="false" condition="control.isvisible(10009)">conditional</animation>
     
    			<!-- Simple fade on stop/start visibility -->
    			<animation effect="fade" time="200" delay="20" easing="inout" condition="true">Visible</animation>
    			<animation effect="fade" time="200" easing="inout" condition="true">Hidden</animation>
     
    			<!-- Slide the CD in view & fade on window open / out of view on window close -->
    			<animation effect="slide" time="200" delay="200" start="-130,0" end="0,0" easing="out" tween="cubic" reversible="false">WindowOpen</animation>
    			<animation effect="fade" time="200" delay="200" end="100">WindowOpen</animation>
    			<animation effect="slide" time="200" delay="0" start="0,0" end="-130,0" easing="out" tween="cubic" reversible="false">WindowClose</animation>
    			<animation effect="fade" time="200" delay="100" end="0">WindowClose</animation>
     
    			<!-- Slide the CD partly into the sleave on pause -->
    			<animation effect="slide" time="200" delay="0" start="0,0" end="-60,0" easing="out" tween="cubic" condition="player.paused">Conditional</animation>
     
    			<!-- On Track Change slide the CD into the sleave completly, works best if on leftmost column, needs fade -->
    			<animation effect="slide" delay="0" time="700" start="0,0" end="-395,0" easing="out" tween="cubic" reversible="false" condition="control.HasText(5545)">Conditional</animation>
    			<animation effect="fade" delay="300" time="200" start="100" end="0" reversible="false" condition="control.HasText(5545)">Conditional</animation>
    			<animation effect="slide" delay="0" time="700" start="-395,0" end="0,0" easing="out" tween="cubic" reversible="false" condition="!control.HasText(5545)">Conditional</animation>
    			<animation effect="fade" delay="300" time="200" start="0" end="100" reversible="false" condition="!control.HasText(5545)">Conditional</animation>
     
    			<!-- Rotate the CD. Stop on pause, speedup on forwarding, reverse speed up on rewinding -->
    			<animation effect="rotate" delay="0" end="-359" time="8000" loop="true" condition="player.playing+!player.paused+!player.rewinding+!player.forwarding">Conditional</animation>
    			<animation effect="rotate" delay="0" end="-359" time="2000" loop="true" condition="player.playing+!player.paused+player.forwarding">Conditional</animation>
    			<animation effect="rotate" delay="0" end="359" time="2000" loop="true" condition="player.playing+!player.paused+player.rewinding">Conditional</animation>
    		</control>

    As you can see from the comments, a lot of different animation blocks. The first section you might already know from previous posts, it positions the control on the BasicHome page depending on the settings. I usually do that to a whole group, eliminating the need for these animations to appear on every control - but animations are applied in the order they come in and group animations are applied last. For the rotation animation to find the correct center, it has to be that last animation in the list (otherwise it will rotate around a center that is not within the CD, looks not good). So I had to take out the CD (and the background as well to keep the order of drawing in place).

    We have fade in on Visibility Change (for positioning). I might change that to the slide animation later on, right now it does not bother me too much.

    Then there is the window open animation that will combine with the thumb (the sleave) so that the CD slides into the cover and the cover slides out of view while fading (might need some more time checking). The same in reverse for window open, cover slides in, CD slides out of cover.

    Next up is a small gimmick on pause - not only will the CD stop spinning (see below), it will slide partly into the sleave.

    Now is the best part, I slide the CD into the sleave, sleave out of view, then the track changes, the sleave slides back into view and the cd slides out of it. I could watch this forever ;-)

    The last block is the rotation. Again I added a little gimmick: When fast forwarding, the CD spins notably faster (4x) and on rewinding it spins it backwards.

    Video will follow.
     
    Last edited:

    mbuzina

    Retired Team Member
  • Premium Supporter
  • April 11, 2005
    2,839
    726
    Germany
    Home Country
    Germany Germany
    Ah, and for those with special needs, I added a SkinSettings switch which allows you to toggle between showing time remaining and current playtime. Here is a screenshot from basic home:
    12-59-15.png
     

    azzuro

    Test Group
  • Team MediaPortal
  • May 10, 2007
    9,956
    5,629
    France - IDF
    Home Country
    France France
    Question : You can have CD turning animation when album is played ?(with 33rpm speed or less)
    and have default Disc/vinyl when nothing is available
    vinyl.png
     

    mbuzina

    Retired Team Member
  • Premium Supporter
  • April 11, 2005
    2,839
    726
    Germany
    Home Country
    Germany Germany
    Hi azzuro,

    Yes the cd spins slowly when played and quickly when rewinding/fast forwarding.

    I don't have a default image yet, but that is no problem, will add it.
     

    Users who are viewing this thread

    Top Bottom