[DEV] correct some interface of android

This commit is contained in:
Edouard DUPIN 2015-06-23 21:09:57 +02:00
parent fbd6eceee6
commit 7aad6c26c4
28 changed files with 138 additions and 142 deletions

View File

@ -51,15 +51,7 @@ public class InterfaceOutput extends Thread implements Constants {
while (!m_stopAudioThreads) {
// Fill buffer with PCM data from C++
// TODO : Set if back ... ORCHESTRA.audioPlayback(streamBuffer, BUFFER_SIZE, nbChannels);
Log.i("audioEWOL", "new data ... ");
int xxx = BUFFER_SIZE;
/*
while (xxx>0) {
Log.e("audioEWOL", (BUFFER_SIZE-xxx) + " data : " + streamBuffer[BUFFER_SIZE-xxx]);
xxx--;
}
*/
ORCHESTRA.playback(uid, streamBuffer, BUFFER_SIZE);
// Stream PCM data into the music AudioTrack
m_musicTrack.write(streamBuffer, 0, BUFFER_SIZE);
}

View File

@ -57,51 +57,25 @@ public class Manager implements ManagerCallback, Constants {
public boolean openDevice(int idDevice, int freq, int nbChannel, int format) {
InterfaceOutput iface = new InterfaceOutput(uid, orchestraHandle, idDevice, freq, nbChannel, format);
uid++;
Log.e("Manager", "Open device : " + idDevice);
if (iface != null) {
//outputList.add(iface);
test = iface;
return true;
}
return false;
/*
if (idDevice == 0) {
mAudioStarted = true;
mAudioThread = new Thread(mStreams);
if (mAudioThread != null) {
mAudioThread.start();
return true;
}
return false;
} else {
Log.e("Manager", "can not open : error unknow device ...");
return false;
}
*/
}
public boolean closeDevice(int idDevice) {
/*
Log.e("Manager", "Close device : " + idDevice);
if (idDevice == 0) {
if (mAudioThread != null) {
// request audio stop
mStreams.AutoStop();
// wait the thread ended ...
try {
mAudioThread.join();
} catch(InterruptedException e) { }
mAudioThread = null;
}
mAudioStarted = false;
return true;
} else {
Log.e("Manager", "can not close : error unknow device ...");
return false;
test = null;
}
*/
return false;
}
public boolean start(int idDevice) {
Log.e("Manager", "start device : " + idDevice);
if (idDevice == 0) {
if (test != null) {
test.start();
@ -112,6 +86,7 @@ public class Manager implements ManagerCallback, Constants {
}
public boolean stop(int idDevice) {
Log.e("Manager", "stop device : " + idDevice);
if (idDevice == 0) {
if (test != null) {
// request audio stop

View File

@ -27,7 +27,12 @@ public class Orchestra {
NNsetJavaManagerRemove();
}
public void playback(int flowId, short[] bufferData, int nbChunk) {
NNPlayback(flowId, bufferData, nbChunk);
}
private native <T extends ManagerCallback> void NNsetJavaManager(T managerInstance);
private native void NNsetJavaManagerRemove();
private native void NNPlayback(int flowId, short[] bufferData, int nbChunk);
}

View File

@ -15,6 +15,7 @@
#include <audio/orchestra/mode.h>
#include <audio/Time.h>
#include <audio/Duration.h>
#include <memory>
namespace audio {
namespace orchestra {
@ -46,7 +47,7 @@ namespace audio {
std::vector<int> outOffset;
};
class Api {
class Api : public std::enable_shared_from_this<Api>{
protected:
std::string m_name;
public:
@ -167,7 +168,7 @@ namespace audio {
uint32_t _firstChannel);
public:
virtual bool isMasterOf(audio::orchestra::Api* _api) {
virtual bool isMasterOf(std11::shared_ptr<audio::orchestra::Api> _api) {
return false;
};
};

View File

@ -26,8 +26,7 @@ std::vector<std::string> audio::orchestra::Interface::getListApi() {
void audio::orchestra::Interface::openApi(const std::string& _api) {
delete m_api;
m_api = nullptr;
m_api.reset();
for (size_t iii=0; iii<m_apiAvaillable.size(); ++iii) {
ATA_INFO("try open " << m_apiAvaillable[iii].first);
if (_api == m_apiAvaillable[iii].first) {
@ -78,8 +77,8 @@ audio::orchestra::Interface::Interface() :
#endif
}
void audio::orchestra::Interface::addInterface(const std::string& _api, Api* (*_callbackCreate)()) {
m_apiAvaillable.push_back(std::pair<std::string, Api* (*)()>(_api, _callbackCreate));
void audio::orchestra::Interface::addInterface(const std::string& _api, std::shared_ptr<Api> (*_callbackCreate)()) {
m_apiAvaillable.push_back(std::pair<std::string, std::shared_ptr<Api> (*)()>(_api, _callbackCreate));
}
enum audio::orchestra::error audio::orchestra::Interface::clear() {
@ -88,8 +87,7 @@ enum audio::orchestra::error audio::orchestra::Interface::clear() {
ATA_WARNING("Interface NOT started!");
return audio::orchestra::error_none;
}
delete m_api;
m_api = nullptr;
m_api.reset();
return audio::orchestra::error_none;
}
@ -140,8 +138,7 @@ enum audio::orchestra::error audio::orchestra::Interface::instanciate(const std:
audio::orchestra::Interface::~Interface() {
ATA_INFO("Remove interface");
delete m_api;
m_api = nullptr;
m_api.reset();
}
enum audio::orchestra::error audio::orchestra::Interface::openStream(audio::orchestra::StreamParameters* _outputParameters,

View File

@ -38,13 +38,12 @@ namespace audio {
*/
class Interface {
protected:
std::vector<std::pair<std::string, Api* (*)()> > m_apiAvaillable;
std::vector<std::pair<std::string, std::shared_ptr<Api> (*)()> > m_apiAvaillable;
protected:
audio::orchestra::Api *m_api;
std::shared_ptr<audio::orchestra::Api> m_api;
public:
void setName(const std::string& _name) {
if (m_api == nullptr) {
return;
}
m_api->setName(_name);
@ -59,7 +58,7 @@ namespace audio {
* @param[in] _api Type of the interface.
* @param[in] _callbackCreate API creation callback.
*/
void addInterface(const std::string& _api, Api* (*_callbackCreate)());
void addInterface(const std::string& _api, std::shared_ptr<Api> (*_callbackCreate)());
/**
* @brief The class constructor.
* @note the creating of the basic instance is done by Instanciate

View File

@ -30,8 +30,8 @@ extern "C" {
#undef __class__
#define __class__ "api::Alsa"
audio::orchestra::Api* audio::orchestra::api::Alsa::create() {
return new audio::orchestra::api::Alsa();
std::shared_ptr<audio::orchestra::Api> audio::orchestra::api::Alsa::create() {
return std::shared_ptr<audio::orchestra::Api>(new audio::orchestra::api::Alsa());
}
namespace audio {
@ -1563,8 +1563,8 @@ unlock:
}
bool audio::orchestra::api::Alsa::isMasterOf(audio::orchestra::Api* _api) {
audio::orchestra::api::Alsa* slave = dynamic_cast<audio::orchestra::api::Alsa*>(_api);
bool audio::orchestra::api::Alsa::isMasterOf(std11::shared_ptr<audio::orchestra::Api> _api) {
std11::shared_ptr<audio::orchestra::api::Alsa> slave = dynamic_pointer_cast<audio::orchestra::api::Alsa>(_api);
if (slave == nullptr) {
ATA_ERROR("NULL ptr API (not ALSA ...)");
return false;

View File

@ -14,7 +14,7 @@ namespace audio {
class AlsaPrivate;
class Alsa: public audio::orchestra::Api {
public:
static audio::orchestra::Api* create();
static std::shared_ptr<audio::orchestra::Api> create();
public:
Alsa();
virtual ~Alsa();
@ -72,7 +72,7 @@ namespace audio {
const audio::orchestra::StreamOptions& _options);
virtual audio::Time getStreamTime();
public:
bool isMasterOf(audio::orchestra::Api* _api);
bool isMasterOf(std11::shared_ptr<audio::orchestra::Api> _api);
};
}
}

View File

@ -17,13 +17,14 @@
#undef __class__
#define __class__ "api::Android"
audio::orchestra::Api* audio::orchestra::api::Android::create() {
std::shared_ptr<audio::orchestra::Api> audio::orchestra::api::Android::create() {
ATA_INFO("Create Android device ... ");
return new audio::orchestra::api::Android();
return std::shared_ptr<audio::orchestra::Api>(new audio::orchestra::api::Android());
}
audio::orchestra::api::Android::Android() {
audio::orchestra::api::Android::Android() :
m_uid(-1) {
ATA_INFO("Create Android interface");
}
@ -52,7 +53,7 @@ enum audio::orchestra::error audio::orchestra::api::Android::startStream() {
// TODO : Check return ...
audio::orchestra::Api::startStream();
// Can not close the stream now...
return audio::orchestra::api::android::startStream(0);
return audio::orchestra::api::android::startStream(m_uid);
}
enum audio::orchestra::error audio::orchestra::api::Android::stopStream() {
@ -62,7 +63,7 @@ enum audio::orchestra::error audio::orchestra::api::Android::stopStream() {
tmpContext.audioCloseDevice(0);
#endif
// Can not close the stream now...
return audio::orchestra::api::android::stopStream(0);
return audio::orchestra::api::android::stopStream(m_uid);
}
enum audio::orchestra::error audio::orchestra::api::Android::abortStream() {
@ -75,47 +76,24 @@ enum audio::orchestra::error audio::orchestra::api::Android::abortStream() {
return audio::orchestra::error_none;
}
void audio::orchestra::api::Android::callBackEvent(void* _data,
int32_t _frameRate) {
#if 0
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;
if (m_doConvertBuffer[audio::orchestra::mode_output] == true) {
doStopStream = m_callback(nullptr,
audio::Time(),
m_userBuffer[audio::orchestra::mode_output],
streamTime,
_frameRate,
status);
convertBuffer((char*)_data, (char*)m_userBuffer[audio::orchestra::mode_output], m_convertInfo[audio::orchestra::mode_output]);
} else {
doStopStream = m_callback(_data,
streamTime,
nullptr,
audio::Time(),
_frameRate,
status);
}
ATA_INFO("Need playback data " << int32_t(_nbChunk));
doStopStream = m_callback(nullptr,
audio::Time(),
&m_userBuffer[audio::orchestra::mode_output][0],
streamTime,
uint32_t(_nbChunk),
status);
convertBuffer((char*)_dst, (char*)&m_userBuffer[audio::orchestra::mode_output][0], m_convertInfo[audio::orchestra::mode_output]);
if (doStopStream == 2) {
abortStream();
return;
}
audio::orchestra::Api::tickStreamTime();
#endif
}
void audio::orchestra::api::Android::androidCallBackEvent(void* _data,
int32_t _frameRate,
void* _userData) {
#if 0
if (_userData == nullptr) {
ATA_INFO("callback event ... nullptr pointer");
return;
}
audio::orchestra::api::Android* myClass = static_cast<audio::orchestra::api::Android*>(_userData);
myClass->callBackEvent(_data, _frameRate/2);
#endif
}
bool audio::orchestra::api::Android::probeDeviceOpen(uint32_t _device,
@ -128,26 +106,26 @@ bool audio::orchestra::api::Android::probeDeviceOpen(uint32_t _device,
const audio::orchestra::StreamOptions& _options) {
bool ret = false;
ATA_INFO("Probe : device=" << _device << " channels=" << _channels << " firstChannel=" << _firstChannel << " sampleRate=" << _sampleRate);
ret = audio::orchestra::api::android::open(_device, _mode, _channels, _firstChannel, _sampleRate, _format, _bufferSize, _options);
#if 0
if (_mode != audio::orchestra::mode_output) {
ATA_ERROR("Can not start a device input or duplex for Android ...");
return false;
}
m_userFormat = _format;
m_nUserChannels[modeToIdTable(_mode)] = _channels;
ewol::Context& tmpContext = ewol::getContext();
if (_format == SINT8) {
ret = tmpContext.audioOpenDevice(_device, _sampleRate, _channels, 0, androidCallBackEvent, this);
m_uid = audio::orchestra::api::android::open(_device, _mode, _channels, _firstChannel, _sampleRate, _format, _bufferSize, _options, std11::static_pointer_cast<audio::orchestra::api::Android>(shared_from_this()));
if (m_uid < 0) {
ret = false;
} else {
ret = tmpContext.audioOpenDevice(_device, _sampleRate, _channels, 1, androidCallBackEvent, this);
ret = true;
}
m_bufferSize = 256;
m_sampleRate = _sampleRate;
m_doByteSwap[modeToIdTable(_mode)] = false; // for endienness ...
// TODO : For now, we write it in hard ==> to bu update later ...
m_deviceFormat[modeToIdTable(_mode)] = SINT16;
m_deviceFormat[modeToIdTable(_mode)] = audio::format_int16;
m_nDeviceChannels[modeToIdTable(_mode)] = 2;
m_deviceInterleaved[modeToIdTable(_mode)] = true;
@ -165,8 +143,8 @@ bool audio::orchestra::api::Android::probeDeviceOpen(uint32_t _device,
if (m_doConvertBuffer[modeToIdTable(_mode)] == true) {
// Allocate necessary internal buffers.
uint64_t bufferBytes = m_nUserChannels[modeToIdTable(_mode)] * m_bufferSize * audio::getFormatBytes(m_userFormat);
m_userBuffer[modeToIdTable(_mode)] = (char *) calloc(bufferBytes, 1);
if (m_userBuffer[modeToIdTable(_mode)] == nullptr) {
m_userBuffer[modeToIdTable(_mode)].resize(bufferBytes);
if (m_userBuffer[modeToIdTable(_mode)].size() == 0) {
ATA_ERROR("audio::orchestra::api::Android::probeDeviceOpen: error allocating user buffer memory.");
}
setConvertInfo(_mode, _firstChannel);
@ -177,7 +155,6 @@ bool audio::orchestra::api::Android::probeDeviceOpen(uint32_t _device,
if (ret == false) {
ATA_ERROR("Can not open device.");
}
#endif
return ret;
}

View File

@ -7,12 +7,14 @@
#if !defined(__AUDIO_ORCHESTRA_API_ANDROID_H__) && defined(ORCHESTRA_BUILD_JAVA)
#define __AUDIO_ORCHESTRA_API_ANDROID_H__
#include <audio/orchestra/Interface.h>
namespace audio {
namespace orchestra {
namespace api {
class Android: public audio::orchestra::Api {
public:
static audio::orchestra::Api* create();
static std::shared_ptr<audio::orchestra::Api> create();
public:
Android();
virtual ~Android();
@ -30,6 +32,12 @@ namespace audio {
// which is not a member of RtAudio. External use of this function
// will most likely produce highly undesireable results!
void callbackEvent();
private:
int32_t m_uid;
public:
int32_t getUId() {
return m_uid;
}
private:
std::vector<audio::orchestra::DeviceInfo> m_devices;
void saveDeviceInfo();
@ -41,12 +49,8 @@ namespace audio {
audio::format _format,
uint32_t *_bufferSize,
const audio::orchestra::StreamOptions& _options);
private:
void callBackEvent(void* _data,
int32_t _frameRate);
static void androidCallBackEvent(void* _data,
int32_t _frameRate,
void* _userData);
public:
void playback(int16_t* _dst, int32_t _nbChunk);
};
}
}

View File

@ -10,6 +10,7 @@
#include <audio/orchestra/debug.h>
#include <audio/orchestra/error.h>
#include <audio/orchestra/api/AndroidNativeInterface.h>
#include <audio/orchestra/api/Android.h>
/* include auto generated file */
#include <org_musicdsp_orchestra_Constants.h>
#include <jvm-basics/jvm-basics.h>
@ -268,6 +269,7 @@ class AndroidOrchestraContext {
return info;
}
private:
std::vector<std11::weak_ptr<audio::orchestra::api::Android> > m_instanceList; // list of connected handle ...
//AndroidAudioCallback m_audioCallBack;
//void* m_audioCallBackUserData;
public:
@ -278,7 +280,8 @@ class AndroidOrchestraContext {
uint32_t _sampleRate,
audio::format _format,
uint32_t *_bufferSize,
const audio::orchestra::StreamOptions& _options) {
const audio::orchestra::StreamOptions& _options,
std11::shared_ptr<audio::orchestra::api::Android> _instance) {
ATA_DEBUG("C->java : audio open device");
int status;
if(!java_attach_current_thread(&status)) {
@ -290,6 +293,7 @@ class AndroidOrchestraContext {
jvm_basics::checkExceptionJavaVM(m_JavaVirtualMachinePointer);
java_detach_current_thread(status);
if (bool(ret) == true) {
m_instanceList.push_back(_instance);
return 0;
}
return -1;
@ -348,6 +352,21 @@ class AndroidOrchestraContext {
enum audio::orchestra::error abortStream(int32_t _id) {
return audio::orchestra::error_fail;
}
void playback(int32_t _id, int16_t* _dst, int32_t _nbChunk) {
auto it = m_instanceList.begin();
while (it != m_instanceList.end()) {
auto elem = it->lock();
if (elem == nullptr) {
it = m_instanceList.erase(it);
continue;
}
if (elem->getUId() == _id) {
elem->playback(_dst, _nbChunk);
}
++it;
}
}
};
static std::shared_ptr<AndroidOrchestraContext> s_localContext;
@ -375,11 +394,12 @@ int32_t audio::orchestra::api::android::open(uint32_t _device,
uint32_t _sampleRate,
audio::format _format,
uint32_t *_bufferSize,
const audio::orchestra::StreamOptions& _options) {
const audio::orchestra::StreamOptions& _options,
std11::shared_ptr<audio::orchestra::api::Android> _instance) {
if (s_localContext == nullptr) {
return -1;
}
return s_localContext->open(_device, _mode, _channels, _firstChannel, _sampleRate, _format, _bufferSize, _options);
return s_localContext->open(_device, _mode, _channels, _firstChannel, _sampleRate, _format, _bufferSize, _options, _instance);
}
enum audio::orchestra::error audio::orchestra::api::android::closeStream(int32_t _id) {
@ -443,5 +463,28 @@ extern "C" {
s_localContext.reset();
}
}
void Java_org_musicdsp_orchestra_Orchestra_NNPlayback(JNIEnv* _env,
void* _reserved,
jint _id,
jshortArray _location,
jint _nbChunk) {
std::unique_lock<std::mutex> lock(jvm_basics::getMutexJavaVM());
if (s_localContext == nullptr) {
ATA_ERROR("Call audio with no more Low level interface");
return;
}
// get the short* pointer from the Java array
jboolean isCopy;
jshort* dst = _env->GetShortArrayElements(_location, &isCopy);
if (dst != nullptr) {
//ATA_INFO("Need audioData " << int32_t(_nbChunk));
s_localContext->playback(int32_t(_id), static_cast<short*>(dst), int32_t(_nbChunk));
}
// TODO : Understand why it did not work corectly ...
//if (isCopy == JNI_TRUE) {
// release the short* pointer
_env->ReleaseShortArrayElements(_location, dst, 0);
//}
}
}

View File

@ -12,10 +12,12 @@
#include <audio/orchestra/error.h>
#include <audio/orchestra/StreamOptions.h>
#include <audio/format.h>
#include <etk/memory.h>
namespace audio {
namespace orchestra {
namespace api {
class Android;
namespace android {
uint32_t getDeviceCount();
audio::orchestra::DeviceInfo getDeviceInfo(uint32_t _device);
@ -26,7 +28,8 @@ namespace audio {
uint32_t _sampleRate,
audio::format _format,
uint32_t *_bufferSize,
const audio::orchestra::StreamOptions& _options);
const audio::orchestra::StreamOptions& _options,
std11::shared_ptr<audio::orchestra::api::Android> _instance);
enum audio::orchestra::error closeStream(int32_t _id);
enum audio::orchestra::error startStream(int32_t _id);
enum audio::orchestra::error stopStream(int32_t _id);

View File

@ -11,8 +11,8 @@
#include <audio/orchestra/Interface.h>
#include <audio/orchestra/debug.h>
audio::orchestra::Api* audio::orchestra::api::Asio::create() {
return new audio::orchestra::api::Asio();
std::shared_ptr<audio::orchestra::Api> audio::orchestra::api::Asio::create() {
return std::shared_ptr<audio::orchestra::Api>(new audio::orchestra::api::Asio());
}

View File

@ -14,7 +14,7 @@ namespace audio {
class AsioPrivate:
class Asio: public audio::orchestra::Api {
public:
static audio::orchestra::Api* create();
static std::shared_ptr<audio::orchestra::Api> create();
public:
Asio();
virtual ~Asio();

View File

@ -19,8 +19,8 @@
#include <etk/thread.h>
#include <etk/thread/tools.h>
audio::orchestra::Api* audio::orchestra::api::Core::create() {
return new audio::orchestra::api::Core();
std::shared_ptr<audio::orchestra::Api> audio::orchestra::api::Core::create() {
return std::shared_ptr<audio::orchestra::Api>(new audio::orchestra::api::Core());
}
#undef __class__

View File

@ -17,7 +17,7 @@ namespace audio {
class CorePrivate;
class Core: public audio::orchestra::Api {
public:
static audio::orchestra::Api* create();
static std::shared_ptr<audio::orchestra::Api> create();
public:
Core();
virtual ~Core();

View File

@ -15,7 +15,7 @@ namespace audio {
class CoreIosPrivate;
class CoreIos: public audio::orchestra::Api {
public:
static audio::orchestra::Api* create();
static std::shared_ptr<audio::orchestra::Api> create();
public:
CoreIos();
virtual ~CoreIos();

View File

@ -18,9 +18,9 @@
#undef __class__
#define __class__ "api::CoreIos"
audio::orchestra::Api* audio::orchestra::api::CoreIos::create() {
std::shared_ptr<audio::orchestra::Api> audio::orchestra::api::CoreIos::create() {
ATA_INFO("Create CoreIos device ... ");
return new audio::orchestra::api::CoreIos();
return std::shared_ptr<audio::orchestra::Api>(new audio::orchestra::api::CoreIos());
}
#define kOutputBus 0

View File

@ -14,8 +14,8 @@
#undef __class__
#define __class__ "api::Ds"
audio::orchestra::Api* audio::orchestra::api::Ds::create() {
return new audio::orchestra::api::Ds();
std::shared_ptr<audio::orchestra::Api> audio::orchestra::api::Ds::create() {
return std::shared_ptr<audio::orchestra::Api>(new audio::orchestra::api::Ds());
}

View File

@ -15,7 +15,7 @@ namespace audio {
class DsPrivate;
class Ds: public audio::orchestra::Api {
public:
static audio::orchestra::Api* create();
static std::shared_ptr<audio::orchestra::Api> create();
public:
Ds();
virtual ~Ds();

View File

@ -12,8 +12,8 @@
#undef __class__
#define __class__ "api::Dummy"
audio::orchestra::Api* audio::orchestra::api::Dummy::create() {
return new audio::orchestra::api::Dummy();
std::shared_ptr<audio::orchestra::Api> audio::orchestra::api::Dummy::create() {
return std::shared_ptr<audio::orchestra::Api>(new audio::orchestra::api::Dummy());
}

View File

@ -16,7 +16,7 @@ namespace audio {
namespace api {
class Dummy: public audio::orchestra::Api {
public:
static audio::orchestra::Api* create();
static std::shared_ptr<audio::orchestra::Api> create();
public:
Dummy();
const std::string& getCurrentApi() {

View File

@ -18,8 +18,8 @@
#undef __class__
#define __class__ "api::Jack"
audio::orchestra::Api* audio::orchestra::api::Jack::create() {
return new audio::orchestra::api::Jack();
std::shared_ptr<audio::orchestra::Api> audio::orchestra::api::Jack::create() {
return std::shared_ptr<audio::orchestra::Api>(new audio::orchestra::api::Jack());
}

View File

@ -16,7 +16,7 @@ namespace audio {
class JackPrivate;
class Jack: public audio::orchestra::Api {
public:
static audio::orchestra::Api* create();
static std::shared_ptr<audio::orchestra::Api> create();
public:
Jack();
virtual ~Jack();

View File

@ -21,8 +21,8 @@
#undef __class__
#define __class__ "api::Oss"
audio::orchestra::Api* audio::orchestra::api::Oss::create() {
return new audio::orchestra::api::Oss();
std::shared_ptr<audio::orchestra::Api> audio::orchestra::api::Oss::create() {
return std::shared_ptr<audio::orchestra::Api>(new audio::orchestra::api::Oss());
}
static void *ossCallbackHandler(void* _userData);

View File

@ -15,7 +15,7 @@ namespace audio {
class OssPrivate;
class Oss: public audio::orchestra::Api {
public:
static audio::orchestra::Api* create();
static std::shared_ptr<audio::orchestra::Api> create();
public:
Oss();
virtual ~Oss();

View File

@ -21,8 +21,8 @@
#undef __class__
#define __class__ "api::Pulse"
audio::orchestra::Api* audio::orchestra::api::Pulse::create() {
return new audio::orchestra::api::Pulse();
std::shared_ptr<audio::orchestra::Api> audio::orchestra::api::Pulse::create() {
return std::shared_ptr<audio::orchestra::Api>(new audio::orchestra::api::Pulse());
}

View File

@ -15,7 +15,7 @@ namespace audio {
class PulsePrivate;
class Pulse: public audio::orchestra::Api {
public:
static audio::orchestra::Api* create();
static std::shared_ptr<audio::orchestra::Api> create();
public:
Pulse();
virtual ~Pulse();