[DEV] update to new binding

This commit is contained in:
Edouard DUPIN 2014-08-22 23:30:19 +02:00
parent 69e1259b27
commit e1e95e46e0
2 changed files with 79 additions and 77 deletions

View File

@ -12,6 +12,7 @@
#include <ewol/widget/Label.h>
#include <etk/tool.h>
#include <eaudiofx/eaudiofx.h>
#include <ewol/widget/Button.h>
#include <eaudiofx/base/GeneratorFile.h>
#include <eaudiofx/core/BlockDecoder.h>
@ -29,6 +30,7 @@ appl::Windows::Windows() {
}
void appl::Windows::init() {
ewol::widget::Windows::init();
setTitle("example 001_HelloWord");
std::string composition = std::string("");
composition += "<sizer mode='vert'>\n";
@ -53,14 +55,13 @@ void appl::Windows::init() {
return;
}
setSubWidget(m_composer);
m_composer->registerOnEventNameWidget(shared_from_this(), "bt-play1", "pressed", g_eventPlay1);
m_composer->registerOnEventNameWidget(shared_from_this(), "bt-play2", "pressed", g_eventPlay2);
composerBind(ewol::widget::Button, "bt-play1", signalPressed, shared_from_this(), &appl::Windows::onCallbackPlay);
composerBind(ewol::widget::Button, "bt-play2", signalPressed, shared_from_this(), &appl::Windows::onCallbackStop);
}
eaudiofx::Processing* process = NULL;
void appl::Windows::onReceiveMessage(const ewol::object::Message& _msg) {
if (_msg.getMessage() == g_eventPlay1) {
void appl::Windows::onCallbackPlay() {
#if 0
APPL_INFO("Play Requested ...");
process = new eaudiofx::Processing();
@ -130,11 +131,10 @@ void appl::Windows::onReceiveMessage(const ewol::object::Message& _msg) {
return;
#endif
}
if (_msg.getMessage() == g_eventPlay2) {
void appl::Windows::onCallbackStop() {
if (process != NULL) {
process->stop();
}
return;
}
}

View File

@ -21,8 +21,10 @@ namespace appl {
void init();
public:
DECLARE_FACTORY(Windows);
public: // herited functions
virtual void onReceiveMessage(const ewol::object::Message& _msg);
public: // callback functions
void onCallbackPlay();
void onCallbackStop();
};
};