[DEV] add a basic tool to record audio sentence/ word or other things ...

This commit is contained in:
2019-01-04 21:29:32 +01:00
parent 1773297dab
commit 715598a0ae
9 changed files with 738 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
/** @file
* @author Edouard DUPIN
* @copyright 2015, Edouard DUPIN, all right reserved
* @copyright 2019, Edouard DUPIN, all right reserved
* @license MPL v2.0 (see license file)
*/
@@ -15,6 +15,7 @@
#include <ewol/widget/Manager.hpp>
#include <ewol/context/Context.hpp>
#include <audio/river/widget/TemporalViewer.hpp>
#include <etk/theme/theme.hpp>
static const etk::String configurationRiver =
"{\n"
@@ -34,9 +35,38 @@ static const etk::String configurationRiver =
class MainApplication : public ewol::context::Application {
public:
bool init(ewol::Context& _context, size_t _initId) {
APPL_INFO("==> Init APPL (START) [" << gale::getBoardType() << "] (" << gale::getCompilationMode() << ")");
virtual void onCreate(ewol::Context& _context) override {
APPL_INFO(" == > CREATE ... (START) [" << gale::getBoardType() << "] (" << gale::getCompilationMode() << ") (BEGIN)");
for( int32_t iii=0 ; iii<_context.getCmd().size(); iii++) {
etk::String tmpppp = _context.getCmd().get(iii);
if ( tmpppp == "-h"
|| tmpppp == "--help") {
//APPL_PRINT(" --ctags=xxx c-flags-file-name" );
exit(0);
}
}
etk::theme::setName("COLOR", "color/white/");
_context.setSize(vec2(800, 600));
_context.setTitle("edn");
// select internal data for font ...
_context.getFontDefault().setUseExternal(true);
#ifdef __TARGET_OS__Android
_context.getFontDefault().set("FreeSerif", 19);
#else
_context.getFontDefault().set("FreeSerif;DejaVuSansMono",14);
#endif
// set the application icon ...
//_context.setIcon("DATA:///icon.png");
APPL_INFO("==> CREATE ... (END)");
}
void onStart(ewol::Context& _context) override {
APPL_INFO("==> START ... (BEGIN)");
// init internal global value
audio::river::initString(configurationRiver);
_context.setSize(vec2(800, 600));
@@ -48,15 +78,54 @@ class MainApplication : public ewol::context::Application {
audio::river::widget::TemporalViewer::createManagerWidget(_context.getWidgetManager());
ememory::SharedPtr<ewol::widget::Windows> basicWindows = appl::Windows::create();
if (basicWindows == null) {
APPL_ERROR("Can not allocate the basic windows");
_context.exit(-1);
return;
}
// create the specific windows
_context.setWindows(basicWindows);
APPL_INFO("==> Init APPL (END)");
return true;
// add files
APPL_INFO("show list of files : ");
/*
for( int32_t iii=0 ; iii<_context.getCmd().size(); iii++) {
etk::String tmpppp = _context.getCmd().get(iii);
if (tmpppp.startWith("--ctags=") == true) {
etk::String name = tmpppp.extract(8);
APPL_INFO("Load ctag file : \"" << name << "\"" );
appl::setCtagsFileName(name);
} else if ( tmpppp == "-h"
|| tmpppp == "--help") {
// nothing to do ...
} else {
etk::Path file(tmpppp);
if (etk::path::isFile(file) == true) {
APPL_INFO("need load file : \"" << file << "\"" );
m_bufferManager->open(file);
} else if (etk::path::isDirectory(file) == true) {
etk::Vector<etk::Path> listOfFiles = etk::path::list(file, etk::path::LIST_FILE);
for (auto &it: listOfFiles) {
if (etk::path::isFile(it) == true) {
APPL_INFO("need load file : \"" << it << "\"" );
m_bufferManager->open(it);
}
}
}
}
}
*/
APPL_INFO("==> START ... (END)");
return;
}
void unInit(ewol::Context& _context) {
APPL_INFO("==> Un-Init APPL (START)");
// nothing to do...
APPL_INFO("==> Un-Init APPL (END)");
void onStop(ewol::Context& _context) override {
APPL_INFO("==> STOP ... (START)");
APPL_INFO("==> STOP ... (END)");
}
void onKillDemand(ewol::Context& _context) override {
APPL_INFO("==> User demand kill ... (START)");
_context.exit(0);
APPL_INFO("==> User demand kill ... (END)");
}
};