<?xml version="1.0" encoding="UTF-8"?>
<includes>
    <include name="GlobalBackground">
        <definition>
            <include content="VideoBackground" />
            <include content="MusicVisualizationBackground" />

            <include content="DefaultBackground" />
            <include content="ImageBackground" />
        </definition>
    </include>

    <include name="EmptyBackground">
        <definition>
            <control type="image">
                <include content="FullscreenDimensions" />
                <texture background="true">black.png</texture>
            </control>
        </definition>
    </include>
    
    <include name="DefaultBackground">
        <definition>
            <control type="image">
                <visible>!Player.HasMedia | [Player.HasAudio + !Skin.HasSetting(Background.Visualiser.Active)] | [Player.HasVideo + !Skin.HasSetting(Background.Video.Active)]</visible>
                <include content="FullscreenDimensions" />
                <texture colordiffuse="$VAR[BackgroundColor]" background="true">white.png</texture>
            </control>
        </definition>
    </include>

    <include name="ImageBackground">
        <definition>
            <control type="group">
                <visible>Skin.HasSetting(Background.Image.Active) + [!Player.HasMedia | [Player.HasAudio + !Skin.HasSetting(Background.Visualiser.Active)] | [Player.HasVideo + !Skin.HasSetting(Background.Video.Active)]]</visible>

                <control type="image">
                    <include content="FadeAnimationForBackground" />
                    <include content="FullscreenDimensions" />
                    <fadetime>500</fadetime>
                    <texture background="true" fallback="special://skin/backgrounds/default.jpg">$VAR[ContentSingleImageBackground]</texture>
                    <aspectratio scalediffuse="false">scale</aspectratio>
                </control>

                <control type="multiimage">
                    <include content="FadeAnimationForBackground" />
                    <include content="FullscreenDimensions" />
                    <timeperimage>8000</timeperimage>
                    <randomize>true</randomize>
                    <fadetime>500</fadetime>
                    <imagepath background="true">$VAR[ContentMultiImageBackground]</imagepath>
                    <aspectratio scalediffuse="false">scale</aspectratio>
                </control>

                <control type="image">
                    <visible>Skin.HasSetting(Background.Image.Faded)</visible>
                    <include content="FadeAnimationForBackground" />
                    <include content="FullscreenDimensions" />
                    <fadetime>500</fadetime>
                    <texture colordiffuse="$VAR[FademaskColor]" background="true">white.png</texture>
                </control>
        </control>
        </definition>
    </include>

    <include name="MusicVisualizationBackground">
        <definition>
            <control type="group">
                <visible>Player.HasAudio + [[Skin.HasSetting(Background.Visualiser.Active) + !SlideShow.IsActive] | Skin.HasSetting(Background.Visualiser.RunHidden)]</visible>

                <control type="visualisation">
                    <include content="FullscreenDimensions" />
                </control>
            
                <control type="image">
                    <visible>Skin.HasSetting(Background.Visualiser.Faded)</visible>
                    <include content="FullscreenDimensions" />
                    <fadetime>500</fadetime>
                    <texture colordiffuse="$VAR[FademaskColor]" background="true">white.png</texture>
                </control>
            </control>
        </definition>
    </include>

    <include name="VideoBackground">
        <definition>
            <control type="group">
                <visible>Player.HasVideo + Skin.HasSetting(Background.Video.Active) + !SlideShow.IsActive</visible>

                <control type="videowindow">
                    <include content="FullscreenDimensions" />
                </control>
            
                <control type="image">
                    <visible>Skin.HasSetting(Background.Video.Faded)</visible>
                    <include content="FullscreenDimensions" />
                    <fadetime>500</fadetime>
                    <texture colordiffuse="$VAR[FademaskColor]" background="true">white.png</texture>
                </control>
            </control>
        </definition>
    </include>

    <include name="FadeAnimationForBackground">
        <definition>
            <animation effect="fade" start="0" end="100" time="500">WindowOpen</animation>
            <animation effect="fade" start="0" end="100" time="500">Visible</animation>
            <animation effect="fade" start="100" end="0" time="500">Hidden</animation>
            <animation effect="fade" start="100" end="0" time="500">WindowClose</animation>
        </definition>
    </include>
</includes>
