Problem with autoset Focus to playing item in PlaylistWindow (Music)
#1
i try to set the Focus to the currently playing item in MyPlaylist Window / View.

what i can tell is that it dont work the way i try it, just why?

i already try different variations, non of them did have the effect im after. Hard for me to tell why it doesnt work.

here is what i try so far:

PHP Code:
V1:
<
onload condition="Window.IsActive(musicplaylist) + Container(55).OnNext + !Skin.String(MusicPlayer.PlaylistPosition,Container(55).Position)">SetFocus(55,MusicPlayer.PlaylistPosition)</onload>

V2:
<
onload condition="Window.IsActive(musicplaylist) + Container(55).OnNext + !Skin.String(MusicPlayer.PlaylistPosition,Container(55).Position)">SetFocus(55,$INFO[MusicPlayer.PlaylistPosition])</onload>

V3:
<
onload condition="Window.IsActive(musicplaylist) + System.IdleTime(5) + !Skin.String(MusicPlayer.PlaylistPosition,Container(55).Position)">SetFocus(55,MusicPlayer.PlaylistPosition)</onload

Where "55" is the ID of the View im using.


Could someone enlighten me where i did the mistake here, and if this is even possible with the current Skinningengin?

Regards



EDIT:
Did also try it this way, (even if it would be horrible codingwise for a Playlist with 1000+ items).
PHP Code:
    <onload condition="Window.IsActive(musicplaylist) + System.IdleTime(5) + String.IsEqual(MusicPlayer.PlaylistPosition,1)">SetFocus(55,1)</onload>
    <
onload condition="Window.IsActive(musicplaylist) + System.IdleTime(5) + String.IsEqual(MusicPlayer.PlaylistPosition,2)">SetFocus(55,2)</onload>
    <
onload condition="Window.IsActive(musicplaylist) + System.IdleTime(5) + String.IsEqual(MusicPlayer.PlaylistPosition,3)">SetFocus(55,3)</onload>
    <
onload condition="Window.IsActive(musicplaylist) + System.IdleTime(5) + String.IsEqual(MusicPlayer.PlaylistPosition,4)">SetFocus(55,4)</onload>
    <
onload condition="Window.IsActive(musicplaylist) + System.IdleTime(5) + String.IsEqual(MusicPlayer.PlaylistPosition,5)">SetFocus(55,5)</onload>
    ... 
Reply
#2
SetFocus(id,id) requires two int's. you can't pass an infolabel to it.

as for the second method, system idle time will be 0 on window open, so those conditions will never return true.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
o.k. thanks, so looks like its currently not possible

thanks for clarification.
Reply
#4
(2016-11-28, 19:23)ronie Wrote: SetFocus(id,id) requires two int's. you can't pass an infolabel to it.

The second parameter can be an infolabel, e.g. SetFocus(9000,$INFO[Window(Home).Property(Offset)]) works.
Reply
#5
Thanks for the hint.

Guess will give it a try together with a Alarm

PHP Code:
<onload condition="Skin.HasSetting(PlaylistAutoFocus)">AlarmClock(AutoFocus,SetFocus(55,$INFO[MusicPlayer.PlaylistPosition]),00:20,silent,loop)</onload>
<
onunload condition="Skin.HasSetting(PlaylistAutoFocus)">XBMC.CancelAlarm(AutoFocus,true)</onunload

maybe not a nice / the best Solution, as i would perefere something according "idle" or "on.next", but all i can think of right now, which may could work in some way.

--

i asked in marcels Tread about getting something according "idle" or "on.next", but guess hes bussy right now with bugfixing...



EDIT:
O.K. doesnt work, it just counts up one item if the alarm gets released.. Sad
Reply
#6
(2016-12-01, 01:44)Rantanplan-1 Wrote: Thanks for the hint.

Guess will give it a try together with a Alarm

PHP Code:
<onload condition="Skin.HasSetting(PlaylistAutoFocus)">AlarmClock(AutoFocus,SetFocus(55,$INFO[MusicPlayer.PlaylistPosition]),00:20,silent,loop)</onload>
<
onunload condition="Skin.HasSetting(PlaylistAutoFocus)">XBMC.CancelAlarm(AutoFocus,true)</onunload

maybe not a nice / the best Solution, as i would perefere something according "idle" or "on.next", but all i can think of right now, which may could work in some way.

--

i asked in marcels Tread about getting something according "idle" or "on.next", but guess hes bussy right now with bugfixing...



EDIT:
O.K. doesnt work, it just counts up one item if the alarm gets released.. Sad

Have you tried the container autoscroll option? I use it hidden for videoplaylist compares..

<autoscroll time="1" delay="1" repeat="50">!Control.HasFocus(509) + !String.IsEqual(MusicPlayer.Title,Container(509).ListItem.Title)</autoscroll>
with the container List focus ID (no idea if it works safety, it seems to work what i try), or with idle time and scrolltime 0..

Regards
Reply

Logout Mark Read Team Forum Stats Members Help
Problem with autoset Focus to playing item in PlaylistWindow (Music)0