2015-02-26 21:44:16 +01:00
|
|
|
/** @file
|
|
|
|
* @author Edouard DUPIN
|
|
|
|
* @copyright 2011, Edouard DUPIN, all right reserved
|
|
|
|
* @license APACHE v2.0 (see license file)
|
|
|
|
* @fork from RTAudio
|
|
|
|
*/
|
|
|
|
|
|
|
|
//#include <etk/types.h>
|
2015-04-10 22:06:17 +02:00
|
|
|
#include <audio/orchestra/debug.h>
|
|
|
|
#include <audio/orchestra/DeviceInfo.h>
|
2015-02-26 21:44:16 +01:00
|
|
|
#include <etk/stdTools.h>
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
#undef __class__
|
|
|
|
#define __class__ "DeviceInfo"
|
|
|
|
|
2015-04-10 22:06:17 +02:00
|
|
|
void audio::orchestra::DeviceInfo::display(int32_t _tabNumber) const {
|
2015-02-26 21:44:16 +01:00
|
|
|
std::string space;
|
|
|
|
for (int32_t iii=0; iii<_tabNumber; ++iii) {
|
|
|
|
space += " ";
|
|
|
|
}
|
2015-07-07 21:37:03 +02:00
|
|
|
if (isCorrect == false) {
|
|
|
|
ATA_PRINT(space + "NOT CORRECT INFORAMATIONS");
|
|
|
|
return;
|
|
|
|
}
|
2015-06-14 18:32:08 +02:00
|
|
|
ATA_PRINT(space + "mode=" << (input==true?"input":"output"));
|
2015-06-13 11:50:30 +02:00
|
|
|
ATA_PRINT(space + "name=" << name);
|
2015-07-07 21:37:03 +02:00
|
|
|
if (desc.size() != 0) {
|
|
|
|
ATA_PRINT(space + "desc=" << desc);
|
|
|
|
}
|
2015-06-14 18:32:08 +02:00
|
|
|
ATA_PRINT(space + "channel" << (channels.size()>1?"s":"") << "=" << channels.size() << " : " << channels);
|
|
|
|
ATA_PRINT(space + "rate" << (sampleRates.size()>1?"s":"") << "=" << sampleRates);
|
|
|
|
ATA_PRINT(space + "native Format" << (nativeFormats.size()>1?"s":"") << ": " << nativeFormats);
|
|
|
|
ATA_PRINT(space + "default=" << (isDefault==true?"true":"false"));
|
2015-02-26 21:44:16 +01:00
|
|
|
}
|
|
|
|
|
2015-07-07 21:37:03 +02:00
|
|
|
void audio::orchestra::DeviceInfo::clear() {
|
|
|
|
isCorrect = false;
|
|
|
|
input = false;
|
|
|
|
name = "";
|
|
|
|
desc = "";
|
|
|
|
channels.clear();
|
|
|
|
sampleRates.clear();
|
|
|
|
nativeFormats.clear();
|
|
|
|
isDefault = false;
|
|
|
|
}
|
2015-06-14 18:32:08 +02:00
|
|
|
|
2015-04-10 22:06:17 +02:00
|
|
|
std::ostream& audio::orchestra::operator <<(std::ostream& _os, const audio::orchestra::DeviceInfo& _obj) {
|
2015-02-26 21:44:16 +01:00
|
|
|
_os << "{";
|
2015-07-07 21:37:03 +02:00
|
|
|
if (_obj.isCorrect == false) {
|
|
|
|
_os << "NOT CORRECT INFORAMATIONS";
|
|
|
|
} else {
|
|
|
|
_os << "name=" << _obj.name << ", ";
|
|
|
|
if (_obj.desc.size() != 0) {
|
|
|
|
_os << "description=" << _obj.desc << ", ";
|
|
|
|
}
|
|
|
|
_os << "channels=" << _obj.channels << ", ";
|
|
|
|
_os << "default=" << _obj.isDefault << ", ";
|
|
|
|
_os << "rates=" << _obj.sampleRates << ", ";
|
|
|
|
_os << "native Format: " << _obj.nativeFormats;
|
|
|
|
}
|
2015-02-26 21:44:16 +01:00
|
|
|
_os << "}";
|
|
|
|
return _os;
|
|
|
|
}
|
|
|
|
|