예제 #1
0
void OpenNiManager::startAll() {
	LOG->info("startAll()");

	for(int i = 0, n = this->cams.size(); i < n; i++) {
		Cam* currentCam = cams.at(i);
		std::cout << (i+1) << ". " << currentCam->toString() << std::endl;

		if(this->initDescriptor->isImageGeneratorRequired()) {
			xn::ImageGenerator generator = currentCam->getImageGenerator();
			CHECK_RC(generator.StartGenerating(), "generator.StartGenerating()");
		}

		if(this->initDescriptor->isUserGeneratorRequired()) {
			this->userManager->start();
		}
	}
}
예제 #2
0
void OpenNiManager::shutdown() {
	LOG->info("shutdown()");

	for(int i = 0, n = this->cams.size(); i < n; i++) {
		Cam* currentCam = cams.at(i);

		if(this->initDescriptor->isImageGeneratorRequired()) {
			xn::ImageGenerator generator = currentCam->getImageGenerator();
			if(generator.IsGenerating()) {
				printf("stop generating cam %s\n", currentCam->toString().c_str());
				generator.StopGenerating();
				// TODO "SOFT"_CHECK_RC(generator.StopGenerating(), "generator.StopGenerating()");
			}
		}

		if(this->initDescriptor->isUserGeneratorRequired()) {
			this->userManager->stop();
		}
	}

	this->context.StopGeneratingAll();
	this->context.Shutdown();
}