コード例 #1
0
ファイル: test.cpp プロジェクト: Gingar/port
int main() {
	PresentationEngineManager* pem;
	pem = new PresentationEngineManager(0, 0, 0, 0, 0, false);
	pem->pausePressed();

	//TODO: tests
	return 0;
}
コード例 #2
0
	void* PresentationEngineManager::eventReceived(void* ptr) {
		struct inputEventNotification* ev;
		PresentationEngineManager* p;
		string parameter;
		vector<string>* cmds;

		ev             = (struct inputEventNotification*)ptr;

		const int code = ev->code;
		p              = ev->p;
		parameter      = ev->parameter;
		cmds           = ev->cmds;

#ifdef DSMCCWRAPPERLISTENER_H_
		ITuner* t;
		t = ev->tuner;
#endif

		if (parameter != "" && code == IPlayer::PL_NOTIFY_STOP) {
			::usleep(100000);
			p->presentationCompleted(parameter);

		} else if (code == CodeMap::KEY_POWER || code == CodeMap::KEY_F10) {
			sb->stop();
			::usleep(900000);
			printTimeStamp();
			cout << "PresentationEngineManager::eventReceived power off!";
			cout << endl;
			p->setIsLocalNcl(true, NULL);
			p->stopPresentation();

		} else if (code == CodeMap::KEY_STOP || code == CodeMap::KEY_F11) {
			sb->stop();
			::usleep(900000);
			printTimeStamp();
			cout << "PresentationEngineManager::eventReceived stop apps!";
			cout << endl;
			p->stopPresentation();

		} else if (code == CodeMap::KEY_PRINTSCREEN ||
				code == CodeMap::KEY_SUPER) {

			p->getScreenShot();

		} else if (code == CodeMap::KEY_PAUSE || code == CodeMap::KEY_F12) {

			sb->pause();
			p->pausePressed();

#ifdef DSMCCWRAPPERLISTENER_H_
		} else if (t != NULL) {
			if (code == CodeMap::KEY_CHANNEL_UP ||
					code == CodeMap::KEY_PAGE_UP) {

				t->channelUp();

			} else if (code == CodeMap::KEY_CHANNEL_DOWN ||
					code == CodeMap::KEY_PAGE_DOWN) {

				t->channelDown();
			}
#endif

		} else if (code == CodeMap::KEY_PLUS_SIGN && cmds != NULL) {
			if (!cmds->empty()) {
				string cmd = *(cmds->begin());
				cout << "RUNNING CURRENT COMMAND '" << cmd;
				cout << "'" << endl;

				p->readCommand(cmd);
				cmds->erase(cmds->begin());
				cmds->push_back(cmd);
			}

		} else if (code == CodeMap::KEY_GREATER_THAN_SIGN) {
			cout << ">> TIME SHIFT >>" << endl;
			p->updateFormatters(UC_SHIFT, "forward");

		} else if (code == CodeMap::KEY_LESS_THAN_SIGN) {
			cout << "<< TIME SHIFT <<" << endl;
			p->updateFormatters(UC_SHIFT, "backward");
		}

		delete ev;
		return NULL;
	}