コード例 #1
0
ファイル: PlainTxtPlayer.cpp プロジェクト: lince/ginga-wac
	void PlainTxtPlayer::play() {
		Player::play();
		if (surface != NULL && surface->getContent() != NULL) {
			wclog << "PlainTxtPlayer::play ok" << endl;
			loadTxt();

		} else {
			wclog << "PlainTxtPlayer::play warning" << endl;
		}
	}
コード例 #2
0
void LLAgentPilot::load()
{
	std::string txt_filename = gSavedSettings.getString("StatsPilotFile");
	std::string xml_filename = gSavedSettings.getString("StatsPilotXMLFile");
	if (LLFile::isfile(xml_filename))
	{
		loadXML(xml_filename);
	}
	else if (LLFile::isfile(txt_filename))
	{
		loadTxt(txt_filename);
	}
	else
	{
		lldebugs << "no autopilot file found" << llendl;
		return;
	}
}
コード例 #3
0
ファイル: PlainTxtPlayer.cpp プロジェクト: lince/ginga-wac
	void PlainTxtPlayer::setPropertyValue(
			string name, string value, double duration, double by) {

		IWindow* parent;

		pthread_mutex_lock(&mutex);

		//cout << "PlainTxtPlayer::setPropertyValue name = '" << name.c_str();
		//cout << "' value = '" << value.c_str() << "'" << endl;
		vector<string>* params;
		bool refresh = true;

		if (surface == NULL || surface->getContent() == NULL) {
			refresh = false;
		}

		if (name == "x-fontColor" && value != "") {
			if (fontColor != NULL) {
				delete fontColor;
				fontColor = NULL;
			}

			fontColor = new Color(value);

		} else if (name == "x-fontSize" && value != "" &&
				isNumeric((void*)(value.c_str()))) {

			setFontSize((int)(stof(value)));

		} else if (name == "x-fontUri" && value != "") {
			setFont(value);

		} else if (name == "x-bgColor" && value != "") {
			if (surface != NULL) {
				if (bgColor != NULL) {
					delete bgColor;
					bgColor = NULL;
				}

				if (value == "black") {
					bgColor = new Color(0x10, 0x10, 0x10, 0xFF);

				} else {
					bgColor = new Color(value);
				}

				//this->surface->setCaps(0);
				surface->clearContent();
				surface->setBgColor(bgColor);
			}

		} else if (name == "x-rgbBgColor" && value != "") {
			params = split(value, ",");
			if (params->size() == 3) {
				if (surface != NULL) {
					if (bgColor != NULL) {
						delete bgColor;
						bgColor = NULL;
					}

					bgColor = new Color(
							(int)stof((*params)[0]),
							(int)stof((*params)[1]),
							(int)stof((*params)[2]));

					//this->surface->setCaps(0);
					surface->clearContent();
					surface->setBgColor(bgColor);
				}

			} else {
				refresh = false;
			}

			delete params;
			params = NULL;

		} else if (name == "x-rgbFontColor" && value != "") {
			params = split(value, ",");
			if (params->size() == 3) {
				if (fontColor != NULL) {
					delete fontColor;
					fontColor = NULL;
				}

				fontColor = new Color(
						(int)stof((*params)[0]),
						(int)stof((*params)[1]),
						(int)stof((*params)[2]));

			} else {
				refresh = false;
			}

			delete params;
			params = NULL;

		} else if (name == "x-content") {
			pthread_mutex_unlock(&mutex);
			setContent(value);
			pthread_mutex_lock(&mutex);
			refresh = false;

		} else if (name == "x-setFile" && value != "") {
			setFile(value);
			refresh = false;
		}

		Player::setPropertyValue(name, value, duration, by);
		pthread_mutex_unlock(&mutex);

		// refreshing changes
		if (refresh) {
			loadTxt();
		}
	}