Developing a Music Scraper - Need C++ help to debug
#1
I am currently developing a couple different scrapers and having an issue with the data being displayed properly in XBMC.

As a quick example: I have thoroughly tested my regex's in regex buddy and the data is correctly located for all tracks on the album. When XBMC imports this data, only every 2-3 tracks show up. Another issue is that regardless of what I put in the <genre> field, nothing is displayed. There are others but they are all similar.

I am happy to provide examples of the XML data I am attempting to parse and the regex's I am using if anyone wants to review. I feel confident I can handle it on my own but I need the tools and knowledge to do so. Mainly I am looking for a way to see what data XBMC is receiving in the buffers and how it is being handled internally.

In the proprietary language I use for touch panel A/V control, I can output the contents of a buffer to either the screen, a file or simply monitor the contents of the buffer in the development environment. I'm sure there must be a way to do this in C++ but I have relatively no knowledge of the language yet so I really need help here. I tried playing with printf but to no avail seeing how I don't know how it works. I also tried playing with the watch list in VC++08 adding the variables I thought data was being stored in but they never seem to populate.

If nothing more a simple example of syntax that I can add to MusicInfoScraper.cpp to be able to see what is really going on would be great. Of course, the more information you are willing to provide, the better. =)

Thanks in advance!!
The XBMC team, plug-in devs, skinners, etc. do this for us for FREE in their spare time because they want to. Think about that for a second before you start bitching...
Reply
#2
There's a couple of things you can do. The easiest is to just put a breakpoint (F9) in the app at the appropriate point (I'm assuming you've built debug ofcourse) run to there and then check content in the watch window, or just hovering over variables as you step through the code.

Otherwise, you can dump the XML it has retrieved to a file easily enough, around ln 120 in MusicInfoScraper.cpp add something like this:

Code:
// dump to disk
  XFILE::CFile file;
  if (file.OpenForWrite("C:\\foo.xml", true, true))
  {
    file.Write(strXML.c_str(), strXML.size());
    file.Close();
  }

Cheers,
Jonathan
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
#3
Thanks a lot for the help - it put me on the right track.

The file function didn't work for me though...does this mean anything to you?

Code:
1>------ Build started: Project: XBMC, Configuration: Debug (SDL) Win32 ------
1>Compiling...
1>MusicInfoScraper.cpp
1>c:\users\desktop\xbmc svn\xbmc\utils\musicinfoscraper.cpp(122) : error C2079: 'file' uses undefined class 'XFILE::CFile'
1>c:\users\desktop\xbmc svn\xbmc\utils\musicinfoscraper.cpp(123) : error C2228: left of '.OpenForWrite' must have class/struct/union
1>        type is 'int'
1>c:\users\desktop\xbmc svn\xbmc\utils\musicinfoscraper.cpp(125) : error C2228: left of '.Write' must have class/struct/union
1>        type is 'int'
1>c:\users\desktop\xbmc svn\xbmc\utils\musicinfoscraper.cpp(126) : error C2228: left of '.Close' must have class/struct/union
1>        type is 'int'

I apologize for my current lack of of C++ knowledge. I am working on it slowly but surely though... =)
The XBMC team, plug-in devs, skinners, etc. do this for us for FREE in their spare time because they want to. Think about that for a second before you start bitching...
Reply
#4
add

#include "FileSystem/File.h"
Reply
#5
Perfect. Thank you both!
The XBMC team, plug-in devs, skinners, etc. do this for us for FREE in their spare time because they want to. Think about that for a second before you start bitching...
Reply

Logout Mark Read Team Forum Stats Members Help
Developing a Music Scraper - Need C++ help to debug0