Listitem Playlists and GUI Modes
#1
I'm working on a xbmc plugin for http://watch.ctv.ca. I've gotten things functional, I'm just trying to work out some convenience issues to improve the Wife Acceptance Factor. There are two issues I'm trying to resolve:

1) I want to add a list item that when selected will play a series of streams. I have the list of streams, and I'm writing them into a temporary STRM file, but when I set a list item to point to that temporary STRM, it just shows me the contents as a list, and lets me pick one to play. I want it to play the playlist, not show its contents. How can I do this? I don't know if you can assign a builtin command to a listitem.

2) I want to set the default view mode for a folder. eg: when I get to the directory level that lists all the episodes of a show, I want it to default to 'Media Info 2' mode. What is the python command to do this?
Reply
#2
*bump*

Is there really no way to do this?

I considered making a list item that points to a python script which would load up and play the playlist, it just seems too hacky.
Reply
#3
anonymous247 Wrote:1) I want to add a list item that when selected will play a series of streams. I have the list of streams, and I'm writing them into a temporary STRM file, but when I set a list item to point to that temporary STRM, it just shows me the contents as a list, and lets me pick one to play. I want it to play the playlist, not show its contents. How can I do this? I don't know if you can assign a builtin command to a listitem.

Why are you writing them to a temporary strm file? Seems overly complicated. Not really familiar with strm in general, but if you just want to add items to the play list them play them:

Code:
#objPL is a playlist object!!!!!!!!!!!!
objPL=xbmc.PlayList(1)
objPL.clear()

for something in somelist:
    listitem = xbmcgui.ListItem(something[name])
    listitem.setinfo(morelistitemstuffinvolvingsomething)
    objPL.add(url, listitem)

xbmc.Player().play(objPL)
anonymous247 Wrote:2) I want to set the default view mode for a folder. eg: when I get to the directory level that lists all the episodes of a show, I want it to default to 'Media Info 2' mode. What is the python command to do this?

Every skin has different view modes, so no, you can't do this. If you set it once your skin should remember it though.

Also, the docs cover this, link in my signature.
Always read the XBMC online-manual, FAQ and search and search the forum before posting.
For troubleshooting and bug reporting please read how to submit a proper bug report.

If you're interested in writing addons for xbmc, read docs and how-to for plugins and scripts ||| http://code.google.com/p/xbmc-addons/
Reply
#4
Thank you.

Ya, writing out the STRM is un-necessary. And as long as I know there's no way to set the default view for a virtual folder, i'll just live without.
Reply
#5
2. xbmc.executebuiltin( "Container.SetViewMode(%d)" % id )

the only problem is you would have to account for every skins view modes.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#6
Huh, ok, so 'id' is some numeric representation of the view mode you want. View modes aren't an enum somewhere? Each skin defines different ones? If so, then ya, I'm just better off leaving it for the user to set the view mode themselves.

Its just that my plugin knows when its listing off shows, seasons, and episodes, and it would seem to make sense to give the GUI hints as to which view mode to choose. But really, its not a big deal, just thought it would be a minor convenience.
Reply
#7
Set the content type (tvshows, seasons, episodes) on the item list.

The skin will then do what it wants to based on what you give it.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#8
Perfect. Thank you.
Reply

Logout Mark Read Team Forum Stats Members Help
Listitem Playlists and GUI Modes0