HephAudio v3.1.0
A cross-platform C++ library for recording, playing, and processing audio on Windows, Android, Linux, iOS, and macOS.
|
remaps the audio channels. More...
#include <ChannelMapper.h>
Classes | |
struct | AudioChannelLayoutHasher |
Public Member Functions | |
ChannelMapper () | |
ChannelMapper (const AudioChannelLayout &targetLayout) | |
virtual | ~ChannelMapper ()=default |
virtual std::string | Name () const override |
virtual const AudioChannelLayout & | GetTargetLayout () const |
virtual void | SetTargetLayout (const AudioChannelLayout &targetLayout) |
Public Member Functions inherited from HephAudio::DoubleBufferedAudioEffect | |
virtual | ~DoubleBufferedAudioEffect ()=default |
virtual void | Process (AudioBuffer &buffer, size_t startIndex, size_t frameCount) override |
virtual void | Process (AudioBuffer &buffer) |
virtual void | Process (AudioBuffer &buffer, size_t startIndex) |
Public Member Functions inherited from HephAudio::AudioEffect | |
virtual | ~AudioEffect ()=default |
virtual bool | HasMTSupport () const |
virtual bool | HasRTSupport () const |
virtual size_t | GetThreadCount () const |
virtual void | SetThreadCount (size_t threadCount) |
virtual size_t | CalculateRequiredFrameCount (size_t outputFrameCount, const AudioFormatInfo &formatInfo) const |
virtual size_t | CalculateOutputFrameCount (size_t inputFrameCount, const AudioFormatInfo &formatInfo) const |
virtual size_t | CalculateAdvanceSize (size_t renderFrameCount, const AudioFormatInfo &formatInfo) const |
virtual void | ResetInternalState () |
Static Public Member Functions | |
static void | SetMapping (const AudioChannelLayout &targetLayout, const AudioChannelLayout &inputLayout, const std::function< void(heph_audio_sample_t *, heph_audio_sample_t *)> &f) |
Protected Types | |
typedef std::unordered_map< AudioChannelLayout, std::unordered_map< AudioChannelLayout, std::function< void(heph_audio_sample_t *, heph_audio_sample_t *)>, AudioChannelLayoutHasher >, AudioChannelLayoutHasher > | ChannelMapperMap |
Protected Member Functions | |
virtual void | ProcessST (const AudioBuffer &inputBuffer, AudioBuffer &outputBuffer, size_t startIndex, size_t frameCount) override |
virtual AudioBuffer | CreateOutputBuffer (const AudioBuffer &inputBuffer, size_t startIndex, size_t frameCount) const override |
virtual void | InitializeOutputBuffer (const AudioBuffer &inputBuffer, AudioBuffer &outputBuffer, size_t startIndex, size_t frameCount) const override |
Protected Member Functions inherited from HephAudio::DoubleBufferedAudioEffect | |
DoubleBufferedAudioEffect () | |
Protected Member Functions inherited from HephAudio::AudioEffect | |
AudioEffect () | |
virtual void | ProcessMT (const AudioBuffer &inputBuffer, AudioBuffer &outputBuffer, size_t startIndex, size_t frameCount) |
Static Protected Member Functions | |
static ChannelMapperMap | CreateMap () |
Protected Attributes | |
AudioChannelLayout | targetLayout |
Protected Attributes inherited from HephAudio::AudioEffect | |
size_t | threadCount |
Static Protected Attributes | |
static ChannelMapperMap | map |
remaps the audio channels.
|
protected |
layout-(layout-function) map.
HephAudio::ChannelMapper::ChannelMapper | ( | ) |
creates a new instance and initializes it with default values.
|
explicit |
creates a new instance and initializes it with the provided values.
targetLayout | channel layout the input buffer will be remapped to. |
|
virtualdefault |
releases the resources and destroys the instance.
|
overridevirtual |
gets the name of the audio effect.
Implements HephAudio::AudioEffect.
|
virtual |
gets the target channel layout.
|
virtual |
sets the target channel layout.
targetLayout | channel layout the input buffer will be remapped to. |
|
overrideprotectedvirtual |
applies the effect using single thread.
inputBuffer | contains the audio data which will be processed. |
outputBuffer | contains the processed audio data. |
startIndex | index of the first sample to process. |
frameCount | number of frames to process. |
Implements HephAudio::AudioEffect.
|
overrideprotectedvirtual |
creates the output buffer but does not initialize it.
inputBuffer | contains the audio data which will be processed. |
startIndex | index of the first sample to process. |
frameCount | number of frames to process. |
Reimplemented from HephAudio::DoubleBufferedAudioEffect.
|
overrideprotectedvirtual |
initializes the output buffer.
inputBuffer | contains the audio data which will be processed. |
outputBuffer | contains the processed audio data. |
startIndex | index of the first sample to process. |
frameCount | number of frames to process. |
Reimplemented from HephAudio::DoubleBufferedAudioEffect.
|
static |
sets mapping from targetLayout to inputLayout.
targetLayout | target (output) channel layout. |
inputLayout | input channel layout. |
f | function that maps the channels. |
|
staticprotected |
creates the ChannelMapper::map.
|
staticprotected |
contains the functions to map the channel layouts.
|
protected |
channel layout the input buffer will be remapped to.