summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-08-22 15:28:46 +0100
committerCarl Hetherington <cth@carlh.net>2012-08-22 15:28:46 +0100
commit1a3818e1c76321095553c91f846478ca44ffb14d (patch)
tree80fec045d9ccf3b7024c1fd41e1cf4b93b759587
parent8b8bce8d2a83739f96e02a48b77d352414361c43 (diff)
Use entry points.
-rw-r--r--src/dcp.cc3
-rw-r--r--src/mxf_asset.cc5
-rw-r--r--src/mxf_asset.h3
-rw-r--r--src/picture_asset.cc20
-rw-r--r--src/picture_asset.h6
-rw-r--r--src/sound_asset.cc10
-rw-r--r--src/sound_asset.h1
7 files changed, 26 insertions, 22 deletions
diff --git a/src/dcp.cc b/src/dcp.cc
index aa937de5..65a6a826 100644
--- a/src/dcp.cc
+++ b/src/dcp.cc
@@ -293,6 +293,7 @@ DCP::DCP (string directory)
_directory,
n,
_fps,
+ (*i)->asset_list->main_picture->entry_point,
(*i)->asset_list->main_picture->duration
)
);
@@ -308,6 +309,7 @@ DCP::DCP (string directory)
_directory,
n,
_fps,
+ (*i)->asset_list->main_stereoscopic_picture->entry_point,
(*i)->asset_list->main_stereoscopic_picture->duration
)
);
@@ -325,6 +327,7 @@ DCP::DCP (string directory)
_directory,
n,
_fps,
+ (*i)->asset_list->main_sound->entry_point,
(*i)->asset_list->main_sound->duration
)
);
diff --git a/src/mxf_asset.cc b/src/mxf_asset.cc
index b5560b26..2246c55d 100644
--- a/src/mxf_asset.cc
+++ b/src/mxf_asset.cc
@@ -34,10 +34,11 @@ using namespace std;
using namespace boost;
using namespace libdcp;
-MXFAsset::MXFAsset (string directory, string file_name, sigc::signal1<void, float>* progress, int fps, int length)
+MXFAsset::MXFAsset (string directory, string file_name, sigc::signal1<void, float>* progress, int fps, int entry_point, int length)
: Asset (directory, file_name)
, _progress (progress)
, _fps (fps)
+ , _entry_point (entry_point)
, _length (length)
{
@@ -120,5 +121,3 @@ MXFAsset::length () const
{
return _length;
}
-
-
diff --git a/src/mxf_asset.h b/src/mxf_asset.h
index d01d091d..cdcd08bf 100644
--- a/src/mxf_asset.h
+++ b/src/mxf_asset.h
@@ -35,7 +35,7 @@ public:
* @param fps Frames per second.
* @param length Length in frames.
*/
- MXFAsset (std::string directory, std::string file_name, sigc::signal1<void, float>* progress, int fps, int length);
+ MXFAsset (std::string directory, std::string file_name, sigc::signal1<void, float>* progress, int fps, int entry_point, int length);
virtual std::list<std::string> equals (boost::shared_ptr<const Asset> other, EqualityOptions opt) const;
@@ -51,6 +51,7 @@ protected:
sigc::signal1<void, float>* _progress;
/** Frames per second */
int _fps;
+ int _entry_point;
/** Length in frames */
int _length;
};
diff --git a/src/picture_asset.cc b/src/picture_asset.cc
index ac6ec05e..7db85156 100644
--- a/src/picture_asset.cc
+++ b/src/picture_asset.cc
@@ -40,8 +40,8 @@ using namespace std;
using namespace boost;
using namespace libdcp;
-PictureAsset::PictureAsset (string directory, string mxf_name, sigc::signal1<void, float>* progress, int fps, int length)
- : MXFAsset (directory, mxf_name, progress, fps, length)
+PictureAsset::PictureAsset (string directory, string mxf_name, sigc::signal1<void, float>* progress, int fps, int entry_point, int length)
+ : MXFAsset (directory, mxf_name, progress, fps, entry_point, length)
{
}
@@ -214,7 +214,7 @@ MonoPictureAsset::MonoPictureAsset (
int length,
int width,
int height)
- : PictureAsset (directory, mxf_name, progress, fps, length)
+ : PictureAsset (directory, mxf_name, progress, fps, 0, length)
{
_width = width;
_height = height;
@@ -230,15 +230,15 @@ MonoPictureAsset::MonoPictureAsset (
int length,
int width,
int height)
- : PictureAsset (directory, mxf_name, progress, fps, length)
+ : PictureAsset (directory, mxf_name, progress, fps, 0, length)
{
_width = width;
_height = height;
construct (sigc::bind (sigc::mem_fun (*this, &MonoPictureAsset::path_from_list), files));
}
-MonoPictureAsset::MonoPictureAsset (string directory, string mxf_name, int fps, int length)
- : PictureAsset (directory, mxf_name, 0, fps, length)
+MonoPictureAsset::MonoPictureAsset (string directory, string mxf_name, int fps, int entry_point, int length)
+ : PictureAsset (directory, mxf_name, 0, fps, entry_point, length)
{
ASDCP::JP2K::MXFReader reader;
if (ASDCP_FAILURE (reader.OpenRead (path().string().c_str()))) {
@@ -305,11 +305,11 @@ MonoPictureAsset::path_from_list (int f, vector<string> const & files) const
shared_ptr<const MonoPictureFrame>
MonoPictureAsset::get_frame (int n) const
{
- return shared_ptr<const MonoPictureFrame> (new MonoPictureFrame (path().string(), n));
+ return shared_ptr<const MonoPictureFrame> (new MonoPictureFrame (path().string(), n + _entry_point));
}
-StereoPictureAsset::StereoPictureAsset (string directory, string mxf_name, int fps, int length)
- : PictureAsset (directory, mxf_name, 0, fps, length)
+StereoPictureAsset::StereoPictureAsset (string directory, string mxf_name, int fps, int entry_point, int length)
+ : PictureAsset (directory, mxf_name, 0, fps, entry_point, length)
{
ASDCP::JP2K::MXFSReader reader;
if (ASDCP_FAILURE (reader.OpenRead (path().string().c_str()))) {
@@ -328,5 +328,5 @@ StereoPictureAsset::StereoPictureAsset (string directory, string mxf_name, int f
shared_ptr<const StereoPictureFrame>
StereoPictureAsset::get_frame (int n) const
{
- return shared_ptr<const StereoPictureFrame> (new StereoPictureFrame (path().string(), n));
+ return shared_ptr<const StereoPictureFrame> (new StereoPictureFrame (path().string(), n + _entry_point));
}
diff --git a/src/picture_asset.h b/src/picture_asset.h
index c21e8cd5..ae457984 100644
--- a/src/picture_asset.h
+++ b/src/picture_asset.h
@@ -34,7 +34,7 @@ class StereoPictureFrame;
class PictureAsset : public MXFAsset
{
public:
- PictureAsset (std::string directory, std::string mxf_name, sigc::signal1<void, float>* progress, int fps, int length);
+ PictureAsset (std::string directory, std::string mxf_name, sigc::signal1<void, float>* progress, int fps, int entry_point, int length);
/** Write details of this asset to a CPL stream.
* @param s Stream.
@@ -105,7 +105,7 @@ public:
int height
);
- MonoPictureAsset (std::string directory, std::string mxf_name, int fps, int length);
+ MonoPictureAsset (std::string directory, std::string mxf_name, int fps, int entry_point, int length);
boost::shared_ptr<const MonoPictureFrame> get_frame (int n) const;
@@ -117,7 +117,7 @@ private:
class StereoPictureAsset : public PictureAsset
{
public:
- StereoPictureAsset (std::string directory, std::string mxf_name, int fps, int length);
+ StereoPictureAsset (std::string directory, std::string mxf_name, int fps, int entry_point, int length);
boost::shared_ptr<const StereoPictureFrame> get_frame (int n) const;
};
diff --git a/src/sound_asset.cc b/src/sound_asset.cc
index 7d8a86c8..75ca3a76 100644
--- a/src/sound_asset.cc
+++ b/src/sound_asset.cc
@@ -39,7 +39,7 @@ using namespace libdcp;
SoundAsset::SoundAsset (
vector<string> const & files, string directory, string mxf_name, sigc::signal1<void, float>* progress, int fps, int length
)
- : MXFAsset (directory, mxf_name, progress, fps, length)
+ : MXFAsset (directory, mxf_name, progress, fps, 0, length)
, _channels (files.size ())
, _sampling_rate (0)
{
@@ -49,15 +49,15 @@ SoundAsset::SoundAsset (
SoundAsset::SoundAsset (
sigc::slot<string, Channel> get_path, string directory, string mxf_name, sigc::signal1<void, float>* progress, int fps, int length, int channels
)
- : MXFAsset (directory, mxf_name, progress, fps, length)
+ : MXFAsset (directory, mxf_name, progress, fps, 0, length)
, _channels (channels)
, _sampling_rate (0)
{
construct (get_path);
}
-SoundAsset::SoundAsset (string directory, string mxf_name, int fps, int length)
- : MXFAsset (directory, mxf_name, 0, fps, length)
+SoundAsset::SoundAsset (string directory, string mxf_name, int fps, int entry_point, int length)
+ : MXFAsset (directory, mxf_name, 0, fps, entry_point, length)
, _channels (0)
{
ASDCP::PCM::MXFReader reader;
@@ -264,5 +264,5 @@ SoundAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt) const
shared_ptr<const SoundFrame>
SoundAsset::get_frame (int n) const
{
- return shared_ptr<const SoundFrame> (new SoundFrame (path().string(), n));
+ return shared_ptr<const SoundFrame> (new SoundFrame (path().string(), n + _entry_point));
}
diff --git a/src/sound_asset.h b/src/sound_asset.h
index 84a941cd..3f42a522 100644
--- a/src/sound_asset.h
+++ b/src/sound_asset.h
@@ -78,6 +78,7 @@ public:
std::string directory,
std::string mxf_name,
int fps,
+ int entry_point,
int length
);