MCPcopy Create free account
hub / github.com/MediaArea/MediaInfoLib / Fims_Transform_TimeCode

Function Fims_Transform_TimeCode

Source/MediaInfo/Export/Export_Fims.cpp:946–996  ·  view source on GitHub ↗

---------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

944
945//---------------------------------------------------------------------------
946Ztring Fims_Transform_TimeCode(Ztring &ToReturn, MediaInfo_Internal &MI, size_t StreamPos, bool Is1_2)
947{
948 if (Is1_2)
949 ToReturn+=__T("\t\t\t\t<!-- (timecodeFormat not in XSD)\n");
950
951 ToReturn+=__T("\t\t\t\t<ebucore:timecodeFormat");
952 if (!MI.Get(Stream_Other, StreamPos, Other_Format).empty())
953 ToReturn+=__T(" timecodeFormatName=\"")+MI.Get(Stream_Other, StreamPos, Other_Format)+__T("\"");
954 ToReturn+=__T(">\n");
955
956 //start
957 {
958 ToReturn+=__T("\t\t\t\t\t<ebucore:timecodeStart>\n");
959 ToReturn+=__T("\t\t\t\t\t\t<ebucore:timecode>")+MI.Get(Stream_Other, StreamPos, Other_TimeCode_FirstFrame)+__T("</ebucore:timecode>\n");
960 ToReturn+=__T("\t\t\t\t\t</ebucore:timecodeStart>\n");
961 }
962
963 if (!MI.Get(Stream_Other, StreamPos, Other_ID).empty() || !MI.Get(Stream_Other, StreamPos, Other_Title).empty())
964 {
965 ToReturn+=__T("\t\t\t\t\t<ebucore:timecodeTrack");
966 if (!MI.Get(Stream_Other, StreamPos, Other_ID).empty())
967 {
968 Ztring ID=MI.Get(Stream_Other, StreamPos, Other_ID);
969 if (MI.Get(Stream_Other, StreamPos, Other_ID).find(__T("-Material"))!=string::npos)
970 {
971 ID.FindAndReplace(__T("-Material"), Ztring());
972 ToReturn+=__T(" trackId=\"")+ID+__T("\"")+__T(" typeLabel=\"Material\"");
973 }
974 else if (MI.Get(Stream_Other, StreamPos, Other_ID).find(__T("-Source"))!=string::npos)
975 {
976 ID.FindAndReplace(__T("-Source"), Ztring());
977 ToReturn+=__T(" trackId=\"")+ID+__T("\"")+__T(" typeLabel=\"Source\"");
978 }
979 else
980 ToReturn+=__T(" trackId=\"")+ID+__T("\"");
981 }
982 if (!MI.Get(Stream_Other, StreamPos, Other_Title).empty())
983 ToReturn+=__T(" trackName=\"")+MI.Get(Stream_Other, StreamPos, Other_Title)+__T("\"");
984 ToReturn+=__T("/>\n");
985 }
986
987 if (!MI.Get(Stream_Other, StreamPos, Other_ID).empty())
988 ToReturn+=__T("\t\t\t\t\t<ebucore:technicalAttributeBoolean typeLabel=\"Stripped\">")+Ztring(MI.Get(Stream_Other, StreamPos, __T("TimeCode_Stripped"))==__T("Yes")?__T("true"):__T("false"))+__T("</ebucore:technicalAttributeBoolean>\n");
989
990 ToReturn+=__T("\t\t\t\t</ebucore:timecodeFormat>\n");
991
992 if (Is1_2)
993 ToReturn+=__T("\t\t\t\t-->\n");
994
995 return ToReturn;
996}
997
998//---------------------------------------------------------------------------
999Ztring Fims_Transform_Metadata(Ztring &ToReturn, MediaInfo_Internal &MI, size_t StreamPos, bool Is1_2)

Callers 1

TransformMethod · 0.85

Calls 2

GetMethod · 0.65
emptyMethod · 0.45

Tested by

no test coverage detected