本文整理汇总了C++中SXMPMeta::SetStructField方法的典型用法代码示例。如果您正苦于以下问题:C++ SXMPMeta::SetStructField方法的具体用法?C++ SXMPMeta::SetStructField怎么用?C++ SXMPMeta::SetStructField使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SXMPMeta
的用法示例。
在下文中一共展示了SXMPMeta::SetStructField方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreatorAtom_SetProperties
static bool CreatorAtom_SetProperties ( SXMPMeta& xmpObj,
const MOV_MetaHandler::CreatorAtomStrings& creatorAtomStrings )
{
if ( ! creatorAtomStrings.posixProjectPath.empty() ) {
xmpObj.SetStructField ( kXMP_NS_CreatorAtom, "macAtom",
kXMP_NS_CreatorAtom, "posixProjectPath", creatorAtomStrings.posixProjectPath, 0 );
}
if ( ! creatorAtomStrings.uncProjectPath.empty() ) {
xmpObj.SetStructField ( kXMP_NS_CreatorAtom, "windowsAtom",
kXMP_NS_CreatorAtom, "uncProjectPath", creatorAtomStrings.uncProjectPath, 0 );
}
if ( ! creatorAtomStrings.projectRefType.empty() ) {
xmpObj.SetStructField ( kXMP_NS_DM, "projectRef", kXMP_NS_DM, "type", creatorAtomStrings.projectRefType.c_str());
}
if ( ! creatorAtomStrings.applicationCode.empty() ) {
xmpObj.SetStructField ( kXMP_NS_CreatorAtom, "macAtom",
kXMP_NS_CreatorAtom, "applicationCode", creatorAtomStrings.applicationCode, 0 );
}
if ( ! creatorAtomStrings.invocationAppleEvent.empty() ) {
xmpObj.SetStructField ( kXMP_NS_CreatorAtom, "macAtom",
kXMP_NS_CreatorAtom, "invocationAppleEvent", creatorAtomStrings.invocationAppleEvent, 0 );
}
if ( ! creatorAtomStrings.extension.empty() ) {
xmpObj.SetStructField ( kXMP_NS_CreatorAtom, "windowsAtom",
kXMP_NS_CreatorAtom, "extension", creatorAtomStrings.extension, 0 );
}
if ( ! creatorAtomStrings.invocationFlags.empty() ) {
xmpObj.SetStructField ( kXMP_NS_CreatorAtom, "windowsAtom",
kXMP_NS_CreatorAtom, "invocationFlags", creatorAtomStrings.invocationFlags, 0 );
}
if ( ! creatorAtomStrings.creatorTool.empty() ) {
xmpObj.SetProperty ( kXMP_NS_XMP, "CreatorTool", creatorAtomStrings.creatorTool, 0 );
}
return ok;
}
示例2: Import
bool CreatorAtom::Import ( SXMPMeta& xmpObj,
LFA_FileRef fileRef,
RIFF_Support::RiffState& riffState )
{
static const long myProjectLink = MakeFourCC ( 'P','r','m','L' );
unsigned long projectLinkSize;
bool ok = RIFF_Support::GetRIFFChunk ( fileRef, riffState, myProjectLink, 0, 0, 0, &projectLinkSize );
if ( ok ) {
Embed_ProjectLinkAtom epla;
std::string projectPathString;
RIFF_Support::GetRIFFChunk ( fileRef, riffState, myProjectLink, 0, 0, (char*) &epla, &projectLinkSize );
if ( ok ) {
ProjectLinkAtom_MakeValid ( &epla );
projectPathString = epla.fullPath.name;
}
if ( ! projectPathString.empty() ) {
if ( projectPathString[0] == '/' ) {
xmpObj.SetStructField ( kXMP_NS_CreatorAtom, "macAtom",
kXMP_NS_CreatorAtom, "posixProjectPath", projectPathString, 0 );
} else if ( projectPathString.substr(0,4) == std::string("\\\\?\\") ) {
xmpObj.SetStructField ( kXMP_NS_CreatorAtom, "windowsAtom",
kXMP_NS_CreatorAtom, "uncProjectPath", projectPathString, 0 );
}
std::string projectTypeString;
switch ( epla.exportType ) {
case Embed_ExportTypeMovie : projectTypeString = "movie"; break;
case Embed_ExportTypeStill : projectTypeString = "still"; break;
case Embed_ExportTypeAudio : projectTypeString = "audio"; break;
case Embed_ExportTypeCustom : projectTypeString = "custom"; break;
}
if ( ! projectTypeString.empty() ) {
xmpObj.SetStructField ( kXMP_NS_DM, "projectRef", kXMP_NS_DM, "type", projectTypeString.c_str() );
}
}
}
unsigned long creatorAtomSize = 0;
ok = RIFF_Support::GetRIFFChunk ( fileRef, riffState, myCreatorAtom, 0, 0, 0, &creatorAtomSize );
if ( ok ) {
CR8R_CreatorAtom creatorAtom;
ok = RIFF_Support::GetRIFFChunk ( fileRef, riffState, myCreatorAtom, 0, 0, (char*) &creatorAtom, &creatorAtomSize );
if ( ok ) {
CreatorAtom_MakeValid ( &creatorAtom );
char buffer[256];
std::string xmpString;
sprintf ( buffer, "%d", creatorAtom.creator_codeLu );
xmpString = buffer;
xmpObj.SetStructField ( kXMP_NS_CreatorAtom, "macAtom", kXMP_NS_CreatorAtom, "applicationCode", xmpString, 0 );
sprintf ( buffer, "%d", creatorAtom.creator_eventLu );
xmpString = buffer;
xmpObj.SetStructField ( kXMP_NS_CreatorAtom, "macAtom", kXMP_NS_CreatorAtom, "invocationAppleEvent", xmpString, 0 );
xmpString = CharsToString ( creatorAtom.creator_extAC, sizeof(creatorAtom.creator_extAC) );
xmpObj.SetStructField ( kXMP_NS_CreatorAtom, "windowsAtom", kXMP_NS_CreatorAtom, "extension", xmpString, 0 );
xmpString = CharsToString ( creatorAtom.creator_flagAC, sizeof(creatorAtom.creator_flagAC) );
xmpObj.SetStructField ( kXMP_NS_CreatorAtom, "windowsAtom", kXMP_NS_CreatorAtom, "invocationFlags", xmpString, 0 );
xmpString = CharsToString ( creatorAtom.creator_nameAC, sizeof(creatorAtom.creator_nameAC) );
xmpObj.SetProperty ( kXMP_NS_XMP, "CreatorTool", xmpString, 0 );
}
}
return ok;
}