hznq
welcome to my space

Half-finished TV-listings code (XMLTV-GUI)

July 4th, 2009 by jane
Posted in enart.hznq.com | edit

  • wow, gratz with the new work mynci and thanks a lot for the half finished source on a xmltv-gui.

    i want to give it a try to finish this, it looks really promissing.

    anyone wanna help, let me know?

    cheers

    /cruent


  • i think the way you are calculating it is perfect. it is rediculous to me to remove functionality that adds flexibilty and user choice... this is america right? ;)

    anyway, maybe you can remove the spaces between each row... that seems to take up a lot so screen real estate and the "import xmltv" button is huge and that 'area' takes up lots of space to.

    as you can see, i'm into maximizing the space. i hate scrolling through pages upon pages...


  • mytv/ television guide: http://img292.echo.cx/img292/597/xbmctvguidemock28ie.th.jpg (http://img292.echo.cx/my.php?image=xbmctvguidemock28ie.jpg) as you can see it uses the standard format (list, icons, big icons) to display available channels, selecting an item would bring up the following screenthat looks very nice and i like to have the option to have that (specific-channel) view too, but only if i can have both :saint:
    (ie; i prefer the 2-3 hour grid with many channels at once, i would not replace that in favour of a 'one-channel' view only)


  • you should also make the grid-pages browsable to the left/right so one can jump one (or three?) hour back/ahead :idea:
    this is already in the code, browsing back and forth takes you forward and back one hour at a time.

    it looks like we could have 2 hours of programming shown in 30 minute increments without any problem in 4:3...much better than i was originally anticipating.
    what does this mean exactly?
    does it mean shows 2 hours on the screen and once, and then when left or right is pressed it goes back or forth 30 minutes?
    that's exactly what i was getting at. i can't wait to check out your next commit, keep up the good work!

    regards,
    los93sol


  • would it not be possible to use some of mediaportals code ?

    i'm not up to speed how diffrent c# is to c++ though.

    looks good anyway :)

    http://mediaportal.sourceforge.net/gallery/mce11.jpg


  • @jslawler
    about the channel logos, they are usually square here as well. *instead of putting them next to the channel name, i was thinking if a logo is present it would replace the channel name. *this way you would have something like:

    8 http://img278.imageshack.us/img278/1926/wtte5aq.jpg

    meh, you get the idea. or if no logo is present it will just go ahead and display like normal, so something like:

    8 fox

    that's all i have for now :)

    regards,
    los93sol


  • looking good, jslawler. apologies to all for jumping in too early regarding insignificant gui details - no point at this stage, given that there's still lots to be done behind the scenes.

    cheers,
    jonathan


  • ph03n1x & jm,
    i cannot see how keeping it in the skin will make it "better"?

    allowing the user to define it will allow them to make the grid smaller/larger and more/less channels/hours as they see fit.

    it might even be a good idea to use the new scaling features jm just put in to allow the users to scale the grid images.

    let the user decide what looks good to him, do not limit the grid to the best wishes of the skinner... skins should be just that... skins. i actually wish skins in xbmc were mote true to definition they are today. (i will not go into my rant but skins in xbmc are not 100% skins, they are feature implimentation as well).

    anyway... it cannot hurt anythign to allow the user to modify the grid size and hours. please leave this in.


  • could you compress the grid area spacing and maybe make the 'import xmltv' button and show buttons smaller so that you can fit more listings into the grid? four channels at a time is not much when you have 250+ channels. i'm thinking you could fit 8 to 10 channels in that area by reducing the size of everythign a bit and it would still be very readable.but all that (including how many channels and hours to display in the grid) will be xml-skinnable for each resolution and skin won't it? ???


  • at the moment the code is set up so the skin xml file decides exactly where everything will go. at the moment the tv grid is just buttons placed next to each other, which works really well. i've made it so the skin designer simply has to place a placeholder button with the fonts to use, etc, and then they make that button the width that the grid should be. the code that grabs the info from that button and uses it to determine how wide the grid will be, and what fonts to use, etc.k, but don't you at least need separate button sizes for 15-minutes, 30-minutes and 1-hour (plus a way or merging them graphicly when a show isn't exacly one of those ,example; auto-merge 30-button with 15-button to get 45?)?

    ps! as for different resolution grid/skins; think you should try by default to have pal/ntsc 4:3 as 2-hours and 4-channels, pal/ntsc 16:9 as 3-hours and 4-channels, 720p as 4-hours and 6-channels, 1080i as 5-hours and 8 channels?


  • good work jslawler!

    i'm working on a tvlisting python grabber for danish channels.

    we need to get a lot of different python grabber for each country.

    cheers


  • i can see how having one script for all countries migh be complicated but i do really like the idea of all the custom settings suggested. much like zap2it it would be nice to be able to put in zip code then tv provider and being able to get an accurate list instead of getting the wrong times for your area or channels that you dont even have. keep up the good work guys this looks great *:kickass:

    just out of curiosity what other things are you seeing as being a part of the "mytv" section aside from the tv guide?


  • @jslawler
    a few things this time...i compiled your latest updates and even with the up-to-date listing.xml file, it keeps prompting that it


  • @los93sol, i think the mediaportal (http://mediaportal.sourceforge.net/gallery/mce11.jpg)/freevo (http://freevo.sourceforge.net/ss/noia/freevo_ss2_640.jpg)/beyondtv (http://www.snapstream.com/images/products/beyondtv/features/beyondtv_programguide.jpg) layout is the best look for a tv (all which seems to be very alike), with topic on top, grid layout in middle, and info at bottom :cool: ...but make it somewhat skinnable ;)


    ps! another (complety other) idea; the listing.xml's probebely need to link/show where to download the logo for its channels (then xmltv-gui should cache it so not have to download it each time)


  • grabber question...
    i don't understand why there is not only one grabber for all countries... why not put a variable in for the country instead of writting a different grabber for each?

    scaling issue...
    how about allowing the user to change the timeframe displayed? so you can "scale" the grid to your liking.

    porting from vb & vbscript...
    someone wrote a vb & vbscript version of this for the homeseer home automation product if anyone is interested. it is free-ware since it is no longer in development. if you know vb, vbscript, and python you could probaby port the code.

    it used the standard xmltv.exe to get the listings but used vbscript to create and display a web page with the grid.


  • :p can't take all the credit for the background...no1cantell helped with it too.


  • @jslawler, sweet! :kickass: ...though personaly i would prefer to have the show-info at the bottom-right with some free available space on the on bottom-left for video-overlay (like in 'my videos') and enough space at the top for the "tv-guide" title (like the other "my..." sections), but i guess you'll make all those skinnable later?

    one thing that isn't properly coded yet, is making the text not overrun the length of the button.suggest you either fade-out (like freevo (http://freevo.sourceforge.net/ss/noia/freevo_ss2_640.jpg)) or just replace overrun with three-dots (like beyondtv (http://www.snapstream.com/images/products/beyondtv/features/beyondtv_programguide.jpg)), ...and maybe make the button that is high-lighted scroll.

    ps! remember to leave space for the tv-channel logos. you should also make the grid-pages browsable to the left/right so one can jump one (or three?) hour back/ahead :idea:


  • hi gamester17,

    your directory structure looks good, but i dont think it really needs its own dll. it is really at the moment only one more guiwindow file.

    at the moment the code is set up so the skin xml file decides exactly where everything will go. at the moment the tv grid is just buttons placed next to each other, which works really well. i've made it so the skin designer simply has to place a placeholder button with the fonts to use, etc, and then they make that button the width that the grid should be. the code that grabs the info from that button and uses it to determine how wide the grid will be, and what fonts to use, etc.

    i have come across a few coding problems. one being at what looks like complete random, when trying to add a grid button it just does not add, the logs say " error exception in capplication::framemove()"
    from my debugging i have found that everything seems ok, apart from the navigation values, they seem to be numbers such as (u:1811951150, d:808591360, l:13616, r:21)
    i'm thinking there is a memory error somewhere and it is corrupting the integers.

    one more question, is it possible to use the current button control and have multiline text ? this would work great as you could fit more of the show name into each grid item.

    there is still a way to go yet, the navigation of the grid is a bit dodgy, as keeping track of lots of different coordinates is a pain and the code is falling over a bit...

    i'll work on the navigation stuff when i get back from work today, and try and post back later.


  • gamester: that's exactly what i was thinking as far as the grabbers and the gui. in my opinion though, the actual gui for the tv guide should be done in c++, but the existing python scripts would definitely be great to look at so the layout can be planned out as efficiently as possible. another thing to think about is the load on the servers that the whole thing would update from. i used to use zap2it and they had a problem with the load on the servers from all the mythtv users updating at once, but since i don't think everyone leaves their xbox on 24/7 i doubt this would be a problem for us. it seems that updating daily would be a bit overwhelming though, i would think if we just had it check to see when the last update was at xbmc start-up and set everything up to update every 7 days it should be fine. that way if everything is already up to date, then we won't put an unnecessary load on the servers. any interested dev's, please join in the irc channel so we can start making this a reality! :lol:
    regards,
    los93sol


  • have you seem the mytv script on xbmcscripts ? - it does everything iteself, and is rather cool :agree:


  • all i can say is... wonderful!

    i'm serioulsy looking forward to this more then any script yet.

    now if we can figure out how to use the grid as a remote control to send a command to my home automation pc so the pc (using usb uirt) can send ir to change the channel!

    do you think there is anyway to tie an http command to a channel/button? my homeseer server can receive this command and send ir.


  • progress report:

    + navigation of the tv grid is pretty much complete and stable now.
    + when moving from one grid item to the next the description of the show is shown at the top of the screen, along with other relevant information.
    + los93sol has created a background image and some media files.

    todo next:
    + now that the code is working and i understand it a lot better, i am going to try and organise the code to make it more readable, before it becomes to out of control.
    + after the code is organised better i will improve the flow of the gui
    + add settings and ability to modify these through gui


  • jslawler,
    please stop by the irc channel so we can chat more about how the layout should be, but i agree that grid view is the way to go. i think if this is going to be done that it should be planned for the future...i mean we should think about the layout as if there is already a my tv section in xbmc. i have been doing some sketches of layouts and looking at other tv guide layouts quite a bit recently, and i have come up with something that would work nicely and keep as much clutter off the screen as possible. the way i see it, the tv guide should be easily laid over something playing in the background (like a live tv stream from your mediaportal box....in the future of course) anyhow, there could be two parts to the tv guide, the top 25% of the screen would display the information about the currently selected channel and show. the channel name and number would be on the left in a header and the current time would be on the right side of the header. when you have a show highlighted, a description of that episode would be displayed in this window as well. the bottom 75% of the screen would be for listing channels and what's on at what time. we can experiment to see how many channels, and how many hours of scheduling is reasonable to have on the screen at one time. i think 10 channels and 3 hours would work nicely, but like i said, we can and will need to experiment with that portion of the layout.

    the other side to this project is the grabbers, we need this to be as universal as possible since people all over the world use xbmc. we should have a place in the settings to configure your parameters for the grabber. ideally, it would be nice if we could have one universal grabber and setup the settings so that your configuration customized it so there would be as little maintenance on the grabbers as possible.

    regards,
    los93sol


  • it sounds great. but i'm already downloading xml data for my mythtv so a http/ftp option wouldbe nice to download data to the xbox


  • about the grabbers, i was thinking something like this:

    the grabbers are stored in a seperative directory and they are called location + grabber url.

    denmark(dr.dk).py

    grabbers output: an xml file called tvlisting.xml (where to put it?)
    <?xml version="1.0" encoding="iso-8859-1"?>
    <tv source-info-url="" source-data-url="">
    *<channel id="">
    * *<display-name></display-name>
    * *<icon src="" />
    *</channel>
    *<programme start="yyyymmddhhmmss +zone" stop="yyyymmddhhmmss +zone" channel="">
    * *<title></title>
    * *<desc></desc>
    * *<credits>
    * * *<director></director>
    * * *<actor></actor>
    * *</credits>
    * *<episode-num></episode-num>
    * *<previously-shown />
    *</programme>
    </tv>


    channel listing config (grabber.xml)
    run the grabber script to download the channel list and let the user pick the channels he wants and perhaps change the order they are downloaded. press next....

    grabber config (grabber.xml)
    then we need to configure the grabber by a gui.
    the script we use, number of days to get the listings, daylight and timezone.

    sample of grabber.xml:
    <grabber>
    *<settings>
    * *<script>denmark(dr.dk).py</script>
    * *<days>3</days>
    * *<daylight>1</daylight>
    * *<timezone>+02</timezone>
    *</settings>
    *<channels>
    * *<entry>channel1</entry>
    * *<entry>channel2</entry> *
    * *<entry>channel3</entry>
    *</channels>
    </grabber>


    more needed?

    after channel config and grabber config, do the xbmc tv guide config.

    set update tv listings -> xbmc startup/tvguide startup/manual
    set cache icons -> on/off
    set timeline -> on/off
    set font/size/color perhaps
    set sorted channels -> on/off

    hope some will read this and make some comments ;)


    cheers

    /cruent


  • hi everyone,

    i don't normally post in the dev section (i am a basic programmer) but i've been following this thread and thought i'd share a few ideas i came up with for the layout. i've created a couple of alternative gui mock ups below to help explain what i mean, let me know what you think! :)

    mytv/ television guide:
    http://img292.echo.cx/img292/597/xbmctvguidemock28ie.th.jpg (http://img292.echo.cx/my.php?image=xbmctvguidemock28ie.jpg)

    as you can see it uses the standard format (list, icons, big icons) to display available channels, selecting an item would bring up the following screen:

    schedule listing:
    [img]http://img292.echo.cx/img292....mg] (http://img292.echo.cx/my.php?image=xbmctvguidemock17bs.jpg)

    from here the user can get specific episode info or do a series lookup via imdb/tvtome.

    imho this layout creates a simple and clean interface (inline with the rest of xbmc) while also providing plenty of space to display programme information. however, a downside is that it requires the user to traverse several screens before they can reach any detailed information.


  • the actual gui for the tv guide should be done in c++that's what i (and cruent) were meant, in referense to mynci's half-finished tv-listings code (xmltv-gui) (http://sourceforge.net/project/showfiles.php?group_id=87054&package_id=153914&release_id=331612), ...i too meant that only the listing.xml grabbers should be python (not the gui itself).

    another thing to think about is the load on the servers that the whole thing would update from. *i used to use zap2it and they had a problem with the load on the servers from all the mythtv users updating at once, but since i don't think everyone leaves their xbox on 24/7 i doubt this would be a problem for us. *it seems that updating daily would be a bit overwhelming though, i would think if we just had it check to see when the last update was at xbmc start-up and set everything up to update every 7 days it should be fine. *that way if everything is already up to date, then we won't put an unnecessary load on the servers.i guess that depends a bit on the websites that is 'ripped' and a bit on how xbmc is set to sheduale when a script is runned; what if one site only have tv-listings for one day, a other has listings for five days and a third for a full week, best would probebely be to just allow the user to select in gui from one of many pre-sets like example: manual/once-a-day/once-every-other-day/once-a-week (xbmc could then be configured by the developer to only run the selected script at first idle-time if set to auto-update), * ...and since most xbmc-users are on different time-zones and live in different countries so will use different scripts that uses different websites plus they will not be runned at any specific time (ie. they will/should not all be set to run at example 18:00 but instead set to run at first idle-time) thus it should balance itself out.


  • anyway, maybe you can remove the spaces between each row... that seems to take up a lot so screen real estate and the "import xmltv" button is huge and that 'area' takes up lots of space to.
    that space is calculated by how many channels u want to see. for example in the image with 7 channels the space between each row is much less, than say the 2 channels image.

    pretty much the code goes like this:

    spaceperrow = maxheight / number of channels

    (i do have a very small inbetween value, but thats to stop the buttons sitting in each other)

    i think the reason it looks like therre is a lot of room is because the background colour is black, and the buttons are also black. so in reality there is actually no space between the rows, it is just that the buttons are very tall and blend in with the background colour. if we had different colour grid buttons it would be more obvious.


  • be nice if it was scalable so those with hdtv (720p and 1080i) could take advantage of the additional space (would probebely mean more channels and more hours displayed at once compared to the lower-resotion on standard tv), and remember that some with normal tvs use 4:3 while others use 16:9 (16:9 wide-screen could probebely display another hour compared to normal 4:3 and still look good).

    personaly i would also love it if the grid was dynamic (instead of all squares with the same sine) when it comes to displaying the programs, maybe as much as down to 15 minutes in detail (though 30 minutes splits would be nice enough), see my poorly made mockup here (link) (https://sourceforge.net/project/screenshots.php?group_id=87054) or be inspired by freevo (link) (http://freevo.sourceforge.net/ss/noia/freevo_ss2_640.jpg), beyondtv (link) (http://www.snapstream.com/images/products/beyondtv/features/beyondtv_programguide.jpg) and mythtv (link) (http://mythtv.sourceforge.net/mc/mythweb1.png).

    ps! a future thing to think of; some websites show which programs are movies and which ones are tv-series to distinguise between them, it would be nice if this is kept in mind by maybe adding separate tags for each in the xml when gabbing the listing (one tag for movies, and one for tv-series) to mark which is which, thus the tv-guide gui could later be linked with www.imdb.com and www.tv.com (once a such interface get added to xbmc) to get more information on that movie or tv-serie directly in the tv-guide by pressing 'info' on that title. this would have to be supported both in the xmltv-gui code and in each python grabber which writes the listing.xml file (though only be optional in the python grabber).


  • now if we can figure out how to use the grid as a remote control to send a command to my home automation pc so the pc (using usb uirt) can send ir to change the channel!
    or, start a python script instead. that it would become really flexible, so we could send a command all sorts of ir blasters but also schedule a recording on pvr.

    this is really looking great, i also can't wait till this becomes part of the cvs builds!

    thanks!!

    le cactus


  • haha, seems there is a nice little debate going on here...

    my view on it is that while this is still in relatively early development the options for # of channels and amount of time displayed are nice to have. it makes it nice and easy to experiment and find the values that work best.

    i do, however think that once we know what works best on what resolutions that it should be defined in the skin. realize that a simple edit of the xml would allow you to change it still, but i doubt many people would ever even want to change these values once it was optimized so i am with jmarshall in the long run, but for now it's good how it is.

    i'm not sure if there is some confusion about the code or not, but i want to make sure everyone knows the gui which is all the screenshots you have seen so far is coded in c++, and not python. python will come into play with this project when the grabbers start being ported over to xbmc.

    just my 2 cents.

    regards,
    los93sol


  • don't forget gbpvr (http://gbpvr.com)!!
    mediaportal is nice, but too much of an overkill. gbpvr does essentialy the same thing, can run as a service background and has a full featured web interface.. and best of all... freeware.
    i use xbmc for 90% of my media tasks.. the only thing that it doesn't do is tvguide and recordings and gbpvr makes it (almost perfect). only missing the remote scheduling from my xbox ;)

    for screenshots:
    http://gbpvr.com/screenshots.htm

    it also includes 2 pics of the tvguide in action to stay on topic :)


  • looking good, but i'd like to make a suggestion
    if its not too much to ask it would be great if we are able to pick the channels that are retrieved & displayed
    if its not possible in the gui then it's ok if we would be able to set it ourselfs in the python file
    just my 2 cents ;)


  • that looks very nice and i like to have the option to have that (specific-channel) view too, but only if i can have both :saint:
    (ie; i prefer the 2-3 hour grid with many channels at once, i would not replace that in favour of a 'one-channel' view only)
    you could have all these views in that design, the raw data is in xml format so we could create something similar to the my music section, modelling the grid as another view of the information. the main reason i chose that view over the grid layout is that it provides a way to manage lists of information such as favourites or top 10s in simple and clean way.

    i agree with the comments made on the the 'one channel' view (doesn't quite have that 'wow' factor does it?) i modelled it on various epgs and thinking about it now, it would probably work better for a more simplified view such as an overlay or osd.


  • i have created a separate class for controlling the grid.
    it now handles all the movements and page changes etc.

    here is a screenshot of it currently.
    ignore the debugging info at the top.

    of course a new skin would need to be created for this window. i currently just use the default project mayhem iii background, and a lot of space is wasted as you can see.

    http://img69.echo.cx/img69/779/tvguide15dd.jpg

    p.s i dont know how long images stay on this temp hosting for, so it may be a dead link in the future.


  • could you compress the grid area spacing and maybe make the 'import xmltv' button and show buttons smaller so that you can fit more listings into the grid? four channels at a time is not much when you have 250+ channels. i'm thinking you could fit 8 to 10 channels in that area by reducing the size of everythign a bit and it would still be very readable.but all that (including how many channels and hours to display in the grid) will be xml-skinnable for each resolution and skin won't it? ???
    as gamester17 says, it is all skinnable for setting the sizes of everything. and there will be a settings page which lets you choose how many channels, and hours to show, etc.
    sounds great :)


  • here is an updated screenshot.

    the gui is still quite dark when viewing on a tv, but it is looking much better.
    one thing that isn't properly coded yet, is making the text not overrun the length of the button.

    http://img102.echo.cx/img102/276/tvguide26bd.jpg


  • @jslawler
    sorry i keep missing you in irc, it seems we are on exact opposite schedules...i am always working when you are there and vice-versa. :p

    outstanding work, this project is really coming along nicely. i got an e-mail from cruent recently, i need to write back to him to verify, but i think he has started on the grabber side of the project.

    truncating the program names looks like it works very nicely now. are you still planning on making the buttons multi-line?

    regards,
    los93sol


  • spent a little time talking to enderw about possible ways to handle the grabber side of the project. it seems if there are 3 parts to this it *could* possibly be done entirely in python without having to worry about maintaining the grabber scripts (at least not too much).

    basically, we could look at the sites used by the grabbers provided with xmltv and use the same sites to base our grabbers on. i know what you are thinking...and no maintaining the scripts would not be an issue, not anymore than maintaining imdb because the major sites used have several projects that rely on them to supply the information so they do not change the site around very much, if at all. our grabbers would be bundled with some additional info to help with the configuration phase of the 3-step process.

    phase 1 - configuration script:

    allows the user to select their country from a spincontrol. the proper script will be linked to the country selected. for example, the us and canada would use a script for zap2it. some areas like sweden will most likely require their own script to grab accurate information.

    this phase is also where the user will select their timezone which would change the value in the script they will be using to their timezone. alternatively, i would think it would be possible to use a time server to set this up so it would be one less step for the end-user to make an error in the setup.

    this phase would also allow you to choose the number of days of information to grab.

    the user would then click on save and apply, they would then be asked if they would like to run the grabber now, which brings us to phase 2.

    phase 2 - the grabber script:

    now that you have your script configured for your settings, you need to run the grabber script to update your info. the grabber would go get the channel information. some sites allow you to setup a username and password and configure your settings directly on the site, for these sites, the script will prompt for your username/password and simply fetch the information. other sites require the user to choose their channels. to handle sites like this, we would need a way to display the channels and let the user pick and choose which ones are included in their final information grab. we are now at phase 3.

    phase 3 - making the xml:

    this phase will convert the channel information to listing.xml so it can be imported into the tv guide. this phase has not been completely planned out, but it seems logical to only code for this phase one time instead of doing it for each individual script.

    note: this is not all intended to be done by one script, it is intended to be handled by 3 seperate scripts, so the information from phase 1 would be passed to phase 2 and that info would be passed to phase 3, then finally imported into the tv guide.

    this would provide the simplest usage for the end-user while maintaining some form of organization so that if a site changes and the grabber stops working, only that particular grabber needs to be updated without needing to worry about the code involved in configuring it and converting the data to an xml. the other thing that should be realized is not every country needs its own script, theoretically, almost every country could be handled with about 10 scripts.

    please post your comments on this subject about how to handle the grabber side appropriately with little maintenance, ease of use, and good organization. also, if anyone wants to help with this, drop by the irc channel at efnet #xbmctvguide

    regards,
    los93sol


  • nice work jslawler, great way of handling it :d


  • you should also make the grid-pages browsable to the left/right so one can jump one (or three?) hour back/ahead :idea:
    this is already in the code, browsing back and forth takes you forward and back one hour at a time.

    it looks like we could have 2 hours of programming shown in 30 minute increments without any problem in 4:3...much better than i was originally anticipating.
    what does this mean exactly?
    does it mean shows 2 hours on the screen and once, and then when left or right is pressed it goes back or forth 30 minutes?


  • just thought i'd mention this for those that had not seen it...

    i've been running a nice python script called tvguide.v0.4

    i run xmltv grabber on my home automation pc and publish it via a web site and the xbox uses it off the web site. it works very well and does a great job maximizing screen real estate.

    i highly suggest checking it out if only to get ideas.

    one cool thing is that it would be fairly easy to color code the grid (sports, movies, series, etc) using this script since, i think, the grid boxes are dynamically created.


  • i was thinking, maybe buttons from picture-files isn't such a good idea as it complicates things more that nessesary(?), what if instead you only draw/make-up the grid in code instead; the skinner would thus only have to set where the grid should begin (top-left) in x,y pixel location and where it ends (bottom-right) in x,y pixel location on the screen via the tvguide.xml in the skin, then make it so the skinner can set the color of the grid 'buttons' in hex (like in html), also selectable should be the space (and possible color in hex too, or if left blank make it transparent) between the buttons, the end-user could then select from gui how many hours and channels he which to be displayed at once to overwite the default set by the skinner, ...the xmltv-gui code would then automaticly calculate the exact position plus hight and width of each 'button' to display within the grid, this way the grid (and location of the grid) will be much more scalable/flexible and easier to skin.

    ex: \pal\tvguide.xml grid configured something like this for pal (720x576), where the horizontal position is "x" (calculated from right to left) and the vertical is "y" (calculated from bottom to top): * *<control>
    * * *<description>grid top-left position</description>
    * * *<id>1021</id>
    * * *<selectedcolor>ffff9600</selectedcolor>
    * * *<posx>74</posx>
    * * *<posy>474</posy>
    * *</control>

    * *<control>
    * * *<description>grid bottom-right position</description>
    * * *<id>1022</id>
    * * *<selectedcolor>ffff9600</selectedcolor>
    * * *<posx>646</posx>
    * * *<posy>102</posy>
    * *</control>

    * *<control>
    * * *<description>space between buttons in grid where hight is pixel girth on horizontal lines and width is pixel girth on vertical lines, leave color blank for transparent</description>
    * * *<id>1023</id>
    * * *<selectedcolor>ffffffff</selectedcolor>
    * * *<height>4</height>
    * * *<width>4</width>
    * *</control>

    * *<control>
    * * *<description>default number of hours and channels to display on this resolution</description>
    * * *<id>1024</id>
    * * *<numberoftvguidehours>2<numberoftvguidehours>
    * * *<numberoftvguidechannels>4</numberoftvguidechannels>
    * *</control>
    end-users can from gui thus select to display 3 hours and 6 channels at once for the resolution he has set instead, xmltv-gui code will then overwrite the defaults and the automaticly recalculate before displaying the grid of show-times.

    the skinner should also be able to select where (horizontal "x" and "y" for beginning to end) to display the show-information as contained in listing.xml or scraped from imdb/tv.com

    what do you think?


  • yes, but extend it with a movies view
    a whats on now view is also preferred
    if possible have the time at the top in a row and make it clickable
    to switch to a later time


  • just a small suggestion from the settings nazi:

    i'd kill the number of channels setting and have that purely defined by the skin. just seems a little out of place with the rest of xbmc. even number of hours is can probably be gotten rid of as well - it's really dictated by the size of font/button that the skinners define, so you mayaswell just have it all done via the skin. just my opinion.

    oh, and please put any grabbers and config stuff under the system/ folder.

    looking good though.

    cheers,
    jonathan


  • agreed, i would love to see someone finish this up and using xmltv it would be universal for anyone. this would be a great starting point for a my tv section in xbmc. anyone interested in this, please join us at efnet #xbmctvguide with enough interest this can take off so xbmc will be prepared when other projects like mediaportal have matured enough that we can start seriously considering some kind of interface. this has been discussed on the boards before so i won't go into it here. however, in my opinion, xbmc shouldn't rely on a backend to do everything, it should have it's own functionality to bring to the table so having its own tv guide would be great.
    regards,
    los93sol


  • hi gamester17,

    buttons have a width property.
    so i can make the button as wide as i want.
    if the grid holds 120 minutes of tv, then it works out the scale by calculating how much space there is for the grid and how much time to hold.
    then when a show is like 25 minutes it makes the button's width = 25 * scale.
    so they all work nicely.

    i'll post a screenshot later tonight.
    i'm working on navigation right now.


  • @jslawler
    the new code is working great! i was unable to check out the settings as i think you left out your new strings.xml when you made your last commit. keep the updates comin'! :thumbsup:

    regards,
    los93sol


  • @gamester 17

    you have pretty much the same idea as i do. *earlier this morning we setup a svn for the project thanks to jslawler and cruent. *for now, we just added a button next to my files to access the tv guide, but hope this will spawn an entire my tv section in xbmc. *the current layout doesn't really work at this point, but it loads up and you are able to retrieve channel data from listings.xml in root. *

    i began working on a mock-up of my own, i noticed most of the grabbers issue information related to each individual program like you said, distinguishing between tv content and movie content. *one thing i noticed is that it actually goes a step further than that in most cases, also issuing information as to the genre of the program (eg. sitcom, comedy, etc.) *my plan is to have two windows, a window on the top 15% of the screen and a window on the bottom 85% of the screen. *the window on the top would have a header to display the following information, channel number, channel name, program name, time of program, and current time. *below the header it would display the genre information and a description of the program since i have not found a grabber yet that doesn't supply a short description. *the window on the bottom of the screen would display the actual guide information exactly the way you laid out in your mock-up. *i would like to plan this to be used as an overlay so it will be ready when interfacing with a backend program like mediaportal is possible. *that way if you are watching a program already, you would be able to call up the tv guide from either a button mapped to it or from an osd, as well as from wherever else you may want to make it accessible in the gui and work nicely. *i will finish my mock-up later tonight when i get back home and post it here. *bear in mind, it is somewhat generic since i am using the dialog-popup.png as windows, but it accurately displays what i have in mind.

    the main focus right now is to get the gui to grab and display the information within the xml properly. *from there, i think we will most into a better gui layout and config screen so it will grab channel data for more people and make it as simple as possible to use. *it would be great if you could drop by the irc channel a bit to help manage the project and give your insight. *any dev's interested in seeing where this project goes and how everything plays out, please join us in irc on efnet #xbmctvguide

    @affini

    what you are thinking about the grabbers is exactly what i hope can be achieved. *the way i see it, we could have a settings screen to tv grabber and have options like:
    country
    -after country is selected, could narrow down by states or region information depending on how the sources for the grabbers in your country work. *

    data source
    -now that we have your country information, we can give options for data sources available in your country. *since some of the data sources require you to register and have a username/password, we could display a popup dialog if the source you will be directed to requires this so there is no question about which site they should be using. *at this time, username/password fields would become active if the information is required.

    time
    -manually set timezone
    -get timezone information from time server if you use that option

    service provider
    -after the previous information is entered, we would be able to narrow down service providers.

    lineup
    -finally, we could narrow you down to just a few lineups so you would be able to select the one you need.

    frequency
    -this would allow the user to configure how many days of information to grab so the grabber will be able to check to see if it is up-to-date and if it is not, will be able to update itself automagically without user intervention.

    save and apply

    this will take some research to figure everything out, but with a proper outline of the sites, should relieve much of the pain sorting everything out. *i think we should start by analyzing the main grabbers used by xmltv to start gathering information. *if anyone can help with this, please get in contact with me or post your findings. *also note that i am not sure that this is entirely possible with the current xbmc gui, someone more knowledgable should make revisions to this plan and give their own ideas so we can come up with something user-friendly, efficient, and feasible.

    regards,
    los93sol

    edit: alright, i just finished the mock-up...slacked off on it, but you get the idea. *sorry for my shotty photoshop skills, and the genericness of the mock-up, but it shows you what i am thinking. *if anyone would like to take this and put together a better mock-up, please do.

    http://img168.echo.cx/img168/8506/mockup6zf.png

    2nd edit: *i haven't included everything in the mock-up, other features would be very nice as well such as a search button that would pull up another screen similar to the search screen used by gbpvr, and the ability to jump to a specific date and time would also be nice. *if gamester17 is correct with his ideas on interfacing the tv guide with tv.com and imdb.com, those lookups could be added to the context menu. *we could go as far as to have different views that would change the way channels are arranged such as genres, normal, etc. *we could even add an option in the context menu to add a channel to your favorites so you could have a favorites view. *just some ideas that have already been discussed, but if we can get a good enough layout, it is possible to use several different options with this. *hopefully this has some people interested and thinking about it. *remember, if somebody can put together some better mock-ups, please do, it would be great to see what you can come up with. * :lol:

    3rd edit: the svn is now up and ready for anonymous checkout if anyone wants to check out what is done so far. don't expect much at this point. as of now, the code mynci left us with is running and synced to xbmc cvs as of 6-20-05. it sort of works, but needs some lovin.

    instructions:
    to use the svn go to http://tortoisesvn.tigris.org/download.html and download tortoisesvn and install it. after that make a new directory for the source, right click it, click svn checkout, it will ask you the url of the repository, put https://opensvn.csie.org/xbmctvguide


  • that certainly looks nice!

    i mostly use a grid when determining what i want to watch.

    my vote to a suggestion someone else said...
    allow the user to color code the show "types". this is really nice to see wuickly if a listing is a movie, sports, series, etc. this feature is quite common and was in the vb version i was using for my home automation software.

    now here's a challenge... how do we get selecting a channel from the listing to actually send ir to change the channel on the tv?


  • hi people,

    http://img153.imageshack.us/img153/5527/tvguide31bn.jpg

    i have updated all the code to make it much more organised and readable.

    if the last date of the current tv guide data is in the past, then it asks to reload xmltv data.

    it now truncates the names of when they do not fit in their buttons or labels.

    finally, the window is fully skinnable.

    <control>
    <description>channel template</description>
    <type>label</type>
    <id>49</id>
    <align>left</align>
    <posx>64</posx>
    <posy>280</posy>
    <width>140</width>
    <label>chn 1</label>
    <font>font13</font>
    </control>

    <control>
    <description>time template</description>
    <type>label</type>
    <id>39</id>
    <align>left</align>
    <posx>210</posx>
    <posy>230</posy>
    <label>time here</label>
    <font>font14</font>
    </control>

    <control>
    <description>tvgrid template</description>
    <type>button</type>
    <id>99</id>
    <align>left</align>
    <posx>210</posx>
    <posy>280</posy>
    <width>430</width>
    <height>240</height>
    <texturefocus>button-focus.png</texturefocus>
    <texturenofocus>button-nofocus.png</texturenofocus>
    <label>you should not see me</label>
    <font>font13</font>
    </control>


    channel template: you put this where you want the grid channel names to appear. the code uses the x and y coordinates, the width of this label, and the font details.

    time template: you put this where you want the times to appear (eg, on the image - 21:00 22:00 23:00). the code uses the x and y coordinates, and the font details.

    tvgrid template: you put this where you want the main grid of buttons to appear. the code uses the x and y coordinates to place the grid. the code uses the height and width of this button to equal the grid width and height. the code uses the font of this button for what the font if each individual grid item will be. the code also uses the textures specified.

    todo:
    make it customizable in the settings screen of xbmc. (the code has been written so all the number of hours on screen, number of channels on screen, etc is a variable so it can be changed)


  • i have managed to get the code to show the grid of current tv shows, by using the code supplied, but slightly modified.

    i have removed the favourites feature for the time being. i personally don't see any need for it.

    at the moment i have it showing 4 channels, and 2 hours of television. the biggest problem at the moment is fitting the information on the screen. with two hours shown, and using "font10" <-- small font, it can't fit most of the show names in the button width. and "font10" is quite difficult to read, so i don't think it would be usable. if it doesn't work out i might make it only show one hour at a time.

    also, at the moment i have it set up so the bottom 75% or so is a grid vision of the xmltv data, and the top 25% will have show description on the left side, and on the right side will be space for an image (channel logo, or tv show logo)

    los93sol, i will send you an email later with the code so you can organise it. i'll do a little more coding before though so browsing the tv grid works.


  • could you compress the grid area spacing and maybe make the 'import xmltv' button and show buttons smaller so that you can fit more listings into the grid? four channels at a time is not much when you have 250+ channels. i'm thinking you could fit 8 to 10 channels in that area by reducing the size of everythign a bit and it would still be very readable.but all that (including how many channels and hours to display in the grid) will be xml-skinnable for each resolution and skin won't it? ???
    as gamester17 says, it is all skinnable for setting the sizes of everything. and there will be a settings page which lets you choose how many channels, and hours to show, etc.


  • @gamester17
    all of what you are wanting to do is already skinnable. :) *the background was designed with osd usage in mind for the future to overlay it onto a video playing full screen, and is just to help get everything working nicely. ;) *i can flip-flop it so the grid is on top of the data to see how it works because i agree it would be nice when you are using it within the normal gui. *actually, thinking about it now...having a small videoplayer window would be more effective then overlaying it. *hmm...i will make a background and do some testing...it just seems more natural to have the information at the top of the page to me for some reason.

    as far as the information inside the grid goes...i would say just truncate the names, no need for anything to scroll since the program title is displayed at the top of the page along with when it starts and ends. *i do think it should only display in half hour increments though as full hours is a little akward to look at.

    no matter what the final layout will come in time...at this point, experimenting is good so everyone can think about it together and come up with something that works best.

    regards,
    los93sol

    edit: *forgot to mention that jslawler mentioned he wants to make the grid multi-line so it would display the program title on two lines instead of just one...i agree that this would be the best way to do it...multi-line and truncate, i believe this is how beyondtv does it...but i also like the fade effect, so perhaps it would be nice to have multi-line and fade?

    also, i forgot to respond to the person who already downloads their data...as long as you download using xmltv, you can just use the same xml placed in root as listing.xml and you are good to go. :)

    2nd edit: thinking about it more and looking everything over...it is very doable to grab the channel icons as well which means there is more space to be gained for the grid...when it reaches a stage where the channel icons can be displayed we should experiment with different variables for the amount of time actually being displayed. it looks like we could have 2 hours of programming shown in 30 minute increments without any problem in 4:3...much better than i was originally anticipating.


  • i'm interested in contributing to this feature.
    i've done quite a bit of c++ before. i admit i haven't done any xbmc programming, but i've been looking at the half finished code and it looks like it should be ok to pick up on.

    do any of you have any ideas on the gui layout for this feature?
    it is going to be in a grid format? or would it be more like have lots of listboxes which go to the next window:

    tvguide (shows list of channels)
    -->picks a channel (once clicked it lists all days)
    ----->picks a day (once clicked it lists all shows for that day)
    ------->picks a show to see the specific details

    i'd prefer to see some kind of grid view so you can get an overall picture of whats on for that day. but i'm worried the screen would be very cluttered and messy.

    anyway i'll keep looking into the code and mess around with it until i understand it better.


  • i don't understand why there is not only one grabber for all countries... why not put a variable in for the country instead of writting a different grabber for each?that sounds way to complicated on both the grabber side and the gui side, one (or more) seperate grabber for each country is easy to manage for both the scripters and the gui.
    ....just think of the mess having to have to merge many countries code from different scripters into one .py file, and what if one persons code crash the whole script, bad idea :talktohand:

    edit: a few such separate python script (which is theory should be ready to use in xbmc, or at least very port-friendly) can be found here (for belgium, new zealand and sweden) (http://)


    porting from vb & vbscript: someone wrote a vb & vbscript version of this for the homeseer home automation product if anyone is interested. it is free-ware since it is no longer in development. if you know vb, vbscript, and python you could probaby port the code. it used the standard xmltv.exe to get the listings but used vbscript to create and display a web page with the grid.fyi, there are loads and loads of such programs, (code), and projects linked from *xmltv.org (http://membled.com/work/apps/xmltv/) :shifty: who's to know which one/ones is best for porting? :oops:


  • be nice if it was scalable so those with hdtv (720p and 1080i) could take advantage of the additional space (would probebely mean more channels and more hours displayed at once compared to the lower-resotion on standard tv), and remember that some with normal tvs use 4:3 while others use 16:9 (16:9 wide-screen could probebely display another hour compared to normal 4:3 and still look good).

    personaly i would also love it if the grid was dynamic (instead of all squares with the same sine) when it comes to displaying the programs, maybe as much as down to 15 minutes in detail (though 30 minutes splits would be nice enough), see my poorly made mockup here (link) (https://sourceforge.net/project/screenshots.php?group_id=87054) or be inspired by freevo (link) (http://freevo.sourceforge.net/ss/noia/freevo_ss2_640.jpg), beyondtv (link) (http://www.snapstream.com/images/products/beyondtv/features/beyondtv_programguide.jpg) and mythtv (link) (http://mythtv.sourceforge.net/mc/mythweb1.png).

    ps! a future thing to think of; some websites show which programs are movies and which ones are tv-series to distinguise between them, it would be nice if this is kept in mind by maybe adding separate tags for each in the xml when gabbing the listing (one tag for movies, and one for tv-series) to mark which is which, thus the tv-guide gui could later be linked with www.imdb.com and www.tv.com (once a such interface get added to xbmc) to get more information on that movie or tv-serie directly in the tv-guide by pressing 'info' on that title. this would have to be supported both in the xmltv-gui code and in each python grabber which writes the listing.xml file (though only be optional in the python grabber).
    i really like this idea. and it would be great if it would be hd compatible like 720p im running tv.guide.py an python script that shows channels in a grid format and it does not look any good in 720p. so lite more channels and more time frames ;)


  • you can use the grabber and point it to a list that specifies the channels you want to "grab". that is simple to build and should be easy to display/edit via the gui. it could basically be a derivative of the notepad script that already exists. but, of course, it would be better in c++ :d


  • hey guys, this is shaping up great! i'm looking forward to this feature! :d

    @affini, i understand where your coming from however i'm siding with jm on this issue - these options are probably better left defined within the skin as they have a major effect on the size of the grid layout. in particular, it would be a real problem for skinners to handle user-defined layouts and maintain ui consistency.


  • :kickass: i am going to check it out more later when i am home and can compile with the latest code, but was just wondering if the amount of time displayed on the screen is configurable in half hour increments. so you could have like 1 hour, 1.5 hours, 2 hours, 2.5 hours, etc.? just to give a few more variables to experiment with. outstanding updates as always jslawler!!!

    regards,
    los93sol


  • my 2 cents on the directory/file-structure (to stay consistant with existing layout):

    \xbmc\skin\project mayhem iii\1080i\tvguide.xml (gui layout for that specific skin and resolution)
    \xbmc\skin\project mayhem iii\720p\tvguide.xml (gui layout for that specific skin and resolution)
    \xbmc\skin\project mayhem iii\ntsc\tvguide.xml (gui layout for that specific skin and resolution)
    \xbmc\skin\project mayhem iii\ntsc16x9\tvguide.xml (gui layout for that specific skin and resolution)
    \xbmc\skin\project mayhem iii\pal\tvguide.xml (gui layout for that specific skin and resolution)
    \xbmc\skin\project mayhem iii\pal16x9\tvguide.xml (gui layout for that specific skin and resolution)
    \xbmc\skin\project mayhem iii\media\*.png (use existing background pictures etc. as much as possible plus add nessesary additions in all correct aspect ratios and resolutions)
    \xbmc\skin\project mayhem iii\skin.xml (add the tv-guide section link)
    \xbmc\skin\any other skin\same as above\*.*

    \xbmc\tvguide\
    \xbmc\tvguide\tvguide.lib or tvguide.dll (dynamicly loadable like how the python and cd-player are)
    \xbmc\tvguide\cache (only if needed by the library, if needed this should be self-cleaning, and not to be used for logos)
    \xbmc\tvguide\tvguide.xml (any general tv-guide settings that should not be available in the gui, should really only be edited by developers and power-users)

    \xbmc\tvguide\listings\listing.xml (listing.xml in xmltv standard, it should then be totally up to each script-writter how much info to grab in his/her script)
    \xbmc\tvguide\
    \xbmc\tvguide\grabbers\denmark(dr.dk).py
    \xbmc\tvguide\grabbers\denmark(dr.dk).xml (user-customization for that specific grabber-script, so it can very easily be saved/backed-up by the users themselves)
    \xbmc\tvguide\grabbers\denmark(dr.dk)\logos\ (logos for that specific script, again so it can very easily be saved/backed-up by the users themselves)

    ps! like you can see i suggest that instead of a generic 'grabber.xml' you have individual xml files for each grabber-script with same same.
    oh, and all gui settings should be saved in the xbmc's standard settings.xml so that they are kept safe when a user updates xbmc builds


  • jm,
    i'm not sure why you would not want the 'hours' and 'number of channels' be able to be defined within the config. i think it is great... the more settings you can expose to the user the better. i'd rather change the config then mod the code. much more user friendly.

    i think the point of the script is to make it skin independant... at least i hope so. that is the best way, right? this is why there were 10 billion request to change the rss feed definition location and such things.

    dynamic scripts + dynamic skins = wonderful xbmc experience!


  • jslawler,
    this is looking amazing! i'm anxious....

    one request if i may:
    could you compress the grid area spacing and maybe make the 'import xmltv' button and show buttons smaller so that you can fit more listings into the grid? four channels at a time is not much when you have 250+ channels. i'm thinking you could fit 8 to 10 channels in that area by reducing the size of everythign a bit and it would still be very readable.

    my dishnetwork grid has 10 channels on a single screen and tey could easily fit more.


  • will there be scrolling texts for too small buttons or how do you plan to handle this?


  • hi guys,

    i did some more coding on this today.
    i have created a settings page. (at the moment it is just a sub category of weather)

    http://img108.imageshack.us/img108/7971/tvguide48vs.jpg

    xmltv source: this option lets you pick a country or network pc. this spin control is populated by adding all file names from q:\tvguide\grabbers\ which end in .py
    refresh now: this is just a button that allows you to run the grabber.
    number of channels: this specifies how many channels will be shown in the grid at once.
    number of hours: this specifies how many hours the grid will cover.

    more settings will be added in the future, but this is just a basic setup at the moment.
    there is still a few bugs to be worked out with the grid navigation, but it is getting there.

    question for any python people: is it possible to open a file that is on a network pc in python code? i want the network pc source method to also be done in a script if i can.


  • request; as for actually getting/scraping the listing.xml for each country (and its tv-channels) i suggest that python-scripts be used (one for each country), you could then code it so the script to be used can be selected from the xmltv-gui or settings, and then so that the selected script can be runned from a button in the xmltv-gui (or set to auto-update once a day), ...that way whoever develops the xmltv-gui (in c++) don't have to worry about creating or maintaining any of the 'grabbers', and instead anyone with some python knowlage could create or help maintain the grabbers for his/her country, (a few such grabber-scripts already exist here (http://www.xboxmediaplayer.de/cgi-bin/forums/ikonboard.pl?act=st;f=21;t=4480)), another good thing using this method is the end-users don't have to use/have a computer to grab their listing.xml

    ps! there are also plenty of complete tv-guide python-scripts (which display everything themself) that could probebely be converted to output a standard xmltv listing.xml instead ;)


  • hi guys,

    this is how the grid resizing works.
    the skinner puts a control on the screen at x and y with a width and height.
    my code then works out how much space vertically and horizontally each item can take up. this is worked out on the values put in the settings (at the moment).
    this gives the user flexibility to see more or less channels at once (as some countries have lots of channels, and some have few)
    i don't mind if you want it taken out of the settings and put into skinning. i just have it this way at the moment as it is easy for me to test resizing code.

    here are a heap of screenshots to demo the resizing:
    1 channel per screen (http://img137.imageshack.us/img137/8741/1channel1rs.jpg)
    2 channels per screen (http://img137.imageshack.us/img137/2379/2channels1wk.jpg)
    4 channels per screen (http://img137.imageshack.us/img137/8169/4channels3ot.jpg)
    10 channels per screen (http://img137.imageshack.us/img137/3392/10channels5ey.jpg) notice it automatically realises that my tv data only has 7 channels and resizes to fit 7.
    4 hours per screen (http://img137.imageshack.us/img137/7928/4hours7yi.jpg)(yes i know the time labels are out of place, im working on it)

    anyway, thats where it is at right now.







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Half-finished TV-listings code (XMLTV-GUI) , Please add it free.
    Font shaping function
    Adding XM radio to XBMC
    • Last Posts

    • my first attempt at
    • memory cards
    • taking b w
    • shows photos
    • post processing help
    • new to site does a
    • new photoshoot c c p
    • manual setting
    • reading material adv
    • cc please
    • choosing a dslr as a
    • first try at long sh
    • am i over pp
    • adorama
    • Archives

      • 2008-01
      • 2008-02
      • 2008-03
      • 2008-04
      • 2008-05
      • 2008-06
      • 2008-07
      • 2008-08
      • 2008-09
      • 2008-10
      • 2008-11
      • 2008-12
      • 2009-01
      • 2009-02
      • 2009-03
      • 2009-04
      • 2009-05
      • 2009-06
      • 2009-07
    • Categories

      • Jewelry
      • Card Games
      • Stress Management
      • Computer Games
      • Home Security
      • Gardening
      • Copywriting
      • Blogging
    • Meta

      • HOME
      • Valid XHTML
      • XFN
      • WordPress

    Copyright © hznq Inc. All rights reserved.