Kodi Community Forum

Full Version: New MythTV add-on using libcmyth
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
(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?
(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.....

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

Image

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/?y563v1goc707gy...hanges.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/etzkl1vepk...hanges.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/etzkl1vepk...hanges.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.
After knowing what I did to get the coverart displaying it was pretty easy getting the fanart to show up

Image

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());
  }
Nice work. Have you considered creating a GitHub account. It would make it a bit easier to merge with my repository.
Jimmer: Could you test if the latest update fixes the extra escape character?
(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
Can we have a latest windows build? Can I assume that 99% is done?
(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!
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.

I forked your latest repo and made some commits

https://github.com/Kr0nZ/xbmc/commits/

I've only tested it on myth 0.24.2
tsp42,

Thanks for the windows executable!

I have the mythtv backend

MythTV Version : 26437
MythTV Branch : branches/release-0-23-fixes
Network Protocol : 23056
Library API : 0.23.1.201000710-1
QT Version : 4.7.0

Will this pvr work with the above version?
vskatusa: Yes it should work.

Kr0nZ: Great. I will see if I can get it merged in the weekend. Have you tested if it can compile in windows?
I'm trying to compile the code on a Shuttle XS35GTV2 running Debian Stable with the 3.2.0-2-686-pae kernel.

Unfortunately I have no luck. When I want to configure I get the error that a required library couldn't be found.
I've installed all the libraries from the dubstar's post #133 and all the packages from the readme. The libvdpau-dev package is installed too as I'd like to have vdpau support.

Here are all the packages I have installed: http://pastebin.com/FUuuwvHS
This is the output of bootstrap: http://pastebin.com/eB9AR41c
And the output of configure: http://pastebin.com/UA1ynmCZ

What am I missing?


Best regards
libtiff?