Example #1
0
//---------------------------------------------------------------------------
void File_DcpPkl::MergeFromAm (File_DcpPkl::streams &StreamsToMerge)
{
    for (File_DcpPkl::streams::iterator Stream=Streams.begin(); Stream!=Streams.end(); ++Stream)
    {
        for (File_DcpPkl::streams::iterator StreamToMerge=StreamsToMerge.begin(); StreamToMerge!=StreamsToMerge.end(); ++StreamToMerge)
            if (StreamToMerge->Id==Stream->Id)
                *Stream=*StreamToMerge;
    }
}
Example #2
0
//---------------------------------------------------------------------------
void File_DcpCpl::MergeFromAm (File_DcpPkl::streams &StreamsToMerge)
{
    map<Ztring, File_DcpPkl::streams::iterator> Map;
    for (File_DcpPkl::streams::iterator StreamToMerge=StreamsToMerge.begin(); StreamToMerge!=StreamsToMerge.end(); ++StreamToMerge)
        Map[Ztring().From_UTF8(StreamToMerge->Id)]=StreamToMerge;

    for (size_t References_Pos=0; References_Pos<ReferenceFiles->References.size(); ++References_Pos)
    {
        for (size_t Pos=0; Pos<ReferenceFiles->References[References_Pos].FileNames.size(); ++Pos)
        {
            map<Ztring, File_DcpPkl::streams::iterator>::iterator Map_Item=Map.find(ReferenceFiles->References[References_Pos].FileNames[Pos]);
            if (Map_Item!=Map.end() && !Map_Item->second->ChunkList.empty()) // Note: ChunkLists with more than 1 file are not yet supported
            {
                ReferenceFiles->References[References_Pos].FileNames[Pos].From_UTF8(Map_Item->second->ChunkList[0].Path);
                ReferenceFiles->References[References_Pos].Infos["UniqueID"].From_UTF8(Map_Item->second->Id);
            }
            else
            {
                ReferenceFiles->References[References_Pos].FileNames.erase(ReferenceFiles->References[References_Pos].FileNames.begin()+Pos);
                Pos--;
            }
        }

        for (size_t Pos=0; Pos<ReferenceFiles->References[References_Pos].CompleteDuration.size(); ++Pos)
        {
            map<Ztring, File_DcpPkl::streams::iterator>::iterator Map_Item=Map.find(ReferenceFiles->References[References_Pos].CompleteDuration[Pos].FileName);
            if (Map_Item!=Map.end() && !Map_Item->second->ChunkList.empty()) // Note: ChunkLists with more than 1 file are not yet supported
            {
                ReferenceFiles->References[References_Pos].CompleteDuration[Pos].FileName.From_UTF8(Map_Item->second->ChunkList[0].Path);
                if (ReferenceFiles->References[References_Pos].Infos["UniqueID"].empty())
                    ReferenceFiles->References[References_Pos].Infos["UniqueID"].From_UTF8(Map_Item->second->Id);
            }
            else
            {
                ReferenceFiles->References[References_Pos].CompleteDuration.erase(ReferenceFiles->References[References_Pos].CompleteDuration.begin()+Pos);
                Pos--;
            }
        }

        if (ReferenceFiles->References[References_Pos].FileNames.empty() && ReferenceFiles->References[References_Pos].CompleteDuration.empty())
        {
            ReferenceFiles->References.erase(ReferenceFiles->References.begin()+References_Pos);
            References_Pos--;
        }
    }
}
Example #3
0
//---------------------------------------------------------------------------
void File_DcpAm::MergeFromPkl (File_DcpPkl::streams &StreamsToMerge)
{
    for (File_DcpPkl::streams::iterator Stream=Streams.begin(); Stream!=Streams.end(); ++Stream)
    {
        for (File_DcpPkl::streams::iterator StreamToMerge=StreamsToMerge.begin(); StreamToMerge!=StreamsToMerge.end(); ++StreamToMerge)
            if (StreamToMerge->Id==Stream->Id)
            {
                if (Stream->StreamKind==Stream_Max)
                    Stream->StreamKind=StreamToMerge->StreamKind;
                if (Stream->OriginalFileName.empty())
                    Stream->OriginalFileName=StreamToMerge->OriginalFileName;
                if (Stream->Type.empty())
                    Stream->Type=StreamToMerge->Type;
                if (Stream->AnnotationText.empty())
                    Stream->AnnotationText=StreamToMerge->AnnotationText;
            }
    }
}
Example #4
0
//---------------------------------------------------------------------------
void File_DcpCpl::MergeFromAm (File_DcpPkl::streams &StreamsToMerge)
{
    for (File_DcpPkl::streams::iterator StreamToMerge=StreamsToMerge.begin(); StreamToMerge!=StreamsToMerge.end(); ++StreamToMerge)
        if (!StreamToMerge->ChunkList.empty()) // Note: ChunkLists with more than 1 file are not yet supported)
            ReferenceFiles->UpdateFileName(Ztring().From_UTF8(StreamToMerge->Id), Ztring().From_UTF8(StreamToMerge->ChunkList[0].Path));
}