Audaspace  1.3.0
A high level audio library.
ConverterReader.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright 2009-2016 Jörg Müller
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  ******************************************************************************/
16 
17 #pragma once
18 
25 #include "fx/EffectReader.h"
27 #include "util/Buffer.h"
28 
30 
35 {
36 private:
40  Buffer m_buffer;
41 
45  SampleFormat m_format;
46 
50  convert_f m_convert;
51 
52  // delete copy constructor and operator=
53  ConverterReader(const ConverterReader&) = delete;
54  ConverterReader& operator=(const ConverterReader&) = delete;
55 
56 public:
62  ConverterReader(std::shared_ptr<IReader> reader, DeviceSpecs specs);
63 
64  virtual void read(int& length, bool& eos, sample_t* buffer);
65 };
66 
convert_f
void(* convert_f)(data_t *target, data_t *source, int length)
The function template for functions converting from one sample format to another, having the same par...
Definition: ConverterFunctions.h:35
ConverterFunctions.h
Defines several conversion functions between different sample formats.
SampleFormat
SampleFormat
The format of a sample.
Definition: Specification.h:47
ConverterReader
This class converts a sound source from one to another format.
Definition: ConverterReader.h:35
DeviceSpecs
Specification of a sound device.
Definition: Specification.h:120
ConverterReader::read
virtual void read(int &length, bool &eos, sample_t *buffer)
Request to read the next length samples out of the source.
Buffer.h
The Buffer class.
ConverterReader::ConverterReader
ConverterReader(std::shared_ptr< IReader > reader, DeviceSpecs specs)
Creates a converter reader.
EffectReader
This reader is a base class for all effect readers that take one other reader as input.
Definition: EffectReader.h:36
Buffer
This class is a simple buffer in RAM which is 32 Byte aligned and provides resize functionality.
Definition: Buffer.h:34
AUD_NAMESPACE_END
#define AUD_NAMESPACE_END
Closes the audaspace namespace aud.
Definition: Audaspace.h:119
sample_t
float sample_t
Sample type.(float samples)
Definition: Audaspace.h:126
AUD_NAMESPACE_BEGIN
#define AUD_NAMESPACE_BEGIN
Opens the audaspace namespace aud.
Definition: Audaspace.h:116
AUD_API
#define AUD_API
Used for exporting symbols in the shared library.
Definition: Audaspace.h:93
EffectReader.h
The EffectReader class.