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

  1. /* 
  2.  *
  3.  * $Id: sourceheader,v 1.3 2005/01/19 13:03:46 trueg Exp $
  4.  * Copyright (C) 2005 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. #ifndef _K3B_AUDIO_DATA_SOURCE_ITERATOR_H_
  17. #define _K3B_AUDIO_DATA_SOURCE_ITERATOR_H_
  18. #include "k3b_export.h"
  19. class K3bAudioDataSource;
  20. class K3bAudioTrack;
  21. class K3bAudioDoc;
  22.  
  23.  
  24. /**
  25.  * This Iterator iterates over the sources in an audio project
  26.  *
  27.  * Be aware that this iterator does not properly update when the doc
  28.  * changes. A manual update can be issued with first(). This is becasue
  29.  * an update would either involve slots (this being a QObject) which is 
  30.  * too much overhead or the AudioDoc would need to have knowledge of all
  31.  * the iterators which is also overhead that would be overkill.
  32.  */
  33. class LIBK3B_EXPORT K3bAudioDataSourceIterator
  34. {
  35.  public:
  36.   /**
  37.    * This will place the iterator on the first source just like first() does.
  38.    */
  39.   explicit K3bAudioDataSourceIterator( K3bAudioDoc* );
  40.  
  41.   K3bAudioDataSource* current() const;
  42.  
  43.   bool hasNext() const;
  44.  
  45.   /**
  46.    * \return the next source or 0 if at end.
  47.    */
  48.   K3bAudioDataSource* next();
  49.  
  50.   /**
  51.    * Reset the iterator
  52.    */
  53.   K3bAudioDataSource* first();
  54.  
  55.  private:
  56.   K3bAudioDoc* m_doc;
  57.   K3bAudioTrack* m_currentTrack;
  58.   K3bAudioDataSource* m_currentSource;
  59. };
  60.  
  61. #endif
  62.