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

View File

@ -22,7 +22,7 @@ namespace audio {
* @brief Audio-orchestra library namespace
*/
namespace orchestra {
const std::vector<uint32_t>& genericSampleRate();
const etk::Vector<uint32_t>& genericSampleRate();
/**
* @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).
@ -37,7 +37,7 @@ namespace audio {
void* _outputBuffer,
const audio::Time& _timeOutput,
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.
class ConvertInfo {
public:
@ -46,24 +46,24 @@ namespace audio {
int32_t outJump;
enum audio::format inFormat;
enum audio::format outFormat;
std::vector<int> inOffset;
std::vector<int> outOffset;
etk::Vector<int> inOffset;
etk::Vector<int> outOffset;
};
class Api : public ememory::EnableSharedFromThis<Api>{
protected:
std::string m_name;
etk::String m_name;
public:
Api();
virtual ~Api();
void setName(const std::string& _name) {
void setName(const etk::String& _name) {
m_name = _name;
}
virtual const std::string& getCurrentApi() = 0;
virtual const etk::String& getCurrentApi() = 0;
virtual uint32_t getDeviceCount() = 0;
virtual audio::orchestra::DeviceInfo getDeviceInfo(uint32_t _device) = 0;
// 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;
}
virtual uint32_t getDefaultInputDevice();
@ -95,7 +95,7 @@ namespace audio {
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::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;
bool m_doConvertBuffer[2]; // Playback and record, respectively.
bool m_deviceInterleaved[2]; // Playback and record, respectively.
@ -130,7 +130,7 @@ namespace audio {
enum audio::format _format,
uint32_t *_bufferSize,
const audio::orchestra::StreamOptions& _options);
virtual bool openName(const std::string& _deviceName,
virtual bool openName(const etk::String& _deviceName,
audio::orchestra::mode _mode,
uint32_t _channels,
uint32_t _firstChannel,

View File

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

View File

@ -18,11 +18,11 @@ namespace audio {
public:
bool isCorrect; //!< the information is correct (the system can return information incorect).
bool input; //!< true if the device in an input; false: output.
std::string name; //!< Character string device identifier.
std::string desc; //!< description of the device
std::vector<audio::channel> channels; //!< Channels interfaces.
std::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::String name; //!< Character string device identifier.
etk::String desc; //!< description of the device
etk::Vector<audio::channel> channels; //!< Channels interfaces.
etk::Vector<uint32_t> sampleRates; //!< Supported sample rates (queried from list of standard rates).
etk::Vector<audio::format> nativeFormats; //!< Bit mask of supported data formats.
bool isDefault; //! is default input/output
// Default constructor.
DeviceInfo() :
@ -43,7 +43,7 @@ namespace audio {
*/
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/Pulse.hpp>
std::vector<std::string> audio::orchestra::Interface::getListApi() {
std::vector<std::string> apis;
etk::Vector<etk::String> audio::orchestra::Interface::getListApi() {
etk::Vector<etk::String> apis;
// The order here will control the order of RtAudio's API search in
// the constructor.
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;
}
void audio::orchestra::Interface::openApi(const std::string& _api) {
void audio::orchestra::Interface::openApi(const etk::String& _api) {
m_api.reset();
for (size_t iii=0; iii<m_apiAvaillable.size(); ++iii) {
ATA_INFO("try open " << m_apiAvaillable[iii].first);
@ -80,8 +80,8 @@ audio::orchestra::Interface::Interface() :
#endif
}
void audio::orchestra::Interface::addInterface(const std::string& _api, ememory::SharedPtr<Api> (*_callbackCreate)()) {
m_apiAvaillable.push_back(std::pair<std::string, ememory::SharedPtr<Api> (*)()>(_api, _callbackCreate));
void audio::orchestra::Interface::addInterface(const etk::String& _api, ememory::SharedPtr<Api> (*_callbackCreate)()) {
m_apiAvaillable.pushBack(etk::Pair<etk::String, ememory::SharedPtr<Api> (*)()>(_api, _callbackCreate));
}
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;
}
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 ...");
if (m_api != nullptr) {
ATA_WARNING("Interface already started!");
@ -118,7 +118,7 @@ enum audio::orchestra::error audio::orchestra::Interface::instanciate(const std:
ATA_INFO("Auto choice API :");
// 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.
std::vector<std::string> apis = getListApi();
etk::Vector<etk::String> apis = getListApi();
ATA_INFO(" find : " << apis.size() << " apis.");
for (size_t iii=0; iii<apis.size(); ++iii) {
ATA_INFO("try open ...");

View File

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

View File

@ -15,13 +15,13 @@ static const char* listValue[] = {
"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];
return _os;
}
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") {
_variableRet = audio::orchestra::timestampMode_Hardware;
return true;
@ -37,7 +37,7 @@ namespace etk {
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];
}
}

View File

@ -15,13 +15,13 @@ namespace audio {
timestampMode_trigered, //!< get harware triger time stamp and increment with duration
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 {
public:
audio::orchestra::Flags flags; //!< A bit-mask of stream flags
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...
// Default constructor.
StreamOptions() :

View File

@ -14,7 +14,7 @@ namespace audio {
class StreamParameters {
public:
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 firstChannel; //!< First channel index on device (default = 0).
// Default constructor.

View File

@ -45,7 +45,7 @@ namespace audio {
bool threadRunning;
bool mmapInterface; //!< enable or disable mmap mode...
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() :
handle(nullptr),
runnable(false),
@ -112,7 +112,7 @@ nextcard:
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;
snd_ctl_t *chandle;
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;
}
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) {
ATA_ERROR("can not get control interface = '" << _deviceName << "' Can not plit at ',' ...");
return false;
@ -190,15 +190,15 @@ bool audio::orchestra::api::Alsa::getNamedDeviceInfoLocal(const std::string& _de
}
ATA_DEBUG("Input channel = " << value);
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.
_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 ) {
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) {
@ -211,27 +211,27 @@ bool audio::orchestra::api::Alsa::getNamedDeviceInfoLocal(const std::string& _de
_info.nativeFormats.clear();
format = SND_PCM_FORMAT_S8;
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;
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;
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;
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;
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;
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
if (_info.nativeFormats.size() == 0) {
@ -406,7 +406,7 @@ foundDevice:
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,
uint32_t _channels,
uint32_t _firstChannel,
@ -989,7 +989,7 @@ void audio::orchestra::api::Alsa::callbackEvent() {
}
ethread::setName("Alsa IO-" + m_name);
//Wait data with poll
std::vector<struct pollfd> ufds;
etk::Vector<struct pollfd> ufds;
signed short *ptr;
int32_t err, count, cptr, init;
count = snd_pcm_poll_descriptors_count(m_private->handle);
@ -1106,9 +1106,9 @@ void audio::orchestra::api::Alsa::callbackEventOneCycleRead() {
}
int32_t doStopStream = 0;
audio::Time streamTime;
std::vector<enum audio::orchestra::status> status;
etk::Vector<enum audio::orchestra::status> status;
if (m_private->xrun[0] == true) {
status.push_back(audio::orchestra::status::underflow);
status.pushBack(audio::orchestra::status::underflow);
m_private->xrun[0] = false;
}
int32_t result;
@ -1223,9 +1223,9 @@ void audio::orchestra::api::Alsa::callbackEventOneCycleWrite() {
}
int32_t doStopStream = 0;
audio::Time streamTime;
std::vector<enum audio::orchestra::status> status;
etk::Vector<enum audio::orchestra::status> status;
if (m_private->xrun[1] == true) {
status.push_back(audio::orchestra::status::overflow);
status.pushBack(audio::orchestra::status::overflow);
m_private->xrun[1] = false;
}
int32_t result;
@ -1325,9 +1325,9 @@ void audio::orchestra::api::Alsa::callbackEventOneCycleMMAPWrite() {
}
int32_t doStopStream = 0;
audio::Time streamTime;
std::vector<enum audio::orchestra::status> status;
etk::Vector<enum audio::orchestra::status> status;
if (m_private->xrun[1] == true) {
status.push_back(audio::orchestra::status::overflow);
status.pushBack(audio::orchestra::status::overflow);
m_private->xrun[1] = false;
}
int32_t result;
@ -1459,9 +1459,9 @@ void audio::orchestra::api::Alsa::callbackEventOneCycleMMAPRead() {
}
int32_t doStopStream = 0;
audio::Time streamTime;
std::vector<enum audio::orchestra::status> status;
etk::Vector<enum audio::orchestra::status> status;
if (m_private->xrun[0] == true) {
status.push_back(audio::orchestra::status::underflow);
status.pushBack(audio::orchestra::status::underflow);
m_private->xrun[0] = false;
}
int32_t result;

View File

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

View File

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

View File

@ -235,7 +235,7 @@ class AndroidOrchestraContext {
//Call java ...
jstring returnString = (jstring) m_JavaVirtualMachinePointer->CallObjectMethod(m_javaObjectOrchestraCallback, m_javaMethodOrchestraActivityAudioGetDeviceProperty, _idDevice);
const char *js = m_JavaVirtualMachinePointer->GetStringUTFChars(returnString, nullptr);
std::string retString(js);
etk::String retString(js);
m_JavaVirtualMachinePointer->ReleaseStringUTFChars(returnString, js);
//m_JavaVirtualMachinePointer->DeleteLocalRef(returnString);
// manage execption :
@ -256,19 +256,19 @@ class AndroidOrchestraContext {
ejson::Array list = doc["sample-rate"].toArray();
if (list.exist() == true) {
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();
if (list.exist() == true) {
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();
if (list.exist() == true) {
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);
@ -276,7 +276,7 @@ class AndroidOrchestraContext {
return info;
}
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;
//void* m_audioCallBackUserData;
public:
@ -305,7 +305,7 @@ class AndroidOrchestraContext {
jvm_basics::checkExceptionJavaVM(m_JavaVirtualMachinePointer);
java_detach_current_thread(status);
if (int32_t(ret) >= 0) {
m_instanceList.push_back(_instance);
m_instanceList.pushBack(_instance);
return int32_t(ret);
}
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++) {
result = ASIOCanSampleRate((ASIOSampleRate) SAMPLE_RATES[i]);
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.
@ -173,19 +173,19 @@ rtaudio::DeviceInfo audio::orchestra::api::Asio::getDeviceInfo(uint32_t _device)
info.nativeFormats.clear();
if ( channelInfo.type == ASIOSTInt16MSB
|| channelInfo.type == ASIOSTInt16LSB) {
info.nativeFormats.push_back(audio::format_int16);
info.nativeFormats.pushBack(audio::format_int16);
} else if ( channelInfo.type == ASIOSTInt32MSB
|| channelInfo.type == ASIOSTInt32LSB) {
info.nativeFormats.push_back(audio::format_int32);
info.nativeFormats.pushBack(audio::format_int32);
} else if ( channelInfo.type == ASIOSTFloat32MSB
|| channelInfo.type == ASIOSTFloat32LSB) {
info.nativeFormats.push_back(audio::format_float);
info.nativeFormats.pushBack(audio::format_float);
} else if ( channelInfo.type == ASIOSTFloat64MSB
|| channelInfo.type == ASIOSTFloat64LSB) {
info.nativeFormats.push_back(audio::format_double);
info.nativeFormats.pushBack(audio::format_double);
} else if ( channelInfo.type == ASIOSTInt24MSB
|| channelInfo.type == ASIOSTInt24LSB) {
info.nativeFormats.push_back(audio::format_int24);
info.nativeFormats.pushBack(audio::format_int24);
}
if (info.outputChannels > 0){
if (getDefaultOutputDevice() == _device) {
@ -692,13 +692,13 @@ bool audio::orchestra::api::Asio::callbackEvent(long bufferIndex) {
// draining stream.
if (m_private->drainCounter == 0) {
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) {
status.push_back(audio::orchestra::status::underflow);
status.pushBack(audio::orchestra::status::underflow);
asioXRun = false;
}
if (m_mode != audio::orchestra::mode_output && asioXRun == true) {
status.push_back(audio::orchestra::status::underflow;
status.pushBack(audio::orchestra::status::underflow;
asioXRun = false;
}
int32_t cbReturnValue = info->callback(m_userBuffer[1],

View File

@ -17,7 +17,7 @@ namespace audio {
public:
Asio();
virtual ~Asio();
const std::string& getCurrentApi() {
const etk::String& getCurrentApi() {
return audio::orchestra::typeAsio;
}
uint32_t getDeviceCount();
@ -34,7 +34,7 @@ namespace audio {
bool callbackEvent(long _bufferIndex);
private:
ememory::SharedPtr<AsioPrivate> m_private;
std::vector<audio::orchestra::DeviceInfo> m_devices;
etk::Vector<audio::orchestra::DeviceInfo> m_devices;
void saveDeviceInfo();
bool m_coInitialized;
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());
int32_t length = CFStringGetLength(cfname);
std::vector<char> name;
etk::Vector<char> name;
name.resize(length * 3 + 1, '\0');
CFStringGetCString(cfname, &name[0], length * 3 + 1, CFStringGetSystemEncoding());
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.
for (size_t iii=0; iii<bufferList->mNumberBuffers; ++iii) {
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);
@ -344,7 +344,7 @@ audio::orchestra::DeviceInfo audio::orchestra::api::Core::getDeviceInfo(uint32_t
for (auto &it : audio::orchestra::genericSampleRate()) {
if ( it >= minimumRate
&& it <= maximumRate) {
info.sampleRates.push_back(it);
info.sampleRates.pushBack(it);
}
}
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.
// Thus, any other "physical" formats supported by the device are of
// no interest to the client.
info.nativeFormats.push_back(audio::format_float);
info.nativeFormats.pushBack(audio::format_float);
// ------------------------------------------------
// Determine the default channel.
// ------------------------------------------------
@ -692,19 +692,19 @@ bool audio::orchestra::api::Core::open(uint32_t _device,
AudioStreamBasicDescription testDescription = description;
uint32_t formatFlags;
// 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;
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;
physicalFormats.push_back(std::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>(32, formatFlags));
physicalFormats.pushBack(etk::Pair<float, uint32_t>(24, formatFlags)); // 24-bit packed
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;
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;
physicalFormats.push_back(std::pair<float, uint32_t>(16, formatFlags));
physicalFormats.push_back(std::pair<float, uint32_t>(8, formatFlags));
physicalFormats.pushBack(etk::Pair<float, uint32_t>(16, formatFlags));
physicalFormats.pushBack(etk::Pair<float, uint32_t>(8, formatFlags));
bool setPhysicalFormat = false;
for(uint32_t i=0; i<physicalFormats.size(); i++) {
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
// different AND this function is called for the input device.
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
&& m_private->xrun[0] == true) {
status.push_back(audio::orchestra::status::underflow);
status.pushBack(audio::orchestra::status::underflow);
m_private->xrun[0] = false;
}
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;
}
int32_t cbReturnValue = m_callback(&m_userBuffer[1][0],

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -63,7 +63,7 @@ namespace audio {
public:
jack_client_t *client;
jack_port_t **ports[2];
std::string deviceName[2];
etk::String deviceName[2];
bool xrun[2];
std::condition_variable condition;
int32_t drainCounter; // Tracks callback counts when draining
@ -103,7 +103,7 @@ uint32_t audio::orchestra::api::Jack::getDeviceCount() {
return 0;
}
const char **ports;
std::string port, previousPort;
etk::String port, previousPort;
uint32_t nChannels = 0, nDevices = 0;
ports = jack_get_ports(client, nullptr, nullptr, 0);
if (ports) {
@ -112,7 +112,7 @@ uint32_t audio::orchestra::api::Jack::getDeviceCount() {
do {
port = (char *) ports[ nChannels ];
iColon = port.find(":");
if (iColon != std::string::npos) {
if (iColon != etk::String::npos) {
port = port.substr(0, iColon + 1);
if (port != previousPort) {
nDevices++;
@ -138,7 +138,7 @@ audio::orchestra::DeviceInfo audio::orchestra::api::Jack::getDeviceInfo(uint32_t
return info;
}
const char **ports;
std::string port, previousPort;
etk::String port, previousPort;
uint32_t nPorts = 0, nDevices = 0;
ports = jack_get_ports(client, nullptr, nullptr, 0);
int32_t deviceID = _device/2;
@ -149,7 +149,7 @@ audio::orchestra::DeviceInfo audio::orchestra::api::Jack::getDeviceInfo(uint32_t
do {
port = (char *) ports[nPorts];
iColon = port.find(":");
if (iColon != std::string::npos) {
if (iColon != etk::String::npos) {
port = port.substr(0, iColon);
if (port != previousPort) {
if (nDevices == deviceID) {
@ -170,14 +170,14 @@ audio::orchestra::DeviceInfo audio::orchestra::api::Jack::getDeviceInfo(uint32_t
}
// Get the current jack server sample rate.
info.sampleRates.clear();
info.sampleRates.push_back(jack_get_sample_rate(client));
info.sampleRates.pushBack(jack_get_sample_rate(client));
if (info.input == true) {
ports = jack_get_ports(client, info.name.c_str(), nullptr, JackPortIsOutput);
if (ports) {
int32_t iii=0;
while (ports[iii]) {
ATA_ERROR(" ploppp='" << ports[iii] << "'");
info.channels.push_back(audio::channel_unknow);
info.channels.pushBack(audio::channel_unknow);
iii++;
}
free(ports);
@ -188,7 +188,7 @@ audio::orchestra::DeviceInfo audio::orchestra::api::Jack::getDeviceInfo(uint32_t
int32_t iii=0;
while (ports[iii]) {
ATA_ERROR(" ploppp='" << ports[iii] << "'");
info.channels.push_back(audio::channel_unknow);
info.channels.pushBack(audio::channel_unknow);
iii++;
}
free(ports);
@ -202,7 +202,7 @@ audio::orchestra::DeviceInfo audio::orchestra::api::Jack::getDeviceInfo(uint32_t
return info;
}
// 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.
if (deviceID == 0) {
info.isDefault = true;
@ -287,7 +287,7 @@ bool audio::orchestra::api::Jack::open(uint32_t _device,
client = m_private->client;
}
const char **ports;
std::string port, previousPort, deviceName;
etk::String port, previousPort, deviceName;
uint32_t nPorts = 0, nDevices = 0;
int32_t deviceID = _device/2;
bool isInput = _device%2==0?true:false;
@ -298,7 +298,7 @@ bool audio::orchestra::api::Jack::open(uint32_t _device,
do {
port = (char *) ports[ nPorts ];
iColon = port.find(":");
if (iColon != std::string::npos) {
if (iColon != etk::String::npos) {
port = port.substr(0, iColon);
if (port != previousPort) {
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.
if (m_private->drainCounter == 0) {
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) {
status.push_back(audio::orchestra::status::underflow);
status.pushBack(audio::orchestra::status::underflow);
m_private->xrun[0] = false;
}
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;
}
int32_t cbReturnValue = m_callback(&m_userBuffer[1][0],

View File

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

View File

@ -80,7 +80,7 @@ audio::orchestra::api::Pulse::~Pulse() {
uint32_t audio::orchestra::api::Pulse::getDeviceCount() {
#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();
#else
return 1;
@ -88,7 +88,7 @@ uint32_t audio::orchestra::api::Pulse::getDeviceCount() {
}
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()) {
ATA_ERROR("Request device out of IDs:" << _device << " >= " << list.size());
return audio::orchestra::DeviceInfo();
@ -145,7 +145,7 @@ void audio::orchestra::api::Pulse::callbackEventOneCycle() {
return;
}
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],
streamTime,
&m_userBuffer[audio::orchestra::modeToIdTable(audio::orchestra::mode_output)][0],

View File

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

View File

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

View File

@ -14,7 +14,7 @@ namespace audio {
namespace orchestra {
namespace api {
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;
}
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) {
case audio::orchestra::mode_unknow:
_os << "unknow";

View File

@ -18,6 +18,6 @@ namespace audio {
};
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"
};
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)];
return _os;
}
std::ostream& audio::orchestra::operator <<(std::ostream& _os, const std::vector<enum audio::orchestra::status>& _obj) {
_os << std::string("{");
etk::Stream& audio::orchestra::operator <<(etk::Stream& _os, const etk::Vector<enum audio::orchestra::status>& _obj) {
_os << etk::String("{");
for (size_t iii=0; iii<_obj.size(); ++iii) {
if (iii!=0) {
_os << std::string(";");
_os << etk::String(";");
}
_os << _obj[iii];
}
_os << std::string("}");
_os << etk::String("}");
return _os;
}

View File

@ -15,8 +15,8 @@ namespace audio {
overflow, //!< Internal buffer has more data than they can accept
underflow //!< The internal buffer is empty
};
std::ostream& operator <<(std::ostream& _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, 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 <climits>
const std::string audio::orchestra::typeUndefined = "undefined";
const std::string audio::orchestra::typeAlsa = "alsa";
const std::string audio::orchestra::typePulse = "pulse";
const std::string audio::orchestra::typeOss = "oss";
const std::string audio::orchestra::typeJack = "jack";
const std::string audio::orchestra::typeCoreOSX = "coreOSX";
const std::string audio::orchestra::typeCoreIOS = "coreIOS";
const std::string audio::orchestra::typeAsio = "asio";
const std::string audio::orchestra::typeDs = "ds";
const std::string audio::orchestra::typeJava = "java";
const std::string audio::orchestra::typeDummy = "dummy";
const etk::String audio::orchestra::typeUndefined = "undefined";
const etk::String audio::orchestra::typeAlsa = "alsa";
const etk::String audio::orchestra::typePulse = "pulse";
const etk::String audio::orchestra::typeOss = "oss";
const etk::String audio::orchestra::typeJack = "jack";
const etk::String audio::orchestra::typeCoreOSX = "coreOSX";
const etk::String audio::orchestra::typeCoreIOS = "coreIOS";
const etk::String audio::orchestra::typeAsio = "asio";
const etk::String audio::orchestra::typeDs = "ds";
const etk::String audio::orchestra::typeJava = "java";
const etk::String audio::orchestra::typeDummy = "dummy";

View File

@ -14,17 +14,17 @@ namespace audio {
/**
* @brief Audio API specifier arguments.
*/
extern const std::string typeUndefined; //!< Error API.
extern const std::string typeAlsa; //!< LINUX The Advanced Linux Sound Architecture.
extern const std::string typePulse; //!< LINUX The Linux PulseAudio.
extern const std::string typeOss; //!< LINUX The Linux Open Sound System.
extern const std::string typeJack; //!< UNIX The Jack Low-Latency Audio Server.
extern const std::string typeCoreOSX; //!< Macintosh OSX Core Audio.
extern const std::string typeCoreIOS; //!< Macintosh iOS Core Audio.
extern const std::string typeAsio; //!< WINDOWS The Steinberg Audio Stream I/O.
extern const std::string typeDs; //!< WINDOWS The Microsoft Direct Sound.
extern const std::string typeJava; //!< ANDROID Interface.
extern const std::string typeDummy; //!< Empty wrapper (non-functional).
extern const etk::String typeUndefined; //!< Error API.
extern const etk::String typeAlsa; //!< LINUX The Advanced Linux Sound Architecture.
extern const etk::String typePulse; //!< LINUX The Linux PulseAudio.
extern const etk::String typeOss; //!< LINUX The Linux Open Sound System.
extern const etk::String typeJack; //!< UNIX The Jack Low-Latency Audio Server.
extern const etk::String typeCoreOSX; //!< Macintosh OSX Core Audio.
extern const etk::String typeCoreIOS; //!< Macintosh iOS Core Audio.
extern const etk::String typeAsio; //!< WINDOWS The Steinberg Audio Stream I/O.
extern const etk::String typeDs; //!< WINDOWS The Microsoft Direct Sound.
extern const etk::String typeJava; //!< ANDROID Interface.
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:
etk::init(_argc, _argv);
for (int32_t iii=0; iii<_argc ; ++iii) {
std::string data = _argv[iii];
etk::String data = _argv[iii];
if ( data == "-h"
|| data == "--help") {
std::cout << "Help : " << std::endl;

View File

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

View File

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