Audaspace 1.5.0
A high level audio library.
Loading...
Searching...
No Matches
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{
36private:
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
56public:
62 ConverterReader(std::shared_ptr<IReader> reader, DeviceSpecs specs);
63
64 virtual void read(int& length, bool& eos, sample_t* buffer);
65};
66
#define AUD_NAMESPACE_END
Closes the audaspace namespace aud.
Definition Audaspace.h:119
float sample_t
Sample type.(float samples)
Definition Audaspace.h:126
#define AUD_NAMESPACE_BEGIN
Opens the audaspace namespace aud.
Definition Audaspace.h:116
#define AUD_API
Used for exporting symbols in the shared library.
Definition Audaspace.h:93
The Buffer class.
Defines several conversion functions between different sample formats.
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
The EffectReader class.
SampleFormat
The format of a sample.
Definition Specification.h:47
This class is a simple buffer in RAM which is 32 Byte aligned and provides resize functionality.
Definition Buffer.h:34
This class converts a sound source from one to another format.
Definition ConverterReader.h:35
virtual void read(int &length, bool &eos, sample_t *buffer)
Request to read the next length samples out of the source.
ConverterReader(std::shared_ptr< IReader > reader, DeviceSpecs specs)
Creates a converter reader.
This reader is a base class for all effect readers that take one other reader as input.
Definition EffectReader.h:36
Specification of a sound device.
Definition Specification.h:129