Beispiel #1
0
// XMLRestore
status_t
PlaybackReport::XMLRestore(XMLHelper& xml)
{
	status_t ret = B_OK;

	while (xml.OpenTag("CLIP")) {
		BString clipID = xml.GetAttribute("clip_id", "");
		int32 playbackCount = xml.GetAttribute("playback_count", (int32)-1);

		if (clipID.Length() > 0 && playbackCount >= 0) {
			ret = fIDPlaybackCountMap.Put(clipID.String(), playbackCount);
		}

		if (ret == B_OK)
			ret = xml.CloseTag(); // CLIP

		if (ret < B_OK)
			break;
	}

	return ret;
}
Beispiel #2
0
// XMLRestore
status_t
RenderPreset::XMLRestore(XMLHelper& xmlHelper)
{
	xmlHelper.GetAttribute("name", fName);
	fRenderPreview = xmlHelper.GetAttribute("preview", fRenderPreview);

	// "use alpha" depends on "preview" setting
	if (!fRenderPreview)
		fUseAlpha = xmlHelper.GetAttribute("use_alpha", fUseAlpha);
	else
		fUseAlpha = false;

	if (xmlHelper.OpenTag("FILE_FORMAT") == B_OK) {
		xmlHelper.GetAttribute("name", fFamilyName);
		xmlHelper.CloseTag();	// FILE_FORMAT
	}
	if (xmlHelper.OpenTag("VIDEO") == B_OK) {
		fHasVideoTrack = xmlHelper.GetAttribute("on", fHasVideoTrack);
		if (xmlHelper.OpenTag("VIDEO_FORMAT") == B_OK) {
			fLineWidth = xmlHelper.GetAttribute("line_width", fLineWidth);
			fLineCount = xmlHelper.GetAttribute("line_count", fLineCount);
			fColorSpace = (color_space)xmlHelper.GetAttribute("color_space",
														 (int32)fColorSpace);
			xmlHelper.CloseTag();	// VIDEO_FORMAT
		}
		if (xmlHelper.OpenTag("VIDEO_CODEC") == B_OK) {
			xmlHelper.GetAttribute("name", fVideoCodecName);
			xmlHelper.CloseTag();	// VIDEO_CODEC
		}
		if (xmlHelper.OpenTag("QUALITY") == B_OK) {
			fVideoQuality = xmlHelper.GetAttribute("value", fVideoQuality);
			xmlHelper.CloseTag();	// QUALITY;
		}
		xmlHelper.CloseTag();	// VIDEO;
	}
	if (xmlHelper.OpenTag("AUDIO") == B_OK) {
		fHasAudioTrack = xmlHelper.GetAttribute("on", fHasAudioTrack);
		if (xmlHelper.OpenTag("AUDIO_CODEC") == B_OK) {
			xmlHelper.GetAttribute("name", fAudioCodecName);
			fAudioFrameRate = xmlHelper.GetAttribute("frame_rate", fAudioFrameRate);
			fAudioChannelCount = xmlHelper.GetAttribute("channels", fAudioChannelCount);
			xmlHelper.CloseTag();	// AUDIO_CODEC
		}
		xmlHelper.CloseTag();	// AUDIO
	}
	if (xmlHelper.OpenTag("COPYRIGHT") == B_OK) {
		xmlHelper.GetAttribute("string", fCopyright);
		xmlHelper.CloseTag();	// COPYRIGHT
	}
	if (xmlHelper.OpenTag("TIMECODE") == B_OK) {
		fTimeCodeOverlay = xmlHelper.GetAttribute("visible", fTimeCodeOverlay);
		fTimeCodeTransparency = xmlHelper.GetAttribute("transparency", fTimeCodeTransparency);
		fTimeCodeScale = xmlHelper.GetAttribute("scale", fTimeCodeScale);
		xmlHelper.CloseTag();	// TIMECODE
	}
	return B_OK;
}