Kodi Community Forum
xbmc api access to fanart and cd cover... - 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)
+---- Forum: Screensavers and visualisations (https://forum.kodi.tv/forumdisplay.php?fid=38)
+---- Thread: xbmc api access to fanart and cd cover... (/showthread.php?tid=161860)



xbmc api access to fanart and cd cover... - amand - 2013-04-08

Hello!
This is my first post in this xbmc forum. I am working on a little visualization addon for linux in C/OPENGL, and I'm wondering if there is a way to get some data from xbmc like the fanart path, or the cd cover...
By looking some of the code for visualizations, I have not seen access to anything apart the audiodata...
It could be very interesting to access more information for a song/album/artist.
Any ideas ?
Do I need to access the xbmc database by myself via sqlite/mysql ?


RE: xbmc api access to fanart and cd cover... - Martijn - 2013-04-08

Using this
http://wiki.xbmc.org/index.php?title=JSON-RPC_API


RE: xbmc api access to fanart and cd cover... - amand - 2013-04-08

Thanks for the idea. I was thinking for a more direct way... But it could be a solution, if I can get at list some information about the song (title or artist). And, by the way, I will need to write a JSON parser...


RE: xbmc api access to fanart and cd cover... - spiff - 2013-04-15

tons of libraries. we use libyajl. not the best performance but very small footprint.


RE: xbmc api access to fanart and cd cover... - amand - 2013-04-18

I just find in the code that we can get album thumb with the method onAction...
I see in Visualisation.h (method UpdateTrack) that m_AlbumArtThumb.c_str is passed to OnAction...
I have tried this, but I only get an empty string, or a string with "DESTROY"...

Anyone know how to get the path of the thumb ?


RE: xbmc api access to fanart and cd cover... - marmitt - 2013-04-28

I just started experimenting with visualization development and I'm able to get the thumb/cover image path (XBMC 12.1 Win32), but it specifies the song file that is currently playing. This makes sense because the image is embedded in the mp3 file as opposed to sitting in the directory as "folder.jpg". The problem now is opening the mp3 using the samba path, re-parsing the ID3 tag, and getting the cover image data. Maybe I'm missing something, but it would seem that since XBMC already has the image data there should be a straight-forward way to access it without doing all of that. It's kind of a bummer that we don't have a pointer to the image data as a member of the VisTrack class. That would make more sense to me.