a1be611cde2f2d1eea1534b8167695fa640dbdda
[vuplus_xbmc] / xbmc / music / Album.h
1 /*!
2  \file Album.h
3 \brief
4 */
5 #pragma once
6
7 /*
8  *      Copyright (C) 2005-2013 Team XBMC
9  *      http://xbmc.org
10  *
11  *  This Program is free software; you can redistribute it and/or modify
12  *  it under the terms of the GNU General Public License as published by
13  *  the Free Software Foundation; either version 2, or (at your option)
14  *  any later version.
15  *
16  *  This Program is distributed in the hope that it will be useful,
17  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  *  GNU General Public License for more details.
20  *
21  *  You should have received a copy of the GNU General Public License
22  *  along with XBMC; see the file COPYING.  If not, see
23  *  <http://www.gnu.org/licenses/>.
24  *
25  */
26
27 #include <map>
28 #include <vector>
29 #include "Artist.h"
30 #include "Song.h"
31 #include "utils/ScraperUrl.h"
32
33 class TiXmlNode;
34 class CFileItem;
35 class CAlbum
36 {
37 public:
38   CAlbum(const CFileItem& item);
39   CAlbum() { idAlbum = 0; iRating = 0; iYear = 0; iTimesPlayed = 0; };
40   bool operator<(const CAlbum &a) const;
41
42   void Reset()
43   {
44     idAlbum = -1;
45     strAlbum.Empty();
46     strMusicBrainzAlbumID.Empty();
47     artist.clear();
48     artistCredits.clear();
49     genre.clear();
50     thumbURL.Clear();
51     moods.clear();
52     styles.clear();
53     themes.clear();
54     art.clear();
55     strReview.Empty();
56     strLabel.Empty();
57     strType.Empty();
58     strPath.Empty();
59     m_strDateOfRelease.Empty();
60     iRating=-1;
61     iYear=-1;
62     bCompilation = false;
63     iTimesPlayed = 0;
64     songs.clear();
65   }
66
67   CStdString GetArtistString() const;
68   CStdString GetGenreString() const;
69
70   /*! \brief Load album information from an XML file.
71    See CVideoInfoTag::Load for a description of the types of elements we load.
72    \param element    the root XML element to parse.
73    \param append     whether information should be added to the existing tag, or whether it should be reset first.
74    \param prioritise if appending, whether additive tags should be prioritised (i.e. replace or prepend) over existing values. Defaults to false.
75    \sa CVideoInfoTag::Load
76    */
77   bool Load(const TiXmlElement *element, bool append = false, bool prioritise = false);
78   bool Save(TiXmlNode *node, const CStdString &tag, const CStdString& strPath);
79
80   long idAlbum;
81   CStdString strAlbum;
82   CStdString strMusicBrainzAlbumID;
83   std::vector<std::string> artist;
84   VECARTISTCREDITS artistCredits;
85   std::vector<std::string> genre;
86   CScraperUrl thumbURL;
87   std::vector<std::string> moods;
88   std::vector<std::string> styles;
89   std::vector<std::string> themes;
90   std::map<std::string, std::string> art;
91   CStdString strReview;
92   CStdString strLabel;
93   CStdString strType;
94   CStdString strPath;
95   CStdString m_strDateOfRelease;
96   int iRating;
97   int iYear;
98   bool bCompilation;
99   int iTimesPlayed;
100   VECSONGS songs;
101 };
102
103 typedef std::vector<CAlbum> VECALBUMS;