libmusicbrainz3  3.0.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
track.h
Go to the documentation of this file.
1 /*
2  * MusicBrainz -- The Internet music metadatabase
3  *
4  * Copyright (C) 2006 Lukas Lalinsky
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  *
20  *
21  */
22 
23 #ifndef __MUSICBRAINZ3_TRACK_H__
24 #define __MUSICBRAINZ3_TRACK_H__
25 
26 #include <string>
28 #include <musicbrainz3/entity.h>
29 
30 namespace MusicBrainz
31 {
32 
33  class Artist;
34 
51  class MB_API Track : public Entity
52  {
53  public:
54 
61  Track(const std::string &id = std::string(),
62  const std::string &title = std::string());
63 
67  virtual ~Track();
68 
80  std::string getTitle() const;
81 
89  void setTitle(const std::string &title);
90 
96  Artist *getArtist();
97 
103  void setArtist(Artist *artist);
104 
110  int getDuration() const;
111 
117  void setDuration(const int duration);
118 
128  ReleaseList &getReleases();
129 
139  int getNumReleases() const;
140 
150  Release *getRelease(int index);
151 
157  void addRelease(Release *release);
158 
171  int getReleasesOffset() const;
172 
180  void setReleasesOffset(const int offset);
181 
193  int getReleasesCount() const;
194 
202  void setReleasesCount(const int count);
203 
209  IsrcList &getIsrcs();
210 
220  int getNumIsrcs() const;
221 
231  std::string getIsrc(int index);
232 
238  void addIsrc(const std::string &isrc);
239 
240  private:
241 
242  class TrackPrivate;
243  TrackPrivate *d;
244  };
245 
246 }
247 
248 #endif
249 
Represents an artist.
Definition: artist.h:46
A first-level MusicBrainz class.
Definition: entity.h:56
Represents a track.
Definition: track.h:51
std::vector< std::string > IsrcList
Definition: lists.h:84
std::vector< Release * > ReleaseList
A vector of pointers to Release objects.
Definition: lists.h:61
#define MB_API
Definition: defines.h:40
Represents a Release.
Definition: release.h:47