Add basics for progressive sound asset writing.
[libdcp.git] / src / dcp.cc
index edb247a51970abf9977d2e77ddbf701d558de8be..4f1732da3ca2149dec2e5fe2bb637ba9c1e5d7ae 100644 (file)
@@ -27,6 +27,7 @@
 #include <cassert>
 #include <iostream>
 #include <boost/filesystem.hpp>
+#include <boost/algorithm/string.hpp>
 #include <libxml++/libxml++.h>
 #include "dcp.h"
 #include "asset.h"
@@ -197,7 +198,7 @@ DCP::read (bool require_mxfs)
                boost::filesystem::path t = _directory;
                t /= (*i)->chunks.front()->path;
                
-               if (ends_with (t.string(), ".mxf") || ends_with (t.string(), ".ttf")) {
+               if (boost::algorithm::ends_with (t.string(), ".mxf") || boost::algorithm::ends_with (t.string(), ".ttf")) {
                        continue;
                }
 
@@ -360,12 +361,11 @@ CPL::CPL (string directory, string file, shared_ptr<const AssetMap> asset_map, b
                        try {
                                picture.reset (new MonoPictureAsset (
                                                       _directory,
-                                                      asset_map->asset_from_id (p->id)->chunks.front()->path,
-                                                      _fps,
-                                                      (*i)->asset_list->main_picture->entry_point,
-                                                      (*i)->asset_list->main_picture->duration
+                                                      asset_map->asset_from_id (p->id)->chunks.front()->path
                                                       )
                                        );
+
+                               picture->set_entry_point ((*i)->asset_list->main_picture->entry_point);
                        } catch (MXFFileError) {
                                if (require_mxfs) {
                                        throw;
@@ -379,10 +379,12 @@ CPL::CPL (string directory, string file, shared_ptr<const AssetMap> asset_map, b
                                                       _directory,
                                                       asset_map->asset_from_id (p->id)->chunks.front()->path,
                                                       _fps,
-                                                      p->entry_point,
                                                       p->duration
                                                       )
                                        );
+
+                               picture->set_entry_point (p->entry_point);
+                               
                        } catch (MXFFileError) {
                                if (require_mxfs) {
                                        throw;
@@ -396,12 +398,11 @@ CPL::CPL (string directory, string file, shared_ptr<const AssetMap> asset_map, b
                        try {
                                sound.reset (new SoundAsset (
                                                     _directory,
-                                                    asset_map->asset_from_id ((*i)->asset_list->main_sound->id)->chunks.front()->path,
-                                                    _fps,
-                                                    (*i)->asset_list->main_sound->entry_point,
-                                                    (*i)->asset_list->main_sound->duration
+                                                    asset_map->asset_from_id ((*i)->asset_list->main_sound->id)->chunks.front()->path
                                                     )
                                        );
+
+                               sound->set_entry_point ((*i)->asset_list->main_sound->entry_point);
                        } catch (MXFFileError) {
                                if (require_mxfs) {
                                        throw;