[solved] FanArt transition (1 Viewer)

ge2301

MP2 Design
  • Team MediaPortal
  • January 11, 2014
    6,615
    2,385
    Stuttgart
    Germany Germany
    Country flag
    Sounds really cool and this is exactly what I'd like to see (y)(y)
     

    ge2301

    MP2 Design
  • Team MediaPortal
  • January 11, 2014
    6,615
    2,385
    Stuttgart
    Germany Germany
    Country flag
    @Brownard
    I've modified the FanArt screen a bit in order to show more from images and audio poster.
    Currently those FanArts are too small, because they are uniformed into space, that is intended for movie posters.

    Everything looks basically ok, just then switching between FanArts with different aspect there is a sudden jump.
    It seems that the FanArt is changing the position after the ImageSourceWrapper finished it's transition effect.

    Attached a small movie showing this.

    Do you have an idea, why this happens or how we can prevent it?

    Here the code in MediaItemFanArt.inc:
    XML:
    <Grid
      xmlns="www.team-mediaportal.com/2008/mpf/directx"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:fanart="clr-namespace:MediaPortal.Extensions.UserServices.FanArtService.Client;assembly=FanArtService.Client"
      xmlns:media="clr-namespace:MediaPortal.UiComponents.Media.Models.AspectWrappers;assembly=Media"
      x:Name="MediaItemDetails" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="{DynamicResource Cover_Width}"
      Margin="-25,-20,-80,30">
    
      <Grid.RowDefinitions>
        <RowDefinition Height="*"/>
      </Grid.RowDefinitions>
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*"/>
      </Grid.ColumnDefinitions>
      <Grid.Resources>
        <fanart:FanArtImageSourceConverter x:Key="FanArtImageSourceConverter"/>
      </Grid.Resources>
    
      <Image Grid.Row="0" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center" Stretch="Uniform" Margin="0,0,5,0" Height="560">
        <Image.Source>
          <ImageSourceWrapper Delay="0.5" DelayInOut="true" Transition="transitions\dissolve" TransitionDuration="0.5"
                         Source="{Binding Source={StaticResource FanArtBackgroundModel}, Path=ImageSource, Converter={StaticResource FanArtImageSourceConverter}, ConverterParameter=Poster;0;0;False}"
                         FallbackSource="{Binding Source={StaticResource FanArtBackgroundModel},Path=MediaItem}" />
        </Image.Source>
      </Image>
    </Grid>
     

    Attachments

    Brownard

    Development Group
  • Team MediaPortal
  • March 21, 2007
    1,945
    1,297
    United Kingdom United Kingdom
    Country flag
    I think the underlying reason is that you haven't given the Image control a width and the skin engine is calculating the size and position of the control during the transition from the size of the first image, then it updates the control's size and position based on the second image's size after the transition.

    A workaround is to give the Image control a width e.g.
    XML:
    <Image Grid.Row="0" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center" Stretch="Uniform" Margin="0,0,5,0" Height="560" Width="{DynamicResource Cover_Width}">
        <Image.Source>
          <ImageSourceWrapper Delay="0.5" DelayInOut="true" Transition="transitions\dissolve" TransitionDuration="0.5"
                        Source="{Binding Source={StaticResource FanArtBackgroundModel}, Path=ImageSource, Converter={StaticResource FanArtImageSourceConverter}, ConverterParameter=Poster;0;0;False}"
                        FallbackSource="{Binding Source={StaticResource FanArtBackgroundModel},Path=MediaItem}" />
        </Image.Source>
    </Image>
    This does impact the alignment though, the image control is aligned to the right but the actual images are centred within the image control's 'rectangle' so the distance to the right hand side varies depending on the image's aspect ratio. It looks acceptable to me though.
     

    ge2301

    MP2 Design
  • Team MediaPortal
  • January 11, 2014
    6,615
    2,385
    Stuttgart
    Germany Germany
    Country flag
    so the distance to the right hand side varies depending on the image's aspect ratio. It looks acceptable to me though.
    Thanks, this is a good step. But the same code is used for movie poster etc. To keep visually a symetry and in order to not cover the FanArt background in the middle, it needs to be aligned on the right side. I'm sure there is a solution, I'll play around with it further :) Google didn't help so far though ...
     

    Brownard

    Development Group
  • Team MediaPortal
  • March 21, 2007
    1,945
    1,297
    United Kingdom United Kingdom
    Country flag
    I don't think it will be easy (maybe impossible).
    You could either define a different Cover_Width for each view based on expected values for that media type or disable transitions.

    The ultimate fix would be to implement ContentAlignment for the image control so that images aren't always drawn in the centre, I don't think WPF even implements this though.
     

    ge2301

    MP2 Design
  • Team MediaPortal
  • January 11, 2014
    6,615
    2,385
    Stuttgart
    Germany Germany
    Country flag
    I think MPF is a "light version" of WPF. Means most parts are taken over, but some parts are missing in MPF.
    Howeer there might be also other reasons, as I'm not part of MP2 from the beginning :)
     

    Lehmden

    Retired Team Member
  • Premium Supporter
  • December 17, 2010
    12,069
    3,681
    Lehmden
    Germany Germany
    Country flag
    I think MPF is a "light version" of WPF
    MPF is meant as an modified WPF to fit MP2 needs perfect. Some features of WPF are not supported but some features used in MP2 are not supported in WPF but in MPF. To say it is a "light" version is not exactly correct...
    Al least it this how I have understood the existance of MPF
     

    Brownard

    Development Group
  • Team MediaPortal
  • March 21, 2007
    1,945
    1,297
    United Kingdom United Kingdom
    Country flag
    I've managed to hack together a working solution to this where you can specify the alignment of the texture within the image control.

    @morpheus_xx is this something we want to support? The current problem is that when an Image control's width/height is dynamic based on the texture size, there is a 'jump' when a transition finishes (it's also there without a transition but much less noticeable) when the layout updates based on the new texture size. But without a dynamic size it isn't possible to get a consistent alignment because the texture is always drawn centred.

    The relevant changes would need to be made here so that textures aren't always drawn centred.
     

    Users Who Are Viewing This Thread (Users: 0, Guests: 1)

    OP Similar threads Forum Replies Date
    horned_reaper [solved] When playing music Fanart does not shuffle Fanart Handler 20
    horned_reaper [solved] No Fanart when playing Fanart Handler 115
    horned_reaper [solved] When playing music Fanart does not appear immediately after downloading Fanart Handler 272
    morpheus_xx [WiP] WIP 2.3 Fanart issues? MediaPortal 2 13
    Rob Hexenmeister [solved] Customising Fanart Handler settings Fanart Handler 3
    franat No funciona ni MepoTools ni DvdArt en castellano Ayuda con MediaPortal 2
    J Suggestion on fanart folder organization. Feature Requests 4
    Lehmden [Videos] More filename possibility for MyVideos local fanart. Improvement Suggestions 26
    DHosein MP-TV no longer holding fanart selections My TVSeries 2
    Edwardfc Fanart setup/configuration General 10
    S Immer gleiche Fanart Musik - CD / MP3 2
    Lehmden Additional naming schemes for local fanart Feature Requests 0
    C [solved] RadioTime Plugin 1.5.0.117 and Fanart Handler Fanart Handler 17
    KlausWirn [solved] MePo1 Cover und Fanart in .nfo Datei ablegen Allgemeines Supportforum 8
    fischy667 [Resolved] No fanart for "Who is America?" My TVSeries 15
    azzuro [MP2-753] Fanart for previous item displayed in some cases Archive 3
    rbo Fanart Handler: Musik-Backdrops für Interpreten ohne eigene Backdrops Plugins & Erweiterungen 8
    C Looking at transitioning from SageTV, but have some questions Newcomers Forum 1
    Top Bottom