home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / libkcddb / cddb.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-01-19  |  2.6 KB  |  93 lines

  1. /*
  2.   Copyright (C) 2002 Rik Hemsley (rikkus) <rik@kde.org>
  3.   Copyright (C) 2002 Benjamin Meyer <ben-devel@meyerhome.net>
  4.   CopyRight (C) 2002 Nadeem Hasan <nhasan@kde.org>
  5.  
  6.   This library is free software; you can redistribute it and/or
  7.   modify it under the terms of the GNU Library General Public
  8.   License as published by the Free Software Foundation; either
  9.   version 2 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.   Library General Public License for more details.
  15.  
  16.   You should have received a copy of the GNU Library General Public License
  17.   along with this library; see the file COPYING.LIB.  If not, write to
  18.   the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  19.   Boston, MA 02111-1307, USA.
  20. */
  21.  
  22. #ifndef KCDDB_CDDB_H
  23. #define KCDDB_CDDB_H
  24.  
  25. #include <qstring.h>
  26. #include <qpair.h>
  27. #include <qvaluelist.h>
  28.  
  29. #include <kdelibs_export.h>
  30.  
  31. /** The KCDDB namespace collects all the CDDB-related classes and methods. */
  32. namespace KCDDB
  33. {
  34.    /** This list is used to calculate the CDDB disc id.
  35.     Insert the start frames ((minute*60 + seconds)*75+frames)
  36.     of all tracks, followed by the first frame of the disc and the last
  37.     frame of the disc. The first frame is for most audio CD's the same
  38.     as the first frame of the first track, the
  39.     last one is the start frame of the leadout track.
  40.     */
  41.   typedef QValueList<uint> TrackOffsetList;
  42.  
  43.   /** This is just a container class used for interpreting results
  44.    of CDDB queries.
  45.    */
  46.   class KDE_EXPORT CDDB
  47.   {
  48.     public:
  49.  
  50.       enum Result
  51.       {
  52.         Success,
  53.         ServerError,
  54.         HostNotFound,
  55.         NoResponse,
  56.         NoRecordFound,
  57.         MultipleRecordFound,
  58.         CannotSave,
  59.         InvalidCategory,
  60.         UnknownError
  61.       };
  62.  
  63.       CDDB();
  64.       virtual ~CDDB();
  65.  
  66.       static QString resultToString(Result);
  67.       static QString trackOffsetListToId( const TrackOffsetList & );
  68.  
  69.       static QString clientName() { return QString::fromLatin1("libkcddb"); }
  70.       static QString clientVersion() { return QString::fromLatin1("0.31"); }
  71.  
  72.     protected:
  73.       bool parseGreeting( const QString & );
  74.       bool parseHandshake( const QString & );
  75.  
  76.       uint statusCode( const QString & );
  77.  
  78.       QString trackOffsetListToId();
  79.       QString trackOffsetListToString();
  80.  
  81.       QString user_;
  82.       QString localHostName_;
  83.  
  84.       bool readOnly_;
  85.  
  86.       TrackOffsetList trackOffsetList_;
  87.   };
  88. }
  89.  
  90. #endif // KCDDB_CDDB_H
  91.  
  92. // vim:tabstop=2:shiftwidth=2:expandtab:cinoptions=(s,U1,m1
  93.