Kodi Community Forum
Python - Get selected ListItem - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+--- Thread: Python - Get selected ListItem (/showthread.php?tid=264338)



Python - Get selected ListItem - Janssuuh - 2016-03-14

Hi All,

I've been searching the forum, but only found some old (2013) posts, saying it is not possible to get a selected listitem-id queried by Python.

I got current songposition by; songpos = xbmc.PlayList(xbmc.PLAYLIST_MUSIC).getposition()

Now I need to get the current selected / focused position of my play-list.
The goal is to autoscroll to currently playing after not pressing any buttons for like 3 seconds.
(I'm developing a 7" car-theme, which does not provide lots of space and therefor requires a lot of scrolling)

Image

I tried something like:

win = xbmcgui.Window(xbmcgui.getCurrentWindowID())
control = win.getControl(50)
(Id of controllist MyMusicSongs.xml)
controlid = control.getSelectedPosition()

which returns:
control; xbmcgui.ControList object at 0x5846eed8
controlid; -1


Python - Get selected ListItem - Janssuuh - 2016-03-14

Hi All,

I've been searching the forum, but only found some old (2013) posts, saying it is not possible to get a selected listitem-id queried by Python.

I got current songposition by; songpos = xbmc.PlayList(xbmc.PLAYLIST_MUSIC).getposition()

Now I need to get the current selected / focused position of my play-list.
The goal is to autoscroll to currently playing after not pressing any buttons for like 3 seconds.
(I'm developing a 7" car-theme, which does not provide lots of space and therefor requires a lot of scrolling)

Image

I tried something like:

win = xbmcgui.Window(xbmcgui.getCurrentWindowID())
control = win.getControl(50)
(Id of controllist MyMusicSongs.xml)
controlid = control.getSelectedPosition()

which returns:
control; xbmcgui.ControList object at 0x5846eed8
controlid; -1


(Sorry, for posting this on 'addon' thread also.)


RE: Python - Get selected ListItem - ronie - 2016-03-14

it's supposed to be in the addon dev section.


moving...