[DEV] update to the new ETK allocator wrapper

This commit is contained in:
Edouard DUPIN 2017-10-21 19:05:21 +02:00
parent 309b63254f
commit 0b8c0e3fd4
9 changed files with 21 additions and 21 deletions

View File

@ -29,7 +29,7 @@ extern "C" {
}
ememory::SharedPtr<audio::orchestra::Api> audio::orchestra::api::Alsa::create() {
return ememory::SharedPtr<audio::orchestra::api::Alsa>(new audio::orchestra::api::Alsa());
return ememory::SharedPtr<audio::orchestra::api::Alsa>(ETK_NEW(audio::orchestra::api::Alsa));
}
namespace audio {
@ -801,7 +801,7 @@ bool audio::orchestra::api::Alsa::openName(const etk::String& _deviceName,
// Setup callback thread.
m_private->threadRunning = true;
ATA_INFO("create thread ...");
m_private->thread = new ethread::Thread([=]() {callbackEvent();});
m_private->thread = ETK_NEW(ethread::Thread, [=]() {callbackEvent();});
if (m_private->thread == nullptr) {
m_private->threadRunning = false;
ATA_ERROR("creating callback thread!");

View File

@ -19,7 +19,7 @@ extern "C" {
ememory::SharedPtr<audio::orchestra::Api> audio::orchestra::api::Android::create() {
ATA_INFO("Create Android device ... ");
return ememory::SharedPtr<audio::orchestra::api::Android>(new audio::orchestra::api::Android());
return ememory::SharedPtr<audio::orchestra::api::Android>(ETK_NEW(audio::orchestra::api::Android));
}

View File

@ -12,7 +12,7 @@
#include <audio/orchestra/debug.hpp>
ememory::SharedPtr<audio::orchestra::Api> audio::orchestra::api::Asio::create() {
return ememory::SharedPtr<audio::orchestra::api::Asio>(new audio::orchestra::api::Asio());
return ememory::SharedPtr<audio::orchestra::api::Asio>(ETK_NEW(audio::orchestra::api::Asio));
}
@ -71,7 +71,7 @@ static void sampleRateChanged(ASIOSampleRate _sRate);
static long asioMessages(long _selector, long _value, void* _message, double* _opt);
audio::orchestra::api::Asio::Asio() :
m_private(new audio::orchestra::api::AsioPrivate()) {
m_private(ETK_NEW(audio::orchestra::api::AsioPrivate)) {
// ASIO cannot run on a multi-threaded appartment. You can call
// CoInitialize beforehand, but it must be for appartment threading
// (in which case, CoInitilialize will return S_FALSE here).

View File

@ -21,7 +21,7 @@
#include <audio/orchestra/api/Core.hpp>
ememory::SharedPtr<audio::orchestra::Api> audio::orchestra::api::Core::create() {
return ememory::SharedPtr<audio::orchestra::api::Core>(new audio::orchestra::api::Core());
return ememory::SharedPtr<audio::orchestra::api::Core>(ETK_NEW(audio::orchestra::api::Core));
}
namespace audio {
@ -57,7 +57,7 @@ namespace audio {
}
audio::orchestra::api::Core::Core() :
m_private(new audio::orchestra::api::CorePrivate()) {
m_private(ETK_NEW(audio::orchestra::api::CorePrivate)) {
#if defined(AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER)
// This is a largely undocumented but absolutely necessary
// requirement starting with OS-X 10.6. If not called, queries and
@ -1036,7 +1036,7 @@ bool audio::orchestra::api::Core::callbackEvent(AudioDeviceID _deviceId,
m_state = audio::orchestra::state::stopping;
ATA_VERBOSE("Set state as stopping");
if (m_private->internalDrain == true) {
new ethread::Thread(&audio::orchestra::api::Core::coreStopStream, this);
ETK_NEW(ethread::Thread, &audio::orchestra::api::Core::coreStopStream, this);
} else {
// external call to stopStream()
m_private->m_semaphore.post();

View File

@ -20,7 +20,7 @@ extern "C" {
ememory::SharedPtr<audio::orchestra::Api> audio::orchestra::api::CoreIos::create() {
ATA_INFO("Create CoreIos device ... ");
return ememory::SharedPtr<audio::orchestra::api::CoreIos>(new audio::orchestra::api::CoreIos());
return ememory::SharedPtr<audio::orchestra::api::CoreIos>(ETK_NEW(audio::orchestra::api::CoreIos));
}
#define kOutputBus 0
@ -40,7 +40,7 @@ namespace audio {
audio::orchestra::api::CoreIos::CoreIos() :
m_private(new audio::orchestra::api::CoreIosPrivate()) {
m_private(ETK_NEW(audio::orchestra::api::CoreIosPrivate)) {
ATA_INFO("new CoreIos");
int32_t deviceCount = 2;
ATA_ERROR("Get count devices : " << 2);

View File

@ -13,7 +13,7 @@
#include <audio/orchestra/api/Ds.hpp>
ememory::SharedPtr<audio::orchestra::Api> audio::orchestra::api::Ds::create() {
return ememory::SharedPtr<audio::orchestra::api::Ds>(new audio::orchestra::api::Ds());
return ememory::SharedPtr<audio::orchestra::api::Ds>(ETK_NEW(audio::orchestra::api::Ds));
}
@ -110,7 +110,7 @@ struct DsProbeData {
};
audio::orchestra::api::Ds::Ds() :
m_private(new audio::orchestra::api::DsPrivate()) {
m_private(ETK_NEW(audio::orchestra::api::DsPrivate)) {
// Dsound will run both-threaded. If CoInitialize fails, then just
// accept whatever the mainline chose for a threading model.
m_coInitialized = false;
@ -761,7 +761,7 @@ bool audio::orchestra::api::Ds::open(uint32_t _device,
// Setup the callback thread.
if (m_private->threadRunning == false) {
m_private->threadRunning = true;
ememory::SharedPtr<ethread::Thread> tmpThread(new ethread::Thread([=](){audio::orchestra::api::Ds::dsCallbackEvent();});
ememory::SharedPtr<ethread::Thread> tmpThread(ETK_NEW(ethread::Thread, [=](){audio::orchestra::api::Ds::dsCallbackEvent();});
m_private->thread = etk::move(tmpThread);
if (m_private->thread == nullptr) {
ATA_ERROR("error creating callback thread!");

View File

@ -10,7 +10,7 @@
#include <audio/orchestra/debug.hpp>
ememory::SharedPtr<audio::orchestra::Api> audio::orchestra::api::Dummy::create() {
return ememory::SharedPtr<audio::orchestra::api::Dummy>(new audio::orchestra::api::Dummy());
return ememory::SharedPtr<audio::orchestra::api::Dummy>(ETK_NEW(audio::orchestra::api::Dummy));
}

View File

@ -17,7 +17,7 @@ extern "C" {
#include <audio/orchestra/api/Jack.hpp>
ememory::SharedPtr<audio::orchestra::Api> audio::orchestra::api::Jack::create() {
return ememory::SharedPtr<audio::orchestra::api::Jack>(new audio::orchestra::api::Jack());
return ememory::SharedPtr<audio::orchestra::api::Jack>(ETK_NEW(audio::orchestra::api::Jack));
}
@ -84,7 +84,7 @@ namespace audio {
}
audio::orchestra::api::Jack::Jack() :
m_private(new audio::orchestra::api::JackPrivate()) {
m_private(ETK_NEW(audio::orchestra::api::JackPrivate)) {
// Nothing to do here.
}
@ -235,7 +235,7 @@ void audio::orchestra::api::Jack::jackShutdown(void* _userData) {
if (myClass->isStreamRunning() == false) {
return;
}
new ethread::Thread([=](){myClass->closeStream();});
ETK_NEW(ethread::Thread, [=](){myClass->closeStream();});
ATA_ERROR("The Jack server is shutting down this client ... stream stopped and closed!!");
}
@ -626,7 +626,7 @@ bool audio::orchestra::api::Jack::callbackEvent(uint64_t _nframes) {
if (m_private->drainCounter > 3) {
m_state = audio::orchestra::state::stopping;
if (m_private->internalDrain == true) {
new ethread::Thread([&](){stopStream();}, "Jack_stopStream");
ETK_NEW(ethread::Thread, [&](){stopStream();}, "Jack_stopStream");
} else {
m_private->m_semaphore.post();
}
@ -653,7 +653,7 @@ bool audio::orchestra::api::Jack::callbackEvent(uint64_t _nframes) {
if (cbReturnValue == 2) {
m_state = audio::orchestra::state::stopping;
m_private->drainCounter = 2;
new ethread::Thread([&](){stopStream();}, "Jack_stopStream2");
ETK_NEW(ethread::Thread, [&](){stopStream();}, "Jack_stopStream2");
return true;
}
else if (cbReturnValue == 1) {

View File

@ -21,7 +21,7 @@ extern "C" {
#include <audio/orchestra/api/Pulse.hpp>
ememory::SharedPtr<audio::orchestra::Api> audio::orchestra::api::Pulse::create() {
return ememory::SharedPtr<audio::orchestra::api::Pulse>(new audio::orchestra::api::Pulse());
return ememory::SharedPtr<audio::orchestra::api::Pulse>(ETK_NEW(audio::orchestra::api::Pulse));
}
@ -69,7 +69,7 @@ namespace audio {
}
}
audio::orchestra::api::Pulse::Pulse() :
m_private(new audio::orchestra::api::PulsePrivate()) {
m_private(ETK_NEW(audio::orchestra::api::PulsePrivate)) {
}