[DEV] add AEC interface (no process now)

This commit is contained in:
2015-02-16 21:04:18 +01:00
parent bc37e70e1e
commit 5cbdf378f8
13 changed files with 881 additions and 397 deletions

View File

@@ -25,46 +25,22 @@
namespace river {
namespace io {
class Manager;
class Node {
private:
mutable std::mutex m_mutex;
std::shared_ptr<const ejson::Object> m_config;
std::shared_ptr<drain::VolumeElement> m_volume; //!< if a volume is set it is set here ...
private:
class Node : public std::enable_shared_from_this<Node> {
protected:
/**
* @brief Constructor
*/
Node(const std::string& _name, const std::shared_ptr<const ejson::Object>& _config);
public:
static std::shared_ptr<Node> create(const std::string& _name, const std::shared_ptr<const ejson::Object>& _config);
/**
* @brief Destructor
*/
virtual ~Node();
private:
std::vector<std::weak_ptr<river::Interface> > m_listAvaillable; //!< List of all interface that exist on this Node
std::vector<std::shared_ptr<river::Interface> > m_list;
public:
void registerAsRemote(const std::shared_ptr<river::Interface>& _interface);
void interfaceAdd(const std::shared_ptr<river::Interface>& _interface);
void interfaceRemove(const std::shared_ptr<river::Interface>& _interface);
private:
airtaudio::Interface m_adac; //!< Real audio interface
airtaudio::DeviceInfo m_info;
unsigned int m_rtaudioFrameSize;
public:
int32_t airtAudioCallback(void* _outputBuffer,
void * _inputBuffer,
uint32_t _nbChunk,
const std::chrono::system_clock::time_point& _time,
airtaudio::status _status);
private:
std::string m_name; //!< Harware.json configuration name
public:
const std::string& getName() {
return m_name;
}
private:
protected:
mutable std::mutex m_mutex;
std::shared_ptr<const ejson::Object> m_config;
protected:
drain::Process m_process;
public:
const drain::IOFormatInterface& getInterfaceFormat() {
@@ -74,7 +50,32 @@ namespace river {
return m_process.getInputConfig();
}
}
private:
protected:
const drain::IOFormatInterface& getHarwareFormat() {
if (m_isInput == true) {
return m_process.getInputConfig();
} else {
return m_process.getOutputConfig();
}
}
protected:
std::shared_ptr<drain::VolumeElement> m_volume; //!< if a volume is set it is set here ...
protected:
std::vector<std::weak_ptr<river::Interface> > m_listAvaillable; //!< List of all interface that exist on this Node
std::vector<std::shared_ptr<river::Interface> > m_list;
public:
void registerAsRemote(const std::shared_ptr<river::Interface>& _interface);
void interfaceAdd(const std::shared_ptr<river::Interface>& _interface);
void interfaceRemove(const std::shared_ptr<river::Interface>& _interface);
protected:
std::string m_name; //!< Harware.json configuration name
public:
const std::string& getName() {
return m_name;
}
protected:
bool m_isInput;
public:
bool isInput() {
@@ -83,15 +84,22 @@ namespace river {
bool isOutput() {
return !m_isInput;
}
private:
void start();
void stop();
protected:
virtual void start() = 0;
virtual void stop() = 0;
public:
const std::shared_ptr<drain::VolumeElement>& getVolume() {
return m_volume;
}
public:
void volumeChange();
protected:
int32_t newInput(const void* _inputBuffer,
uint32_t _nbChunk,
const std::chrono::system_clock::time_point& _time);
int32_t newOutput(void* _outputBuffer,
uint32_t _nbChunk,
const std::chrono::system_clock::time_point& _time);
};
}
}