/** @file * @author Edouard DUPIN * @copyright 2011, Edouard DUPIN, all right reserved * @license APACHE v2.0 (see license file) */ #include "debug.h" #include #include #undef __class__ #define __class__ "Volume" airtalgo::Volume::Volume() : m_volumedB(0.0f), m_volumeAppli(1.0f) { } void airtalgo::Volume::init() { airtalgo::Algo::init(); m_type = "Volume"; m_supportedFormat.push_back(format_int16); m_supportedFormat.push_back(format_int16_on_int32); } std::shared_ptr airtalgo::Volume::create() { std::shared_ptr tmp(new airtalgo::Volume()); tmp->init(); return tmp; } airtalgo::Volume::~Volume() { } void airtalgo::Volume::configurationChange() { airtalgo::Algo::configurationChange(); if (m_input.getFormat() != m_output.getFormat()) { AIRTALGO_ERROR("Volume format change is not supported"); } if (m_input.getMap() != m_output.getMap()) { AIRTALGO_ERROR("Volume map change is not supported"); } if (m_input.getFrequency() != m_output.getFrequency()) { AIRTALGO_ERROR("Volume frequency change is not supported"); } // nee to process all time (the format not change (just a simple filter)) m_needProcess = false; } std::vector airtalgo::Volume::getFormatSupportedInput() { return m_supportedFormat; }; std::vector airtalgo::Volume::getFormatSupportedOutput() { return m_supportedFormat; }; bool airtalgo::Volume::process(std::chrono::system_clock::time_point& _time, void* _input, size_t _inputNbChunk, void*& _output, size_t& _outputNbChunk) { airtalgo::autoLogInOut tmpLog("Volume"); if (m_volumeAppli == 1.0f) { _output = _input; _outputNbChunk = _inputNbChunk; return true; } return true; }