4 * Copyright (C) 2005-2008 Team XBMC
7 * This Program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
12 * This Program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with XBMC; see the file COPYING. If not, write to
19 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
20 * http://www.gnu.org/copyleft/gpl.html
24 #include "MusicAlbumInfo.h"
25 #include "MusicArtistInfo.h"
26 #include "addons/Scraper.h"
28 #include "FileSystem/FileCurl.h"
30 namespace XFILE
{ class CFileCurl
; }
32 namespace MUSIC_GRABBER
34 class CMusicInfoScraper
: public CThread
37 CMusicInfoScraper(const ADDON::ScraperPtr
&scraper
);
38 virtual ~CMusicInfoScraper(void);
39 void FindAlbuminfo(const CStdString
& strAlbum
, const CStdString
& strArtist
= "");
40 void LoadAlbuminfo(int iAlbum
);
41 void FindArtistinfo(const CStdString
& strArtist
);
42 void LoadArtistinfo(int iArtist
);
47 int GetAlbumCount() const;
48 int GetArtistCount() const;
49 CMusicAlbumInfo
& GetAlbum(int iAlbum
);
50 CMusicArtistInfo
& GetArtist(int iArtist
);
51 std::vector
<CMusicArtistInfo
>& GetArtists()
55 std::vector
<CMusicAlbumInfo
>& GetAlbums()
59 void SetScraperInfo(const ADDON::ScraperPtr
& scraper
)
64 \brief Checks whether we have a valid scraper. If not, we try the fallbackScraper
65 First tests the current scraper for validity by loading it. If it is not valid we
66 attempt to load the fallback scraper. If this is also invalid we return false.
67 \param fallbackScraper name of scraper to use as a fallback
68 \return true if we have a valid scraper (or the default is valid).
70 bool CheckValidOrFallback(const CStdString
&fallbackScraper
);
74 void FindArtistinfo();
75 void LoadArtistinfo();
76 virtual void OnStartup();
77 virtual void Process();
78 std::vector
<CMusicAlbumInfo
> m_vecAlbums
;
79 std::vector
<CMusicArtistInfo
> m_vecArtists
;
80 CStdString m_strAlbum
;
81 CStdString m_strArtist
;
86 XFILE::CFileCurl m_http
;
87 ADDON::ScraperPtr m_scraper
;