Source: multiaudioreader.h


Annotated List
Files
Globals
Hierarchy
Index
// ##########################################################################
// ####                                                                  ####
// ####                      RTP Audio Server Project                    ####
// ####                    ============================                  ####
// ####                                                                  ####
// #### Multi Audio Reader                                               ####
// ####                                                                  ####
// #### Version 1.00  --  February 04, 2001                              ####
// ####                                                                  ####
// #### Copyright (C) 1999  Thomas Dreibholz                             ####
// ####               2000  Universität Bonn, Abt. IV                    ####
// ####               2001  EMail: Dreibholz@bigfoot.com                 ####
// ####                     WWW:   http://www.bigfoot.com/~dreibholz     ####
// ####                                                                  ####
// ##########################################################################


#ifndef WAVREADER_H
#define WAVREADER_H


#include "system.h"
#include "audioreaderinterface.h"
#include "audioquality.h"
#include "string.h"


#include <multimap.h>
#include <algo.h>


namespace Coral {


/**
  * This class is a reader for multiple audio files from a list.
  *
  * @short   Multi Audio Reader
  * @author  Thomas Dreibholz (Dreibholz@bigfoot.com)
  * @version 1.0
  */
class MultiAudioReader : public AudioReaderInterface,
                         public AudioQuality
{
   // ====== Constructor/Destructor =========================================
   public:
   /**
     * Constructor.
     *
     * @param name Name of AudioList file or NULL.
     * @param level Recursion level (normally 0).
     */
   MultiAudioReader(const char* name = NULL, const cardinal level = 0);

   /**
     * Destructor.
     */
   ~MultiAudioReader();

   // ====== Initialize =====================================================
   /**
     * openMedia() implementation of AudioReaderInterface.
     *
     * @see AudioReaderInterface#openMedia
     */
   bool openMedia(const char* name);

   /**
     * closeMedia() implementation of AudioReaderInterface.
     *
     * @see AudioReaderInterface#closeMedia
     */
   void closeMedia();

   /**
     * ready() implementation of AudioReaderInterface.
     *
     * @see AudioReaderInterface#ready
     */
   bool ready() const;


   // ====== Input functions ================================================
   /**
     * getMediaInfo() implementation of AudioReaderInterface.
     *
     * @see AudioReaderInterface#getMediaInfo
     */
   void getMediaInfo(MediaInfo& mediaInfo) const;

   /**
     * getErrorCode() implementation of AudioReaderInterface.
     *
     * @see AudioReaderInterface#getErrorCode
     */
   MediaError getErrorCode() const;

   /**
     * getPosition() implementation of AudioReaderInterface.
     *
     * @see AudioReaderInterface#getPosition
     */
   card64 getPosition() const;

   /**
     * getMaxPosition() implementation of AudioReaderInterface.
     *
     * @see AudioReaderInterface#getMaxPosition
     */
   card64 getMaxPosition() const;

   /**
     * setPosition() implementation of AudioReaderInterface.
     *
     * @see AudioReaderInterface#setPosition
     */
   void setPosition(card64 position);

   /**
     * getNextBlock() implementation of AudioReaderInterface.
     *
     * @see AudioReaderInterface#getNextBlock
     */
   cardinal getNextBlock(void* buffer, const cardinal blockSize);


   // ====== Static functions ===============================================
   /**
     * Get AudioReaderInterface for loading a given file.
     *
     * @param name File name.
     * @param level Recursion level (normally 0).
     * @return AudioReaderInterface, if load was successfull; NULL otherwise.
     */
   AudioReaderInterface* getAudioReader(const char* name, const cardinal level);
  
  
   // ====== Private data ===================================================
   private:
   struct ReaderEntry {
      AudioReaderInterface* Reader;
      bool                  OverwriteSettings;
      String                Title;
      String                Artist;
      String                Comment;
   };
   
   
   AudioReaderInterface*                         Reader;
   multimap<const card64, ReaderEntry>           ReaderSet;
   multimap<const card64, ReaderEntry>::iterator ReaderIterator;

   MediaError Error;
   card64     Position;
   card64     MaxPosition;
   cardinal   Level;
};


}


#endif

Generated by: viper@odin on Sun Feb 4 18:54:51 2001, using kdoc 2.0a22.