<?xml version="1.0" encoding="UTF-8"?>
<timers>
    <timer>
        <name>autoclosevideoosd</name>
        <description>Timer to auto close the video OSD (if enabled in the skin settings)</description>
        <start reset="true">Window.IsActive(videoosd) + Skin.HasSetting(OSDAutoClose) + !String.IsEqual(window(home).Property(settingslist_content),osd) + !Window.IsActive(osdsubtitlesettings) + !Window.IsActive(osdaudiosettings) + !Window.IsActive(osdvideosettings) + !Window.IsActive(OSDCMSSettings)</start>
        <reset>Window.IsActive(videoosd) + !System.IdleTime(1) + Integer.IsGreaterOrEqual(Skin.TimerElapsedSecs(autoclosevideoosd), 1) | String.IsEqual(window(home).Property(settingslist_content),osd) | Window.IsActive(osdsubtitlesettings) | Window.IsActive(osdaudiosettings) | Window.IsActive(osdvideosettings) | Window.IsActive(OSDCMSSettings)</reset>
        <stop>!Window.IsActive(videoosd) | String.IsEmpty(Skin.String(OSDAutoCloseTime)) + Integer.IsGreaterOrEqual(Skin.TimerElapsedSecs(autoclosevideoosd), 4) | !String.IsEmpty(Skin.String(OSDAutoCloseTime)) + Integer.IsGreaterOrEqual(Skin.TimerElapsedSecs(autoclosevideoosd),Skin.Numeric(OSDAutoCloseTime))</stop>
        <onstop>Dialog.Close(videoosd)</onstop>
    </timer>
    <!-- <timer>
        <name>1110_topbaroverlay</name>
        <description>A timer that is activated when the topbaroverlay is loaded and stops automatically after 5 seconds (or playback is resumed)</description>
        <stop>!Player.Paused | Integer.IsGreaterOrEqual(Skin.TimerElapsedSecs(1110_topbaroverlay),5)</stop>
    </timer> -->
    <timer>
        <name>wall_scroll_timer</name>
        <description>Timer to automatically return to Flix/FlixScape view</description>
        <start reset="true">Control.HasFocus($PARAM[list_id])</start>
        <stop>Integer.IsGreaterOrEqual(Skin.TimerElapsedSecs(wall_scroll_timer),Skin.Numeric(RevertFromWallDelay))</stop>
        <onstop condition="Control.IsVisible(500) + ![Control.HasFocus(532) | ControlGroup(9000).HasFocus]">Container.SetViewMode(54)</onstop>
        <onstop condition="Control.IsVisible(501) + ![Control.HasFocus(532) | ControlGroup(9000).HasFocus]">Container.SetViewMode(55)</onstop>
        <!-- <onstart>Notification(skintimer, Wall scroll timer started, 1000)</onstart>
        <onstop>Notification(skintimer, Wall scroll timer stopped, 1000)</onstop> -->
    </timer>
    <timer>
        <name>posterflow_scroll_timer</name>
        <description>Timer to automatically display information on PosterFlow view after scrolling</description>
        <start reset="true">Control.HasFocus($PARAM[list_id])</start>
        <stop>Integer.IsGreaterOrEqual(Skin.TimerElapsedSecs(posterflow_scroll_timer),Skin.Numeric(PosterFlowAutoInfoDelay))</stop>
        <!-- <onstart>Notification(postertimer, Poster scroll timer started, 1000)</onstart>
        <onstop>Notification(postertimer, Poster scroll timer stopped, 1000)</onstop> -->
    </timer>
    <timer>
        <name>autolock_view_timer</name>
        <start reset="true">Control.HasFocus($PARAM[list_id])</start>
        <stop>Integer.IsGreaterOrEqual(Skin.TimerElapsedSecs(autolock_view_timer),1)</stop>
        <onstop condition="Container.Content(episodes) + !String.StartsWith(Container.PluginCategory,Season)">Skin.SetString(Skin.ForcedView.episodes.outside,$INFO[Container.Viewmode])</onstop>
        <onstop condition="Container.Content(episodes) + String.StartsWith(Container.PluginCategory,Season)">Skin.SetString(Skin.ForcedView.episodes.inside,$INFO[Container.Viewmode])</onstop>
        <onstop condition="!Container.Content(episodes)">Skin.SetString(Skin.ForcedView.$INFO[Container.Content],$INFO[Container.Viewmode])</onstop>
        <!-- <onstop>Notification(View Locked,$INFO[Container.Content] - $INFO[Container.Viewmode],3000)</onstop> -->
        <!-- <onstop>Notification(View locked$VAR[ContentTypeLabel], [UPPERCASE]$INFO[Container.Viewmode][/UPPERCASE], 2000)</onstop> -->
    </timer>
    <timer>
        <name>end_playback_timer</name>
        <description>Timer to automatically stop playback</description>
        <start>Player.Paused + Skin.HasSetting(Enable.AutoEndPlayback)</start>
        <reset>!Player.Paused + Skin.HasSetting(Enable.AutoEndPlayback)</reset>
        <stop>Integer.IsGreaterOrEqual(Skin.TimerElapsedSecs(end_playback_timer),Skin.Numeric(PlaybackDelaySecs))</stop>
        <onstop>PlayerControl(Stop)</onstop>
        <!-- <onstart>Notification(skintimer, End playback timer started, 1000)</onstart>
        <onstop>Notification(skintimer, End playback timer stopped, 1000)</onstop> -->
    </timer>
    <timer>
        <name>autoplay_trailer_timer</name>
        <description>Timer to autoplay trailers</description>
        <start reset="true">Control.HasFocus($PARAM[list_id])</start>
        <stop>Integer.IsGreaterOrEqual(Skin.TimerElapsedSecs(autoplay_trailer_timer),Skin.Numeric(TrailerDelaySecs))</stop>
        <onstop condition="!String.IsEmpty(ListItem.IMDBNumber) + String.StartsWith(ListItem.IMDBNumber,tt) + [ControlGroup(2000).HasFocus | Control.HasFocus(50) | Control.HasFocus(51) | Control.HasFocus(54) | Control.HasFocus(55) | Control.HasFocus(56)]">Skin.SetString(TrailerPlaying, true)</onstop>
        <onstop condition="!String.IsEmpty(ListItem.IMDBNumber) + String.StartsWith(ListItem.IMDBNumber,tt) + [ControlGroup(2000).HasFocus | Control.HasFocus(50) | Control.HasFocus(51) | Control.HasFocus(54) | Control.HasFocus(55) | Control.HasFocus(56)]">$VAR[AutoplayTrailerSource]</onstop>
        <!-- <onstart>Notification(skintimer, Autoplay trailer timer started, 1000)</onstart>
        <onstop>Notification(skintimer, Autoplay trailer timer stopped, 1000)</onstop> -->
    </timer>
    
</timers>
