XBMC Community Forum  

Go Back   XBMC Community Forum > Development > Scraper Development

Scraper Development Developers forum for meta data scrapers. Scraper developers only!
Not for posting feature requests, bugs, or end-user support requests!

Reply
 
Thread Tools Search this Thread Display Modes
Old 2008-11-11, 04:56   #1
TechLife
Member
 
Join Date: Aug 2008
Location: Wilmington, NC
Posts: 66
TechLife is on a distinguished road
Default Developing a Music Scraper - Need C++ help to debug

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!!
__________________
HTPC: AMD 3.2GHz Dual-Core / 2GB RAM (1.5G System, 512M allocated to IGP) / Gigabyte GA-MA78GM-S2H w/ ATI Radeon HD3200 IGP / Catalyst 8.11 / XP MCE SP3 / XBMC r17272
Development Platform: AMD 2.4GHz Dual-Core / 2GB RAM / Asus A8N32-SLI Deluxe / EVGA 7950GX2 / GeForce 178.24 / Vista SP1 32-bit / XBMC r17272

Last edited by TechLife; 2008-11-11 at 05:03.
TechLife is offline   Reply With Quote
Old 2008-11-11, 05:23   #2
jmarshall
Team-XBMC Developer
 
Join Date: Oct 2003
Posts: 15,077
jmarshall is on a distinguished road
Default

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.


jmarshall is offline   Reply With Quote
Old 2008-11-12, 01:12   #3
TechLife
Member
 
Join Date: Aug 2008
Location: Wilmington, NC
Posts: 66
TechLife is on a distinguished road
Default

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... =)
__________________
HTPC: AMD 3.2GHz Dual-Core / 2GB RAM (1.5G System, 512M allocated to IGP) / Gigabyte GA-MA78GM-S2H w/ ATI Radeon HD3200 IGP / Catalyst 8.11 / XP MCE SP3 / XBMC r17272
Development Platform: AMD 2.4GHz Dual-Core / 2GB RAM / Asus A8N32-SLI Deluxe / EVGA 7950GX2 / GeForce 178.24 / Vista SP1 32-bit / XBMC r17272
TechLife is offline   Reply With Quote
Old 2008-11-12, 01:41   #4
spiff
Grumpy Bastard Developer
 
spiff's Avatar
 
Join Date: Nov 2003
Posts: 7,715
spiff is on a distinguished road
Default

add

#include "FileSystem/File.h"
__________________
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.
spiff is offline   Reply With Quote
Old 2008-11-15, 04:00   #5
TechLife
Member
 
Join Date: Aug 2008
Location: Wilmington, NC
Posts: 66
TechLife is on a distinguished road
Default

Perfect. Thank you both!
__________________
HTPC: AMD 3.2GHz Dual-Core / 2GB RAM (1.5G System, 512M allocated to IGP) / Gigabyte GA-MA78GM-S2H w/ ATI Radeon HD3200 IGP / Catalyst 8.11 / XP MCE SP3 / XBMC r17272
Development Platform: AMD 2.4GHz Dual-Core / 2GB RAM / Asus A8N32-SLI Deluxe / EVGA 7950GX2 / GeForce 178.24 / Vista SP1 32-bit / XBMC r17272
TechLife is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:19.


Protected by Akismet, We recommend WordPress blogs
Copyright © 2008, XBMC Project