libmusicbrainz3  3.0.3
disc.h
Go to the documentation of this file.
00001 /*
00002  * MusicBrainz -- The Internet music metadatabase
00003  *
00004  * Copyright (C) 2006 Lukas Lalinsky
00005  *  
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  * 
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  * 
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00019  *
00020  * 
00021  */
00022  
00023 #ifndef __MUSICBRAINZ3_DISC_H__
00024 #define __MUSICBRAINZ3_DISC_H__
00025 
00026 #include <string>
00027 #include <vector>
00028 #include <utility>
00029 #include <musicbrainz3/musicbrainz.h>
00030 
00031 namespace MusicBrainz
00032 {
00033 
00054         class MB_API Disc
00055         {
00056         public:
00057 
00058                 typedef std::pair<int, int> Track;
00059                 typedef std::vector<Disc::Track> TrackList;
00060         
00066                 Disc(const std::string &id = std::string());
00067 
00071                 virtual ~Disc();
00072                 
00078                 std::string getId() const;
00079                 
00085                 void setId(const std::string &value);
00086                 
00092                 int getSectors() const;
00093                 
00099                 void setSectors(const int sectors);
00100                 
00106                 int getFirstTrackNum() const;
00107                 
00113                 void setFirstTrackNum(const int trackNum);
00114                 
00120                 int getLastTrackNum() const;
00121                 
00127                 void setLastTrackNum(const int trackNum);
00128                 
00140                 Disc::TrackList &getTracks();
00141                 
00153                 void addTrack(Disc::Track track);
00154                 
00155         private:
00156 
00157                 class DiscPrivate;
00158                 DiscPrivate *d;
00159         };
00160         
00168         class MB_API DiscError : public Exception
00169         {
00170         public:
00171                 DiscError(const std::string &msg = std::string()) : Exception(msg) {}
00172         };
00173         
00196         MB_API Disc *readDisc(const std::string &deviceName = std::string());
00197 
00218         MB_API std::string getSubmissionUrl(Disc *disc,
00219                 const std::string &host = "mm.musicbrainz.org",
00220                 int port = 80);
00221         
00222 }
00223 
00224 #endif
00225 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines