XBMC Community Forum
New MythTV add-on using libcmyth - Printable Version

+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: PVR Development (/forumdisplay.php?fid=136)
+--- Thread: New MythTV add-on using libcmyth (/showthread.php?tid=110694)



RE: New MythTV add-on using libcmyth - simonind - 2012-03-18 23:50

(2012-03-15 21:01)321liftoff Wrote:  
(2012-03-14 00:58)simonind Wrote:  inet_ntop seems to be the function call that's for Vista and later, it will need a change to libcmyth to make it XP compatible I think

Is that a change I need to make in the source and compile, or can that change be made in the binary?

I suspect it's needed in the source so that libcmyth can be built using a boost or some other alternative function - is the source for libcmyth readily available?


RE: New MythTV add-on using libcmyth - Jimmer - 2012-03-19 10:02

(2012-03-18 23:50)simonind Wrote:  I suspect it's needed in the source so that libcmyth can be built using a boost or some other alternative function - is the source for libcmyth readily available?

sure thing, it's under lib/cmyth in the xbmc source tree. I think the one in tsp's tree has had recent commits to fix problems with the addon. The one in mainline xbmc has been untouched for a couple of months..... Go to tsp's github and you can browse down to lib/cmyth and check out the code for yourself.....


RE: New MythTV add-on using libcmyth - Kr0nZ - 2012-03-19 21:46

Well after tinkering with the source for awhile I have finally got the tv show posters to show up in the recordings section,

[Image: 7bO07.png]

not sure if my solution is ideal as I had to make a few changes to the libcmyth source, the addon source, and the main xbmc source

(note to non-devs: just copying these files over might not work as you have to make actual changes to the source.
Im just providing this to help out the dev process, so you shouldn't make these change unless you know what your doing)


In the cmyth source
I added a new function, 'cmyth_storagegroup_filelist', to 'proglist.c' so I could list files in certain storage groups(coverart,fanart),
modified the function 'cmyth_conn_connect_path' (added a 'CStdSring' to the parameters) in 'connection.c' so I could transfer (image)files over the myth protocol
http://www.mediafire.com/?y563v1goc707gyt/cmyth-changes.tar

In the addon source
I made my own class, fileOps,that makes a new connection to mythbackend. When calling the GetArtwork function in this class it checks if any artwork exists locally then checks the backend, it searches using the show title, then transfers it using the myth protocol, storing in '.xbmc/cache/folder'.
I also modified MythConnection and libcmyth.h, in the addon source, functions 'ConnectPath' and 'GetStorageGroupFileList' to use the modified cmyth functions
http://www.mediafire.com/file/etzkl1vepkq77x8/addon-changes.tar

In the main XBMC source,
i couldnt find any way to actually attach an image to the recording, so I added a 'char *' var to the 'PVR_RECORDING' struct (xbmc_pvr_types.h) and a cstdstring to 'CPVRRecording' class (PVRRecording.h),
then modifield 'fileitem.cpp' (function: 'CFileItem::CFileItem(const CPVRRecording& record)') to check that variable, and set the icon
http://www.mediafire.com/file/etzkl1vepkq77x8/addon-changes.tar

I think that's all the changes I made let me know if I missed anything, currently Im trying to get the background to change depending on title and get more infomation in the CVideoInfo tag populated.


Keep in mind, I might of made some mistakes, i just got this working yesterday and I'm not really an advanced c++ programmer
so let me know how I did, thnx.



RE: New MythTV add-on using libcmyth - Kr0nZ - 2012-03-20 00:02

After knowing what I did to get the coverart displaying it was pretty easy getting the fanart to show up

[Image: BWIC1.jpg]

Basically I just added a new string var in 'xbmc_pvr_types.h' to PVR_RECORDING struct (const char * strDefFanart), and in 'PVRRecording.cpp' to CPVRRecording class (CStdString m_fanart_image), make sure to update the initializer, and reset functions in 'PVRRecording.cpp'.
Then in the GetRecordings(PVRClient-MythTV.cpp) function set 'strDefFanart' to the coverart location (returned from my GetArtwork function),

finally In the filelist.cpp file (in the same function, just below where I previously set the coverart icon)
Code:
if ((!record.m_fanart_image.IsEmpty()) &&
    ((record.m_fanart_image.Left(1).CompareNoCase("/") == 0) ||
    (record.m_fanart_image.Left(8).CompareNoCase("special:") == 0)))
  {
    SetProperty("Fanart_Image",record.m_fanart_image.c_str());
  }



RE: New MythTV add-on using libcmyth - tsp42 - 2012-03-20 22:14

Nice work. Have you considered creating a GitHub account. It would make it a bit easier to merge with my repository.


RE: New MythTV add-on using libcmyth - tsp42 - 2012-03-21 00:01

Jimmer: Could you test if the latest update fixes the extra escape character?


RE: New MythTV add-on using libcmyth - Jimmer - 2012-03-21 09:04

(2012-03-21 00:01)tsp42 Wrote:  Jimmer: Could you test if the latest update fixes the extra escape character?

Hey tsp, thanks for the quick work! Have tested on one recording with an apostrophe and am happy to say it worked correctly! I have scheduled a handful of recordings throughout today to test more thoroughly and make sure though....

Not to be pushy, but how much of a priority is grouping recordings by show/Movies (like dteirney's branch implemented before the end)? I was wondering if you could re-implement dteirney's last few changes in your branch rather than reinvent the wheel..... Or perhaps you weren't a fan of his implementation and have designs to work up your own from scratch?

Also, any news on the commskipping front?

Don't mean to be ungrateful/pushy/rude (I know how these types of "I want my favourite feature now" type of comments can come across) just curious, really. Your branch is now 99.9% of the way towards pvr perfection and I'm hungry for news of that other 0.1% !

Jimmer


RE: New MythTV add-on using libcmyth - vskatusa - 2012-03-21 14:42

Can we have a latest windows build? Can I assume that 99% is done?


RE: New MythTV add-on using libcmyth - Jimmer - 2012-03-21 16:30

(2012-03-21 00:01)tsp42 Wrote:  Jimmer: Could you test if the latest update fixes the extra escape character?

Just to report back.....

Have tested recording title's with apostrophes, percentage symbols and exclamation marks - all work just fine. Look's like you can mark this one down as solved... Cheers!


RE: New MythTV add-on using libcmyth - tsp42 - 2012-03-21 21:41

vskatusa: Yes sure. I've updated the link in the first post.

Jimmer: Not much progress on the feature list I'm afraid. Too little time. I had hoped to finish the new RecordingRules dialog but it will take some time to do. So it may make sense to implement some of the easier items on the list and it should be easy to reuse dteirney's code. The current PVR API doesn't support adding bookmarks to the recordings so I will have to add it before the commskiping will work.