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 / k3btoc.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-05-27  |  2.1 KB  |  102 lines

  1. /* 
  2.  *
  3.  * $Id: k3btoc.h 619556 2007-01-03 17:38:12Z trueg $
  4.  * Copyright (C) 2003-2007 Sebastian Trueg <trueg@k3b.org>
  5.  *
  6.  * This file is part of the K3b project.
  7.  * Copyright (C) 1998-2007 Sebastian Trueg <trueg@k3b.org>
  8.  *
  9.  * This program is free software; you can redistribute it and/or modify
  10.  * it under the terms of the GNU General Public License as published by
  11.  * the Free Software Foundation; either version 2 of the License, or
  12.  * (at your option) any later version.
  13.  * See the file "COPYING" for the exact licensing terms.
  14.  */
  15.  
  16.  
  17. #ifndef K3BTOC_H
  18. #define K3BTOC_H
  19.  
  20. #include <qvaluelist.h>
  21. #include <qcstring.h>
  22.  
  23. #include <k3bmsf.h>
  24.  
  25. #include "k3btrack.h"
  26. #include "k3bdevice_export.h"
  27. class QString;
  28.  
  29. namespace K3bDevice
  30. {
  31.  
  32.   enum ContentsType {
  33.     DATA,
  34.     AUDIO,
  35.     MIXED,
  36.     NONE // no tracks
  37.   };
  38.  
  39.   /**
  40.    * A list of K3bTracks that represents the contents
  41.    * of a cd.
  42.    * The Toc deletes all its tracks when it is deleted and
  43.    * deletes removed tracks.
  44.    */
  45.   class LIBK3BDEVICE_EXPORT Toc : public QValueList<K3bTrack>
  46.   {
  47.   public:
  48.     Toc();
  49.     /** deep copy */
  50.     Toc( const Toc& );
  51.     /** deletes all tracks */
  52.     ~Toc();
  53.     /** deep copy */
  54.     Toc& operator=( const Toc& );
  55.  
  56.     /**
  57.      * CDDB disc Id
  58.      */
  59.     unsigned int discId() const;
  60.  
  61.     const QCString& mcn() const { return m_mcn; }
  62.  
  63.     /**
  64.      * determine the contents type based on the tracks' types.
  65.      * Audio, Data, or Mixed
  66.      */
  67.     int contentType() const;
  68.  
  69.     /**
  70.      * \return the number of sessions in this TOC.
  71.      */
  72.     int sessions() const;
  73.  
  74.     /**
  75.      * The first track's first sector could differ from the disc's
  76.      * first sector if there is a pregap before index 1
  77.      */
  78.     const K3b::Msf& firstSector() const;
  79.     K3b::Msf lastSector() const;
  80.     K3b::Msf length() const;
  81.  
  82.     void setFirstSector( int i ) { m_firstSector = i; }
  83.  
  84.     void setMcn( const QCString& mcn ) { m_mcn = mcn; }
  85.  
  86.     void clear();
  87.  
  88.     void debug() const;
  89.  
  90.     bool operator==( const Toc& ) const;
  91.     bool operator!=( const Toc& ) const;
  92.  
  93.   private:
  94.     unsigned int m_discId;
  95.     K3b::Msf m_firstSector;
  96.  
  97.     QCString m_mcn;
  98.   };
  99. }
  100.  
  101. #endif
  102.