audio-drain/audio/drain/IOFormatInterface.hpp

89 lines
2.5 KiB
C++
Raw Permalink Normal View History

2015-04-10 23:00:13 +02:00
/** @file
* @author Edouard DUPIN
* @copyright 2011, Edouard DUPIN, all right reserved
* @license MPL v2.0 (see license file)
2015-04-10 23:00:13 +02:00
*/
#pragma once
2015-04-10 23:00:13 +02:00
2017-08-28 00:08:17 +02:00
#include <etk/String.hpp>
#include <etk/Vector.hpp>
2016-10-02 21:41:55 +02:00
#include <audio/format.hpp>
#include <audio/channel.hpp>
2017-09-26 15:57:44 +02:00
#include <echrono/Steady.hpp>
2017-09-14 00:59:21 +02:00
#include <etk/Function.hpp>
2016-10-02 21:41:55 +02:00
#include <ememory/memory.hpp>
#include "AutoLogInOut.hpp"
#include "debug.hpp"
2015-04-10 23:00:13 +02:00
namespace audio {
namespace drain{
class IOFormatInterface {
public:
IOFormatInterface();
2017-08-28 00:08:17 +02:00
IOFormatInterface(etk::Vector<enum audio::channel> _map, enum audio::format _format=audio::format_int16, float _frequency=48000.0f);
void set(etk::Vector<enum audio::channel> _map, enum audio::format _format=audio::format_int16, float _frequency=48000.0f);
2015-04-10 23:00:13 +02:00
protected:
bool m_configured;
public:
void setConfigured(bool _value);
bool getConfigured() const;
protected:
2016-10-07 21:02:35 +02:00
enum audio::format m_format; //!< input Algo Format
2015-04-10 23:00:13 +02:00
public:
/**
* @brief Get the algo format.
* @return the current Format.
*/
2016-10-07 21:02:35 +02:00
enum audio::format getFormat() const;
2015-04-10 23:00:13 +02:00
/**
* @brief Set the algo format.
* @param[in] _value New Format.
*/
2016-10-07 21:02:35 +02:00
void setFormat(enum audio::format _value);
2015-04-10 23:00:13 +02:00
protected:
2017-08-28 00:08:17 +02:00
etk::Vector<enum audio::channel> m_map; //!< input channel Map
2015-04-10 23:00:13 +02:00
public:
/**
* @brief Get the algo channel Map.
* @return the current channel Map.
*/
2017-08-28 00:08:17 +02:00
const etk::Vector<enum audio::channel>& getMap() const;
2015-04-10 23:00:13 +02:00
/**
* @brief Set the algo channel Map.
* @param[in] _value New channel Map.
*/
2017-08-28 00:08:17 +02:00
void setMap(const etk::Vector<enum audio::channel>& _value);
2015-04-10 23:00:13 +02:00
protected:
float m_frequency; //!< input Algo Format
public:
/**
* @brief Get the algo frequency.
* @return the current frequency.
*/
float getFrequency() const;
/**
* @brief Set the algo frequency.
* @param[in] _value New frequency.
*/
void setFrequency(float _value);
public:
/**
* @brief Get the Chunk size in byte.
* @return the number of byte used by chunk.
*/
int32_t getChunkSize() const;
protected:
2017-09-07 23:38:26 +02:00
etk::Function<void()> m_ioChangeFunctor; //!< function pointer on the upper class
2015-04-10 23:00:13 +02:00
void configurationChange();
public:
/**
* @brief Set the callback function to be notify when the arameter change.
* @param[in] _functor Function to call.
*/
2017-09-07 23:38:26 +02:00
void setCallback(const etk::Function<void()>& _functor);
2015-04-10 23:00:13 +02:00
};
2017-08-28 00:08:17 +02:00
etk::Stream& operator <<(etk::Stream& _os, const audio::drain::IOFormatInterface& _obj);
2015-04-10 23:00:13 +02:00
}
}