2
* $Id: AUD_ConverterReader.h 25643 2010-01-01 05:09:30Z nexyon $
4
* ***** BEGIN LGPL LICENSE BLOCK *****
6
* Copyright 2009 Jörg Hermann Müller
2
* ***** BEGIN GPL LICENSE BLOCK *****
4
* Copyright 2009-2011 Jörg Hermann Müller
8
6
* 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 Lesser General Public License as published by
12
* the Free Software Foundation, either version 3 of the License, or
8
* Audaspace is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License, or
13
11
* (at your option) any later version.
15
13
* AudaSpace is distributed in the hope that it will be useful,
16
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU Lesser General Public License for more details.
20
* You should have received a copy of the GNU Lesser General Public License
21
* along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
23
* ***** END LGPL LICENSE BLOCK *****
26
#ifndef AUD_CONVERTERREADER
27
#define AUD_CONVERTERREADER
16
* GNU General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with Audaspace; if not, write to the Free Software Foundation,
20
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22
* ***** END GPL LICENSE BLOCK *****
25
/** \file audaspace/intern/AUD_ConverterReader.h
26
* \ingroup audaspaceintern
30
#ifndef __AUD_CONVERTERREADER_H__
31
#define __AUD_CONVERTERREADER_H__
29
33
#include "AUD_EffectReader.h"
30
34
#include "AUD_ConverterFunctions.h"
35
#include "AUD_Buffer.h"
34
38
* This class converts a sound source from one to another format.
40
44
* The sound output buffer.
45
49
* The target specification.
47
AUD_DeviceSpecs m_specs;
51
AUD_SampleFormat m_format;
50
54
* Converter function.
52
56
AUD_convert_f m_convert;
58
// hide copy constructor and operator=
59
AUD_ConverterReader(const AUD_ConverterReader&);
60
AUD_ConverterReader& operator=(const AUD_ConverterReader&);
56
64
* Creates a converter reader.
57
65
* \param reader The reader to convert.
58
66
* \param specs The target specification.
59
* \exception AUD_Exception Thrown if the reader is NULL.
61
AUD_ConverterReader(AUD_IReader* reader, AUD_DeviceSpecs specs);
63
* Destroys the reader.
65
~AUD_ConverterReader();
68
AUD_ConverterReader(AUD_Reference<AUD_IReader> reader, AUD_DeviceSpecs specs);
67
virtual AUD_Specs getSpecs();
68
virtual void read(int & length, sample_t* & buffer);
70
virtual void read(int& length, bool& eos, sample_t* buffer);
71
#endif //AUD_CONVERTERREADER
73
#endif //__AUD_CONVERTERREADER_H__