本文整理汇总了C++中Exporter::Process方法的典型用法代码示例。如果您正苦于以下问题:C++ Exporter::Process方法的具体用法?C++ Exporter::Process怎么用?C++ Exporter::Process使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Exporter
的用法示例。
在下文中一共展示了Exporter::Process方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Apply
bool ExportCommand::Apply(CommandExecutionContext context)
{
wxString mode = GetString(wxT("Mode"));
wxString filename = GetString(wxT("Filename"));
long numChannels = GetLong(wxT("Channels"));
bool selection = mode.IsSameAs(wxT("Selection"));
double t0, t1;
if (selection)
{
t0 = context.GetProject()->mViewInfo.selectedRegion.t0();
t1 = context.GetProject()->mViewInfo.selectedRegion.t1();
}
else
{
t0 = 0.0;
t1 = context.GetProject()->GetTracks()->GetEndTime();
}
// Find the extension and check it's valid
int splitAt = filename.Find(wxUniChar('.'), true);
if (splitAt < 0)
{
Error(wxT("Export filename must have an extension!"));
return false;
}
wxString extension = filename.Mid(splitAt+1).MakeUpper();
Exporter exporter;
bool exportSuccess = exporter.Process(context.GetProject(),
std::max(0L, numChannels),
extension, filename,
selection, t0, t1);
if (exportSuccess)
{
Status(wxString::Format(wxT("Exported to %s format: %s"),
extension, filename));
return true;
}
Error(wxString::Format(wxT("Could not export to %s format!"), extension));
return false;
}