当前位置: 首页>>代码示例>>C++>>正文


C++ ContentManager::CreateContent方法代码示例

本文整理汇总了C++中ContentManager::CreateContent方法的典型用法代码示例。如果您正苦于以下问题:C++ ContentManager::CreateContent方法的具体用法?C++ ContentManager::CreateContent怎么用?C++ ContentManager::CreateContent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ContentManager的用法示例。


在下文中一共展示了ContentManager::CreateContent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnActionPerformed


//.........这里部分代码省略.........
		pExportThread_->filenameout = exporttempfilename;
		pExportThread_->framefilepos = pPlayerThread_->curframefilepos;
		pExportThread_->Start();
		ExportProgressRefTimer_->Start(500);

		if (exporttotype == EXPORTTYPE_VIDEO) {
			pExportThread_->SendUserEvent(pExportThread_->THREAD_EXPORTMJPEG, null);
		} else if (exporttotype == EXPORTTYPE_FRAME) {
			pExportThread_->SendUserEvent(pExportThread_->THREAD_EXPORTFRAME, null);
		}

	} else if (actionId == THREADCALLBACK_EXPORTPROGRESSUPDATE) {
		if (pExportThread_ != null) {
			double progress = ((double)pExportThread_->TimeLapseClass_->exportfileframecurno / (double)pExportThread_->TimeLapseClass_->exportfileframescount);
			if (progress > 1) progress = 1;
			if (progress < 1) {
				ExportProgressRefTimer_->Start(500);
			}
			int progressint = (int)(progress * 100.0f);
			if (progressint < 0) progressint = 0;
			if (progressint > 100) progressint = 100;
			Osp::Ui::Controls::Progress * savingpopupprogressel_ = static_cast<Progress *>(savingpopup_->GetControl(L"IDC_PROGRESS1"));
			savingpopupprogressel_->SetValue(progressint);
			savingpopupprogressel_->Draw();
			savingpopupprogressel_->Show();
		}
	} else if (actionId == THREADCALLBACK_EXPORTDONE) {
		ExportProgressRefTimer_->Cancel();
		Osp::Ui::Controls::Progress * savingpopupprogressel_ = static_cast<Progress *>(savingpopup_->GetControl(L"IDC_PROGRESS1"));
		savingpopupprogressel_->SetValue(100);
		savingpopupprogressel_->Draw();
		savingpopupprogressel_->Show();

		pExportThread_->Stop();
		pExportThread_->Join();
		delete pExportThread_;
		pExportThread_ = null;

		ContentId contentId;
		ContentManager contentManager;
		contentManager.Construct();
		if (Osp::Content::ContentManagerUtil::CopyToMediaDirectory(exporttempfilename, exportfilename) != E_SUCCESS) {
			savingpopup_->SetShowState(false);
			this->RequestRedraw();
			MessageBox msgbox;
			int modalResult = 0;
			msgbox.Construct("Error", "Error saving file! Maybe out of disk space.", MSGBOX_STYLE_OK, 10000);
			msgbox.ShowAndWait(modalResult);
			return;
		}
		if (Osp::Io::File::IsFileExist(exporttempfilename)) {
			Osp::Io::File::Remove(exporttempfilename);
		}

		if (exporttotype == EXPORTTYPE_VIDEO) {
			VideoContentInfo videoContentInfo;
			videoContentInfo.Construct(exportfilename);
			contentId = contentManager.CreateContent(videoContentInfo);
			videoContentInfo.SetAuthor(L"Timelapse");
			videoContentInfo.SetDescription(L"Timelapse app");
			videoContentInfo.SetKeyword(L"Timelapse");
			contentManager.UpdateContent(videoContentInfo);
		} else if (exporttotype == EXPORTTYPE_FRAME) {
			ImageContentInfo imageContentInfo;
			imageContentInfo.Construct(exportfilename);
			contentId = contentManager.CreateContent(imageContentInfo);
			imageContentInfo.SetAuthor(L"Timelapse");
			imageContentInfo.SetDescription(L"Timelapse app");
			imageContentInfo.SetKeyword(L"Timelapse");
			contentManager.UpdateContent(imageContentInfo);
		}
		savingpopup_->SetShowState(false);
		this->RequestRedraw();
		MessageBox msgbox;
		int modalResult = 0;
		msgbox.Construct("Saved", L"File saved to:\n" + exportfilename, MSGBOX_STYLE_OK, 10000);
		msgbox.ShowAndWait(modalResult);
	} else if (actionId == ASPEEDCHANGE) {
		if ((int)pPlayerThread_->fileinfo_.playframerate == 10) {
			pPlayerThread_->SetFrameRate(15);
		} else if ((int)pPlayerThread_->fileinfo_.playframerate == 15) {
			pPlayerThread_->SetFrameRate(20);
		} else if ((int)pPlayerThread_->fileinfo_.playframerate == 20) {
			pPlayerThread_->SetFrameRate(25);
		} else if ((int)pPlayerThread_->fileinfo_.playframerate == 25) {
			pPlayerThread_->SetFrameRate(30);
		} else {
			pPlayerThread_->SetFrameRate(10);
		}

		delete speedbtnbmpn_;
		delete speedbtnbmps_;
		speedbtnbmpn_ = CreateSpeedBtnBmp(164, Osp::Base::Integer::ToString((int)pPlayerThread_->fileinfo_.playframerate) + L" fps", false);
		speedbtnbmps_ = CreateSpeedBtnBmp(164, Osp::Base::Integer::ToString((int)pPlayerThread_->fileinfo_.playframerate) + L" fps", true);
		speedbtn->SetNormalBackgroundBitmap(*speedbtnbmpn_);
		speedbtn->SetPressedBackgroundBitmap(*speedbtnbmps_);
		this->RequestRedraw();

	}
}
开发者ID:BoboTheRobot,项目名称:Badaprojects,代码行数:101,代码来源:FPlayer.cpp


注:本文中的ContentManager::CreateContent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。