*/
Film::Film (string d, bool must_exist)
- : _use_dci_name (true)
+ : _playlist (new Playlist)
+ , _use_dci_name (true)
, _trust_content_headers (true)
, _dcp_content_type (0)
, _format (0)
: boost::enable_shared_from_this<Film> (o)
/* note: the copied film shares the original's log */
, _log (o._log)
+ , _playlist (new Playlist)
, _directory (o._directory)
, _name (o._name)
, _use_dci_name (o._use_dci_name)
, _dcp_frame_rate (o._dcp_frame_rate)
, _dirty (o._dirty)
{
-
+ _playlist->setup (_content);
}
Film::~Film ()
}
}
- _crop.left = f.number_child<int> ("CropLeft");
- _crop.right = f.number_child<int> ("CropRight");
- _crop.top = f.number_child<int> ("CropTop");
- _crop.bottom = f.number_child<int> ("CropBottom");
+ _crop.left = f.number_child<int> ("LeftCrop");
+ _crop.right = f.number_child<int> ("RightCrop");
+ _crop.top = f.number_child<int> ("TopCrop");
+ _crop.bottom = f.number_child<int> ("BottomCrop");
{
list<shared_ptr<cxml::Node> > c = f.node_children ("Filter");
int
Film::target_audio_sample_rate () const
{
- /* XXX: how often is this method called? */
-
- boost::shared_ptr<Playlist> p = playlist ();
- if (p->has_audio ()) {
+ if (has_audio ()) {
return 0;
}
/* Resample to a DCI-approved sample rate */
- double t = dcp_audio_sample_rate (p->audio_frame_rate());
+ double t = dcp_audio_sample_rate (audio_frame_rate());
- FrameRateConversion frc (p->video_frame_rate(), dcp_frame_rate());
+ FrameRateConversion frc (video_frame_rate(), dcp_frame_rate());
/* Compensate if the DCP is being run at a different frame rate
to the source; that is, if the video is run such that it will
*/
if (frc.change_speed) {
- t *= p->video_frame_rate() * frc.factor() / dcp_frame_rate();
+ t *= video_frame_rate() * frc.factor() / dcp_frame_rate();
}
return rint (t);
return true;
}
-shared_ptr<Playlist>
-Film::playlist () const
+shared_ptr<Player>
+Film::player () const
{
boost::mutex::scoped_lock lm (_state_mutex);
- return shared_ptr<Playlist> (new Playlist (shared_from_this (), _content));
+ return shared_ptr<Player> (new Player (shared_from_this (), _playlist));
}
void
{
boost::mutex::scoped_lock lm (_state_mutex);
_content.push_back (c);
+ _playlist->setup (_content);
}
signal_changed (CONTENT);
examine_content (c);
}
+
+ContentAudioFrame
+Film::audio_length () const
+{
+ return _playlist->audio_length ();
+}
+
+int
+Film::audio_channels () const
+{
+ return _playlist->audio_channels ();
+}
+
+int
+Film::audio_frame_rate () const
+{
+ return _playlist->audio_frame_rate ();
+}
+
+int64_t
+Film::audio_channel_layout () const
+{
+ return _playlist->audio_channel_layout ();
+}
+
+bool
+Film::has_audio () const
+{
+ return _playlist->has_audio ();
+}
+
+float
+Film::video_frame_rate () const
+{
+ return _playlist->video_frame_rate ();
+}
+
+libdcp::Size
+Film::video_size () const
+{
+ return _playlist->video_size ();
+}
+
+ContentVideoFrame
+Film::video_length () const
+{
+ return _playlist->video_length ();
+}
+