4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * Copyright 2009-2011 Jörg Hermann Müller
8 * This file is part of AudaSpace.
10 * Audaspace is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * AudaSpace is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with Audaspace; if not, write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 * ***** END GPL LICENSE BLOCK *****
27 /** \file audaspace/FX/AUD_SuperposeReader.h
32 #ifndef AUD_SUPERPOSEREADER
33 #define AUD_SUPERPOSEREADER
35 #include "AUD_IReader.h"
36 #include "AUD_Buffer.h"
39 * This reader plays two readers with the same specs sequently.
41 class AUD_SuperposeReader : public AUD_IReader
47 AUD_IReader* m_reader1;
52 AUD_IReader* m_reader2;
55 * The playback buffer for the intersecting part.
59 // hide copy constructor and operator=
60 AUD_SuperposeReader(const AUD_SuperposeReader&);
61 AUD_SuperposeReader& operator=(const AUD_SuperposeReader&);
65 * Creates a new superpose reader.
66 * \param reader1 The first reader to read from.
67 * \param reader2 The second reader to read from.
68 * \exception AUD_Exception Thrown if the specs from the readers differ.
70 AUD_SuperposeReader(AUD_IReader* reader1, AUD_IReader* reader2);
73 * Destroys the reader.
75 virtual ~AUD_SuperposeReader();
77 virtual bool isSeekable() const;
78 virtual void seek(int position);
79 virtual int getLength() const;
80 virtual int getPosition() const;
81 virtual AUD_Specs getSpecs() const;
82 virtual void read(int & length, sample_t* & buffer);
85 #endif //AUD_SUPERPOSEREADER