using std::vector;
using std::setfill;
using std::min;
+using std::max;
using std::make_pair;
using std::endl;
using std::cout;
set_isdcf_date_today ();
_playlist_changed_connection = _playlist->Changed.connect (bind (&Film::playlist_changed, this));
- _playlist_content_changed_connection = _playlist->ContentChanged.connect (bind (&Film::playlist_content_changed, this, _1, _2));
+ _playlist_content_changed_connection = _playlist->ContentChanged.connect (bind (&Film::playlist_content_changed, this, _1, _2, _3));
/* Make state.directory a complete path without ..s (where possible)
(Code swiped from Adam Bowen on stackoverflow)
}
boost::filesystem::path
-Film::internal_video_mxf_dir () const
+Film::internal_video_asset_dir () const
{
return dir ("video");
}
boost::filesystem::path
-Film::internal_video_mxf_filename () const
+Film::internal_video_asset_filename () const
{
return video_identifier() + ".mxf";
}
}
boost::filesystem::path
-Film::audio_analysis_path (shared_ptr<const Playlist> playlist) const
+Film::audio_analysis_path () const
{
boost::filesystem::path p = dir ("analysis");
MD5Digester digester;
- BOOST_FOREACH (shared_ptr<Content> i, playlist->content ()) {
+ BOOST_FOREACH (shared_ptr<Content> i, content ()) {
shared_ptr<AudioContent> ac = dynamic_pointer_cast<AudioContent> (i);
if (!ac) {
continue;
{
_audio_processor = processor;
signal_changed (AUDIO_PROCESSOR);
+ signal_changed (AUDIO_CHANNELS);
}
void
return out;
}
-shared_ptr<Player>
-Film::make_player () const
-{
- return shared_ptr<Player> (new Player (shared_from_this (), _playlist));
-}
-
void
Film::set_signed (bool s)
{
signal_changed (KEY);
}
-shared_ptr<Playlist>
-Film::playlist () const
-{
- return _playlist;
-}
-
ContentList
Film::content () const
{
}
void
-Film::playlist_content_changed (boost::weak_ptr<Content> c, int p)
+Film::playlist_content_changed (boost::weak_ptr<Content> c, int p, bool frequent)
{
if (p == VideoContentProperty::VIDEO_FRAME_RATE) {
set_video_frame_rate (_playlist->best_dcp_frame_rate ());
signal_changed (NAME);
}
- emit (boost::bind (boost::ref (ContentChanged), c, p));
+ emit (boost::bind (boost::ref (ContentChanged), c, p, frequent));
}
void
Film::should_be_enough_disk_space (double& required, double& available, bool& can_hard_link) const
{
/* Create a test file and see if we can hard-link it */
- boost::filesystem::path test = internal_video_mxf_dir() / "test";
- boost::filesystem::path test2 = internal_video_mxf_dir() / "test2";
+ boost::filesystem::path test = internal_video_asset_dir() / "test";
+ boost::filesystem::path test2 = internal_video_asset_dir() / "test2";
can_hard_link = true;
FILE* f = fopen_boost (test, "w");
if (f) {
boost::filesystem::remove (test2);
}
- boost::filesystem::space_info s = boost::filesystem::space (internal_video_mxf_dir ());
+ boost::filesystem::space_info s = boost::filesystem::space (internal_video_asset_dir ());
required = double (required_disk_space ()) / 1073741824.0f;
if (!can_hard_link) {
required *= 2;
return vector<string> (n.begin(), n.begin() + audio_channels ());
}
+
+void
+Film::repeat_content (ContentList c, int n)
+{
+ _playlist->repeat (c, n);
+}
+
+void
+Film::remove_content (ContentList c)
+{
+ _playlist->remove (c);
+}