[DEV] continue removing stl

This commit is contained in:
Edouard DUPIN 2017-08-28 00:08:41 +02:00
parent bcff6508ab
commit a4ba319ffc
37 changed files with 288 additions and 288 deletions

View File

@ -14,26 +14,26 @@
#include <climits> #include <climits>
// Static variable definitions. // Static variable definitions.
const std::vector<uint32_t>& audio::orchestra::genericSampleRate() { const etk::Vector<uint32_t>& audio::orchestra::genericSampleRate() {
static std::vector<uint32_t> list; static etk::Vector<uint32_t> list;
if (list.size() == 0) { if (list.size() == 0) {
list.push_back(4000); list.pushBack(4000);
list.push_back(5512); list.pushBack(5512);
list.push_back(8000); list.pushBack(8000);
list.push_back(9600); list.pushBack(9600);
list.push_back(11025); list.pushBack(11025);
list.push_back(16000); list.pushBack(16000);
list.push_back(22050); list.pushBack(22050);
list.push_back(32000); list.pushBack(32000);
list.push_back(44100); list.pushBack(44100);
list.push_back(48000); list.pushBack(48000);
list.push_back(64000); list.pushBack(64000);
list.push_back(88200); list.pushBack(88200);
list.push_back(96000); list.pushBack(96000);
list.push_back(128000); list.pushBack(128000);
list.push_back(176400); list.pushBack(176400);
list.push_back(192000); list.pushBack(192000);
list.push_back(256000); list.pushBack(256000);
} }
return list; return list;
}; };
@ -295,21 +295,21 @@ void audio::orchestra::Api::setConvertInfo(audio::orchestra::mode _mode, uint32_
if (m_deviceInterleaved[idTable] == false) { if (m_deviceInterleaved[idTable] == false) {
if (_mode == audio::orchestra::mode_input) { if (_mode == audio::orchestra::mode_input) {
for (int32_t kkk=0; kkk<m_convertInfo[idTable].channels; ++kkk) { for (int32_t kkk=0; kkk<m_convertInfo[idTable].channels; ++kkk) {
m_convertInfo[idTable].inOffset.push_back(kkk * m_bufferSize); m_convertInfo[idTable].inOffset.pushBack(kkk * m_bufferSize);
m_convertInfo[idTable].outOffset.push_back(kkk); m_convertInfo[idTable].outOffset.pushBack(kkk);
m_convertInfo[idTable].inJump = 1; m_convertInfo[idTable].inJump = 1;
} }
} else { } else {
for (int32_t kkk=0; kkk<m_convertInfo[idTable].channels; ++kkk) { for (int32_t kkk=0; kkk<m_convertInfo[idTable].channels; ++kkk) {
m_convertInfo[idTable].inOffset.push_back(kkk); m_convertInfo[idTable].inOffset.pushBack(kkk);
m_convertInfo[idTable].outOffset.push_back(kkk * m_bufferSize); m_convertInfo[idTable].outOffset.pushBack(kkk * m_bufferSize);
m_convertInfo[idTable].outJump = 1; m_convertInfo[idTable].outJump = 1;
} }
} }
} else { // no (de)interleaving } else { // no (de)interleaving
for (int32_t kkk=0; kkk<m_convertInfo[idTable].channels; ++kkk) { for (int32_t kkk=0; kkk<m_convertInfo[idTable].channels; ++kkk) {
m_convertInfo[idTable].inOffset.push_back(kkk); m_convertInfo[idTable].inOffset.pushBack(kkk);
m_convertInfo[idTable].outOffset.push_back(kkk); m_convertInfo[idTable].outOffset.pushBack(kkk);
} }
} }

View File

@ -22,7 +22,7 @@ namespace audio {
* @brief Audio-orchestra library namespace * @brief Audio-orchestra library namespace
*/ */
namespace orchestra { namespace orchestra {
const std::vector<uint32_t>& genericSampleRate(); const etk::Vector<uint32_t>& genericSampleRate();
/** /**
* @brief airtaudio callback function prototype. * @brief airtaudio callback function prototype.
* @param _inputBuffer For input (or duplex) streams, this buffer will hold _nbChunk of input audio chunk (nullptr if no data). * @param _inputBuffer For input (or duplex) streams, this buffer will hold _nbChunk of input audio chunk (nullptr if no data).
@ -37,7 +37,7 @@ namespace audio {
void* _outputBuffer, void* _outputBuffer,
const audio::Time& _timeOutput, const audio::Time& _timeOutput,
uint32_t _nbChunk, uint32_t _nbChunk,
const std::vector<audio::orchestra::status>& _status)> AirTAudioCallback; const etk::Vector<audio::orchestra::status>& _status)> AirTAudioCallback;
// A protected structure used for buffer conversion. // A protected structure used for buffer conversion.
class ConvertInfo { class ConvertInfo {
public: public:
@ -46,24 +46,24 @@ namespace audio {
int32_t outJump; int32_t outJump;
enum audio::format inFormat; enum audio::format inFormat;
enum audio::format outFormat; enum audio::format outFormat;
std::vector<int> inOffset; etk::Vector<int> inOffset;
std::vector<int> outOffset; etk::Vector<int> outOffset;
}; };
class Api : public ememory::EnableSharedFromThis<Api>{ class Api : public ememory::EnableSharedFromThis<Api>{
protected: protected:
std::string m_name; etk::String m_name;
public: public:
Api(); Api();
virtual ~Api(); virtual ~Api();
void setName(const std::string& _name) { void setName(const etk::String& _name) {
m_name = _name; m_name = _name;
} }
virtual const std::string& getCurrentApi() = 0; virtual const etk::String& getCurrentApi() = 0;
virtual uint32_t getDeviceCount() = 0; virtual uint32_t getDeviceCount() = 0;
virtual audio::orchestra::DeviceInfo getDeviceInfo(uint32_t _device) = 0; virtual audio::orchestra::DeviceInfo getDeviceInfo(uint32_t _device) = 0;
// TODO : Check API ... // TODO : Check API ...
virtual bool getNamedDeviceInfo(const std::string& _deviceName, audio::orchestra::DeviceInfo& _info) { virtual bool getNamedDeviceInfo(const etk::String& _deviceName, audio::orchestra::DeviceInfo& _info) {
return false; return false;
} }
virtual uint32_t getDefaultInputDevice(); virtual uint32_t getDefaultInputDevice();
@ -95,7 +95,7 @@ namespace audio {
uint32_t m_device[2]; // Playback and record, respectively. uint32_t m_device[2]; // Playback and record, respectively.
enum audio::orchestra::mode m_mode; // audio::orchestra::mode_output, audio::orchestra::mode_input, or audio::orchestra::mode_duplex. enum audio::orchestra::mode m_mode; // audio::orchestra::mode_output, audio::orchestra::mode_input, or audio::orchestra::mode_duplex.
enum audio::orchestra::state m_state; // STOPPED, RUNNING, or CLOSED enum audio::orchestra::state m_state; // STOPPED, RUNNING, or CLOSED
std::vector<char> m_userBuffer[2]; // Playback and record, respectively. etk::Vector<char> m_userBuffer[2]; // Playback and record, respectively.
char *m_deviceBuffer; char *m_deviceBuffer;
bool m_doConvertBuffer[2]; // Playback and record, respectively. bool m_doConvertBuffer[2]; // Playback and record, respectively.
bool m_deviceInterleaved[2]; // Playback and record, respectively. bool m_deviceInterleaved[2]; // Playback and record, respectively.
@ -130,7 +130,7 @@ namespace audio {
enum audio::format _format, enum audio::format _format,
uint32_t *_bufferSize, uint32_t *_bufferSize,
const audio::orchestra::StreamOptions& _options); const audio::orchestra::StreamOptions& _options);
virtual bool openName(const std::string& _deviceName, virtual bool openName(const etk::String& _deviceName,
audio::orchestra::mode _mode, audio::orchestra::mode _mode,
uint32_t _channels, uint32_t _channels,
uint32_t _firstChannel, uint32_t _firstChannel,

View File

@ -12,7 +12,7 @@
#include <iostream> #include <iostream>
void audio::orchestra::DeviceInfo::display(int32_t _tabNumber) const { void audio::orchestra::DeviceInfo::display(int32_t _tabNumber) const {
std::string space; etk::String space;
for (int32_t iii=0; iii<_tabNumber; ++iii) { for (int32_t iii=0; iii<_tabNumber; ++iii) {
space += " "; space += " ";
} }
@ -42,7 +42,7 @@ void audio::orchestra::DeviceInfo::clear() {
isDefault = false; isDefault = false;
} }
std::ostream& audio::orchestra::operator <<(std::ostream& _os, const audio::orchestra::DeviceInfo& _obj) { etk::Stream& audio::orchestra::operator <<(etk::Stream& _os, const audio::orchestra::DeviceInfo& _obj) {
_os << "{"; _os << "{";
if (_obj.isCorrect == false) { if (_obj.isCorrect == false) {
_os << "NOT CORRECT INFORAMATIONS"; _os << "NOT CORRECT INFORAMATIONS";

View File

@ -18,11 +18,11 @@ namespace audio {
public: public:
bool isCorrect; //!< the information is correct (the system can return information incorect). bool isCorrect; //!< the information is correct (the system can return information incorect).
bool input; //!< true if the device in an input; false: output. bool input; //!< true if the device in an input; false: output.
std::string name; //!< Character string device identifier. etk::String name; //!< Character string device identifier.
std::string desc; //!< description of the device etk::String desc; //!< description of the device
std::vector<audio::channel> channels; //!< Channels interfaces. etk::Vector<audio::channel> channels; //!< Channels interfaces.
std::vector<uint32_t> sampleRates; //!< Supported sample rates (queried from list of standard rates). etk::Vector<uint32_t> sampleRates; //!< Supported sample rates (queried from list of standard rates).
std::vector<audio::format> nativeFormats; //!< Bit mask of supported data formats. etk::Vector<audio::format> nativeFormats; //!< Bit mask of supported data formats.
bool isDefault; //! is default input/output bool isDefault; //! is default input/output
// Default constructor. // Default constructor.
DeviceInfo() : DeviceInfo() :
@ -43,7 +43,7 @@ namespace audio {
*/ */
void clear(); void clear();
}; };
std::ostream& operator <<(std::ostream& _os, const audio::orchestra::DeviceInfo& _obj); etk::Stream& operator <<(etk::Stream& _os, const audio::orchestra::DeviceInfo& _obj);
} }
} }

View File

@ -19,19 +19,19 @@
#include <audio/orchestra/api/Jack.hpp> #include <audio/orchestra/api/Jack.hpp>
#include <audio/orchestra/api/Pulse.hpp> #include <audio/orchestra/api/Pulse.hpp>
std::vector<std::string> audio::orchestra::Interface::getListApi() { etk::Vector<etk::String> audio::orchestra::Interface::getListApi() {
std::vector<std::string> apis; etk::Vector<etk::String> apis;
// The order here will control the order of RtAudio's API search in // The order here will control the order of RtAudio's API search in
// the constructor. // the constructor.
for (size_t iii=0; iii<m_apiAvaillable.size(); ++iii) { for (size_t iii=0; iii<m_apiAvaillable.size(); ++iii) {
apis.push_back(m_apiAvaillable[iii].first); apis.pushBack(m_apiAvaillable[iii].first);
} }
return apis; return apis;
} }
void audio::orchestra::Interface::openApi(const std::string& _api) { void audio::orchestra::Interface::openApi(const etk::String& _api) {
m_api.reset(); m_api.reset();
for (size_t iii=0; iii<m_apiAvaillable.size(); ++iii) { for (size_t iii=0; iii<m_apiAvaillable.size(); ++iii) {
ATA_INFO("try open " << m_apiAvaillable[iii].first); ATA_INFO("try open " << m_apiAvaillable[iii].first);
@ -80,8 +80,8 @@ audio::orchestra::Interface::Interface() :
#endif #endif
} }
void audio::orchestra::Interface::addInterface(const std::string& _api, ememory::SharedPtr<Api> (*_callbackCreate)()) { void audio::orchestra::Interface::addInterface(const etk::String& _api, ememory::SharedPtr<Api> (*_callbackCreate)()) {
m_apiAvaillable.push_back(std::pair<std::string, ememory::SharedPtr<Api> (*)()>(_api, _callbackCreate)); m_apiAvaillable.pushBack(etk::Pair<etk::String, ememory::SharedPtr<Api> (*)()>(_api, _callbackCreate));
} }
enum audio::orchestra::error audio::orchestra::Interface::clear() { enum audio::orchestra::error audio::orchestra::Interface::clear() {
@ -94,7 +94,7 @@ enum audio::orchestra::error audio::orchestra::Interface::clear() {
return audio::orchestra::error_none; return audio::orchestra::error_none;
} }
enum audio::orchestra::error audio::orchestra::Interface::instanciate(const std::string& _api) { enum audio::orchestra::error audio::orchestra::Interface::instanciate(const etk::String& _api) {
ATA_INFO("Instanciate API ..."); ATA_INFO("Instanciate API ...");
if (m_api != nullptr) { if (m_api != nullptr) {
ATA_WARNING("Interface already started!"); ATA_WARNING("Interface already started!");
@ -118,7 +118,7 @@ enum audio::orchestra::error audio::orchestra::Interface::instanciate(const std:
ATA_INFO("Auto choice API :"); ATA_INFO("Auto choice API :");
// Iterate through the compiled APIs and return as soon as we find // Iterate through the compiled APIs and return as soon as we find
// one with at least one device or we reach the end of the list. // one with at least one device or we reach the end of the list.
std::vector<std::string> apis = getListApi(); etk::Vector<etk::String> apis = getListApi();
ATA_INFO(" find : " << apis.size() << " apis."); ATA_INFO(" find : " << apis.size() << " apis.");
for (size_t iii=0; iii<apis.size(); ++iii) { for (size_t iii=0; iii<apis.size(); ++iii) {
ATA_INFO("try open ..."); ATA_INFO("try open ...");

View File

@ -6,8 +6,8 @@
*/ */
#pragma once #pragma once
#include <string> #include <etk/String.hpp>
#include <vector> #include <etk/Vector.hpp>
#include <audio/orchestra/base.hpp> #include <audio/orchestra/base.hpp>
#include <audio/orchestra/CallbackInfo.hpp> #include <audio/orchestra/CallbackInfo.hpp>
#include <audio/orchestra/Api.hpp> #include <audio/orchestra/Api.hpp>
@ -26,11 +26,11 @@ namespace audio {
*/ */
class Interface { class Interface {
protected: protected:
std::vector<std::pair<std::string, ememory::SharedPtr<Api> (*)()> > m_apiAvaillable; etk::Vector<etk::Pair<etk::String, ememory::SharedPtr<Api> (*)()> > m_apiAvaillable;
protected: protected:
ememory::SharedPtr<audio::orchestra::Api> m_api; ememory::SharedPtr<audio::orchestra::Api> m_api;
public: public:
void setName(const std::string& _name) { void setName(const etk::String& _name) {
if (m_api == nullptr) { if (m_api == nullptr) {
return; return;
} }
@ -40,13 +40,13 @@ namespace audio {
* @brief Get the list of all availlable API in the system. * @brief Get the list of all availlable API in the system.
* @return the list of all APIs * @return the list of all APIs
*/ */
std::vector<std::string> getListApi(); etk::Vector<etk::String> getListApi();
/** /**
* @brief Add an interface of the Possible List. * @brief Add an interface of the Possible List.
* @param[in] _api Type of the interface. * @param[in] _api Type of the interface.
* @param[in] _callbackCreate API creation callback. * @param[in] _callbackCreate API creation callback.
*/ */
void addInterface(const std::string& _api, ememory::SharedPtr<Api> (*_callbackCreate)()); void addInterface(const etk::String& _api, ememory::SharedPtr<Api> (*_callbackCreate)());
/** /**
* @brief The class constructor. * @brief The class constructor.
* @note the creating of the basic instance is done by Instanciate * @note the creating of the basic instance is done by Instanciate
@ -66,11 +66,11 @@ namespace audio {
/** /**
* @brief Create an interface instance * @brief Create an interface instance
*/ */
enum audio::orchestra::error instanciate(const std::string& _api = audio::orchestra::typeUndefined); enum audio::orchestra::error instanciate(const etk::String& _api = audio::orchestra::typeUndefined);
/** /**
* @return the audio API specifier for the current instance of airtaudio. * @return the audio API specifier for the current instance of airtaudio.
*/ */
const std::string& getCurrentApi() { const etk::String& getCurrentApi() {
if (m_api == nullptr) { if (m_api == nullptr) {
return audio::orchestra::typeUndefined; return audio::orchestra::typeUndefined;
} }
@ -106,7 +106,7 @@ namespace audio {
} }
return m_api->getDeviceInfo(_device); return m_api->getDeviceInfo(_device);
} }
audio::orchestra::DeviceInfo getDeviceInfo(const std::string& _deviceName) { audio::orchestra::DeviceInfo getDeviceInfo(const etk::String& _deviceName) {
if (m_api == nullptr) { if (m_api == nullptr) {
return audio::orchestra::DeviceInfo(); return audio::orchestra::DeviceInfo();
} }
@ -300,7 +300,7 @@ namespace audio {
} }
bool isMasterOf(audio::orchestra::Interface& _interface); bool isMasterOf(audio::orchestra::Interface& _interface);
protected: protected:
void openApi(const std::string& _api); void openApi(const etk::String& _api);
}; };
} }
} }

View File

@ -15,13 +15,13 @@ static const char* listValue[] = {
"soft" "soft"
}; };
std::ostream& audio::orchestra::operator <<(std::ostream& _os, enum audio::orchestra::timestampMode _obj) { etk::Stream& audio::orchestra::operator <<(etk::Stream& _os, enum audio::orchestra::timestampMode _obj) {
_os << listValue[_obj]; _os << listValue[_obj];
return _os; return _os;
} }
namespace etk { namespace etk {
template <> bool from_string<enum audio::orchestra::timestampMode>(enum audio::orchestra::timestampMode& _variableRet, const std::string& _value) { template <> bool from_string<enum audio::orchestra::timestampMode>(enum audio::orchestra::timestampMode& _variableRet, const etk::String& _value) {
if (_value == "hardware") { if (_value == "hardware") {
_variableRet = audio::orchestra::timestampMode_Hardware; _variableRet = audio::orchestra::timestampMode_Hardware;
return true; return true;
@ -37,7 +37,7 @@ namespace etk {
return false; return false;
} }
template <enum audio::orchestra::timestampMode> std::string to_string(const enum audio::orchestra::timestampMode& _variable) { template <enum audio::orchestra::timestampMode> etk::String toString(const enum audio::orchestra::timestampMode& _variable) {
return listValue[_variable]; return listValue[_variable];
} }
} }

View File

@ -15,13 +15,13 @@ namespace audio {
timestampMode_trigered, //!< get harware triger time stamp and increment with duration timestampMode_trigered, //!< get harware triger time stamp and increment with duration
timestampMode_soft, //!< Simulate all timestamp. timestampMode_soft, //!< Simulate all timestamp.
}; };
std::ostream& operator <<(std::ostream& _os, enum audio::orchestra::timestampMode _obj); etk::Stream& operator <<(etk::Stream& _os, enum audio::orchestra::timestampMode _obj);
class StreamOptions { class StreamOptions {
public: public:
audio::orchestra::Flags flags; //!< A bit-mask of stream flags audio::orchestra::Flags flags; //!< A bit-mask of stream flags
uint32_t numberOfBuffers; //!< Number of stream buffers. uint32_t numberOfBuffers; //!< Number of stream buffers.
std::string streamName; //!< A stream name (currently used only in Jack). etk::String streamName; //!< A stream name (currently used only in Jack).
enum timestampMode mode; //!< mode of timestamping data... enum timestampMode mode; //!< mode of timestamping data...
// Default constructor. // Default constructor.
StreamOptions() : StreamOptions() :

View File

@ -14,7 +14,7 @@ namespace audio {
class StreamParameters { class StreamParameters {
public: public:
int32_t deviceId; //!< Device index (-1 to getDeviceCount() - 1). int32_t deviceId; //!< Device index (-1 to getDeviceCount() - 1).
std::string deviceName; //!< name of the device (if deviceId==-1 this must not be == "", and the oposite ...) etk::String deviceName; //!< name of the device (if deviceId==-1 this must not be == "", and the oposite ...)
uint32_t nChannels; //!< Number of channels. uint32_t nChannels; //!< Number of channels.
uint32_t firstChannel; //!< First channel index on device (default = 0). uint32_t firstChannel; //!< First channel index on device (default = 0).
// Default constructor. // Default constructor.

View File

@ -45,7 +45,7 @@ namespace audio {
bool threadRunning; bool threadRunning;
bool mmapInterface; //!< enable or disable mmap mode... bool mmapInterface; //!< enable or disable mmap mode...
enum timestampMode timeMode; //!< the timestamp of the flow came from the harware. enum timestampMode timeMode; //!< the timestamp of the flow came from the harware.
std::vector<snd_pcm_channel_area_t> areas; etk::Vector<snd_pcm_channel_area_t> areas;
AlsaPrivate() : AlsaPrivate() :
handle(nullptr), handle(nullptr),
runnable(false), runnable(false),
@ -112,7 +112,7 @@ nextcard:
return nDevices; return nDevices;
} }
bool audio::orchestra::api::Alsa::getNamedDeviceInfoLocal(const std::string& _deviceName, audio::orchestra::DeviceInfo& _info, int32_t _cardId, int32_t _subdevice, int32_t _localDeviceId, bool _input) { bool audio::orchestra::api::Alsa::getNamedDeviceInfoLocal(const etk::String& _deviceName, audio::orchestra::DeviceInfo& _info, int32_t _cardId, int32_t _subdevice, int32_t _localDeviceId, bool _input) {
int32_t result; int32_t result;
snd_ctl_t *chandle; snd_ctl_t *chandle;
int32_t openMode = SND_PCM_ASYNC; int32_t openMode = SND_PCM_ASYNC;
@ -130,7 +130,7 @@ bool audio::orchestra::api::Alsa::getNamedDeviceInfoLocal(const std::string& _de
stream = SND_PCM_STREAM_PLAYBACK; stream = SND_PCM_STREAM_PLAYBACK;
} }
snd_pcm_info_set_stream(pcminfo, stream); snd_pcm_info_set_stream(pcminfo, stream);
std::vector<std::string> listElement = etk::split(_deviceName, ','); etk::Vector<etk::String> listElement = etk::split(_deviceName, ',');
if (listElement.size() == 0) { if (listElement.size() == 0) {
ATA_ERROR("can not get control interface = '" << _deviceName << "' Can not plit at ',' ..."); ATA_ERROR("can not get control interface = '" << _deviceName << "' Can not plit at ',' ...");
return false; return false;
@ -190,15 +190,15 @@ bool audio::orchestra::api::Alsa::getNamedDeviceInfoLocal(const std::string& _de
} }
ATA_DEBUG("Input channel = " << value); ATA_DEBUG("Input channel = " << value);
for (int32_t iii=0; iii<value; ++iii) { for (int32_t iii=0; iii<value; ++iii) {
_info.channels.push_back(audio::channel_unknow); _info.channels.pushBack(audio::channel_unknow);
} }
// Test our discrete set of sample rate values. // Test our discrete set of sample rate values.
_info.sampleRates.clear(); _info.sampleRates.clear();
for (std::vector<uint32_t>::const_iterator it(audio::orchestra::genericSampleRate().begin()); for (etk::Vector<uint32_t>::const_iterator it(audio::orchestra::genericSampleRate().begin());
it != audio::orchestra::genericSampleRate().end(); it != audio::orchestra::genericSampleRate().end();
++it ) { ++it ) {
if (snd_pcm_hw_params_test_rate(phandle, params, *it, 0) == 0) { if (snd_pcm_hw_params_test_rate(phandle, params, *it, 0) == 0) {
_info.sampleRates.push_back(*it); _info.sampleRates.pushBack(*it);
} }
} }
if (_info.sampleRates.size() == 0) { if (_info.sampleRates.size() == 0) {
@ -211,27 +211,27 @@ bool audio::orchestra::api::Alsa::getNamedDeviceInfoLocal(const std::string& _de
_info.nativeFormats.clear(); _info.nativeFormats.clear();
format = SND_PCM_FORMAT_S8; format = SND_PCM_FORMAT_S8;
if (snd_pcm_hw_params_test_format(phandle, params, format) == 0) { if (snd_pcm_hw_params_test_format(phandle, params, format) == 0) {
_info.nativeFormats.push_back(audio::format_int8); _info.nativeFormats.pushBack(audio::format_int8);
} }
format = SND_PCM_FORMAT_S16; format = SND_PCM_FORMAT_S16;
if (snd_pcm_hw_params_test_format(phandle, params, format) == 0) { if (snd_pcm_hw_params_test_format(phandle, params, format) == 0) {
_info.nativeFormats.push_back(audio::format_int16); _info.nativeFormats.pushBack(audio::format_int16);
} }
format = SND_PCM_FORMAT_S24; format = SND_PCM_FORMAT_S24;
if (snd_pcm_hw_params_test_format(phandle, params, format) == 0) { if (snd_pcm_hw_params_test_format(phandle, params, format) == 0) {
_info.nativeFormats.push_back(audio::format_int24); _info.nativeFormats.pushBack(audio::format_int24);
} }
format = SND_PCM_FORMAT_S32; format = SND_PCM_FORMAT_S32;
if (snd_pcm_hw_params_test_format(phandle, params, format) == 0) { if (snd_pcm_hw_params_test_format(phandle, params, format) == 0) {
_info.nativeFormats.push_back(audio::format_int32); _info.nativeFormats.pushBack(audio::format_int32);
} }
format = SND_PCM_FORMAT_FLOAT; format = SND_PCM_FORMAT_FLOAT;
if (snd_pcm_hw_params_test_format(phandle, params, format) == 0) { if (snd_pcm_hw_params_test_format(phandle, params, format) == 0) {
_info.nativeFormats.push_back(audio::format_float); _info.nativeFormats.pushBack(audio::format_float);
} }
format = SND_PCM_FORMAT_FLOAT64; format = SND_PCM_FORMAT_FLOAT64;
if (snd_pcm_hw_params_test_format(phandle, params, format) == 0) { if (snd_pcm_hw_params_test_format(phandle, params, format) == 0) {
_info.nativeFormats.push_back(audio::format_double); _info.nativeFormats.pushBack(audio::format_double);
} }
// Check that we have at least one supported format // Check that we have at least one supported format
if (_info.nativeFormats.size() == 0) { if (_info.nativeFormats.size() == 0) {
@ -406,7 +406,7 @@ foundDevice:
return openName(name, _mode, _channels, _firstChannel, _sampleRate, _format, _bufferSize, _options); return openName(name, _mode, _channels, _firstChannel, _sampleRate, _format, _bufferSize, _options);
} }
bool audio::orchestra::api::Alsa::openName(const std::string& _deviceName, bool audio::orchestra::api::Alsa::openName(const etk::String& _deviceName,
audio::orchestra::mode _mode, audio::orchestra::mode _mode,
uint32_t _channels, uint32_t _channels,
uint32_t _firstChannel, uint32_t _firstChannel,
@ -989,7 +989,7 @@ void audio::orchestra::api::Alsa::callbackEvent() {
} }
ethread::setName("Alsa IO-" + m_name); ethread::setName("Alsa IO-" + m_name);
//Wait data with poll //Wait data with poll
std::vector<struct pollfd> ufds; etk::Vector<struct pollfd> ufds;
signed short *ptr; signed short *ptr;
int32_t err, count, cptr, init; int32_t err, count, cptr, init;
count = snd_pcm_poll_descriptors_count(m_private->handle); count = snd_pcm_poll_descriptors_count(m_private->handle);
@ -1106,9 +1106,9 @@ void audio::orchestra::api::Alsa::callbackEventOneCycleRead() {
} }
int32_t doStopStream = 0; int32_t doStopStream = 0;
audio::Time streamTime; audio::Time streamTime;
std::vector<enum audio::orchestra::status> status; etk::Vector<enum audio::orchestra::status> status;
if (m_private->xrun[0] == true) { if (m_private->xrun[0] == true) {
status.push_back(audio::orchestra::status::underflow); status.pushBack(audio::orchestra::status::underflow);
m_private->xrun[0] = false; m_private->xrun[0] = false;
} }
int32_t result; int32_t result;
@ -1223,9 +1223,9 @@ void audio::orchestra::api::Alsa::callbackEventOneCycleWrite() {
} }
int32_t doStopStream = 0; int32_t doStopStream = 0;
audio::Time streamTime; audio::Time streamTime;
std::vector<enum audio::orchestra::status> status; etk::Vector<enum audio::orchestra::status> status;
if (m_private->xrun[1] == true) { if (m_private->xrun[1] == true) {
status.push_back(audio::orchestra::status::overflow); status.pushBack(audio::orchestra::status::overflow);
m_private->xrun[1] = false; m_private->xrun[1] = false;
} }
int32_t result; int32_t result;
@ -1325,9 +1325,9 @@ void audio::orchestra::api::Alsa::callbackEventOneCycleMMAPWrite() {
} }
int32_t doStopStream = 0; int32_t doStopStream = 0;
audio::Time streamTime; audio::Time streamTime;
std::vector<enum audio::orchestra::status> status; etk::Vector<enum audio::orchestra::status> status;
if (m_private->xrun[1] == true) { if (m_private->xrun[1] == true) {
status.push_back(audio::orchestra::status::overflow); status.pushBack(audio::orchestra::status::overflow);
m_private->xrun[1] = false; m_private->xrun[1] = false;
} }
int32_t result; int32_t result;
@ -1459,9 +1459,9 @@ void audio::orchestra::api::Alsa::callbackEventOneCycleMMAPRead() {
} }
int32_t doStopStream = 0; int32_t doStopStream = 0;
audio::Time streamTime; audio::Time streamTime;
std::vector<enum audio::orchestra::status> status; etk::Vector<enum audio::orchestra::status> status;
if (m_private->xrun[0] == true) { if (m_private->xrun[0] == true) {
status.push_back(audio::orchestra::status::underflow); status.pushBack(audio::orchestra::status::underflow);
m_private->xrun[0] = false; m_private->xrun[0] = false;
} }
int32_t result; int32_t result;

View File

@ -18,19 +18,19 @@ namespace audio {
public: public:
Alsa(); Alsa();
virtual ~Alsa(); virtual ~Alsa();
const std::string& getCurrentApi() { const etk::String& getCurrentApi() {
return audio::orchestra::typeAlsa; return audio::orchestra::typeAlsa;
} }
uint32_t getDeviceCount(); uint32_t getDeviceCount();
private: private:
bool getNamedDeviceInfoLocal(const std::string& _deviceName, bool getNamedDeviceInfoLocal(const etk::String& _deviceName,
audio::orchestra::DeviceInfo& _info, audio::orchestra::DeviceInfo& _info,
int32_t _cardId=-1, // Alsa card ID int32_t _cardId=-1, // Alsa card ID
int32_t _subdevice=-1, // alsa subdevice ID int32_t _subdevice=-1, // alsa subdevice ID
int32_t _localDeviceId=-1,// local ID of device find int32_t _localDeviceId=-1,// local ID of device find
bool _input=false); bool _input=false);
public: public:
bool getNamedDeviceInfo(const std::string& _deviceName, audio::orchestra::DeviceInfo& _info) { bool getNamedDeviceInfo(const etk::String& _deviceName, audio::orchestra::DeviceInfo& _info) {
return getNamedDeviceInfoLocal(_deviceName, _info); return getNamedDeviceInfoLocal(_deviceName, _info);
} }
audio::orchestra::DeviceInfo getDeviceInfo(uint32_t _device); audio::orchestra::DeviceInfo getDeviceInfo(uint32_t _device);
@ -51,7 +51,7 @@ namespace audio {
static void alsaCallbackEvent(void* _userData); static void alsaCallbackEvent(void* _userData);
private: private:
ememory::SharedPtr<AlsaPrivate> m_private; ememory::SharedPtr<AlsaPrivate> m_private;
std::vector<audio::orchestra::DeviceInfo> m_devices; etk::Vector<audio::orchestra::DeviceInfo> m_devices;
void saveDeviceInfo(); void saveDeviceInfo();
bool open(uint32_t _device, bool open(uint32_t _device,
enum audio::orchestra::mode _mode, enum audio::orchestra::mode _mode,
@ -62,7 +62,7 @@ namespace audio {
uint32_t *_bufferSize, uint32_t *_bufferSize,
const audio::orchestra::StreamOptions& _options); const audio::orchestra::StreamOptions& _options);
bool openName(const std::string& _deviceName, bool openName(const etk::String& _deviceName,
audio::orchestra::mode _mode, audio::orchestra::mode _mode,
uint32_t _channels, uint32_t _channels,
uint32_t _firstChannel, uint32_t _firstChannel,

View File

@ -74,7 +74,7 @@ void audio::orchestra::api::Android::playback(int16_t* _dst, int32_t _nbChunk) {
} }
int32_t doStopStream = 0; int32_t doStopStream = 0;
audio::Time streamTime = getStreamTime(); audio::Time streamTime = getStreamTime();
std::vector<enum audio::orchestra::status> status; etk::Vector<enum audio::orchestra::status> status;
if (m_doConvertBuffer[modeToIdTable(m_mode)] == true) { if (m_doConvertBuffer[modeToIdTable(m_mode)] == true) {
ATA_VERBOSE("Need playback data " << int32_t(_nbChunk) << " userbuffer size = " << m_userBuffer[audio::orchestra::mode_output].size() << "pointer=" << int64_t(&m_userBuffer[audio::orchestra::mode_output][0])); ATA_VERBOSE("Need playback data " << int32_t(_nbChunk) << " userbuffer size = " << m_userBuffer[audio::orchestra::mode_output].size() << "pointer=" << int64_t(&m_userBuffer[audio::orchestra::mode_output][0]));
doStopStream = m_callback(nullptr, doStopStream = m_callback(nullptr,
@ -104,7 +104,7 @@ void audio::orchestra::api::Android::playback(int16_t* _dst, int32_t _nbChunk) {
void audio::orchestra::api::Android::record(int16_t* _dst, int32_t _nbChunk) { void audio::orchestra::api::Android::record(int16_t* _dst, int32_t _nbChunk) {
int32_t doStopStream = 0; int32_t doStopStream = 0;
audio::Time streamTime = getStreamTime(); audio::Time streamTime = getStreamTime();
std::vector<enum audio::orchestra::status> status; etk::Vector<enum audio::orchestra::status> status;
if (m_doConvertBuffer[modeToIdTable(m_mode)] == true) { if (m_doConvertBuffer[modeToIdTable(m_mode)] == true) {
ATA_VERBOSE("Need playback data " << int32_t(_nbChunk) << " userbuffer size = " << m_userBuffer[audio::orchestra::mode_output].size() << "pointer=" << int64_t(&m_userBuffer[audio::orchestra::mode_output][0])); ATA_VERBOSE("Need playback data " << int32_t(_nbChunk) << " userbuffer size = " << m_userBuffer[audio::orchestra::mode_output].size() << "pointer=" << int64_t(&m_userBuffer[audio::orchestra::mode_output][0]));
convertBuffer((char*)&m_userBuffer[audio::orchestra::mode_input][0], (char*)_dst, m_convertInfo[audio::orchestra::mode_input]); convertBuffer((char*)&m_userBuffer[audio::orchestra::mode_input][0], (char*)_dst, m_convertInfo[audio::orchestra::mode_input]);

View File

@ -18,7 +18,7 @@ namespace audio {
public: public:
Android(); Android();
virtual ~Android(); virtual ~Android();
const std::string& getCurrentApi() { const etk::String& getCurrentApi() {
return audio::orchestra::typeJava; return audio::orchestra::typeJava;
} }
uint32_t getDeviceCount(); uint32_t getDeviceCount();
@ -39,7 +39,7 @@ namespace audio {
return m_uid; return m_uid;
} }
private: private:
std::vector<audio::orchestra::DeviceInfo> m_devices; etk::Vector<audio::orchestra::DeviceInfo> m_devices;
void saveDeviceInfo(); void saveDeviceInfo();
bool open(uint32_t _device, bool open(uint32_t _device,
audio::orchestra::mode _mode, audio::orchestra::mode _mode,

View File

@ -235,7 +235,7 @@ class AndroidOrchestraContext {
//Call java ... //Call java ...
jstring returnString = (jstring) m_JavaVirtualMachinePointer->CallObjectMethod(m_javaObjectOrchestraCallback, m_javaMethodOrchestraActivityAudioGetDeviceProperty, _idDevice); jstring returnString = (jstring) m_JavaVirtualMachinePointer->CallObjectMethod(m_javaObjectOrchestraCallback, m_javaMethodOrchestraActivityAudioGetDeviceProperty, _idDevice);
const char *js = m_JavaVirtualMachinePointer->GetStringUTFChars(returnString, nullptr); const char *js = m_JavaVirtualMachinePointer->GetStringUTFChars(returnString, nullptr);
std::string retString(js); etk::String retString(js);
m_JavaVirtualMachinePointer->ReleaseStringUTFChars(returnString, js); m_JavaVirtualMachinePointer->ReleaseStringUTFChars(returnString, js);
//m_JavaVirtualMachinePointer->DeleteLocalRef(returnString); //m_JavaVirtualMachinePointer->DeleteLocalRef(returnString);
// manage execption : // manage execption :
@ -256,19 +256,19 @@ class AndroidOrchestraContext {
ejson::Array list = doc["sample-rate"].toArray(); ejson::Array list = doc["sample-rate"].toArray();
if (list.exist() == true) { if (list.exist() == true) {
for (auto it : list) { for (auto it : list) {
info.sampleRates.push_back(int32_t(it.toNumber().get(48000))); info.sampleRates.pushBack(int32_t(it.toNumber().get(48000)));
} }
} }
list = doc["channels"].toArray(); list = doc["channels"].toArray();
if (list.exist() == true) { if (list.exist() == true) {
for (auto it : list) { for (auto it : list) {
info.channels.push_back(audio::getChannelFromString(it.toString().get("???"))); info.channels.pushBack(audio::getChannelFromString(it.toString().get("???")));
} }
} }
list = doc["format"].toArray(); list = doc["format"].toArray();
if (list.exist() == true) { if (list.exist() == true) {
for (auto it : list) { for (auto it : list) {
info.nativeFormats.push_back(audio::getFormatFromString(it.toString().get("???"))); info.nativeFormats.pushBack(audio::getFormatFromString(it.toString().get("???")));
} }
} }
info.isDefault = doc["default"].toBoolean().get(false); info.isDefault = doc["default"].toBoolean().get(false);
@ -276,7 +276,7 @@ class AndroidOrchestraContext {
return info; return info;
} }
private: private:
std::vector<ememory::WeakPtr<audio::orchestra::api::Android> > m_instanceList; // list of connected handle ... etk::Vector<ememory::WeakPtr<audio::orchestra::api::Android> > m_instanceList; // list of connected handle ...
//AndroidAudioCallback m_audioCallBack; //AndroidAudioCallback m_audioCallBack;
//void* m_audioCallBackUserData; //void* m_audioCallBackUserData;
public: public:
@ -305,7 +305,7 @@ class AndroidOrchestraContext {
jvm_basics::checkExceptionJavaVM(m_JavaVirtualMachinePointer); jvm_basics::checkExceptionJavaVM(m_JavaVirtualMachinePointer);
java_detach_current_thread(status); java_detach_current_thread(status);
if (int32_t(ret) >= 0) { if (int32_t(ret) >= 0) {
m_instanceList.push_back(_instance); m_instanceList.pushBack(_instance);
return int32_t(ret); return int32_t(ret);
} }
return -1; return -1;

View File

@ -154,7 +154,7 @@ rtaudio::DeviceInfo audio::orchestra::api::Asio::getDeviceInfo(uint32_t _device)
for (uint32_t i=0; i<MAX_SAMPLE_RATES; i++) { for (uint32_t i=0; i<MAX_SAMPLE_RATES; i++) {
result = ASIOCanSampleRate((ASIOSampleRate) SAMPLE_RATES[i]); result = ASIOCanSampleRate((ASIOSampleRate) SAMPLE_RATES[i]);
if (result == ASE_OK) { if (result == ASE_OK) {
info.sampleRates.push_back(SAMPLE_RATES[i]); info.sampleRates.pushBack(SAMPLE_RATES[i]);
} }
} }
// Determine supported data types ... just check first channel and assume rest are the same. // Determine supported data types ... just check first channel and assume rest are the same.
@ -173,19 +173,19 @@ rtaudio::DeviceInfo audio::orchestra::api::Asio::getDeviceInfo(uint32_t _device)
info.nativeFormats.clear(); info.nativeFormats.clear();
if ( channelInfo.type == ASIOSTInt16MSB if ( channelInfo.type == ASIOSTInt16MSB
|| channelInfo.type == ASIOSTInt16LSB) { || channelInfo.type == ASIOSTInt16LSB) {
info.nativeFormats.push_back(audio::format_int16); info.nativeFormats.pushBack(audio::format_int16);
} else if ( channelInfo.type == ASIOSTInt32MSB } else if ( channelInfo.type == ASIOSTInt32MSB
|| channelInfo.type == ASIOSTInt32LSB) { || channelInfo.type == ASIOSTInt32LSB) {
info.nativeFormats.push_back(audio::format_int32); info.nativeFormats.pushBack(audio::format_int32);
} else if ( channelInfo.type == ASIOSTFloat32MSB } else if ( channelInfo.type == ASIOSTFloat32MSB
|| channelInfo.type == ASIOSTFloat32LSB) { || channelInfo.type == ASIOSTFloat32LSB) {
info.nativeFormats.push_back(audio::format_float); info.nativeFormats.pushBack(audio::format_float);
} else if ( channelInfo.type == ASIOSTFloat64MSB } else if ( channelInfo.type == ASIOSTFloat64MSB
|| channelInfo.type == ASIOSTFloat64LSB) { || channelInfo.type == ASIOSTFloat64LSB) {
info.nativeFormats.push_back(audio::format_double); info.nativeFormats.pushBack(audio::format_double);
} else if ( channelInfo.type == ASIOSTInt24MSB } else if ( channelInfo.type == ASIOSTInt24MSB
|| channelInfo.type == ASIOSTInt24LSB) { || channelInfo.type == ASIOSTInt24LSB) {
info.nativeFormats.push_back(audio::format_int24); info.nativeFormats.pushBack(audio::format_int24);
} }
if (info.outputChannels > 0){ if (info.outputChannels > 0){
if (getDefaultOutputDevice() == _device) { if (getDefaultOutputDevice() == _device) {
@ -692,13 +692,13 @@ bool audio::orchestra::api::Asio::callbackEvent(long bufferIndex) {
// draining stream. // draining stream.
if (m_private->drainCounter == 0) { if (m_private->drainCounter == 0) {
audio::Time streamTime = getStreamTime(); audio::Time streamTime = getStreamTime();
std::vector<enum audio::orchestra::status status; etk::Vector<enum audio::orchestra::status status;
if (m_mode != audio::orchestra::mode_input && asioXRun == true) { if (m_mode != audio::orchestra::mode_input && asioXRun == true) {
status.push_back(audio::orchestra::status::underflow); status.pushBack(audio::orchestra::status::underflow);
asioXRun = false; asioXRun = false;
} }
if (m_mode != audio::orchestra::mode_output && asioXRun == true) { if (m_mode != audio::orchestra::mode_output && asioXRun == true) {
status.push_back(audio::orchestra::status::underflow; status.pushBack(audio::orchestra::status::underflow;
asioXRun = false; asioXRun = false;
} }
int32_t cbReturnValue = info->callback(m_userBuffer[1], int32_t cbReturnValue = info->callback(m_userBuffer[1],

View File

@ -17,7 +17,7 @@ namespace audio {
public: public:
Asio(); Asio();
virtual ~Asio(); virtual ~Asio();
const std::string& getCurrentApi() { const etk::String& getCurrentApi() {
return audio::orchestra::typeAsio; return audio::orchestra::typeAsio;
} }
uint32_t getDeviceCount(); uint32_t getDeviceCount();
@ -34,7 +34,7 @@ namespace audio {
bool callbackEvent(long _bufferIndex); bool callbackEvent(long _bufferIndex);
private: private:
ememory::SharedPtr<AsioPrivate> m_private; ememory::SharedPtr<AsioPrivate> m_private;
std::vector<audio::orchestra::DeviceInfo> m_devices; etk::Vector<audio::orchestra::DeviceInfo> m_devices;
void saveDeviceInfo(); void saveDeviceInfo();
bool m_coInitialized; bool m_coInitialized;
bool open(uint32_t _device, bool open(uint32_t _device,

View File

@ -247,7 +247,7 @@ audio::orchestra::DeviceInfo audio::orchestra::api::Core::getDeviceInfo(uint32_t
} }
//const char *mname = CFStringGetCStringPtr(cfname, CFStringGetSystemEncoding()); //const char *mname = CFStringGetCStringPtr(cfname, CFStringGetSystemEncoding());
int32_t length = CFStringGetLength(cfname); int32_t length = CFStringGetLength(cfname);
std::vector<char> name; etk::Vector<char> name;
name.resize(length * 3 + 1, '\0'); name.resize(length * 3 + 1, '\0');
CFStringGetCString(cfname, &name[0], length * 3 + 1, CFStringGetSystemEncoding()); CFStringGetCString(cfname, &name[0], length * 3 + 1, CFStringGetSystemEncoding());
info.name.append(&name[0], strlen(&name[0])); info.name.append(&name[0], strlen(&name[0]));
@ -302,7 +302,7 @@ audio::orchestra::DeviceInfo audio::orchestra::api::Core::getDeviceInfo(uint32_t
// Get channel information. // Get channel information.
for (size_t iii=0; iii<bufferList->mNumberBuffers; ++iii) { for (size_t iii=0; iii<bufferList->mNumberBuffers; ++iii) {
for (size_t jjj=0; jjj<bufferList->mBuffers[iii].mNumberChannels; ++jjj) { for (size_t jjj=0; jjj<bufferList->mBuffers[iii].mNumberChannels; ++jjj) {
info.channels.push_back(audio::channel_unknow); info.channels.pushBack(audio::channel_unknow);
} }
} }
free(bufferList); free(bufferList);
@ -344,7 +344,7 @@ audio::orchestra::DeviceInfo audio::orchestra::api::Core::getDeviceInfo(uint32_t
for (auto &it : audio::orchestra::genericSampleRate()) { for (auto &it : audio::orchestra::genericSampleRate()) {
if ( it >= minimumRate if ( it >= minimumRate
&& it <= maximumRate) { && it <= maximumRate) {
info.sampleRates.push_back(it); info.sampleRates.pushBack(it);
} }
} }
if (info.sampleRates.size() == 0) { if (info.sampleRates.size() == 0) {
@ -358,7 +358,7 @@ audio::orchestra::DeviceInfo audio::orchestra::api::Core::getDeviceInfo(uint32_t
// CoreAudio always uses 32-bit floating point data for PCM streams. // CoreAudio always uses 32-bit floating point data for PCM streams.
// Thus, any other "physical" formats supported by the device are of // Thus, any other "physical" formats supported by the device are of
// no interest to the client. // no interest to the client.
info.nativeFormats.push_back(audio::format_float); info.nativeFormats.pushBack(audio::format_float);
// ------------------------------------------------ // ------------------------------------------------
// Determine the default channel. // Determine the default channel.
// ------------------------------------------------ // ------------------------------------------------
@ -692,19 +692,19 @@ bool audio::orchestra::api::Core::open(uint32_t _device,
AudioStreamBasicDescription testDescription = description; AudioStreamBasicDescription testDescription = description;
uint32_t formatFlags; uint32_t formatFlags;
// We'll try higher bit rates first and then work our way down. // We'll try higher bit rates first and then work our way down.
std::vector< std::pair<uint32_t, uint32_t> > physicalFormats; etk::Vector< etk::Pair<uint32_t, uint32_t> > physicalFormats;
formatFlags = (description.mFormatFlags | kLinearPCMFormatFlagIsFloat) & ~kLinearPCMFormatFlagIsSignedInteger; formatFlags = (description.mFormatFlags | kLinearPCMFormatFlagIsFloat) & ~kLinearPCMFormatFlagIsSignedInteger;
physicalFormats.push_back(std::pair<float, uint32_t>(32, formatFlags)); physicalFormats.pushBack(etk::Pair<float, uint32_t>(32, formatFlags));
formatFlags = (description.mFormatFlags | kLinearPCMFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked) & ~kLinearPCMFormatFlagIsFloat; formatFlags = (description.mFormatFlags | kLinearPCMFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked) & ~kLinearPCMFormatFlagIsFloat;
physicalFormats.push_back(std::pair<float, uint32_t>(32, formatFlags)); physicalFormats.pushBack(etk::Pair<float, uint32_t>(32, formatFlags));
physicalFormats.push_back(std::pair<float, uint32_t>(24, formatFlags)); // 24-bit packed physicalFormats.pushBack(etk::Pair<float, uint32_t>(24, formatFlags)); // 24-bit packed
formatFlags &= ~(kAudioFormatFlagIsPacked | kAudioFormatFlagIsAlignedHigh); formatFlags &= ~(kAudioFormatFlagIsPacked | kAudioFormatFlagIsAlignedHigh);
physicalFormats.push_back(std::pair<float, uint32_t>(24.2, formatFlags)); // 24-bit in 4 bytes, aligned low physicalFormats.pushBack(etk::Pair<float, uint32_t>(24.2, formatFlags)); // 24-bit in 4 bytes, aligned low
formatFlags |= kAudioFormatFlagIsAlignedHigh; formatFlags |= kAudioFormatFlagIsAlignedHigh;
physicalFormats.push_back(std::pair<float, uint32_t>(24.4, formatFlags)); // 24-bit in 4 bytes, aligned high physicalFormats.pushBack(etk::Pair<float, uint32_t>(24.4, formatFlags)); // 24-bit in 4 bytes, aligned high
formatFlags = (description.mFormatFlags | kLinearPCMFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked) & ~kLinearPCMFormatFlagIsFloat; formatFlags = (description.mFormatFlags | kLinearPCMFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked) & ~kLinearPCMFormatFlagIsFloat;
physicalFormats.push_back(std::pair<float, uint32_t>(16, formatFlags)); physicalFormats.pushBack(etk::Pair<float, uint32_t>(16, formatFlags));
physicalFormats.push_back(std::pair<float, uint32_t>(8, formatFlags)); physicalFormats.pushBack(etk::Pair<float, uint32_t>(8, formatFlags));
bool setPhysicalFormat = false; bool setPhysicalFormat = false;
for(uint32_t i=0; i<physicalFormats.size(); i++) { for(uint32_t i=0; i<physicalFormats.size(); i++) {
testDescription = description; testDescription = description;
@ -1048,15 +1048,15 @@ bool audio::orchestra::api::Core::callbackEvent(AudioDeviceID _deviceId,
// draining stream or duplex mode AND the input/output devices are // draining stream or duplex mode AND the input/output devices are
// different AND this function is called for the input device. // different AND this function is called for the input device.
if (m_private->drainCounter == 0 && (m_mode != audio::orchestra::mode_duplex || _deviceId == outputDevice)) { if (m_private->drainCounter == 0 && (m_mode != audio::orchestra::mode_duplex || _deviceId == outputDevice)) {
std::vector<enum audio::orchestra::status> status; etk::Vector<enum audio::orchestra::status> status;
if ( m_mode != audio::orchestra::mode_input if ( m_mode != audio::orchestra::mode_input
&& m_private->xrun[0] == true) { && m_private->xrun[0] == true) {
status.push_back(audio::orchestra::status::underflow); status.pushBack(audio::orchestra::status::underflow);
m_private->xrun[0] = false; m_private->xrun[0] = false;
} }
if ( m_mode != audio::orchestra::mode_output if ( m_mode != audio::orchestra::mode_output
&& m_private->xrun[1] == true) { && m_private->xrun[1] == true) {
status.push_back(audio::orchestra::status::overflow); status.pushBack(audio::orchestra::status::overflow);
m_private->xrun[1] = false; m_private->xrun[1] = false;
} }
int32_t cbReturnValue = m_callback(&m_userBuffer[1][0], int32_t cbReturnValue = m_callback(&m_userBuffer[1][0],

View File

@ -20,7 +20,7 @@ namespace audio {
public: public:
Core(); Core();
virtual ~Core(); virtual ~Core();
const std::string& getCurrentApi() { const etk::String& getCurrentApi() {
return audio::orchestra::typeCoreOSX; return audio::orchestra::typeCoreOSX;
} }
uint32_t getDeviceCount(); uint32_t getDeviceCount();

View File

@ -17,7 +17,7 @@ namespace audio {
public: public:
CoreIos(); CoreIos();
virtual ~CoreIos(); virtual ~CoreIos();
const std::string& getCurrentApi() { const etk::String& getCurrentApi() {
return audio::orchestra::typeCoreIOS; return audio::orchestra::typeCoreIOS;
} }
uint32_t getDeviceCount(); uint32_t getDeviceCount();
@ -32,7 +32,7 @@ namespace audio {
// will most likely produce highly undesireable results! // will most likely produce highly undesireable results!
void callbackEvent(); void callbackEvent();
private: private:
std::vector<audio::orchestra::DeviceInfo> m_devices; etk::Vector<audio::orchestra::DeviceInfo> m_devices;
void saveDeviceInfo(); void saveDeviceInfo();
bool open(uint32_t _device, bool open(uint32_t _device,
audio::orchestra::mode _mode, audio::orchestra::mode _mode,

View File

@ -59,7 +59,7 @@ class DsDevice {
public: public:
LPGUID id; LPGUID id;
bool input; bool input;
std::string name; etk::String name;
DsDevice() : DsDevice() :
id(0), id(0),
input(false) { input(false) {
@ -83,7 +83,7 @@ namespace audio {
DWORD dsBufferSize[2]; DWORD dsBufferSize[2];
DWORD dsPointerLeadTime[2]; // the number of bytes ahead of the safe pointer to lead by. DWORD dsPointerLeadTime[2]; // the number of bytes ahead of the safe pointer to lead by.
HANDLE condition; HANDLE condition;
std::vector<DsDevice> dsDevices; etk::Vector<DsDevice> dsDevices;
DsPrivate() : DsPrivate() :
threadRunning(false), threadRunning(false),
drainCounter(0), drainCounter(0),
@ -107,7 +107,7 @@ static const char* getErrorString(int32_t _code);
struct DsProbeData { struct DsProbeData {
bool isInput; bool isInput;
std::vector<DsDevice>* dsDevices; etk::Vector<DsDevice>* dsDevices;
}; };
audio::orchestra::api::Ds::Ds() : audio::orchestra::api::Ds::Ds() :
@ -132,13 +132,13 @@ audio::orchestra::api::Ds::~Ds() {
#include "tchar.h" #include "tchar.h"
static std::string convertTChar(LPCTSTR _name) { static etk::String convertTChar(LPCTSTR _name) {
#if defined(UNICODE) || defined(_UNICODE) #if defined(UNICODE) || defined(_UNICODE)
int32_t length = WideCharToMultiByte(CP_UTF8, 0, _name, -1, nullptr, 0, nullptr, nullptr); int32_t length = WideCharToMultiByte(CP_UTF8, 0, _name, -1, nullptr, 0, nullptr, nullptr);
std::string s(length-1, '\0'); etk::String s(length-1, '\0');
WideCharToMultiByte(CP_UTF8, 0, _name, -1, &s[0], length, nullptr, nullptr); WideCharToMultiByte(CP_UTF8, 0, _name, -1, &s[0], length, nullptr, nullptr);
#else #else
std::string s(_name); etk::String s(_name);
#endif #endif
return s; return s;
} }
@ -148,7 +148,7 @@ static BOOL CALLBACK deviceQueryCallback(LPGUID _lpguid,
LPCTSTR _module, LPCTSTR _module,
LPVOID _lpContext) { LPVOID _lpContext) {
struct DsProbeData& probeInfo = *(struct DsProbeData*) _lpContext; struct DsProbeData& probeInfo = *(struct DsProbeData*) _lpContext;
std::vector<DsDevice>& dsDevices = *probeInfo.dsDevices; etk::Vector<DsDevice>& dsDevices = *probeInfo.dsDevices;
HRESULT hr; HRESULT hr;
bool validDevice = false; bool validDevice = false;
if (probeInfo.isInput == true) { if (probeInfo.isInput == true) {
@ -187,7 +187,7 @@ static BOOL CALLBACK deviceQueryCallback(LPGUID _lpguid,
return TRUE; return TRUE;
} }
// If good device, then save its name and guid. // If good device, then save its name and guid.
std::string name = convertTChar(_description); etk::String name = convertTChar(_description);
//if (name == "Primary Sound Driver" || name == "Primary Sound Capture Driver") //if (name == "Primary Sound Driver" || name == "Primary Sound Capture Driver")
if (_lpguid == nullptr) { if (_lpguid == nullptr) {
name = "Default Device"; name = "Default Device";
@ -196,7 +196,7 @@ static BOOL CALLBACK deviceQueryCallback(LPGUID _lpguid,
device.name = name; device.name = name;
device.input = probeInfo.isInput; device.input = probeInfo.isInput;
device.id = _lpguid; device.id = _lpguid;
dsDevices.push_back(device); dsDevices.pushBack(device);
return TRUE; return TRUE;
} }
@ -250,24 +250,24 @@ audio::orchestra::DeviceInfo audio::orchestra::api::Ds::getDeviceInfo(uint32_t _
} }
// Get output channel information. // Get output channel information.
if (outCaps.dwFlags & DSCAPS_PRIMARYSTEREO) { if (outCaps.dwFlags & DSCAPS_PRIMARYSTEREO) {
info.channels.push_back(audio::channel_unknow); info.channels.pushBack(audio::channel_unknow);
info.channels.push_back(audio::channel_unknow); info.channels.pushBack(audio::channel_unknow);
} else { } else {
info.channels.push_back(audio::channel_unknow); info.channels.pushBack(audio::channel_unknow);
} }
// Get sample rate information. // Get sample rate information.
for (auto &it : audio::orchestra::genericSampleRate()) { for (auto &it : audio::orchestra::genericSampleRate()) {
if ( it >= outCaps.dwMinSecondarySampleRate if ( it >= outCaps.dwMinSecondarySampleRate
&& it <= outCaps.dwMaxSecondarySampleRate) { && it <= outCaps.dwMaxSecondarySampleRate) {
info.sampleRates.push_back(it); info.sampleRates.pushBack(it);
} }
} }
// Get format information. // Get format information.
if (outCaps.dwFlags & DSCAPS_PRIMARY16BIT) { if (outCaps.dwFlags & DSCAPS_PRIMARY16BIT) {
info.nativeFormats.push_back(audio::format_int16); info.nativeFormats.pushBack(audio::format_int16);
} }
if (outCaps.dwFlags & DSCAPS_PRIMARY8BIT) { if (outCaps.dwFlags & DSCAPS_PRIMARY8BIT) {
info.nativeFormats.push_back(audio::format_int8); info.nativeFormats.pushBack(audio::format_int8);
} }
output->Release(); output->Release();
info.name = m_private->dsDevices[_device].name; info.name = m_private->dsDevices[_device].name;
@ -292,67 +292,67 @@ audio::orchestra::DeviceInfo audio::orchestra::api::Ds::getDeviceInfo(uint32_t _
} }
// Get input channel information. // Get input channel information.
for (int32_t iii=0; iii<inCaps.dwChannels; ++iii) { for (int32_t iii=0; iii<inCaps.dwChannels; ++iii) {
info.channels.push_back(audio::channel_unknow); info.channels.pushBack(audio::channel_unknow);
} }
// Get sample rate and format information. // Get sample rate and format information.
std::vector<uint32_t> rates; etk::Vector<uint32_t> rates;
if (inCaps.dwChannels >= 2) { if (inCaps.dwChannels >= 2) {
if ( (inCaps.dwFormats & WAVE_FORMAT_1S16) if ( (inCaps.dwFormats & WAVE_FORMAT_1S16)
|| (inCaps.dwFormats & WAVE_FORMAT_2S16) || (inCaps.dwFormats & WAVE_FORMAT_2S16)
|| (inCaps.dwFormats & WAVE_FORMAT_4S16) || (inCaps.dwFormats & WAVE_FORMAT_4S16)
|| (inCaps.dwFormats & WAVE_FORMAT_96S16) ) { || (inCaps.dwFormats & WAVE_FORMAT_96S16) ) {
info.nativeFormats.push_back(audio::format_int16); info.nativeFormats.pushBack(audio::format_int16);
} }
if ( (inCaps.dwFormats & WAVE_FORMAT_1S08) if ( (inCaps.dwFormats & WAVE_FORMAT_1S08)
|| (inCaps.dwFormats & WAVE_FORMAT_2S08) || (inCaps.dwFormats & WAVE_FORMAT_2S08)
|| (inCaps.dwFormats & WAVE_FORMAT_4S08) || (inCaps.dwFormats & WAVE_FORMAT_4S08)
|| (inCaps.dwFormats & WAVE_FORMAT_96S08) ) { || (inCaps.dwFormats & WAVE_FORMAT_96S08) ) {
info.nativeFormats.push_back(audio::format_int8); info.nativeFormats.pushBack(audio::format_int8);
} }
if ( (inCaps.dwFormats & WAVE_FORMAT_1S16) if ( (inCaps.dwFormats & WAVE_FORMAT_1S16)
|| (inCaps.dwFormats & WAVE_FORMAT_1S08) ){ || (inCaps.dwFormats & WAVE_FORMAT_1S08) ){
rates.push_back(11025); rates.pushBack(11025);
} }
if ( (inCaps.dwFormats & WAVE_FORMAT_2S16) if ( (inCaps.dwFormats & WAVE_FORMAT_2S16)
|| (inCaps.dwFormats & WAVE_FORMAT_2S08) ){ || (inCaps.dwFormats & WAVE_FORMAT_2S08) ){
rates.push_back(22050); rates.pushBack(22050);
} }
if ( (inCaps.dwFormats & WAVE_FORMAT_4S16) if ( (inCaps.dwFormats & WAVE_FORMAT_4S16)
|| (inCaps.dwFormats & WAVE_FORMAT_4S08) ){ || (inCaps.dwFormats & WAVE_FORMAT_4S08) ){
rates.push_back(44100); rates.pushBack(44100);
} }
if ( (inCaps.dwFormats & WAVE_FORMAT_96S16) if ( (inCaps.dwFormats & WAVE_FORMAT_96S16)
|| (inCaps.dwFormats & WAVE_FORMAT_96S08) ){ || (inCaps.dwFormats & WAVE_FORMAT_96S08) ){
rates.push_back(96000); rates.pushBack(96000);
} }
} else if (inCaps.dwChannels == 1) { } else if (inCaps.dwChannels == 1) {
if ( (inCaps.dwFormats & WAVE_FORMAT_1M16) if ( (inCaps.dwFormats & WAVE_FORMAT_1M16)
|| (inCaps.dwFormats & WAVE_FORMAT_2M16) || (inCaps.dwFormats & WAVE_FORMAT_2M16)
|| (inCaps.dwFormats & WAVE_FORMAT_4M16) || (inCaps.dwFormats & WAVE_FORMAT_4M16)
|| (inCaps.dwFormats & WAVE_FORMAT_96M16) ) { || (inCaps.dwFormats & WAVE_FORMAT_96M16) ) {
info.nativeFormats.push_back(audio::format_int16); info.nativeFormats.pushBack(audio::format_int16);
} }
if ( (inCaps.dwFormats & WAVE_FORMAT_1M08) if ( (inCaps.dwFormats & WAVE_FORMAT_1M08)
|| (inCaps.dwFormats & WAVE_FORMAT_2M08) || (inCaps.dwFormats & WAVE_FORMAT_2M08)
|| (inCaps.dwFormats & WAVE_FORMAT_4M08) || (inCaps.dwFormats & WAVE_FORMAT_4M08)
|| (inCaps.dwFormats & WAVE_FORMAT_96M08) ) { || (inCaps.dwFormats & WAVE_FORMAT_96M08) ) {
info.nativeFormats.push_back(audio::format_int8); info.nativeFormats.pushBack(audio::format_int8);
} }
if ( (inCaps.dwFormats & WAVE_FORMAT_1M16) if ( (inCaps.dwFormats & WAVE_FORMAT_1M16)
|| (inCaps.dwFormats & WAVE_FORMAT_1M08) ){ || (inCaps.dwFormats & WAVE_FORMAT_1M08) ){
rates.push_back(11025); rates.pushBack(11025);
} }
if ( (inCaps.dwFormats & WAVE_FORMAT_2M16) if ( (inCaps.dwFormats & WAVE_FORMAT_2M16)
|| (inCaps.dwFormats & WAVE_FORMAT_2M08) ){ || (inCaps.dwFormats & WAVE_FORMAT_2M08) ){
rates.push_back(22050); rates.pushBack(22050);
} }
if ( (inCaps.dwFormats & WAVE_FORMAT_4M16) if ( (inCaps.dwFormats & WAVE_FORMAT_4M16)
|| (inCaps.dwFormats & WAVE_FORMAT_4M08) ){ || (inCaps.dwFormats & WAVE_FORMAT_4M08) ){
rates.push_back(44100); rates.pushBack(44100);
} }
if ( (inCaps.dwFormats & WAVE_FORMAT_96M16) if ( (inCaps.dwFormats & WAVE_FORMAT_96M16)
|| (inCaps.dwFormats & WAVE_FORMAT_96M08) ){ || (inCaps.dwFormats & WAVE_FORMAT_96M08) ){
rates.push_back(96000); rates.pushBack(96000);
} }
} else { } else {
// technically, this would be an error // technically, this would be an error
@ -374,7 +374,7 @@ audio::orchestra::DeviceInfo audio::orchestra::api::Ds::getDeviceInfo(uint32_t _
} }
} }
if (found == false) { if (found == false) {
info.sampleRates.push_back(rates[i]); info.sampleRates.pushBack(rates[i]);
} }
} }
std::sort(info.sampleRates.begin(), info.sampleRates.end()); std::sort(info.sampleRates.begin(), info.sampleRates.end());
@ -763,7 +763,7 @@ bool audio::orchestra::api::Ds::open(uint32_t _device,
if (m_private->threadRunning == false) { if (m_private->threadRunning == false) {
m_private->threadRunning = true; m_private->threadRunning = true;
ememory::SharedPtr<std::thread> tmpThread(new std::thread(&audio::orchestra::api::Ds::dsCallbackEvent, this)); ememory::SharedPtr<std::thread> tmpThread(new std::thread(&audio::orchestra::api::Ds::dsCallbackEvent, this));
m_private->thread = std::move(tmpThread); m_private->thread = etk::move(tmpThread);
if (m_private->thread == nullptr) { if (m_private->thread == nullptr) {
ATA_ERROR("error creating callback thread!"); ATA_ERROR("error creating callback thread!");
goto error; goto error;
@ -1009,15 +1009,15 @@ void audio::orchestra::api::Ds::callbackEvent() {
// draining stream. // draining stream.
if (m_private->drainCounter == 0) { if (m_private->drainCounter == 0) {
audio::Time streamTime = getStreamTime(); audio::Time streamTime = getStreamTime();
std::vector<audio::orchestra::status> status; etk::Vector<audio::orchestra::status> status;
if ( m_mode != audio::orchestra::mode_input if ( m_mode != audio::orchestra::mode_input
&& m_private->xrun[0] == true) { && m_private->xrun[0] == true) {
status.push_back(audio::orchestra::status::underflow); status.pushBack(audio::orchestra::status::underflow);
m_private->xrun[0] = false; m_private->xrun[0] = false;
} }
if ( m_mode != audio::orchestra::mode_output if ( m_mode != audio::orchestra::mode_output
&& m_private->xrun[1] == true) { && m_private->xrun[1] == true) {
status.push_back(audio::orchestra::status::overflow); status.pushBack(audio::orchestra::status::overflow);
m_private->xrun[1] = false; m_private->xrun[1] = false;
} }
int32_t cbReturnValue = m_callback(&m_userBuffer[1][0], int32_t cbReturnValue = m_callback(&m_userBuffer[1][0],

View File

@ -17,7 +17,7 @@ namespace audio {
public: public:
Ds(); Ds();
virtual ~Ds(); virtual ~Ds();
const std::string& getCurrentApi() { const etk::String& getCurrentApi() {
return audio::orchestra::typeDs; return audio::orchestra::typeDs;
} }
uint32_t getDeviceCount(); uint32_t getDeviceCount();

View File

@ -18,7 +18,7 @@ namespace audio {
static ememory::SharedPtr<audio::orchestra::Api> create(); static ememory::SharedPtr<audio::orchestra::Api> create();
public: public:
Dummy(); Dummy();
const std::string& getCurrentApi() { const etk::String& getCurrentApi() {
return audio::orchestra::typeDummy; return audio::orchestra::typeDummy;
} }
uint32_t getDeviceCount(); uint32_t getDeviceCount();

View File

@ -63,7 +63,7 @@ namespace audio {
public: public:
jack_client_t *client; jack_client_t *client;
jack_port_t **ports[2]; jack_port_t **ports[2];
std::string deviceName[2]; etk::String deviceName[2];
bool xrun[2]; bool xrun[2];
std::condition_variable condition; std::condition_variable condition;
int32_t drainCounter; // Tracks callback counts when draining int32_t drainCounter; // Tracks callback counts when draining
@ -103,7 +103,7 @@ uint32_t audio::orchestra::api::Jack::getDeviceCount() {
return 0; return 0;
} }
const char **ports; const char **ports;
std::string port, previousPort; etk::String port, previousPort;
uint32_t nChannels = 0, nDevices = 0; uint32_t nChannels = 0, nDevices = 0;
ports = jack_get_ports(client, nullptr, nullptr, 0); ports = jack_get_ports(client, nullptr, nullptr, 0);
if (ports) { if (ports) {
@ -112,7 +112,7 @@ uint32_t audio::orchestra::api::Jack::getDeviceCount() {
do { do {
port = (char *) ports[ nChannels ]; port = (char *) ports[ nChannels ];
iColon = port.find(":"); iColon = port.find(":");
if (iColon != std::string::npos) { if (iColon != etk::String::npos) {
port = port.substr(0, iColon + 1); port = port.substr(0, iColon + 1);
if (port != previousPort) { if (port != previousPort) {
nDevices++; nDevices++;
@ -138,7 +138,7 @@ audio::orchestra::DeviceInfo audio::orchestra::api::Jack::getDeviceInfo(uint32_t
return info; return info;
} }
const char **ports; const char **ports;
std::string port, previousPort; etk::String port, previousPort;
uint32_t nPorts = 0, nDevices = 0; uint32_t nPorts = 0, nDevices = 0;
ports = jack_get_ports(client, nullptr, nullptr, 0); ports = jack_get_ports(client, nullptr, nullptr, 0);
int32_t deviceID = _device/2; int32_t deviceID = _device/2;
@ -149,7 +149,7 @@ audio::orchestra::DeviceInfo audio::orchestra::api::Jack::getDeviceInfo(uint32_t
do { do {
port = (char *) ports[nPorts]; port = (char *) ports[nPorts];
iColon = port.find(":"); iColon = port.find(":");
if (iColon != std::string::npos) { if (iColon != etk::String::npos) {
port = port.substr(0, iColon); port = port.substr(0, iColon);
if (port != previousPort) { if (port != previousPort) {
if (nDevices == deviceID) { if (nDevices == deviceID) {
@ -170,14 +170,14 @@ audio::orchestra::DeviceInfo audio::orchestra::api::Jack::getDeviceInfo(uint32_t
} }
// Get the current jack server sample rate. // Get the current jack server sample rate.
info.sampleRates.clear(); info.sampleRates.clear();
info.sampleRates.push_back(jack_get_sample_rate(client)); info.sampleRates.pushBack(jack_get_sample_rate(client));
if (info.input == true) { if (info.input == true) {
ports = jack_get_ports(client, info.name.c_str(), nullptr, JackPortIsOutput); ports = jack_get_ports(client, info.name.c_str(), nullptr, JackPortIsOutput);
if (ports) { if (ports) {
int32_t iii=0; int32_t iii=0;
while (ports[iii]) { while (ports[iii]) {
ATA_ERROR(" ploppp='" << ports[iii] << "'"); ATA_ERROR(" ploppp='" << ports[iii] << "'");
info.channels.push_back(audio::channel_unknow); info.channels.pushBack(audio::channel_unknow);
iii++; iii++;
} }
free(ports); free(ports);
@ -188,7 +188,7 @@ audio::orchestra::DeviceInfo audio::orchestra::api::Jack::getDeviceInfo(uint32_t
int32_t iii=0; int32_t iii=0;
while (ports[iii]) { while (ports[iii]) {
ATA_ERROR(" ploppp='" << ports[iii] << "'"); ATA_ERROR(" ploppp='" << ports[iii] << "'");
info.channels.push_back(audio::channel_unknow); info.channels.pushBack(audio::channel_unknow);
iii++; iii++;
} }
free(ports); free(ports);
@ -202,7 +202,7 @@ audio::orchestra::DeviceInfo audio::orchestra::api::Jack::getDeviceInfo(uint32_t
return info; return info;
} }
// Jack always uses 32-bit floats. // Jack always uses 32-bit floats.
info.nativeFormats.push_back(audio::format_float); info.nativeFormats.pushBack(audio::format_float);
// Jack doesn't provide default devices so we'll use the first available one. // Jack doesn't provide default devices so we'll use the first available one.
if (deviceID == 0) { if (deviceID == 0) {
info.isDefault = true; info.isDefault = true;
@ -287,7 +287,7 @@ bool audio::orchestra::api::Jack::open(uint32_t _device,
client = m_private->client; client = m_private->client;
} }
const char **ports; const char **ports;
std::string port, previousPort, deviceName; etk::String port, previousPort, deviceName;
uint32_t nPorts = 0, nDevices = 0; uint32_t nPorts = 0, nDevices = 0;
int32_t deviceID = _device/2; int32_t deviceID = _device/2;
bool isInput = _device%2==0?true:false; bool isInput = _device%2==0?true:false;
@ -298,7 +298,7 @@ bool audio::orchestra::api::Jack::open(uint32_t _device,
do { do {
port = (char *) ports[ nPorts ]; port = (char *) ports[ nPorts ];
iColon = port.find(":"); iColon = port.find(":");
if (iColon != std::string::npos) { if (iColon != etk::String::npos) {
port = port.substr(0, iColon); port = port.substr(0, iColon);
if (port != previousPort) { if (port != previousPort) {
if (nDevices == deviceID) { if (nDevices == deviceID) {
@ -655,13 +655,13 @@ bool audio::orchestra::api::Jack::callbackEvent(uint64_t _nframes) {
// Invoke user callback first, to get fresh output data. // Invoke user callback first, to get fresh output data.
if (m_private->drainCounter == 0) { if (m_private->drainCounter == 0) {
audio::Time streamTime = getStreamTime(); audio::Time streamTime = getStreamTime();
std::vector<enum audio::orchestra::status> status; etk::Vector<enum audio::orchestra::status> status;
if (m_mode != audio::orchestra::mode_input && m_private->xrun[0] == true) { if (m_mode != audio::orchestra::mode_input && m_private->xrun[0] == true) {
status.push_back(audio::orchestra::status::underflow); status.pushBack(audio::orchestra::status::underflow);
m_private->xrun[0] = false; m_private->xrun[0] = false;
} }
if (m_mode != audio::orchestra::mode_output && m_private->xrun[1] == true) { if (m_mode != audio::orchestra::mode_output && m_private->xrun[1] == true) {
status.push_back(audio::orchestra::status::overflow); status.pushBack(audio::orchestra::status::overflow);
m_private->xrun[1] = false; m_private->xrun[1] = false;
} }
int32_t cbReturnValue = m_callback(&m_userBuffer[1][0], int32_t cbReturnValue = m_callback(&m_userBuffer[1][0],

View File

@ -19,7 +19,7 @@ namespace audio {
public: public:
Jack(); Jack();
virtual ~Jack(); virtual ~Jack();
const std::string& getCurrentApi() { const etk::String& getCurrentApi() {
return audio::orchestra::typeJack; return audio::orchestra::typeJack;
} }
uint32_t getDeviceCount(); uint32_t getDeviceCount();

View File

@ -80,7 +80,7 @@ audio::orchestra::api::Pulse::~Pulse() {
uint32_t audio::orchestra::api::Pulse::getDeviceCount() { uint32_t audio::orchestra::api::Pulse::getDeviceCount() {
#if 1 #if 1
std::vector<audio::orchestra::DeviceInfo> list = audio::orchestra::api::pulse::getDeviceList(); etk::Vector<audio::orchestra::DeviceInfo> list = audio::orchestra::api::pulse::getDeviceList();
return list.size(); return list.size();
#else #else
return 1; return 1;
@ -88,7 +88,7 @@ uint32_t audio::orchestra::api::Pulse::getDeviceCount() {
} }
audio::orchestra::DeviceInfo audio::orchestra::api::Pulse::getDeviceInfo(uint32_t _device) { audio::orchestra::DeviceInfo audio::orchestra::api::Pulse::getDeviceInfo(uint32_t _device) {
std::vector<audio::orchestra::DeviceInfo> list = audio::orchestra::api::pulse::getDeviceList(); etk::Vector<audio::orchestra::DeviceInfo> list = audio::orchestra::api::pulse::getDeviceList();
if (_device >= list.size()) { if (_device >= list.size()) {
ATA_ERROR("Request device out of IDs:" << _device << " >= " << list.size()); ATA_ERROR("Request device out of IDs:" << _device << " >= " << list.size());
return audio::orchestra::DeviceInfo(); return audio::orchestra::DeviceInfo();
@ -145,7 +145,7 @@ void audio::orchestra::api::Pulse::callbackEventOneCycle() {
return; return;
} }
audio::Time streamTime = getStreamTime(); audio::Time streamTime = getStreamTime();
std::vector<enum audio::orchestra::status> status; etk::Vector<enum audio::orchestra::status> status;
int32_t doStopStream = m_callback(&m_userBuffer[audio::orchestra::modeToIdTable(audio::orchestra::mode_input)][0], int32_t doStopStream = m_callback(&m_userBuffer[audio::orchestra::modeToIdTable(audio::orchestra::mode_input)][0],
streamTime, streamTime,
&m_userBuffer[audio::orchestra::modeToIdTable(audio::orchestra::mode_output)][0], &m_userBuffer[audio::orchestra::modeToIdTable(audio::orchestra::mode_output)][0],

View File

@ -17,7 +17,7 @@ namespace audio {
public: public:
Pulse(); Pulse();
virtual ~Pulse(); virtual ~Pulse();
const std::string& getCurrentApi() { const etk::String& getCurrentApi() {
return audio::orchestra::typePulse; return audio::orchestra::typePulse;
} }
uint32_t getDeviceCount(); uint32_t getDeviceCount();
@ -34,7 +34,7 @@ namespace audio {
void callbackEvent(); void callbackEvent();
private: private:
ememory::SharedPtr<PulsePrivate> m_private; ememory::SharedPtr<PulsePrivate> m_private;
std::vector<audio::orchestra::DeviceInfo> m_devices; etk::Vector<audio::orchestra::DeviceInfo> m_devices;
void saveDeviceInfo(); void saveDeviceInfo();
bool open(uint32_t _device, bool open(uint32_t _device,
audio::orchestra::mode _mode, audio::orchestra::mode _mode,

View File

@ -105,101 +105,101 @@ static audio::format getFormatFromPulseFormat(enum pa_sample_format _format) {
return audio::format_unknow; return audio::format_unknow;
} }
static std::vector<audio::channel> getChannelOrderFromPulseChannel(const struct pa_channel_map& _map) { static etk::Vector<audio::channel> getChannelOrderFromPulseChannel(const struct pa_channel_map& _map) {
std::vector<audio::channel> out; etk::Vector<audio::channel> out;
for (int32_t iii=0; iii<_map.channels; ++iii) { for (int32_t iii=0; iii<_map.channels; ++iii) {
switch(_map.map[iii]) { switch(_map.map[iii]) {
default: default:
case PA_CHANNEL_POSITION_MAX: case PA_CHANNEL_POSITION_MAX:
case PA_CHANNEL_POSITION_INVALID: case PA_CHANNEL_POSITION_INVALID:
out.push_back(audio::channel_unknow); out.pushBack(audio::channel_unknow);
break; break;
case PA_CHANNEL_POSITION_MONO: case PA_CHANNEL_POSITION_MONO:
case PA_CHANNEL_POSITION_FRONT_CENTER: case PA_CHANNEL_POSITION_FRONT_CENTER:
out.push_back(audio::channel_frontCenter); out.pushBack(audio::channel_frontCenter);
break; break;
case PA_CHANNEL_POSITION_FRONT_LEFT: case PA_CHANNEL_POSITION_FRONT_LEFT:
out.push_back(audio::channel_frontLeft); out.pushBack(audio::channel_frontLeft);
break; break;
case PA_CHANNEL_POSITION_FRONT_RIGHT: case PA_CHANNEL_POSITION_FRONT_RIGHT:
out.push_back(audio::channel_frontRight); out.pushBack(audio::channel_frontRight);
break; break;
case PA_CHANNEL_POSITION_REAR_CENTER: case PA_CHANNEL_POSITION_REAR_CENTER:
out.push_back(audio::channel_rearCenter); out.pushBack(audio::channel_rearCenter);
break; break;
case PA_CHANNEL_POSITION_REAR_LEFT: case PA_CHANNEL_POSITION_REAR_LEFT:
out.push_back(audio::channel_rearLeft); out.pushBack(audio::channel_rearLeft);
break; break;
case PA_CHANNEL_POSITION_REAR_RIGHT: case PA_CHANNEL_POSITION_REAR_RIGHT:
out.push_back(audio::channel_rearRight); out.pushBack(audio::channel_rearRight);
break; break;
case PA_CHANNEL_POSITION_LFE: case PA_CHANNEL_POSITION_LFE:
out.push_back(audio::channel_lfe); out.pushBack(audio::channel_lfe);
break; break;
case PA_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER: case PA_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER:
out.push_back(audio::channel_centerLeft); out.pushBack(audio::channel_centerLeft);
break; break;
case PA_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER: case PA_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER:
out.push_back(audio::channel_centerRight); out.pushBack(audio::channel_centerRight);
break; break;
case PA_CHANNEL_POSITION_SIDE_LEFT: case PA_CHANNEL_POSITION_SIDE_LEFT:
out.push_back(audio::channel_topCenterLeft); out.pushBack(audio::channel_topCenterLeft);
break; break;
case PA_CHANNEL_POSITION_SIDE_RIGHT: case PA_CHANNEL_POSITION_SIDE_RIGHT:
out.push_back(audio::channel_topCenterRight); out.pushBack(audio::channel_topCenterRight);
break; break;
case PA_CHANNEL_POSITION_TOP_CENTER: case PA_CHANNEL_POSITION_TOP_CENTER:
case PA_CHANNEL_POSITION_TOP_FRONT_CENTER: case PA_CHANNEL_POSITION_TOP_FRONT_CENTER:
out.push_back(audio::channel_topFrontCenter); out.pushBack(audio::channel_topFrontCenter);
break; break;
case PA_CHANNEL_POSITION_TOP_FRONT_LEFT: case PA_CHANNEL_POSITION_TOP_FRONT_LEFT:
out.push_back(audio::channel_topFrontLeft); out.pushBack(audio::channel_topFrontLeft);
break; break;
case PA_CHANNEL_POSITION_TOP_FRONT_RIGHT: case PA_CHANNEL_POSITION_TOP_FRONT_RIGHT:
out.push_back(audio::channel_topFrontRight); out.pushBack(audio::channel_topFrontRight);
break; break;
case PA_CHANNEL_POSITION_TOP_REAR_LEFT: case PA_CHANNEL_POSITION_TOP_REAR_LEFT:
out.push_back(audio::channel_topRearLeft); out.pushBack(audio::channel_topRearLeft);
break; break;
case PA_CHANNEL_POSITION_TOP_REAR_RIGHT: case PA_CHANNEL_POSITION_TOP_REAR_RIGHT:
out.push_back(audio::channel_topRearRight); out.pushBack(audio::channel_topRearRight);
break; break;
case PA_CHANNEL_POSITION_TOP_REAR_CENTER: case PA_CHANNEL_POSITION_TOP_REAR_CENTER:
out.push_back(audio::channel_topRearCenter); out.pushBack(audio::channel_topRearCenter);
break; break;
case PA_CHANNEL_POSITION_AUX0: out.push_back(audio::channel_aux0); break; case PA_CHANNEL_POSITION_AUX0: out.pushBack(audio::channel_aux0); break;
case PA_CHANNEL_POSITION_AUX1: out.push_back(audio::channel_aux1); break; case PA_CHANNEL_POSITION_AUX1: out.pushBack(audio::channel_aux1); break;
case PA_CHANNEL_POSITION_AUX2: out.push_back(audio::channel_aux2); break; case PA_CHANNEL_POSITION_AUX2: out.pushBack(audio::channel_aux2); break;
case PA_CHANNEL_POSITION_AUX3: out.push_back(audio::channel_aux3); break; case PA_CHANNEL_POSITION_AUX3: out.pushBack(audio::channel_aux3); break;
case PA_CHANNEL_POSITION_AUX4: out.push_back(audio::channel_aux4); break; case PA_CHANNEL_POSITION_AUX4: out.pushBack(audio::channel_aux4); break;
case PA_CHANNEL_POSITION_AUX5: out.push_back(audio::channel_aux5); break; case PA_CHANNEL_POSITION_AUX5: out.pushBack(audio::channel_aux5); break;
case PA_CHANNEL_POSITION_AUX6: out.push_back(audio::channel_aux6); break; case PA_CHANNEL_POSITION_AUX6: out.pushBack(audio::channel_aux6); break;
case PA_CHANNEL_POSITION_AUX7: out.push_back(audio::channel_aux7); break; case PA_CHANNEL_POSITION_AUX7: out.pushBack(audio::channel_aux7); break;
case PA_CHANNEL_POSITION_AUX8: out.push_back(audio::channel_aux8); break; case PA_CHANNEL_POSITION_AUX8: out.pushBack(audio::channel_aux8); break;
case PA_CHANNEL_POSITION_AUX9: out.push_back(audio::channel_aux9); break; case PA_CHANNEL_POSITION_AUX9: out.pushBack(audio::channel_aux9); break;
case PA_CHANNEL_POSITION_AUX10: out.push_back(audio::channel_aux10); break; case PA_CHANNEL_POSITION_AUX10: out.pushBack(audio::channel_aux10); break;
case PA_CHANNEL_POSITION_AUX11: out.push_back(audio::channel_aux11); break; case PA_CHANNEL_POSITION_AUX11: out.pushBack(audio::channel_aux11); break;
case PA_CHANNEL_POSITION_AUX12: out.push_back(audio::channel_aux12); break; case PA_CHANNEL_POSITION_AUX12: out.pushBack(audio::channel_aux12); break;
case PA_CHANNEL_POSITION_AUX13: out.push_back(audio::channel_aux13); break; case PA_CHANNEL_POSITION_AUX13: out.pushBack(audio::channel_aux13); break;
case PA_CHANNEL_POSITION_AUX14: out.push_back(audio::channel_aux14); break; case PA_CHANNEL_POSITION_AUX14: out.pushBack(audio::channel_aux14); break;
case PA_CHANNEL_POSITION_AUX15: out.push_back(audio::channel_aux15); break; case PA_CHANNEL_POSITION_AUX15: out.pushBack(audio::channel_aux15); break;
case PA_CHANNEL_POSITION_AUX16: out.push_back(audio::channel_aux16); break; case PA_CHANNEL_POSITION_AUX16: out.pushBack(audio::channel_aux16); break;
case PA_CHANNEL_POSITION_AUX17: out.push_back(audio::channel_aux17); break; case PA_CHANNEL_POSITION_AUX17: out.pushBack(audio::channel_aux17); break;
case PA_CHANNEL_POSITION_AUX18: out.push_back(audio::channel_aux18); break; case PA_CHANNEL_POSITION_AUX18: out.pushBack(audio::channel_aux18); break;
case PA_CHANNEL_POSITION_AUX19: out.push_back(audio::channel_aux19); break; case PA_CHANNEL_POSITION_AUX19: out.pushBack(audio::channel_aux19); break;
case PA_CHANNEL_POSITION_AUX20: out.push_back(audio::channel_aux20); break; case PA_CHANNEL_POSITION_AUX20: out.pushBack(audio::channel_aux20); break;
case PA_CHANNEL_POSITION_AUX21: out.push_back(audio::channel_aux21); break; case PA_CHANNEL_POSITION_AUX21: out.pushBack(audio::channel_aux21); break;
case PA_CHANNEL_POSITION_AUX22: out.push_back(audio::channel_aux22); break; case PA_CHANNEL_POSITION_AUX22: out.pushBack(audio::channel_aux22); break;
case PA_CHANNEL_POSITION_AUX23: out.push_back(audio::channel_aux23); break; case PA_CHANNEL_POSITION_AUX23: out.pushBack(audio::channel_aux23); break;
case PA_CHANNEL_POSITION_AUX24: out.push_back(audio::channel_aux24); break; case PA_CHANNEL_POSITION_AUX24: out.pushBack(audio::channel_aux24); break;
case PA_CHANNEL_POSITION_AUX25: out.push_back(audio::channel_aux25); break; case PA_CHANNEL_POSITION_AUX25: out.pushBack(audio::channel_aux25); break;
case PA_CHANNEL_POSITION_AUX26: out.push_back(audio::channel_aux26); break; case PA_CHANNEL_POSITION_AUX26: out.pushBack(audio::channel_aux26); break;
case PA_CHANNEL_POSITION_AUX27: out.push_back(audio::channel_aux27); break; case PA_CHANNEL_POSITION_AUX27: out.pushBack(audio::channel_aux27); break;
case PA_CHANNEL_POSITION_AUX28: out.push_back(audio::channel_aux28); break; case PA_CHANNEL_POSITION_AUX28: out.pushBack(audio::channel_aux28); break;
case PA_CHANNEL_POSITION_AUX29: out.push_back(audio::channel_aux29); break; case PA_CHANNEL_POSITION_AUX29: out.pushBack(audio::channel_aux29); break;
case PA_CHANNEL_POSITION_AUX30: out.push_back(audio::channel_aux30); break; case PA_CHANNEL_POSITION_AUX30: out.pushBack(audio::channel_aux30); break;
case PA_CHANNEL_POSITION_AUX31: out.push_back(audio::channel_aux31); break; case PA_CHANNEL_POSITION_AUX31: out.pushBack(audio::channel_aux31); break;
} }
} }
@ -207,7 +207,7 @@ static std::vector<audio::channel> getChannelOrderFromPulseChannel(const struct
} }
// Callback on getting data from pulseaudio: // Callback on getting data from pulseaudio:
static void callbackGetSinkList(pa_context* _contex, const pa_sink_info* _info, int _eol, void* _userdata) { static void callbackGetSinkList(pa_context* _contex, const pa_sink_info* _info, int _eol, void* _userdata) {
std::vector<audio::orchestra::DeviceInfo>* list = static_cast<std::vector<audio::orchestra::DeviceInfo>*>(_userdata); etk::Vector<audio::orchestra::DeviceInfo>* list = static_cast<etk::Vector<audio::orchestra::DeviceInfo>*>(_userdata);
// If eol is set to a positive number, you're at the end of the list // If eol is set to a positive number, you're at the end of the list
if (_eol > 0) { if (_eol > 0) {
return; return;
@ -217,17 +217,17 @@ static void callbackGetSinkList(pa_context* _contex, const pa_sink_info* _info,
info.input = false; info.input = false;
info.name = _info->name; info.name = _info->name;
info.desc = _info->description; info.desc = _info->description;
info.sampleRates.push_back(_info->sample_spec.rate); info.sampleRates.pushBack(_info->sample_spec.rate);
info.nativeFormats.push_back(getFormatFromPulseFormat(_info->sample_spec.format)); info.nativeFormats.pushBack(getFormatFromPulseFormat(_info->sample_spec.format));
info.channels = getChannelOrderFromPulseChannel(_info->channel_map); info.channels = getChannelOrderFromPulseChannel(_info->channel_map);
ATA_VERBOSE("plop=" << _info->index << " " << _info->name); ATA_VERBOSE("plop=" << _info->index << " " << _info->name);
//ATA_DEBUG(" ports=" << _info->n_ports); //ATA_DEBUG(" ports=" << _info->n_ports);
list->push_back(info); list->pushBack(info);
} }
// allback to get data from pulseaudio: // allback to get data from pulseaudio:
static void callbackGetSourceList(pa_context* _contex, const pa_source_info* _info, int _eol, void* _userdata) { static void callbackGetSourceList(pa_context* _contex, const pa_source_info* _info, int _eol, void* _userdata) {
std::vector<audio::orchestra::DeviceInfo>* list = static_cast<std::vector<audio::orchestra::DeviceInfo>*>(_userdata); etk::Vector<audio::orchestra::DeviceInfo>* list = static_cast<etk::Vector<audio::orchestra::DeviceInfo>*>(_userdata);
if (_eol > 0) { if (_eol > 0) {
return; return;
} }
@ -236,18 +236,18 @@ static void callbackGetSourceList(pa_context* _contex, const pa_source_info* _in
info.input = true; info.input = true;
info.name = _info->name; info.name = _info->name;
info.desc = _info->description; info.desc = _info->description;
info.sampleRates.push_back(_info->sample_spec.rate); info.sampleRates.pushBack(_info->sample_spec.rate);
info.nativeFormats.push_back(getFormatFromPulseFormat(_info->sample_spec.format)); info.nativeFormats.pushBack(getFormatFromPulseFormat(_info->sample_spec.format));
info.channels = getChannelOrderFromPulseChannel(_info->channel_map); info.channels = getChannelOrderFromPulseChannel(_info->channel_map);
ATA_VERBOSE("plop=" << _info->index << " " << _info->name); ATA_VERBOSE("plop=" << _info->index << " " << _info->name);
list->push_back(info); list->pushBack(info);
} }
// to not update all the time ... // to not update all the time ...
static std::vector<audio::orchestra::DeviceInfo> pulseAudioListOfDevice; static etk::Vector<audio::orchestra::DeviceInfo> pulseAudioListOfDevice;
static audio::Time pulseAudioListOfDeviceTime; static audio::Time pulseAudioListOfDeviceTime;
std::vector<audio::orchestra::DeviceInfo> audio::orchestra::api::pulse::getDeviceList() { etk::Vector<audio::orchestra::DeviceInfo> audio::orchestra::api::pulse::getDeviceList() {
audio::Duration delta = audio::Time::now() - pulseAudioListOfDeviceTime; audio::Duration delta = audio::Time::now() - pulseAudioListOfDeviceTime;
if (delta < audio::Duration(30,0)) { if (delta < audio::Duration(30,0)) {
return pulseAudioListOfDevice; return pulseAudioListOfDevice;
@ -258,7 +258,7 @@ std::vector<audio::orchestra::DeviceInfo> audio::orchestra::api::pulse::getDevic
pa_operation* pulseAudioOperation; pa_operation* pulseAudioOperation;
pa_context* pulseAudioContex; pa_context* pulseAudioContex;
pa_context_flags_t pulseAudioFlags = PA_CONTEXT_NOAUTOSPAWN; pa_context_flags_t pulseAudioFlags = PA_CONTEXT_NOAUTOSPAWN;
std::vector<audio::orchestra::DeviceInfo>& out = pulseAudioListOfDevice; etk::Vector<audio::orchestra::DeviceInfo>& out = pulseAudioListOfDevice;
out.clear(); out.clear();
// We'll need these state variables to keep track of our requests // We'll need these state variables to keep track of our requests
int state = 0; int state = 0;

View File

@ -14,7 +14,7 @@ namespace audio {
namespace orchestra { namespace orchestra {
namespace api { namespace api {
namespace pulse { namespace pulse {
std::vector<audio::orchestra::DeviceInfo> getDeviceList(); etk::Vector<audio::orchestra::DeviceInfo> getDeviceList();
} }
} }
} }

View File

@ -20,7 +20,7 @@ int32_t audio::orchestra::modeToIdTable(enum mode _mode) {
return 0; return 0;
} }
std::ostream& audio::operator <<(std::ostream& _os, enum audio::orchestra::mode _obj) { etk::Stream& audio::operator <<(etk::Stream& _os, enum audio::orchestra::mode _obj) {
switch (_obj) { switch (_obj) {
case audio::orchestra::mode_unknow: case audio::orchestra::mode_unknow:
_os << "unknow"; _os << "unknow";

View File

@ -18,6 +18,6 @@ namespace audio {
}; };
int32_t modeToIdTable(enum mode _mode); int32_t modeToIdTable(enum mode _mode);
} }
std::ostream& operator <<(std::ostream& _os, enum audio::orchestra::mode _obj); etk::Stream& operator <<(etk::Stream& _os, enum audio::orchestra::mode _obj);
} }

View File

@ -13,20 +13,20 @@ static const char* listValue[] = {
"underflow" "underflow"
}; };
std::ostream& audio::orchestra::operator <<(std::ostream& _os, enum audio::orchestra::status _obj) { etk::Stream& audio::orchestra::operator <<(etk::Stream& _os, enum audio::orchestra::status _obj) {
_os << listValue[int32_t(_obj)]; _os << listValue[int32_t(_obj)];
return _os; return _os;
} }
std::ostream& audio::orchestra::operator <<(std::ostream& _os, const std::vector<enum audio::orchestra::status>& _obj) { etk::Stream& audio::orchestra::operator <<(etk::Stream& _os, const etk::Vector<enum audio::orchestra::status>& _obj) {
_os << std::string("{"); _os << etk::String("{");
for (size_t iii=0; iii<_obj.size(); ++iii) { for (size_t iii=0; iii<_obj.size(); ++iii) {
if (iii!=0) { if (iii!=0) {
_os << std::string(";"); _os << etk::String(";");
} }
_os << _obj[iii]; _os << _obj[iii];
} }
_os << std::string("}"); _os << etk::String("}");
return _os; return _os;
} }

View File

@ -15,8 +15,8 @@ namespace audio {
overflow, //!< Internal buffer has more data than they can accept overflow, //!< Internal buffer has more data than they can accept
underflow //!< The internal buffer is empty underflow //!< The internal buffer is empty
}; };
std::ostream& operator <<(std::ostream& _os, enum audio::orchestra::status _obj); etk::Stream& operator <<(etk::Stream& _os, enum audio::orchestra::status _obj);
std::ostream& operator <<(std::ostream& _os, const std::vector<enum audio::orchestra::status>& _obj); etk::Stream& operator <<(etk::Stream& _os, const etk::Vector<enum audio::orchestra::status>& _obj);
} }
} }

View File

@ -12,14 +12,14 @@
#include <cstring> #include <cstring>
#include <climits> #include <climits>
const std::string audio::orchestra::typeUndefined = "undefined"; const etk::String audio::orchestra::typeUndefined = "undefined";
const std::string audio::orchestra::typeAlsa = "alsa"; const etk::String audio::orchestra::typeAlsa = "alsa";
const std::string audio::orchestra::typePulse = "pulse"; const etk::String audio::orchestra::typePulse = "pulse";
const std::string audio::orchestra::typeOss = "oss"; const etk::String audio::orchestra::typeOss = "oss";
const std::string audio::orchestra::typeJack = "jack"; const etk::String audio::orchestra::typeJack = "jack";
const std::string audio::orchestra::typeCoreOSX = "coreOSX"; const etk::String audio::orchestra::typeCoreOSX = "coreOSX";
const std::string audio::orchestra::typeCoreIOS = "coreIOS"; const etk::String audio::orchestra::typeCoreIOS = "coreIOS";
const std::string audio::orchestra::typeAsio = "asio"; const etk::String audio::orchestra::typeAsio = "asio";
const std::string audio::orchestra::typeDs = "ds"; const etk::String audio::orchestra::typeDs = "ds";
const std::string audio::orchestra::typeJava = "java"; const etk::String audio::orchestra::typeJava = "java";
const std::string audio::orchestra::typeDummy = "dummy"; const etk::String audio::orchestra::typeDummy = "dummy";

View File

@ -14,17 +14,17 @@ namespace audio {
/** /**
* @brief Audio API specifier arguments. * @brief Audio API specifier arguments.
*/ */
extern const std::string typeUndefined; //!< Error API. extern const etk::String typeUndefined; //!< Error API.
extern const std::string typeAlsa; //!< LINUX The Advanced Linux Sound Architecture. extern const etk::String typeAlsa; //!< LINUX The Advanced Linux Sound Architecture.
extern const std::string typePulse; //!< LINUX The Linux PulseAudio. extern const etk::String typePulse; //!< LINUX The Linux PulseAudio.
extern const std::string typeOss; //!< LINUX The Linux Open Sound System. extern const etk::String typeOss; //!< LINUX The Linux Open Sound System.
extern const std::string typeJack; //!< UNIX The Jack Low-Latency Audio Server. extern const etk::String typeJack; //!< UNIX The Jack Low-Latency Audio Server.
extern const std::string typeCoreOSX; //!< Macintosh OSX Core Audio. extern const etk::String typeCoreOSX; //!< Macintosh OSX Core Audio.
extern const std::string typeCoreIOS; //!< Macintosh iOS Core Audio. extern const etk::String typeCoreIOS; //!< Macintosh iOS Core Audio.
extern const std::string typeAsio; //!< WINDOWS The Steinberg Audio Stream I/O. extern const etk::String typeAsio; //!< WINDOWS The Steinberg Audio Stream I/O.
extern const std::string typeDs; //!< WINDOWS The Microsoft Direct Sound. extern const etk::String typeDs; //!< WINDOWS The Microsoft Direct Sound.
extern const std::string typeJava; //!< ANDROID Interface. extern const etk::String typeJava; //!< ANDROID Interface.
extern const std::string typeDummy; //!< Empty wrapper (non-functional). extern const etk::String typeDummy; //!< Empty wrapper (non-functional).
} }
} }

View File

@ -13,7 +13,7 @@ int main(int _argc, const char **_argv) {
// the only one init for etk: // the only one init for etk:
etk::init(_argc, _argv); etk::init(_argc, _argv);
for (int32_t iii=0; iii<_argc ; ++iii) { for (int32_t iii=0; iii<_argc ; ++iii) {
std::string data = _argv[iii]; etk::String data = _argv[iii];
if ( data == "-h" if ( data == "-h"
|| data == "--help") { || data == "--help") {
std::cout << "Help : " << std::endl; std::cout << "Help : " << std::endl;

View File

@ -13,7 +13,7 @@ int main(int _argc, const char **_argv) {
// the only one init for etk: // the only one init for etk:
etk::init(_argc, _argv); etk::init(_argc, _argv);
for (int32_t iii=0; iii<_argc ; ++iii) { for (int32_t iii=0; iii<_argc ; ++iii) {
std::string data = _argv[iii]; etk::String data = _argv[iii];
if ( data == "-h" if ( data == "-h"
|| data == "--help") { || data == "--help") {
std::cout << "Help : " << std::endl; std::cout << "Help : " << std::endl;
@ -22,7 +22,7 @@ int main(int _argc, const char **_argv) {
} }
} }
audio::orchestra::Interface interface; audio::orchestra::Interface interface;
std::vector<std::string> apis = interface.getListApi(); etk::Vector<etk::String> apis = interface.getListApi();
TEST_PRINT("Find : " << apis.size() << " apis."); TEST_PRINT("Find : " << apis.size() << " apis.");
for (auto &it : apis) { for (auto &it : apis) {
interface.instanciate(it); interface.instanciate(it);

View File

@ -13,7 +13,7 @@ int main(int _argc, const char **_argv) {
// the only one init for etk: // the only one init for etk:
etk::init(_argc, _argv); etk::init(_argc, _argv);
for (int32_t iii=0; iii<_argc ; ++iii) { for (int32_t iii=0; iii<_argc ; ++iii) {
std::string data = _argv[iii]; etk::String data = _argv[iii];
if ( data == "-h" if ( data == "-h"
|| data == "--help") { || data == "--help") {
std::cout << "Help : " << std::endl; std::cout << "Help : " << std::endl;