示例#1
0
bool appl::TextPluginCtags::onReceiveShortCut(appl::TextViewer& _textDrawer,
                                              const std::string& _shortCutName) {
	if (isEnable() == false) {
		return false;
	}
	if (_shortCutName == "appl::TextPluginCtags::OpenCtagsFile") {
		APPL_INFO("Request opening ctag file");
		ememory::SharedPtr<ewol::widget::FileChooser> tmpWidget = ewol::widget::FileChooser::create();
		if (tmpWidget == nullptr) {
			APPL_ERROR("Can not allocate widget  == > display might be in error");
			return true;
		}
		tmpWidget->propertyLabelTitle.set("Open Exuberant Ctags file");
		tmpWidget->propertyLabelValidate.set("Open");
		// try to get the current folder :
		std::string path = _textDrawer.getBufferPath();
		APPL_ERROR("get path : '" << path << "'");
		if (path != "") {
			tmpWidget->propertyPath.set(path);
		}
		ewol::getContext().getWindows()->popUpWidgetPush(tmpWidget);
		tmpWidget->signalValidate.connect(sharedFromThis(), &appl::TextPluginCtags::onCallbackOpenCtagsOpenFileReturn);
		return true;
	} else if (_shortCutName == "appl::TextPluginCtags::JumpDestination") {
		if (_textDrawer.hasBuffer() == false) {
			return false;
		}
		std::string textToSearch;
		if (_textDrawer.hasTextSelected() == true) {
			_textDrawer.copy(textToSearch, _textDrawer.selectStart(), _textDrawer.selectStop() );
		} else {
			appl::Buffer::Iterator _beginPos;
			appl::Buffer::Iterator _endPos;
			if (_textDrawer.getPosAround(_textDrawer.cursor(), _beginPos, _endPos) == false) {
				APPL_WARNING("Can not get data around...");
				return true;
			}
			_textDrawer.copy(textToSearch, _beginPos, _endPos);
		}
		jumpTo(textToSearch);
		return true;
	} else if (_shortCutName == "appl::TextPluginCtags::JumpBack") {
		if (_textDrawer.hasBuffer() == false) {
			return false;
		}
		return true;
	}
	return false;
}
示例#2
0
void appl::Windows::init() {
	ewol::widget::Windows::init();
	
	getObjectManager().periodicCall.connect(sharedFromThis(), &appl::Windows::onCallbackPeriodicUpdateCamera);
	
	m_env = ege::Environement::create();
	// Create basic Camera
	m_camera = ememory::makeShared<ege::camera::View>(vec3(30,30,-100), vec3(0,0,0));
	m_env->addCamera("basic", m_camera);
	
	ememory::SharedPtr<ege::widget::Scene> tmpWidget = ege::widget::Scene::create();
	if (tmpWidget == nullptr) {
		APPL_ERROR("Can not allocate widget ==> display might be in error");
	} else {
		tmpWidget->setEnv(m_env);
		tmpWidget->propertyExpand.set(bvec2(true,true));
		tmpWidget->propertyFill.set(bvec2(true,true));
		tmpWidget->setCamera("basic");
		setSubWidget(tmpWidget);
	}
	ememory::SharedPtr<ege::resource::Mesh> myMesh;
	// Create an external box :
	myMesh = createViewBoxStar();
	if (myMesh != nullptr) {
		m_env->addStaticMeshToDraw(myMesh);
	}
	myMesh = ege::resource::Mesh::createGrid(10, vec3(0,0,0), 5);
	if (myMesh != nullptr) {
		m_env->addStaticMeshToDraw(myMesh);
	}
}
示例#3
0
ememory::SharedPtr<appl::Buffer> appl::BufferManager::get(const std::string& _fileName, bool _createIfNeeded) {
	APPL_INFO("get('" << _fileName << "'," << _createIfNeeded << ")");
	for (auto &it : m_list) {
		if (it == nullptr) {
			continue;
		}
		if (it->getFileName() == _fileName) {
			return it;
		}
	}
	if (_createIfNeeded == true) {
		if (etk::FSNodeGetType(_fileName) == etk::typeNode_folder) {
			APPL_WARNING("try open a folder : " << _fileName);
			APPL_CRITICAL("plop");
			return nullptr;
		}
		ememory::SharedPtr<appl::Buffer> tmp = appl::Buffer::create();
		if (tmp == nullptr) {
			APPL_ERROR("Can not allocate the Buffer class : " << _fileName);
			return nullptr;
		}
		tmp->setParent(ewol::Object::sharedFromThis());
		tmp->loadFile(_fileName);
		m_list.push_back(tmp);
		APPL_INFO("Creata a open Buffer");
		signalNewBuffer.emit(tmp->getFileName());
		APPL_INFO("Creata a open Buffer (done)");
		return tmp;
	}
	return nullptr;
}
示例#4
0
bool appl::Highlight::isCompatible(const std::string& _name) {
	for (auto &it : m_listExtentions) {
		APPL_DEBUG("        check : " << it << "=?=" << _name);
		std::regex expression;
		try {
			expression.assign(it, std::regex_constants::optimize | std::regex_constants::ECMAScript);
		} catch (std::regex_error e) {
			APPL_ERROR("can not parse regex : '" << e.what() << "' for : " << it);
			continue;
		}
		std::smatch resultMatch;
		std::regex_search(_name.begin(), _name.end(), resultMatch, expression, std::regex_constants::match_continuous);
		if (resultMatch.size() <= 0) {
			continue;
		}
		APPL_VERBOSE("    - begin=" << std::distance(_name.begin(), resultMatch[0].first) << "  end=" << std::distance(_name.begin(), resultMatch[0].second));
		if (resultMatch[0].first != _name.begin()) {
			continue;
		}
		if (resultMatch[0].second != _name.end()) {
			continue;
		}
		return true;
	}
	return false;
}
示例#5
0
/**
 * @brief second pass of the hightlight pattern (have found something before)
 * @param[in] _upper upper pattern to find the data
 * @param[out] _metaData Output list of all find patern
 * @param[in] _buffer buffer where we need to search data
 */
void appl::Highlight::parseSubElement(const appl::HighlightInfo& _upper,
                                      std::vector<appl::HighlightInfo> &_metaData,
                                      std::string &_buffer) {
	if (_upper.patern->getSubPatternName().size() == 0) {
		return;
	}
	HL2_DEBUG("Parse element 0 => " << m_listHighlightNamed.size() <<
	          "  == > position search: (" << _upper.start << "," << _upper.stop << ")" );
	int64_t elementStart = _upper.start;
	int64_t elementStop = _upper.stop;
	appl::HighlightInfo resultat;
	// Find element in the list:
	auto itHL = m_listHighlightNamed.find(_upper.patern->getSubPatternName());
	if (itHL == m_listHighlightNamed.end()) {
		APPL_ERROR("Patern does not exist : " << _upper.patern->getSubPatternName() << " note : Removing it ...");
		_upper.patern->setSubPatternName("");
		return;
	}
	
	while (elementStart < elementStop) {
		//try to fond the HL in ALL of we have
		for (auto &it : itHL->second){
			HL2_DEBUG("Parse HL position search: (" << elementStart << "," << elementStop << ") in='" << _buffer[elementStart] << "' " << it.getPaternString().first << " " << it.getPaternString().second);
			// Stop the search to the end (to get the end of the pattern)
			bool ret = it.find(elementStart, elementStop, resultat, _buffer);
			if (ret == true) {
				_metaData.push_back(resultat);
				elementStart = resultat.stop-1;
				break;
			}
		}
		// Go to the next element (and search again ...).
		elementStart++;
	}
}
示例#6
0
void appl::BufferManager::setBufferSelected(ememory::SharedPtr<appl::Buffer> _bufferSelected) {
	m_bufferSelected = _bufferSelected;
	if (m_bufferSelected == nullptr) {
		APPL_ERROR("select a NULL buffer ...");
		propertySetOnWidgetNamed("appl-widget-display-name", "value", "---");
		return;
	}
	APPL_INFO("Set buffer selected");
	//signalSelectFile.emit(m_bufferSelected->getName());
	//propertySetOnWidgetNamed("appl-widget-display-name", "value", m_bufferSelected->getName());
	APPL_INFO("Set buffer selected (done)");
}
示例#7
0
void appl::BufferManager::open(const std::string& _fileName) {
	if (exist(_fileName) == true) {
		APPL_WARNING(" the element '" << _fileName << "' already exist ... just reselect it ...");
		signalSelectFile.emit(_fileName);
		propertySetOnWidgetNamed("appl-widget-display-name", "value", etk::FSNodeGetRealName(_fileName));
		return;
	}
	if (get(_fileName, true) == nullptr) {
		APPL_ERROR("Error get '" << _fileName << "' ... ");
		return;
	}
	signalSelectFile.emit(_fileName);
	propertySetOnWidgetNamed("appl-widget-display-name", "value", etk::FSNodeGetRealName(_fileName));
}
示例#8
0
ememory::SharedPtr<appl::Buffer> appl::BufferManager::createNewBuffer() {
	ememory::SharedPtr<appl::Buffer> tmp = appl::Buffer::create();
	if (tmp == nullptr) {
		APPL_ERROR("Can not allocate the Buffer (empty).");
		return nullptr;
	}
	tmp->setParent(ewol::Object::sharedFromThis());
	m_list.push_back(tmp);
	APPL_INFO("Create a new Buffer");
	signalNewBuffer.emit(tmp->getFileName());
	APPL_INFO("Create a new Buffer (done)");
	APPL_INFO("select Buffer");
	signalSelectFile.emit(tmp->getFileName());
	APPL_INFO("select Buffer (done)");
	return tmp;
}
示例#9
0
void appl::Windows::init() {
	//! [ewol_sample_HW_windows_init]
	ewol::widget::Windows::init();
	//! [ewol_sample_HW_windows_init]
	//! [ewol_sample_HW_windows_label]
	ewol::widget::LabelShared tmpWidget = ewol::widget::Label::create();
	if (tmpWidget == nullptr) {
		APPL_ERROR("Can not allocate widget ==> display might be in error");
	} else {
		tmpWidget->propertyValue.set("Hello <font color='blue'>World</font>");
		tmpWidget->propertyExpand.set(bvec2(true,true));
		// confidure the label as a windows sub-widget
		setSubWidget(tmpWidget);
	}
	//! [ewol_sample_HW_windows_label]
}
示例#10
0
/**
 * @brief main application function Initialisation
 */
void APP_Init(void)
{
	#ifdef __PLATFORM__Linux
		#ifdef MODE_RELEASE
			APPL_INFO("==> Init "PROJECT_NAME" (START) (Linux) (Release)");
		#else
			APPL_INFO("==> Init "PROJECT_NAME" (START) (Linux) (Debug)");
		#endif
	#else
		#ifdef MODE_RELEASE
			APPL_INFO("==> Init "PROJECT_NAME" (START) (Android) (Release)");
		#else
			APPL_INFO("==> Init "PROJECT_NAME" (START) (Android) (Debug)");
		#endif
	#endif
	ewol::ChangeSize(800, 600);
	etk::InitDefaultFolder(PROJECT_NAME);

	ewol::SetFontFolder("Font");
	
	#ifdef __PLATFORM__Android
		ewol::SetDefaultFont("freefont/FreeSerif.ttf", 19);
	#else
		ewol::SetDefaultFont("freefont/FreeSerif.ttf", 14);
	#endif
	
	basicWindows = new MainWindows();
	
	if (NULL == basicWindows) {
		APPL_ERROR("Can not allocate the basic windows");
		ewol::Stop();
		return;
	}
	// create the specific windows
	ewol::DisplayWindows(basicWindows);
	// set basic random sound
	generator::GenerateBasicRandom();
	// initialize output audio :
	ewol::audio::Init();
	ewol::audio::AddCallbackOutput(&generator::GenerateAudio);
	// add files
	APPL_INFO("show list of files : ");
	
	APPL_INFO("==> Init Edn (END)");
}
示例#11
0
void appl::TextPluginCtags::jumpTo(const std::string& _name) {
	if (m_ctagFile == nullptr) {
		APPL_WARNING("No ctags file open");
		return;
	}
	tagEntry entry;
	APPL_INFO("try to find the tag : " << _name);
	if (tagsFind (m_ctagFile, &entry, _name.c_str(), 0) != TagSuccess) {
		APPL_INFO("no tag find ...");
		return;
	}
	tagEntry entrySave = entry;
	int32_t numberOfTags = 0;
	
	// For all tags : Save in an internal Structure :
	std::string tmpFile(m_tagFolderBase + "/" + entry.file);
	etk::FSNode myfile(tmpFile);
	int32_t lineID = entry.address.lineNumber;
	printTag(&entry);
	
	if (tagsFindNext (m_ctagFile, &entry) == TagSuccess) {
		APPL_INFO("Multiple file destination ...");
		ememory::SharedPtr<appl::TagFileSelection> tmpWidget = appl::TagFileSelection::create();
		if (tmpWidget == nullptr) {
			APPL_ERROR("Can not allocate widget  == > display might be in error");
		} else {
			tmpWidget->addCtagsNewItem(myfile.getFileSystemName(), lineID);
			do {
				tmpFile = m_tagFolderBase + "/" + entry.file;
				myfile = tmpFile;
				lineID = entry.address.lineNumber;
				printTag(&entry);
				tmpWidget->addCtagsNewItem(myfile.getFileSystemName(), lineID);
			} while (tagsFindNext (m_ctagFile, &entry) == TagSuccess);
			ewol::getContext().getWindows()->popUpWidgetPush(tmpWidget);
			tmpWidget->signalSelect.connect(sharedFromThis(), &appl::TextPluginCtags::onCallbackOpenCtagsSelectReturn);
		}
	} else {
		jumpFile(myfile.getName(), lineID - 1);
	}
}
示例#12
0
void appl::Highlight::init(const std::string& _xmlFilename, const std::string& _colorFile) {
	gale::Resource::init(_xmlFilename);
	
	// keep color propertiy file :
	m_paintingProperties = appl::GlyphPainting::create(_colorFile);
	
	exml::Document doc;
	if (doc.load(_xmlFilename) == false) {
		APPL_ERROR(" can not load file XML : " << _xmlFilename);
		return;
	}
	exml::Element root = doc.nodes["EdnLang"];
	if (root.exist() == false) {
		APPL_ERROR("(l ?) main node not find: 'EdnLang' ...");
		return;
	}
	m_typeName = root.attributes["lang"];
	int32_t level1 = 0;
	int32_t level2 = 0;
	// parse all the elements :
	for (const auto it : root.nodes) {
		const exml::Element child = it.toElement();
		if (child.exist() == false) {
			// trash here all that is not element ...
			continue;
		}
		if (child.getValue() == "ext") {
			std::string myData = child.getText();
			if (myData.size()!=0) {
				//HL_DEBUG("(l %d) node fined : %s=\"%s\"", child->Row(), child->Value() , myData);
				m_listExtentions.push_back(myData);
			}
		} else if (child.getValue() == "pass1") {
			// get sub Nodes ...
			for (const auto it2 : child.nodes) {
				const exml::Element passChild = it2.toElement();
				if (passChild.exist() == false) {
					continue;
				}
				if (passChild.getValue() != "rule") {
					APPL_ERROR("(l "<< passChild.getPos() << ") node not suported : '"<< passChild.getValue() << "' must be [rule]" );
					continue;
				}
				// Create the patern in list
				m_listHighlightPass1.push_back(HighlightPattern(m_paintingProperties, passChild, level1++));
			}
		} else if (child.getValue() == "pass2") {
			// get sub Nodes ...
			for (const auto it2 : child.nodes) {
				const exml::Element passChild = it2.toElement();
				if (passChild.exist() == false) {
					continue;
				}
				if (passChild.getValue() != "rule") {
					APPL_ERROR("(l "<< passChild.getPos() << ") node not suported : '"<< passChild.getValue() << "' must be [rule]" );
					continue;
				}
				// Create the patern in list
				m_listHighlightPass2.push_back(HighlightPattern(m_paintingProperties, passChild, level2++));
			}
		} else if (child.getValue() == "pass") {
			std::string attributeName = child.attributes["name"];
			if (attributeName == "") {
				APPL_ERROR("Can not parse an element pass with no attribute name ... ligne=" << child.getPos());
				continue;
			}
			m_listHighlightNamed.insert(std::pair<std::string, std::vector<HighlightPattern>>(attributeName, std::vector<HighlightPattern>()));
			auto it3 = m_listHighlightNamed.find(attributeName);
			int32_t level3=0;
			// get sub Nodes ...
			for (const auto it2 : child.nodes) {
				const exml::Element passChild = it2.toElement();
				if (passChild.exist() == false) {
					continue;
				}
				if (passChild.getValue() != "rule") {
					APPL_ERROR("(l "<< passChild.getPos() << ") node not suported : '"<< passChild.getValue() << "' must be [rule]" );
					continue;
				}
				// add element in the list
				it3->second.push_back(HighlightPattern(m_paintingProperties, passChild, level3++));
			}
		} else {
			APPL_ERROR("(l "<< child.getPos() << ") node not suported : '"<< child.getValue() << "' must be [ext,pass1,pass2]" );
		}
	}
}
示例#13
0
int main(int _argc, const char** _argv) {
	// the only one init for etk:
	etk::init(_argc, _argv);
	std::string fbName = "";
	std::string micName = "";
	int32_t filterSize = 0;
	float mu = 0.0f;
	bool nlms = false;
	bool perf = false;
	int64_t sampleRate = 48000;
	for (int32_t iii=0; iii<_argc ; ++iii) {
		std::string data = _argv[iii];
		if (etk::start_with(data,"--fb=")) {
			fbName = &data[5];
		} else if (etk::start_with(data,"--mic=")) {
			micName = &data[6];
		} else if (etk::start_with(data,"--filter-size=")) {
			data = &data[14];
			filterSize = etk::string_to_int32_t(data);
		} else if (etk::start_with(data,"--mu=")) {
			data = &data[5];
			mu = etk::string_to_float(data);
		} else if (data == "--nlms") {
			nlms = true;
		} else if (data == "--perf") {
			perf = true;
		} else if (etk::start_with(data,"--sample-rate=")) {
			data = &data[14];
			sampleRate = etk::string_to_int32_t(data);
		} else if (    data == "-h"
		            || data == "--help") {
			APPL_INFO("Help : ");
			APPL_INFO("    ./xxx --fb=file.raw --mic=file.raw");
			APPL_INFO("        --fb=YYY.raw        Feedback file");
			APPL_INFO("        --mic=XXX.raw       Microphone file");
			APPL_INFO("        --filter-size=xxx   Size of the filter");
			APPL_INFO("        --mu=0.xx           Mu value -1.0< mu < -1.0");
			APPL_INFO("        --nlms              NLMS version");
			APPL_INFO("        --perf              Enable performence test (little slower but real performence test)");
			APPL_INFO("        --sample-rate=XXXX  Signal sample rate (default 48000)");
			exit(0);
		}
	}
	if (    fbName == ""
	     || micName == "") {
		APPL_ERROR("Can not Process missing parameters...");
		exit(-1);
	}
	APPL_INFO("Read FeedBack:");
	std::vector<int16_t> fbData = etk::FSNodeReadAllDataType<int16_t>(fbName);
	APPL_INFO("    " << fbData.size() << " samples");
	APPL_INFO("Read Microphone:");
	std::vector<int16_t> micData = etk::FSNodeReadAllDataType<int16_t>(micName);
	APPL_INFO("    " << micData.size() << " samples");
	// resize output :
	std::vector<int16_t> output;
	output.resize(std::min(fbData.size(), micData.size()), 0);
	// process in chunk of 256 samples
	int32_t blockSize = 256;
	// end filter :
	std::vector<float> filter;
	std11::chrono::nanoseconds totalTimeProcessing(0);
	std11::chrono::nanoseconds minProcessing(99999999999999LL);
	std11::chrono::nanoseconds maxProcessing(0);
	int32_t totalIteration = 0;
	if (nlms == false) {
		APPL_INFO("***********************");
		APPL_INFO("**         LMS       **");
		APPL_INFO("***********************");
		audio::algo::aec::Lms algo;
		if (filterSize != 0) {
			algo.setFilterSize(filterSize);
		}
		if (mu != 0.0f) {
			algo.setMu(mu);
		}
		int32_t lastPourcent = -1;
		for (int32_t iii=0; iii<output.size()/blockSize; ++iii) {
			if (lastPourcent != 100*iii / (output.size()/blockSize)) {
				lastPourcent = 100*iii / (output.size()/blockSize);
				APPL_INFO("Process : " << iii*blockSize << "/" << int32_t(output.size()/blockSize)*blockSize << " " << lastPourcent << "/100");
			} else {
				APPL_VERBOSE("Process : " << iii*blockSize << "/" << int32_t(output.size()/blockSize)*blockSize);
			}
			std11::chrono::steady_clock::time_point timeStart = std11::chrono::steady_clock::now();
			algo.process(&output[iii*blockSize], &fbData[iii*blockSize], &micData[iii*blockSize], blockSize);
			if (perf == true) {
				std11::chrono::steady_clock::time_point timeEnd = std11::chrono::steady_clock::now();
				std11::chrono::nanoseconds time = timeEnd - timeStart;
				minProcessing = std::min(minProcessing, time);
				maxProcessing = std::max(maxProcessing, time);
				totalTimeProcessing += time;
				totalIteration++;
				usleep(10000);
			}
		}
		filter = algo.getFilter();
	} else {
		APPL_INFO("***********************");
		APPL_INFO("**    NLMS (power)   **");
		APPL_INFO("***********************");
		audio::algo::aec::Nlms algo;
		if (filterSize != 0) {
			algo.setFilterSize(filterSize);
		}
		int32_t lastPourcent = -1;
		for (int32_t iii=0; iii<output.size()/blockSize; ++iii) {
			if (lastPourcent != 100*iii / (output.size()/blockSize)) {
				lastPourcent = 100*iii / (output.size()/blockSize);
				APPL_INFO("Process : " << iii*blockSize << "/" << int32_t(output.size()/blockSize)*blockSize << " " << lastPourcent << "/100");
			} else {
				APPL_VERBOSE("Process : " << iii*blockSize << "/" << int32_t(output.size()/blockSize)*blockSize);
			}
			algo.process(&output[iii*blockSize], &fbData[iii*blockSize], &micData[iii*blockSize], blockSize);
		}
		filter = algo.getFilter();
	}
	if (perf == true) {
		APPL_INFO("Performance Result: ");
		APPL_INFO("    blockSize=" << blockSize << " sample");
		APPL_INFO("    min=" << minProcessing.count() << " ns");
		APPL_INFO("    max=" << maxProcessing.count() << " ns");
		APPL_INFO("    avg=" << totalTimeProcessing.count()/totalIteration << " ns");
		
		APPL_INFO("    min=" << (float((minProcessing.count()*sampleRate)/blockSize)/1000000000.0)*100.0 << " %");
		APPL_INFO("    max=" << (float((maxProcessing.count()*sampleRate)/blockSize)/1000000000.0)*100.0 << " %");
		APPL_INFO("    avg=" << (float(((totalTimeProcessing.count()/totalIteration)*sampleRate)/blockSize)/1000000000.0)*100.0 << " %");
	}
	etk::FSNodeWriteAllDataType<int16_t>("output.raw", output);
	etk::FSNodeWriteAllDataType<float>("filter.raw", filter);
	
}
示例#14
0
void appl::Windows::onCallbackPlay() {
	#if 0
		APPL_INFO("Play Requested ...");
		m_process = audio::blockEngine::Processing::create();
		if (m_process == null) {
			APPL_ERROR("can not create processing ...");
			return;
		}
		APPL_INFO("Create Generator ...");
		ememory::SharedPtr<audio::blockEngine::GeneratorFile> generator = audio::blockEngine::GeneratorFile::create();
		if (generator == null) {
			APPL_ERROR("can not create Generator ...");
			return;
		}
		generator->propertyName.set("myGenerator");
		m_process->addBlock(generator);
		
		APPL_INFO("Create DECODER ...");
		ememory::SharedPtr<audio::blockEngine::BlockDecoder> decoder = audio::blockEngine::BlockDecoder::create();
		if (decoder == null) {
			APPL_ERROR("can not create Generator ...");
			return;
		}
		decoder->propertyName.set("myDecoder");
		m_process->addBlock(decoder);
		
		APPL_INFO("Create Receiver ...");
		ememory::SharedPtr<audio::blockEngine::ReceiverRtAudio> receiver = audio::blockEngine::ReceiverRtAudio::create();
		if (receiver == null) {
			APPL_ERROR("can not create Receiver ...");
			return;
		}
		receiver->propertyName.set("myReceiver");
		m_process->addBlock(receiver);
		
		m_process->linkBlock("myGenerator", "out","myDecoder", "in");
		m_process->linkBlock("myDecoder", "out","myReceiver", "in");
		
		m_process->start();
		return;
	#else
		APPL_INFO("Play Requested ...");
		m_process = audio::blockEngine::Processing::create();
		if (m_process == null) {
			APPL_ERROR("can not create processing ...");
			return;
		}
		m_process->propertyName.set("main Process");
		APPL_INFO("Create Generator Sinus");
		ememory::SharedPtr<audio::blockEngine::GeneratorSignal> generator = audio::blockEngine::GeneratorSignal::create();
		if (generator == null) {
			APPL_ERROR("can not create Generator ...");
			return;
		}
		generator->propertyName.set("myGenerator");
		m_process->addBlock(generator);
		
		APPL_INFO("Create Receiver ...");
		ememory::SharedPtr<audio::blockEngine::ReceiverRiver> receiver = audio::blockEngine::ReceiverRiver::create();
		if (receiver == null) {
			APPL_ERROR("can not create Receiver ...");
			return;
		}
		receiver->propertyName.set("myReceiver");
		m_process->addBlock(receiver);
		
		m_process->linkBlock("myGenerator", "out","myReceiver", "in");
		
		m_process->start();
		return;
	#endif
}
示例#15
0
文件: global.cpp 项目: HeeroYui/edn
void globals::ParameterGlobalsGui::init() {
	ewol::widget::Sizer::init();
	propertyMode.set(ewol::widget::Sizer::modeVert);
	ememory::SharedPtr<ewol::widget::CheckBox> myCheckbox;
	ememory::SharedPtr<ewol::widget::Spacer> mySpacer;
	
	mySpacer = ewol::widget::Spacer::create();
	if (mySpacer == nullptr) {
		APPL_ERROR("Can not allocate widget  == > display might be in error");
	} else {
		mySpacer->propertyExpand.set(bvec2(true,true));
		subWidgetAdd(mySpacer);
	}
	myCheckbox = ewol::widget::CheckBox::create();
	if (myCheckbox == nullptr) {
		APPL_ERROR("Can not allocate widget  == > display might be in error");
	} else {
		//TODO : myCheckbox->propertyLabel.set("Automatic Indentation");
		myCheckbox->propertyExpand.set(bvec2(true,false));
		myCheckbox->propertyValue.set(isSetAutoIndent());
		myCheckbox->signalValue.connect(sharedFromThis(), &globals::ParameterGlobalsGui::onCallbackIndentation);
		subWidgetAdd(myCheckbox);
	}
	myCheckbox = ewol::widget::CheckBox::create();
	if (myCheckbox == nullptr) {
		APPL_ERROR("Can not allocate widget  == > display might be in error");
	} else {
		//TODO : myCheckbox->propertyLabel.set("Display space char (' ')");
		myCheckbox->propertyExpand.set(bvec2(true,false));
		myCheckbox->propertyValue.set(isSetDisplaySpaceChar());
		myCheckbox->signalValue.connect(sharedFromThis(), &globals::ParameterGlobalsGui::onCallbackSpace);
		subWidgetAdd(myCheckbox);
	}
	myCheckbox = ewol::widget::CheckBox::create();
	if (myCheckbox == nullptr) {
		APPL_ERROR("Can not allocate widget  == > display might be in error");
	} else {
		//TODO : myCheckbox->propertyLabel.set("Display tabulation char ('\\t')");
		
		myCheckbox->propertyExpand.set(bvec2(true,false));
		myCheckbox->propertyValue.set(isSetDisplayTabChar());
		myCheckbox->signalValue.connect(sharedFromThis(), &globals::ParameterGlobalsGui::onCallbackTabulation);
		subWidgetAdd(myCheckbox);
	}
	myCheckbox = ewol::widget::CheckBox::create();
	if (myCheckbox == nullptr) {
		APPL_ERROR("Can not allocate widget  == > display might be in error");
	} else {
		//TODO : myCheckbox->propertyLabel.set("Display end of line ('\\n')");
		myCheckbox->propertyExpand.set(bvec2(true,false));
		myCheckbox->propertyValue.set(isSetDisplayEndOfLine());
		myCheckbox->signalValue.connect(sharedFromThis(), &globals::ParameterGlobalsGui::onCallbackEndOfLine);
		subWidgetAdd(myCheckbox);
	}
	myCheckbox = ewol::widget::CheckBox::create();
	if (myCheckbox == nullptr) {
		APPL_ERROR("Can not allocate widget  == > display might be in error");
	} else {
		//TODO : myCheckbox->propertyLabel.set("switch Rounded/default");
		myCheckbox->propertyExpand.set(bvec2(true,false));
		myCheckbox->propertyValue.set(isSetDisplayEndOfLine());
		myCheckbox->signalValue.connect(sharedFromThis(), &globals::ParameterGlobalsGui::onCallbackRounded);
		subWidgetAdd(myCheckbox);
	}
}