[DEV] add dependency of audio base format
This commit is contained in:
@@ -65,10 +65,14 @@ std::shared_ptr<airtalgo::VolumeElement> airtio::io::Manager::getVolumeGroup(con
|
||||
bool airtio::io::Manager::setVolume(const std::string& _volumeName, float _valuedB) {
|
||||
std::shared_ptr<airtalgo::VolumeElement> volume = getVolumeGroup(_volumeName);
|
||||
if (volume == nullptr) {
|
||||
AIRTIO_ERROR("Can not get volume ... : '" << _volumeName << "'");
|
||||
AIRTIO_ERROR("Can not set volume ... : '" << _volumeName << "'");
|
||||
return false;
|
||||
}
|
||||
if ( _valuedB < -300
|
||||
|| _valuedB > 300) {
|
||||
AIRTIO_ERROR("Can not set volume ... : '" << _volumeName << "' out of range : [-300..300]");
|
||||
return false;
|
||||
}
|
||||
// TODO : Check range ...
|
||||
volume->setVolume(_valuedB);
|
||||
for (auto &it2 : m_list) {
|
||||
std::shared_ptr<airtio::io::Node> val = it2.lock();
|
||||
|
@@ -13,8 +13,8 @@
|
||||
#include <stdint.h>
|
||||
#include <chrono>
|
||||
#include <functional>
|
||||
#include <airtalgo/format.h>
|
||||
#include <airtalgo/channel.h>
|
||||
#include <audio/format.h>
|
||||
#include <audio/channel.h>
|
||||
#include <ejson/ejson.h>
|
||||
#include <memory>
|
||||
#include <airtalgo/Volume.h>
|
||||
|
@@ -150,9 +150,9 @@ airtio::io::Node::Node(const std::string& _name, const std::shared_ptr<const ejs
|
||||
m_volume = airtio::io::Manager::getInstance()->getVolumeGroup(volumeName);
|
||||
}
|
||||
|
||||
enum airtalgo::format formatType = airtalgo::format_int16;
|
||||
enum audio::format formatType = audio::format_int16;
|
||||
if (type == "int16") {
|
||||
formatType = airtalgo::format_int16;
|
||||
formatType = audio::format_int16;
|
||||
} else {
|
||||
AIRTIO_WARNING("not managed type : '" << type << "'");
|
||||
}
|
||||
@@ -165,19 +165,19 @@ airtio::io::Node::Node(const std::string& _name, const std::shared_ptr<const ejs
|
||||
if (streamName == "") {
|
||||
streamName = "default";
|
||||
}
|
||||
std::vector<airtalgo::channel> map;
|
||||
std::vector<audio::channel> map;
|
||||
// set default channel property :
|
||||
map.push_back(airtalgo::channel_frontLeft);
|
||||
map.push_back(airtalgo::channel_frontRight);
|
||||
map.push_back(audio::channel_frontLeft);
|
||||
map.push_back(audio::channel_frontRight);
|
||||
|
||||
m_hardwareFormat.set(map, formatType, frequency);
|
||||
// TODO : Better view of interface type float -> float, int16 -> int16/int32, ...
|
||||
if (m_isInput == true) {
|
||||
// for input we just transfert audio with no transformation
|
||||
m_interfaceFormat.set(map, airtalgo::format_int16, frequency);
|
||||
m_interfaceFormat.set(map, audio::format_int16, frequency);
|
||||
} else {
|
||||
// for output we will do a mix ...
|
||||
m_interfaceFormat.set(map, airtalgo::format_int16_on_int32, frequency);
|
||||
m_interfaceFormat.set(map, audio::format_int16_on_int32, frequency);
|
||||
}
|
||||
|
||||
// search device ID :
|
||||
|
@@ -13,8 +13,8 @@
|
||||
#include <stdint.h>
|
||||
#include <chrono>
|
||||
#include <functional>
|
||||
#include <airtalgo/format.h>
|
||||
#include <airtalgo/channel.h>
|
||||
#include <audio/format.h>
|
||||
#include <audio/channel.h>
|
||||
#include "Manager.h"
|
||||
#include <memory>
|
||||
#include <airtio/Interface.h>
|
||||
@@ -59,7 +59,7 @@ namespace airtio {
|
||||
double _streamTime,
|
||||
airtaudio::streamStatus _status);
|
||||
private:
|
||||
std::string m_name;
|
||||
std::string m_name; //!< Harware.json configuration name
|
||||
public:
|
||||
const std::string& getName() {
|
||||
return m_name;
|
||||
|
Reference in New Issue
Block a user