[DEV] continue removing stl

This commit is contained in:
2017-08-28 00:08:50 +02:00
parent c3b5ba2bdd
commit 0e175ad23c
37 changed files with 422 additions and 422 deletions

View File

@@ -7,7 +7,7 @@
#include "Node.hpp"
#include <audio/river/debug.hpp>
audio::river::io::Node::Node(const std::string& _name, const ejson::Object& _config) :
audio::river::io::Node::Node(const etk::String& _name, const ejson::Object& _config) :
m_config(_config),
m_name(_name),
m_isInput(false) {
@@ -30,7 +30,7 @@ audio::river::io::Node::Node(const std::string& _name, const ejson::Object& _con
# muxer/demuxer format type (int8-on-int16, int16-on-int32, int24-on-int32, int32-on-int64, float)
mux-demux-type:"int16_on_int32",
*/
std::string interfaceType = m_config["io"].toString().get();
etk::String interfaceType = m_config["io"].toString().get();
RIVER_INFO("interfaceType=" << interfaceType);
if ( interfaceType == "input"
|| interfaceType == "PAinput"
@@ -43,33 +43,33 @@ audio::river::io::Node::Node(const std::string& _name, const ejson::Object& _con
int32_t frequency = m_config["frequency"].toNumber().get(1);
// Get audio format type:
std::string type = m_config["type"].toString().get("int16");
etk::String type = m_config["type"].toString().get("int16");
enum audio::format formatType = audio::getFormatFromString(type);
// Get volume stage :
std::string volumeName = m_config["volume-name"].toString().get();
etk::String volumeName = m_config["volume-name"].toString().get();
if (volumeName != "") {
RIVER_INFO("add node volume stage : '" << volumeName << "'");
// use global manager for volume ...
m_volume = audio::river::io::Manager::getInstance()->getVolumeGroup(volumeName);
}
// Get map type :
std::vector<audio::channel> map;
etk::Vector<audio::channel> map;
const ejson::Array listChannelMap = m_config["channel-map"].toArray();
if ( listChannelMap.exist() == false
|| listChannelMap.size() == 0) {
// set default channel property:
map.push_back(audio::channel_frontLeft);
map.push_back(audio::channel_frontRight);
map.pushBack(audio::channel_frontLeft);
map.pushBack(audio::channel_frontRight);
} else {
for (auto it : listChannelMap) {
std::string value = it.toString().get();
map.push_back(audio::getChannelFromString(value));
etk::String value = it.toString().get();
map.pushBack(audio::getChannelFromString(value));
}
}
hardwareFormat.set(map, formatType, frequency);
std::string muxerDemuxerConfig;
etk::String muxerDemuxerConfig;
if (m_isInput == true) {
muxerDemuxerConfig = m_config["mux-demux-type"].toString().get("int16");
} else {
@@ -134,7 +134,7 @@ size_t audio::river::io::Node::getNumberOfInterfaceAvaillable(enum audio::river:
}
void audio::river::io::Node::registerAsRemote(const ememory::SharedPtr<audio::river::Interface>& _interface) {
std::vector<ememory::WeakPtr<audio::river::Interface> >::iterator it = m_listAvaillable.begin();
etk::Vector<ememory::WeakPtr<audio::river::Interface> >::iterator it = m_listAvaillable.begin();
while (it != m_listAvaillable.end()) {
if (it->expired() == true) {
it = m_listAvaillable.erase(it);
@@ -142,7 +142,7 @@ void audio::river::io::Node::registerAsRemote(const ememory::SharedPtr<audio::ri
}
++it;
}
m_listAvaillable.push_back(_interface);
m_listAvaillable.pushBack(_interface);
}
void audio::river::io::Node::interfaceAdd(const ememory::SharedPtr<audio::river::Interface>& _interface) {
@@ -154,7 +154,7 @@ void audio::river::io::Node::interfaceAdd(const ememory::SharedPtr<audio::river:
}
}
RIVER_INFO("ADD interface for stream : '" << m_name << "' mode=" << (m_isInput?"input":"output") );
m_list.push_back(_interface);
m_list.pushBack(_interface);
}
if (m_list.size() == 1) {
startInGroup();
@@ -215,7 +215,7 @@ void audio::river::io::Node::newOutput(void* _outputBuffer,
return;
}
enum audio::format muxerFormatType = m_process.getInputConfig().getFormat();
std::vector<uint8_t> outputTmp2;
etk::Vector<uint8_t> outputTmp2;
uint32_t nbByteTmpBuffer = audio::getFormatBytes(muxerFormatType)*m_process.getInputConfig().getMap().size()*_nbChunk;
RIVER_VERBOSE("resize=" << nbByteTmpBuffer);
outputTmp2.resize(nbByteTmpBuffer);
@@ -225,7 +225,7 @@ void audio::river::io::Node::newOutput(void* _outputBuffer,
// process 16 bits
//////////////////////////////////////////////////////////////////////////////////////////////////
// $$$$ change the int16
std::vector<int16_t> output;
etk::Vector<int16_t> output;
RIVER_VERBOSE("resize=" << _nbChunk*m_process.getInputConfig().getMap().size());
output.resize(_nbChunk*m_process.getInputConfig().getMap().size(), 0);
// $$$$ change the int16
@@ -258,7 +258,7 @@ void audio::river::io::Node::newOutput(void* _outputBuffer,
//////////////////////////////////////////////////////////////////////////////////////////////////
// process 32 bits
//////////////////////////////////////////////////////////////////////////////////////////////////
std::vector<int32_t> output;
etk::Vector<int32_t> output;
RIVER_VERBOSE("resize=" << _nbChunk*m_process.getInputConfig().getMap().size());
output.resize(_nbChunk*m_process.getInputConfig().getMap().size(), 0);
const int32_t* outputTmp = nullptr;
@@ -288,7 +288,7 @@ void audio::river::io::Node::newOutput(void* _outputBuffer,
//////////////////////////////////////////////////////////////////////////////////////////////////
// process 64 bits
//////////////////////////////////////////////////////////////////////////////////////////////////
std::vector<int64_t> output;
etk::Vector<int64_t> output;
RIVER_VERBOSE("resize=" << _nbChunk*m_process.getInputConfig().getMap().size());
output.resize(_nbChunk*m_process.getInputConfig().getMap().size(), 0);
const int64_t* outputTmp = nullptr;
@@ -318,7 +318,7 @@ void audio::river::io::Node::newOutput(void* _outputBuffer,
//////////////////////////////////////////////////////////////////////////////////////////////////
// process 32 bits FLOAT
//////////////////////////////////////////////////////////////////////////////////////////////////
std::vector<float> output;
etk::Vector<float> output;
RIVER_VERBOSE("resize=" << _nbChunk*m_process.getInputConfig().getMap().size());
output.resize(_nbChunk*m_process.getInputConfig().getMap().size(), 0);
const float* outputTmp = nullptr;
@@ -347,7 +347,7 @@ void audio::river::io::Node::newOutput(void* _outputBuffer,
//////////////////////////////////////////////////////////////////////////////////////////////////
// process 64 bits FLOAT
//////////////////////////////////////////////////////////////////////////////////////////////////
std::vector<double> output;
etk::Vector<double> output;
RIVER_VERBOSE("resize=" << _nbChunk*m_process.getInputConfig().getMap().size());
output.resize(_nbChunk*m_process.getInputConfig().getMap().size(), 0);
const double* outputTmp = nullptr;
@@ -392,7 +392,7 @@ void audio::river::io::Node::newOutput(void* _outputBuffer,
return;
}
static void link(etk::FSNode& _node, const std::string& _first, const std::string& _op, const std::string& _second) {
static void link(etk::FSNode& _node, const etk::String& _first, const etk::String& _op, const std::string& _second) {
if (_op == "->") {
_node << " " << _first << " -> " << _second << ";\n";
} else if (_op == "<-") {
@@ -409,11 +409,11 @@ void audio::river::io::Node::generateDot(etk::FSNode& _node) {
if (m_isInput == true) {
_node << " node [shape=rarrow];\n";
_node << " NODE_" << m_uid << "_HW_interface [ label=\"HW interface\\n interface=ALSA\\n stream=" << m_name << "\\n type=input\" ];\n";
std::string nameIn;
std::string nameOut;
etk::String nameIn;
etk::String nameOut;
m_process.generateDotProcess(_node, 3, m_uid, nameIn, nameOut, false);
_node << " node [shape=square];\n";
_node << " NODE_" << m_uid << "_demuxer [ label=\"DEMUXER\\n format=" << etk::to_string(m_process.getOutputConfig().getFormat()) << "\" ];\n";
_node << " NODE_" << m_uid << "_demuxer [ label=\"DEMUXER\\n format=" << etk::toString(m_process.getOutputConfig().getFormat()) << "\" ];\n";
// Link all nodes :
_node << " NODE_" << m_uid << "_HW_interface -> " << nameIn << " [arrowhead=\"open\"];\n";
_node << " " << nameOut << " -> NODE_" << m_uid << "_demuxer [arrowhead=\"open\"];\n";
@@ -422,22 +422,22 @@ void audio::river::io::Node::generateDot(etk::FSNode& _node) {
size_t nbfeedback = getNumberOfInterfaceAvaillable(audio::river::modeInterface_feedback);
_node << " node [shape=larrow];\n";
_node << " NODE_" << m_uid << "_HW_interface [ label=\"HW interface\\n interface=ALSA\\n stream=" << m_name << "\\n type=output\" ];\n";
std::string nameIn;
std::string nameOut;
etk::String nameIn;
etk::String nameOut;
if (nbOutput>0) {
m_process.generateDotProcess(_node, 3, m_uid, nameIn, nameOut, true);
}
_node << " node [shape=square];\n";
if (nbOutput>0) {
_node << " NODE_" << m_uid << "_muxer [ label=\"MUXER\\n format=" << etk::to_string(m_process.getInputConfig().getFormat()) << "\" ];\n";
_node << " NODE_" << m_uid << "_muxer [ label=\"MUXER\\n format=" << etk::toString(m_process.getInputConfig().getFormat()) << "\" ];\n";
}
if (nbfeedback>0) {
_node << " NODE_" << m_uid << "_demuxer [ label=\"DEMUXER\\n format=" << etk::to_string(m_process.getOutputConfig().getFormat()) << "\" ];\n";
_node << " NODE_" << m_uid << "_demuxer [ label=\"DEMUXER\\n format=" << etk::toString(m_process.getOutputConfig().getFormat()) << "\" ];\n";
}
// Link all nodes :
if (nbOutput>0) {
link(_node, "NODE_" + etk::to_string(m_uid) + "_HW_interface", "<-", nameOut);
link(_node, nameIn, "<-", "NODE_" + etk::to_string(m_uid) + "_muxer");
link(_node, "NODE_" + etk::toString(m_uid) + "_HW_interface", "<-", nameOut);
link(_node, nameIn, "<-", "NODE_" + etk::toString(m_uid) + "_muxer");
}
if (nbfeedback>0) {
_node << " NODE_" << m_uid << "_HW_interface -> NODE_" << m_uid << "_demuxer [arrowhead=\"open\"];\n";
@@ -466,11 +466,11 @@ void audio::river::io::Node::generateDot(etk::FSNode& _node) {
}
if (element != nullptr) {
if (element->getMode() == modeInterface_input) {
element->generateDot(_node, "NODE_" + etk::to_string(m_uid) + "_demuxer", isLink);
element->generateDot(_node, "NODE_" + etk::toString(m_uid) + "_demuxer", isLink);
} else if (element->getMode() == modeInterface_output) {
element->generateDot(_node, "NODE_" + etk::to_string(m_uid) + "_muxer", isLink);
element->generateDot(_node, "NODE_" + etk::toString(m_uid) + "_muxer", isLink);
} else if (element->getMode() == modeInterface_feedback) {
element->generateDot(_node, "NODE_" + etk::to_string(m_uid) + "_demuxer", isLink);
element->generateDot(_node, "NODE_" + etk::toString(m_uid) + "_demuxer", isLink);
} else {
}