- /* Cross-check */
- /* XXX */
-
- /* Now cherry-pick the required bits into our own data structure */
-
- _name = cpl->annotation_text;
- _content_kind = cpl->content_kind;
- _length = 0;
- _fps = 0;
-
- for (list<shared_ptr<CPLReel> >::iterator i = cpl->reels.begin(); i != cpl->reels.end(); ++i) {
- assert (_fps == 0 || _fps == (*i)->asset_list->main_picture->frame_rate.numerator);
- _fps = (*i)->asset_list->main_picture->frame_rate.numerator;
- _length += (*i)->asset_list->main_picture->duration;
-
- string n = pkl->asset_from_id ((*i)->asset_list->main_picture->id)->original_file_name;
- if (n.empty ()) {
- n = (*i)->asset_list->main_picture->annotation_text;
- }
-
- shared_ptr<PictureAsset> picture (new PictureAsset (
- _directory,
- n,
- _fps,
- (*i)->asset_list->main_picture->duration
- )
- );
-
- shared_ptr<SoundAsset> sound;
-
- if ((*i)->asset_list->main_sound) {
-
- n = pkl->asset_from_id ((*i)->asset_list->main_sound->id)->original_file_name;
- if (n.empty ()) {
- n = (*i)->asset_list->main_sound->annotation_text;
- }
-
- sound.reset (new SoundAsset (
- _directory,
- n,
- _fps,
- (*i)->asset_list->main_sound->duration
- )
- );
- }
-
- assert (files.subtitles.size() < 2);
-
- shared_ptr<SubtitleAsset> subtitle;
- if (!files.subtitles.empty ()) {
- string const l = files.subtitles.front().substr (_directory.length ());
- subtitle.reset (new SubtitleAsset (_directory, l));
- }
-
- _reels.push_back (shared_ptr<Reel> (new Reel (picture, sound, subtitle)));
- }