[DEV] update sharedPtr
This commit is contained in:
parent
a4a021277a
commit
6f6ee330ac
@ -12,7 +12,7 @@
|
||||
#include <audio/channel.h>
|
||||
#include <chrono>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <ememory/memory.h>
|
||||
#include "AutoLogInOut.h"
|
||||
#include "IOFormatInterface.h"
|
||||
#include <audio/Time.h>
|
||||
@ -22,7 +22,7 @@
|
||||
namespace audio {
|
||||
namespace drain{
|
||||
typedef std::function<void (const std::string& _origin, const std::string& _status)> algoStatusFunction;
|
||||
class Algo : public std::enable_shared_from_this<Algo> {
|
||||
class Algo : public ememory::EnableSharedFromThis<Algo> {
|
||||
private:
|
||||
std::string m_name;
|
||||
public:
|
||||
|
@ -20,8 +20,8 @@ void audio::drain::ChannelReorder::init() {
|
||||
m_type = "ChannelReorder";
|
||||
}
|
||||
|
||||
std::shared_ptr<audio::drain::ChannelReorder> audio::drain::ChannelReorder::create() {
|
||||
std::shared_ptr<audio::drain::ChannelReorder> tmp(new audio::drain::ChannelReorder());
|
||||
ememory::SharedPtr<audio::drain::ChannelReorder> audio::drain::ChannelReorder::create() {
|
||||
ememory::SharedPtr<audio::drain::ChannelReorder> tmp(new audio::drain::ChannelReorder());
|
||||
tmp->init();
|
||||
return tmp;
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ namespace audio {
|
||||
ChannelReorder();
|
||||
void init();
|
||||
public:
|
||||
static std::shared_ptr<audio::drain::ChannelReorder> create();
|
||||
static ememory::SharedPtr<audio::drain::ChannelReorder> create();
|
||||
/**
|
||||
* @brief Destructor
|
||||
*/
|
||||
|
@ -25,14 +25,14 @@ void audio::drain::EndPointCallback::init(recordFunction _callback) {
|
||||
m_type = "EndPointCallback";
|
||||
}
|
||||
|
||||
std::shared_ptr<audio::drain::EndPointCallback> audio::drain::EndPointCallback::create(playbackFunction _callback) {
|
||||
std::shared_ptr<audio::drain::EndPointCallback> tmp(new audio::drain::EndPointCallback());
|
||||
ememory::SharedPtr<audio::drain::EndPointCallback> audio::drain::EndPointCallback::create(playbackFunction _callback) {
|
||||
ememory::SharedPtr<audio::drain::EndPointCallback> tmp(new audio::drain::EndPointCallback());
|
||||
tmp->init(_callback);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
std::shared_ptr<audio::drain::EndPointCallback> audio::drain::EndPointCallback::create(recordFunction _callback) {
|
||||
std::shared_ptr<audio::drain::EndPointCallback> tmp(new audio::drain::EndPointCallback());
|
||||
ememory::SharedPtr<audio::drain::EndPointCallback> audio::drain::EndPointCallback::create(recordFunction _callback) {
|
||||
ememory::SharedPtr<audio::drain::EndPointCallback> tmp(new audio::drain::EndPointCallback());
|
||||
tmp->init(_callback);
|
||||
return tmp;
|
||||
}
|
||||
|
@ -34,8 +34,8 @@ namespace audio {
|
||||
void init(playbackFunction _callback);
|
||||
void init(recordFunction _callback);
|
||||
public:
|
||||
static std::shared_ptr<EndPointCallback> create(playbackFunction _callback);
|
||||
static std::shared_ptr<EndPointCallback> create(recordFunction _callback);
|
||||
static ememory::SharedPtr<EndPointCallback> create(playbackFunction _callback);
|
||||
static ememory::SharedPtr<EndPointCallback> create(recordFunction _callback);
|
||||
/**
|
||||
* @brief Destructor
|
||||
*/
|
||||
|
@ -18,8 +18,8 @@ void audio::drain::EndPointRead::init() {
|
||||
m_type = "EndPointRead";
|
||||
}
|
||||
|
||||
std::shared_ptr<audio::drain::EndPointRead> audio::drain::EndPointRead::create() {
|
||||
std::shared_ptr<audio::drain::EndPointRead> tmp(new audio::drain::EndPointRead());
|
||||
ememory::SharedPtr<audio::drain::EndPointRead> audio::drain::EndPointRead::create() {
|
||||
ememory::SharedPtr<audio::drain::EndPointRead> tmp(new audio::drain::EndPointRead());
|
||||
tmp->init();
|
||||
return tmp;
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ namespace audio {
|
||||
EndPointRead();
|
||||
void init();
|
||||
public:
|
||||
static std::shared_ptr<EndPointRead> create();
|
||||
static ememory::SharedPtr<EndPointRead> create();
|
||||
/**
|
||||
* @brief Destructor
|
||||
*/
|
||||
|
@ -24,8 +24,8 @@ void audio::drain::EndPointWrite::init() {
|
||||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<audio::drain::EndPointWrite> audio::drain::EndPointWrite::create() {
|
||||
std::shared_ptr<audio::drain::EndPointWrite> tmp(new audio::drain::EndPointWrite());
|
||||
ememory::SharedPtr<audio::drain::EndPointWrite> audio::drain::EndPointWrite::create() {
|
||||
ememory::SharedPtr<audio::drain::EndPointWrite> tmp(new audio::drain::EndPointWrite());
|
||||
tmp->init();
|
||||
return tmp;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace audio {
|
||||
EndPointWrite();
|
||||
void init();
|
||||
public:
|
||||
static std::shared_ptr<audio::drain::EndPointWrite> create();
|
||||
static ememory::SharedPtr<audio::drain::EndPointWrite> create();
|
||||
/**
|
||||
* @brief Destructor
|
||||
*/
|
||||
|
@ -23,8 +23,8 @@ void audio::drain::Equalizer::init() {
|
||||
configureBiQuad();
|
||||
}
|
||||
|
||||
std::shared_ptr<audio::drain::Equalizer> audio::drain::Equalizer::create() {
|
||||
std::shared_ptr<audio::drain::Equalizer> tmp(new audio::drain::Equalizer());
|
||||
ememory::SharedPtr<audio::drain::Equalizer> audio::drain::Equalizer::create() {
|
||||
ememory::SharedPtr<audio::drain::Equalizer> tmp(new audio::drain::Equalizer());
|
||||
tmp->init();
|
||||
return tmp;
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <audio/drain/Algo.h>
|
||||
#include <memory>
|
||||
#include <ememory/memory.h>
|
||||
#include <ejson/Object.h>
|
||||
#include <audio/algo/drain/Equalizer.h>
|
||||
|
||||
@ -20,7 +20,7 @@ namespace audio {
|
||||
Equalizer();
|
||||
void init();
|
||||
public:
|
||||
static std::shared_ptr<audio::drain::Equalizer> create();
|
||||
static ememory::SharedPtr<audio::drain::Equalizer> create();
|
||||
/**
|
||||
* @brief Destructor
|
||||
*/
|
||||
|
@ -133,8 +133,8 @@ void audio::drain::FormatUpdate::init() {
|
||||
m_type = "FormatUpdate";
|
||||
}
|
||||
|
||||
std::shared_ptr<audio::drain::FormatUpdate> audio::drain::FormatUpdate::create() {
|
||||
std::shared_ptr<audio::drain::FormatUpdate> tmp(new audio::drain::FormatUpdate());
|
||||
ememory::SharedPtr<audio::drain::FormatUpdate> audio::drain::FormatUpdate::create() {
|
||||
ememory::SharedPtr<audio::drain::FormatUpdate> tmp(new audio::drain::FormatUpdate());
|
||||
tmp->init();
|
||||
return tmp;
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ namespace audio {
|
||||
FormatUpdate();
|
||||
void init();
|
||||
public:
|
||||
static std::shared_ptr<audio::drain::FormatUpdate> create();
|
||||
static ememory::SharedPtr<audio::drain::FormatUpdate> create();
|
||||
/**
|
||||
* @brief Destructor
|
||||
*/
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include <audio/channel.h>
|
||||
#include <chrono>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <ememory/memory.h>
|
||||
#include "AutoLogInOut.h"
|
||||
#include "debug.h"
|
||||
|
||||
|
@ -101,13 +101,13 @@ bool audio::drain::Process::process(audio::Time& _time,
|
||||
return true;
|
||||
}
|
||||
|
||||
void audio::drain::Process::pushBack(const std::shared_ptr<audio::drain::Algo>& _algo) {
|
||||
void audio::drain::Process::pushBack(ememory::SharedPtr<audio::drain::Algo> _algo) {
|
||||
removeAlgoDynamic();
|
||||
_algo->setStatusFunction(std::bind(&audio::drain::Process::generateStatus, this, std::placeholders::_1, std::placeholders::_2));
|
||||
m_listAlgo.push_back(_algo);
|
||||
}
|
||||
|
||||
void audio::drain::Process::pushFront(const std::shared_ptr<audio::drain::Algo>& _algo) {
|
||||
void audio::drain::Process::pushFront(ememory::SharedPtr<audio::drain::Algo> _algo) {
|
||||
removeAlgoDynamic();
|
||||
_algo->setStatusFunction(std::bind(&audio::drain::Process::generateStatus, this, std::placeholders::_1, std::placeholders::_2));
|
||||
m_listAlgo.insert(m_listAlgo.begin(), _algo);
|
||||
@ -334,7 +334,7 @@ void audio::drain::Process::updateAlgo(size_t _position) {
|
||||
if ( out.getFormat() != audio::format_int16
|
||||
/* && out.getFormat() != format_float */) {
|
||||
// need add a format Updater
|
||||
std::shared_ptr<audio::drain::FormatUpdate> algo = audio::drain::FormatUpdate::create();
|
||||
ememory::SharedPtr<audio::drain::FormatUpdate> algo = audio::drain::FormatUpdate::create();
|
||||
algo->setTemporary();
|
||||
algo->setInputFormat(out);
|
||||
out.setFormat(audio::format_int16);
|
||||
@ -345,7 +345,7 @@ void audio::drain::Process::updateAlgo(size_t _position) {
|
||||
_position++;
|
||||
}
|
||||
// need add a resampler
|
||||
std::shared_ptr<audio::drain::Resampler> algo = audio::drain::Resampler::create();
|
||||
ememory::SharedPtr<audio::drain::Resampler> algo = audio::drain::Resampler::create();
|
||||
algo->setTemporary();
|
||||
algo->setInputFormat(out);
|
||||
out.setFrequency(in.getFrequency());
|
||||
@ -358,7 +358,7 @@ void audio::drain::Process::updateAlgo(size_t _position) {
|
||||
}
|
||||
if (out.getMap() != in.getMap()) {
|
||||
// need add a channel Reorder
|
||||
std::shared_ptr<audio::drain::ChannelReorder> algo = audio::drain::ChannelReorder::create();
|
||||
ememory::SharedPtr<audio::drain::ChannelReorder> algo = audio::drain::ChannelReorder::create();
|
||||
algo->setTemporary();
|
||||
algo->setInputFormat(out);
|
||||
out.setMap(in.getMap());
|
||||
@ -370,7 +370,7 @@ void audio::drain::Process::updateAlgo(size_t _position) {
|
||||
}
|
||||
if (out.getFormat() != in.getFormat()) {
|
||||
// need add a format Updater
|
||||
std::shared_ptr<audio::drain::FormatUpdate> algo = audio::drain::FormatUpdate::create();
|
||||
ememory::SharedPtr<audio::drain::FormatUpdate> algo = audio::drain::FormatUpdate::create();
|
||||
algo->setTemporary();
|
||||
algo->setInputFormat(out);
|
||||
out.setFormat(in.getFormat());
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include <audio/channel.h>
|
||||
#include <audio/drain/Algo.h>
|
||||
#include <chrono>
|
||||
#include <memory>
|
||||
#include <ememory/memory.h>
|
||||
#include <etk/os/FSNode.h>
|
||||
|
||||
namespace audio {
|
||||
@ -94,10 +94,10 @@ namespace audio {
|
||||
m_outputConfig = _interface;
|
||||
}
|
||||
protected:
|
||||
std::vector<std::shared_ptr<drain::Algo> > m_listAlgo;
|
||||
std::vector<ememory::SharedPtr<drain::Algo> > m_listAlgo;
|
||||
public:
|
||||
void pushBack(const std::shared_ptr<drain::Algo>& _algo);
|
||||
void pushFront(const std::shared_ptr<drain::Algo>& _algo);
|
||||
void pushBack(ememory::SharedPtr<drain::Algo> _algo);
|
||||
void pushFront(ememory::SharedPtr<drain::Algo> _algo);
|
||||
void clear() {
|
||||
m_isConfigured = false;
|
||||
m_listAlgo.clear();
|
||||
@ -105,44 +105,44 @@ namespace audio {
|
||||
size_t size() {
|
||||
return m_listAlgo.size();
|
||||
}
|
||||
std::vector<std::shared_ptr<drain::Algo> >::iterator begin() {
|
||||
std::vector<ememory::SharedPtr<drain::Algo> >::iterator begin() {
|
||||
return m_listAlgo.begin();
|
||||
}
|
||||
std::vector<std::shared_ptr<drain::Algo> >::iterator end() {
|
||||
std::vector<ememory::SharedPtr<drain::Algo> >::iterator end() {
|
||||
return m_listAlgo.end();
|
||||
}
|
||||
std::shared_ptr<drain::Algo> operator[](int32_t _id) {
|
||||
ememory::SharedPtr<drain::Algo> operator[](int32_t _id) {
|
||||
return m_listAlgo[_id];
|
||||
}
|
||||
|
||||
template<typename T> std::shared_ptr<T> get(const std::string& _name) {
|
||||
template<typename T> ememory::SharedPtr<T> get(const std::string& _name) {
|
||||
for (size_t iii=0; iii<m_listAlgo.size(); ++iii) {
|
||||
if (m_listAlgo[iii] == nullptr) {
|
||||
continue;
|
||||
}
|
||||
if (m_listAlgo[iii]->getName() == _name) {
|
||||
return std::dynamic_pointer_cast<T>(m_listAlgo[iii]);
|
||||
return ememory::dynamicPointerCast<T>(m_listAlgo[iii]);
|
||||
}
|
||||
}
|
||||
return std::shared_ptr<T>();
|
||||
return ememory::SharedPtr<T>();
|
||||
}
|
||||
template<typename T> std::shared_ptr<const T> get(const std::string& _name) const {
|
||||
template<typename T> ememory::SharedPtr<const T> get(const std::string& _name) const {
|
||||
for (size_t iii=0; iii<m_listAlgo.size(); ++iii) {
|
||||
if (m_listAlgo[iii] == nullptr) {
|
||||
continue;
|
||||
}
|
||||
if (m_listAlgo[iii]->getName() == _name) {
|
||||
return std::dynamic_pointer_cast<T>(m_listAlgo[iii]);
|
||||
return ememory::dynamicPointerCast<T>(m_listAlgo[iii]);
|
||||
}
|
||||
}
|
||||
return std::shared_ptr<const T>();
|
||||
return ememory::SharedPtr<const T>();
|
||||
}
|
||||
template<typename T> std::shared_ptr<T> get(int32_t _id) {
|
||||
return std::dynamic_pointer_cast<T>(m_listAlgo[_id]);
|
||||
template<typename T> ememory::SharedPtr<T> get(int32_t _id) {
|
||||
return ememory::dynamicPointerCast<T>(m_listAlgo[_id]);
|
||||
}
|
||||
template<typename T> void removeIfFirst() {
|
||||
if (m_listAlgo.size() > 0) {
|
||||
std::shared_ptr<T> algoEP = get<T>(0);
|
||||
ememory::SharedPtr<T> algoEP = get<T>(0);
|
||||
if (algoEP != nullptr) {
|
||||
m_listAlgo.erase(m_listAlgo.begin());
|
||||
}
|
||||
@ -150,7 +150,7 @@ namespace audio {
|
||||
}
|
||||
template<typename T> void removeIfLast() {
|
||||
if (m_listAlgo.size() > 0) {
|
||||
std::shared_ptr<T> algoEP = get<T>(m_listAlgo.size()-1);
|
||||
ememory::SharedPtr<T> algoEP = get<T>(m_listAlgo.size()-1);
|
||||
if (algoEP != nullptr) {
|
||||
m_listAlgo.erase(m_listAlgo.begin()+m_listAlgo.size()-1);
|
||||
}
|
||||
@ -158,7 +158,7 @@ namespace audio {
|
||||
}
|
||||
template<typename T> bool hasType() {
|
||||
for (size_t iii=0; iii<m_listAlgo.size(); ++iii) {
|
||||
std::shared_ptr<T> tmp = std::dynamic_pointer_cast<T>(m_listAlgo[iii]);
|
||||
ememory::SharedPtr<T> tmp = ememory::dynamicPointerCast<T>(m_listAlgo[iii]);
|
||||
if (tmp != nullptr) {
|
||||
return true;
|
||||
}
|
||||
|
@ -24,8 +24,8 @@ void audio::drain::Resampler::init() {
|
||||
m_residualTimeInResampler = audio::Duration(0);
|
||||
}
|
||||
|
||||
std::shared_ptr<audio::drain::Resampler> audio::drain::Resampler::create() {
|
||||
std::shared_ptr<audio::drain::Resampler> tmp(new audio::drain::Resampler());
|
||||
ememory::SharedPtr<audio::drain::Resampler> audio::drain::Resampler::create() {
|
||||
ememory::SharedPtr<audio::drain::Resampler> tmp(new audio::drain::Resampler());
|
||||
tmp->init();
|
||||
return tmp;
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
#ifdef HAVE_SPEEX_DSP_RESAMPLE
|
||||
#include <speex/speex_resampler.h>
|
||||
#endif
|
||||
#include <memory>
|
||||
#include <ememory/memory.h>
|
||||
|
||||
namespace audio {
|
||||
namespace drain {
|
||||
@ -29,7 +29,7 @@ namespace audio {
|
||||
Resampler();
|
||||
void init();
|
||||
public:
|
||||
static std::shared_ptr<audio::drain::Resampler> create();
|
||||
static ememory::SharedPtr<audio::drain::Resampler> create();
|
||||
/**
|
||||
* @brief Destructor
|
||||
*/
|
||||
|
@ -22,8 +22,8 @@ void audio::drain::Volume::init() {
|
||||
m_supportedFormat.push_back(audio::format_int16_on_int32);
|
||||
}
|
||||
|
||||
std::shared_ptr<audio::drain::Volume> audio::drain::Volume::create() {
|
||||
std::shared_ptr<audio::drain::Volume> tmp(new audio::drain::Volume());
|
||||
ememory::SharedPtr<audio::drain::Volume> audio::drain::Volume::create() {
|
||||
ememory::SharedPtr<audio::drain::Volume> tmp(new audio::drain::Volume());
|
||||
tmp->init();
|
||||
return tmp;
|
||||
}
|
||||
@ -341,7 +341,7 @@ bool audio::drain::Volume::process(audio::Time& _time,
|
||||
return true;
|
||||
}
|
||||
|
||||
void audio::drain::Volume::addVolumeStage(const std::shared_ptr<audio::drain::VolumeElement>& _volume) {
|
||||
void audio::drain::Volume::addVolumeStage(const ememory::SharedPtr<audio::drain::VolumeElement>& _volume) {
|
||||
if (_volume == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
#ifdef HAVE_SPEEX_DSP_RESAMPLE
|
||||
#include <speex/speex_resampler.h>
|
||||
#endif
|
||||
#include <memory>
|
||||
#include <ememory/memory.h>
|
||||
|
||||
namespace audio {
|
||||
namespace drain {
|
||||
@ -54,7 +54,7 @@ namespace audio {
|
||||
// TODO: Manage set volume
|
||||
class Volume : public audio::drain::Algo {
|
||||
private:
|
||||
std::vector<std::shared_ptr<drain::VolumeElement> > m_volumeList;
|
||||
std::vector<ememory::SharedPtr<drain::VolumeElement> > m_volumeList;
|
||||
// for float input :
|
||||
float m_volumeAppli;
|
||||
// for integer input :
|
||||
@ -69,7 +69,7 @@ namespace audio {
|
||||
Volume();
|
||||
void init();
|
||||
public:
|
||||
static std::shared_ptr<Volume> create();
|
||||
static ememory::SharedPtr<Volume> create();
|
||||
/**
|
||||
* @brief Destructor
|
||||
*/
|
||||
@ -86,7 +86,7 @@ namespace audio {
|
||||
virtual std::vector<audio::format> getFormatSupportedInput();
|
||||
virtual std::vector<audio::format> getFormatSupportedOutput();
|
||||
public:
|
||||
virtual void addVolumeStage(const std::shared_ptr<drain::VolumeElement>& _volume);
|
||||
virtual void addVolumeStage(const ememory::SharedPtr<drain::VolumeElement>& _volume);
|
||||
virtual bool setParameter(const std::string& _parameter, const std::string& _value);
|
||||
virtual std::string getParameter(const std::string& _parameter) const;
|
||||
virtual std::string getParameterProperty(const std::string& _parameter) const;
|
||||
|
@ -70,23 +70,23 @@ void appl::Windows::init() {
|
||||
if (m_gui != nullptr) {
|
||||
setSubWidget(m_gui);
|
||||
}
|
||||
subBind(ewol::widget::Button, "sample-rate-low", signalPressed, shared_from_this(), &appl::Windows::onCallbackSampleRateLow);
|
||||
subBind(ewol::widget::Button, "sample-rate-up", signalPressed, shared_from_this(), &appl::Windows::onCallbackSampleRateUp);
|
||||
subBind(ewol::widget::Button, "type-low", signalPressed, shared_from_this(), &appl::Windows::onCallbackTypeLow);
|
||||
subBind(ewol::widget::Button, "type-up", signalPressed, shared_from_this(), &appl::Windows::onCallbackTypeUp);
|
||||
subBind(ewol::widget::Button, "sample-rate-low", signalPressed, sharedFromThis(), &appl::Windows::onCallbackSampleRateLow);
|
||||
subBind(ewol::widget::Button, "sample-rate-up", signalPressed, sharedFromThis(), &appl::Windows::onCallbackSampleRateUp);
|
||||
subBind(ewol::widget::Button, "type-low", signalPressed, sharedFromThis(), &appl::Windows::onCallbackTypeLow);
|
||||
subBind(ewol::widget::Button, "type-up", signalPressed, sharedFromThis(), &appl::Windows::onCallbackTypeUp);
|
||||
|
||||
subBind(ewol::widget::Entry, "gain", signalModify, shared_from_this(), &appl::Windows::onCallbackGain);
|
||||
subBind(ewol::widget::Slider, "gain-slider", signalChange, shared_from_this(), &appl::Windows::onCallbackGainSlider);
|
||||
subBind(ewol::widget::Entry, "gain", signalModify, sharedFromThis(), &appl::Windows::onCallbackGain);
|
||||
subBind(ewol::widget::Slider, "gain-slider", signalChange, sharedFromThis(), &appl::Windows::onCallbackGainSlider);
|
||||
|
||||
subBind(ewol::widget::Entry, "frequency", signalModify, shared_from_this(), &appl::Windows::onCallbackFrequency);
|
||||
subBind(ewol::widget::Slider, "frequency-slider", signalChange, shared_from_this(), &appl::Windows::onCallbackFrequencySlider);
|
||||
subBind(ewol::widget::Entry, "frequency", signalModify, sharedFromThis(), &appl::Windows::onCallbackFrequency);
|
||||
subBind(ewol::widget::Slider, "frequency-slider", signalChange, sharedFromThis(), &appl::Windows::onCallbackFrequencySlider);
|
||||
|
||||
subBind(ewol::widget::Entry, "quality", signalModify, shared_from_this(), &appl::Windows::onCallbackQuality);
|
||||
subBind(ewol::widget::Slider, "quality-slider", signalChange, shared_from_this(), &appl::Windows::onCallbackQualitySlider);
|
||||
subBind(ewol::widget::Entry, "quality", signalModify, sharedFromThis(), &appl::Windows::onCallbackQuality);
|
||||
subBind(ewol::widget::Slider, "quality-slider", signalChange, sharedFromThis(), &appl::Windows::onCallbackQualitySlider);
|
||||
|
||||
subBind(ewol::widget::Button, "display16", signalPressed, shared_from_this(), &appl::Windows::onCallbackStart16);
|
||||
subBind(ewol::widget::Button, "displayFloat", signalPressed, shared_from_this(), &appl::Windows::onCallbackStartFloat);
|
||||
m_displayer = std::dynamic_pointer_cast<appl::widget::DisplayFrequency>(getSubObjectNamed("displayer"));
|
||||
subBind(ewol::widget::Button, "display16", signalPressed, sharedFromThis(), &appl::Windows::onCallbackStart16);
|
||||
subBind(ewol::widget::Button, "displayFloat", signalPressed, sharedFromThis(), &appl::Windows::onCallbackStartFloat);
|
||||
m_displayer = ememory::dynamicPointerCast<appl::widget::DisplayFrequency>(getSubObjectNamed("displayer"));
|
||||
onCallbackStart();
|
||||
}
|
||||
|
||||
|
@ -19,8 +19,8 @@ namespace appl {
|
||||
public:
|
||||
DECLARE_FACTORY(Windows);
|
||||
protected:
|
||||
std::shared_ptr<ewol::widget::Composer> m_gui;
|
||||
std::shared_ptr<appl::widget::DisplayFrequency> m_displayer;
|
||||
ememory::SharedPtr<ewol::widget::Composer> m_gui;
|
||||
ememory::SharedPtr<appl::widget::DisplayFrequency> m_displayer;
|
||||
void onCallbackSampleRateLow();
|
||||
void onCallbackSampleRateUp();
|
||||
void onCallbackTypeUp();
|
||||
|
@ -32,7 +32,7 @@ class MainApplication : public ewol::context::Application {
|
||||
// add local widget list:
|
||||
appl::widget::DisplayFrequency::createManagerWidget(_context.getWidgetManager());
|
||||
|
||||
std::shared_ptr<ewol::widget::Windows> basicWindows = appl::Windows::create();
|
||||
ememory::SharedPtr<ewol::widget::Windows> basicWindows = appl::Windows::create();
|
||||
// create the specific windows
|
||||
_context.setWindows(basicWindows);
|
||||
APPL_INFO("==> Init APPL (END)");
|
||||
|
@ -57,23 +57,23 @@ void appl::Windows::init() {
|
||||
if (m_gui != nullptr) {
|
||||
setSubWidget(m_gui);
|
||||
}
|
||||
subBind(ewol::widget::Button, "sample-rate-low", signalPressed, shared_from_this(), &appl::Windows::onCallbackSampleRateLow);
|
||||
subBind(ewol::widget::Button, "sample-rate-up", signalPressed, shared_from_this(), &appl::Windows::onCallbackSampleRateUp);
|
||||
subBind(ewol::widget::Button, "sample-rate-low", signalPressed, sharedFromThis(), &appl::Windows::onCallbackSampleRateLow);
|
||||
subBind(ewol::widget::Button, "sample-rate-up", signalPressed, sharedFromThis(), &appl::Windows::onCallbackSampleRateUp);
|
||||
|
||||
subBind(ewol::widget::Slider, "gain-0", signalChange, shared_from_this(), &appl::Windows::onCallbackGain0);
|
||||
subBind(ewol::widget::Slider, "gain-1", signalChange, shared_from_this(), &appl::Windows::onCallbackGain1);
|
||||
subBind(ewol::widget::Slider, "gain-2", signalChange, shared_from_this(), &appl::Windows::onCallbackGain2);
|
||||
subBind(ewol::widget::Slider, "gain-3", signalChange, shared_from_this(), &appl::Windows::onCallbackGain3);
|
||||
subBind(ewol::widget::Slider, "gain-4", signalChange, shared_from_this(), &appl::Windows::onCallbackGain4);
|
||||
subBind(ewol::widget::Slider, "gain-5", signalChange, shared_from_this(), &appl::Windows::onCallbackGain5);
|
||||
subBind(ewol::widget::Slider, "gain-6", signalChange, shared_from_this(), &appl::Windows::onCallbackGain6);
|
||||
subBind(ewol::widget::Slider, "gain-7", signalChange, shared_from_this(), &appl::Windows::onCallbackGain7);
|
||||
subBind(ewol::widget::Slider, "gain-8", signalChange, shared_from_this(), &appl::Windows::onCallbackGain8);
|
||||
subBind(ewol::widget::Slider, "gain-9", signalChange, shared_from_this(), &appl::Windows::onCallbackGain9);
|
||||
subBind(ewol::widget::Slider, "gain-0", signalChange, sharedFromThis(), &appl::Windows::onCallbackGain0);
|
||||
subBind(ewol::widget::Slider, "gain-1", signalChange, sharedFromThis(), &appl::Windows::onCallbackGain1);
|
||||
subBind(ewol::widget::Slider, "gain-2", signalChange, sharedFromThis(), &appl::Windows::onCallbackGain2);
|
||||
subBind(ewol::widget::Slider, "gain-3", signalChange, sharedFromThis(), &appl::Windows::onCallbackGain3);
|
||||
subBind(ewol::widget::Slider, "gain-4", signalChange, sharedFromThis(), &appl::Windows::onCallbackGain4);
|
||||
subBind(ewol::widget::Slider, "gain-5", signalChange, sharedFromThis(), &appl::Windows::onCallbackGain5);
|
||||
subBind(ewol::widget::Slider, "gain-6", signalChange, sharedFromThis(), &appl::Windows::onCallbackGain6);
|
||||
subBind(ewol::widget::Slider, "gain-7", signalChange, sharedFromThis(), &appl::Windows::onCallbackGain7);
|
||||
subBind(ewol::widget::Slider, "gain-8", signalChange, sharedFromThis(), &appl::Windows::onCallbackGain8);
|
||||
subBind(ewol::widget::Slider, "gain-9", signalChange, sharedFromThis(), &appl::Windows::onCallbackGain9);
|
||||
|
||||
subBind(ewol::widget::Button, "display16", signalPressed, shared_from_this(), &appl::Windows::onCallbackStart16);
|
||||
subBind(ewol::widget::Button, "displayFloat", signalPressed, shared_from_this(), &appl::Windows::onCallbackStartFloat);
|
||||
m_displayer = std::dynamic_pointer_cast<appl::widget::DisplayFrequency>(getSubObjectNamed("displayer"));
|
||||
subBind(ewol::widget::Button, "display16", signalPressed, sharedFromThis(), &appl::Windows::onCallbackStart16);
|
||||
subBind(ewol::widget::Button, "displayFloat", signalPressed, sharedFromThis(), &appl::Windows::onCallbackStartFloat);
|
||||
m_displayer = ememory::dynamicPointerCast<appl::widget::DisplayFrequency>(getSubObjectNamed("displayer"));
|
||||
onCallbackStart();
|
||||
}
|
||||
|
||||
@ -121,12 +121,12 @@ void appl::Windows::onCallbackGain(const float& _value, int32_t _id) {
|
||||
onCallbackStart();
|
||||
}
|
||||
|
||||
std::shared_ptr<audio::drain::Equalizer> appl::Windows::createEqualizer(enum audio::format _format) {
|
||||
ememory::SharedPtr<audio::drain::Equalizer> appl::Windows::createEqualizer(enum audio::format _format) {
|
||||
std::vector<audio::channel> map;
|
||||
map.push_back(audio::channel_frontCenter);
|
||||
audio::drain::IOFormatInterface format(map, _format, m_sampleRate);
|
||||
// create equalizer
|
||||
std::shared_ptr<audio::drain::Equalizer> out = audio::drain::Equalizer::create();
|
||||
ememory::SharedPtr<audio::drain::Equalizer> out = audio::drain::Equalizer::create();
|
||||
// configure input
|
||||
out->setInputFormat(format);
|
||||
// configure output
|
||||
@ -171,7 +171,7 @@ std::shared_ptr<audio::drain::Equalizer> appl::Windows::createEqualizer(enum aud
|
||||
|
||||
void appl::Windows::onCallbackStart() {
|
||||
APPL_INFO("start ");
|
||||
std::shared_ptr<audio::drain::Equalizer> eq = appl::Windows::createEqualizer();
|
||||
ememory::SharedPtr<audio::drain::Equalizer> eq = appl::Windows::createEqualizer();
|
||||
std::vector<std::pair<float,float> > theory = eq->calculateTheory();
|
||||
m_displayer->clear();
|
||||
m_displayer->setValue(theory);
|
||||
@ -180,7 +180,7 @@ void appl::Windows::onCallbackStart() {
|
||||
|
||||
void appl::Windows::onCallbackStart16() {
|
||||
APPL_INFO("start ");
|
||||
std::shared_ptr<audio::drain::Equalizer> eq = appl::Windows::createEqualizer(audio::format_int16);
|
||||
ememory::SharedPtr<audio::drain::Equalizer> eq = appl::Windows::createEqualizer(audio::format_int16);
|
||||
std::vector<std::pair<float,float> > pratic;
|
||||
size_t len = 512;
|
||||
std::vector<int16_t> data;
|
||||
@ -221,7 +221,7 @@ void appl::Windows::onCallbackStart16() {
|
||||
|
||||
void appl::Windows::onCallbackStartFloat() {
|
||||
APPL_INFO("start ");
|
||||
std::shared_ptr<audio::drain::Equalizer> eq = appl::Windows::createEqualizer(audio::format_float);
|
||||
ememory::SharedPtr<audio::drain::Equalizer> eq = appl::Windows::createEqualizer(audio::format_float);
|
||||
std::vector<std::pair<float,float> > pratic;
|
||||
size_t len = 512;
|
||||
std::vector<float> data;
|
||||
|
@ -19,8 +19,8 @@ namespace appl {
|
||||
public:
|
||||
DECLARE_FACTORY(Windows);
|
||||
protected:
|
||||
std::shared_ptr<ewol::widget::Composer> m_gui;
|
||||
std::shared_ptr<appl::widget::DisplayFrequency> m_displayer;
|
||||
ememory::SharedPtr<ewol::widget::Composer> m_gui;
|
||||
ememory::SharedPtr<appl::widget::DisplayFrequency> m_displayer;
|
||||
void onCallbackSampleRateLow();
|
||||
void onCallbackSampleRateUp();
|
||||
void onCallbackGain0(const float& _value) {
|
||||
@ -62,7 +62,7 @@ namespace appl {
|
||||
std::vector<int32_t> m_listSampleRate;
|
||||
|
||||
std::vector<float> m_listGain;
|
||||
std::shared_ptr<audio::drain::Equalizer> createEqualizer(enum audio::format _format = audio::format_float);
|
||||
ememory::SharedPtr<audio::drain::Equalizer> createEqualizer(enum audio::format _format = audio::format_float);
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ class MainApplication : public ewol::context::Application {
|
||||
// add local widget list:
|
||||
appl::widget::DisplayFrequency::createManagerWidget(_context.getWidgetManager());
|
||||
|
||||
std::shared_ptr<ewol::widget::Windows> basicWindows = appl::Windows::create();
|
||||
ememory::SharedPtr<ewol::widget::Windows> basicWindows = appl::Windows::create();
|
||||
// create the specific windows
|
||||
_context.setWindows(basicWindows);
|
||||
APPL_INFO("==> Init APPL (END)");
|
||||
|
Loading…
Reference in New Issue
Block a user