libmusicbrainz4  4.0.3
Track.h
Go to the documentation of this file.
00001 /* --------------------------------------------------------------------------
00002 
00003    libmusicbrainz4 - Client library to access MusicBrainz
00004 
00005    Copyright (C) 2011 Andrew Hawkins
00006 
00007    This file is part of libmusicbrainz4.
00008 
00009    This library is free software; you can redistribute it and/or
00010    modify it under the terms of v2 of the GNU Lesser General Public
00011    License as published by the Free Software Foundation.
00012 
00013    libmusicbrainz4 is distributed in the hope that it will be useful,
00014    but WITHOUT ANY WARRANTY; without even the implied warranty of
00015    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016    Lesser General Public License for more details.
00017 
00018    You should have received a copy of the GNU General Public License
00019    along with this library.  If not, see <http://www.gnu.org/licenses/>.
00020 
00021      $Id$
00022 
00023 ----------------------------------------------------------------------------*/
00024 
00025 #ifndef _MUSICBRAINZ4_TRACK_H
00026 #define _MUSICBRAINZ4_TRACK_H
00027 
00028 #include <string>
00029 #include <iostream>
00030 
00031 #include "musicbrainz4/Entity.h"
00032 
00033 #include "musicbrainz4/xmlParser.h"
00034 
00035 namespace MusicBrainz4
00036 {
00037         class CTrackPrivate;
00038 
00039         class CRecording;
00040         class CArtistCredit;
00041 
00042         class CTrack: public CEntity
00043         {
00044         public:
00045                 CTrack(const XMLNode& Node=XMLNode::emptyNode());
00046                 CTrack(const CTrack& Other);
00047                 CTrack& operator =(const CTrack& Other);
00048                 virtual ~CTrack();
00049 
00050                 virtual CTrack *Clone();
00051 
00052                 int Position() const;
00053                 std::string Title() const;
00054                 CRecording *Recording() const;
00055                 int Length() const;
00056                 CArtistCredit *ArtistCredit() const;
00057                 std::string Number() const;
00058 
00059                 virtual std::ostream& Serialise(std::ostream& os) const;
00060                 static std::string GetElementName();
00061 
00062         protected:
00063                 virtual void ParseAttribute(const std::string& Name, const std::string& Value);
00064                 virtual void ParseElement(const XMLNode& Node);
00065 
00066         private:
00067                 void Cleanup();
00068 
00069                 CTrackPrivate * const m_d;
00070         };
00071 }
00072 
00073 #endif
 All Classes Namespaces Files Functions Typedefs Enumerations Enumerator Defines