summaryrefslogtreecommitdiff
path: root/src/cpl.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-09-25 20:41:45 +0100
committerCarl Hetherington <cth@carlh.net>2013-09-25 20:41:45 +0100
commitf76647abae551840a43bb8f07189051ec20bab6d (patch)
tree12d67e33c71516480cb71381bc426dfe18513821 /src/cpl.cc
parente8530ea06f0b0883e5e19dd18beed70732ac5d3c (diff)
Switch away from the many-constructor-arguments approach to a hopefully simpler API.
Diffstat (limited to 'src/cpl.cc')
-rw-r--r--src/cpl.cc36
1 files changed, 11 insertions, 25 deletions
diff --git a/src/cpl.cc b/src/cpl.cc
index 5d57c7c7..48d08035 100644
--- a/src/cpl.cc
+++ b/src/cpl.cc
@@ -107,15 +107,13 @@ CPL::CPL (boost::filesystem::path directory, string file, list<PathAssetMap> ass
if (!(*i)->asset_list->main_stereoscopic_picture && p->edit_rate == p->frame_rate) {
- pair<string, shared_ptr<const parse::AssetMapAsset> > asset = asset_from_id (asset_maps, p->id);
-
try {
- picture.reset (new MonoPictureAsset (
- asset.first,
- asset.second->chunks.front()->path
- )
- );
+ pair<string, shared_ptr<const parse::AssetMapAsset> > asset = asset_from_id (asset_maps, p->id);
+ picture.reset (new MonoPictureAsset (asset.first, asset.second->chunks.front()->path));
+
+ picture->read ();
+ picture->set_edit_rate (_fps);
picture->set_entry_point (p->entry_point);
picture->set_duration (p->duration);
if (p->key_id.length() > 9) {
@@ -132,14 +130,10 @@ CPL::CPL (boost::filesystem::path directory, string file, list<PathAssetMap> ass
try {
pair<string, shared_ptr<const parse::AssetMapAsset> > asset = asset_from_id (asset_maps, p->id);
- picture.reset (new StereoPictureAsset (
- asset.first,
- asset.second->chunks.front()->path,
- _fps,
- p->duration
- )
- );
+ picture.reset (new StereoPictureAsset (asset.first, asset.second->chunks.front()->path));
+ picture->read ();
+ picture->set_edit_rate (_fps);
picture->set_entry_point (p->entry_point);
picture->set_duration (p->duration);
if (p->key_id.length() > 9) {
@@ -160,14 +154,10 @@ CPL::CPL (boost::filesystem::path directory, string file, list<PathAssetMap> ass
try {
pair<string, shared_ptr<const parse::AssetMapAsset> > asset = asset_from_id (asset_maps, (*i)->asset_list->main_sound->id);
- sound.reset (new SoundAsset (
- asset.first,
- asset.second->chunks.front()->path
- )
- );
-
+ sound.reset (new SoundAsset (asset.first, asset.second->chunks.front()->path));
shared_ptr<parse::MainSound> s = (*i)->asset_list->main_sound;
+ sound->read ();
sound->set_entry_point (s->entry_point);
sound->set_duration (s->duration);
if (s->key_id.length() > 9) {
@@ -185,11 +175,7 @@ CPL::CPL (boost::filesystem::path directory, string file, list<PathAssetMap> ass
pair<string, shared_ptr<const parse::AssetMapAsset> > asset = asset_from_id (asset_maps, (*i)->asset_list->main_subtitle->id);
- subtitle.reset (new SubtitleAsset (
- asset.first,
- asset.second->chunks.front()->path
- )
- );
+ subtitle.reset (new SubtitleAsset (asset.first, asset.second->chunks.front()->path));
subtitle->set_entry_point ((*i)->asset_list->main_subtitle->entry_point);
subtitle->set_duration ((*i)->asset_list->main_subtitle->duration);