# Use distro-provided FFmpeg on Arch
deps = []
- deps.append(('libdcp', '6fef005'))
- deps.append(('libsub', '32b8463'))
+ deps.append(('libdcp', 'ee05b1c'))
+ deps.append(('libsub', '1cf5cdf'))
deps.append(('rtaudio-cdist', '739969e'))
return deps
_gdc_password = optional<string>();
_interface_complexity = INTERFACE_SIMPLE;
_player_mode = PLAYER_MODE_WINDOW;
+ _respect_kdm_validity_periods = false;
_allowed_dcp_frame_rates.clear ();
_allowed_dcp_frame_rates.push_back (24);
_player_mode = PLAYER_MODE_DUAL;
}
+ _respect_kdm_validity_periods = f.optional_bool_child("RespectKDMValidityPeriods").get_value_or(false);
+
/* Replace any cinemas from config.xml with those from the configured file */
if (boost::filesystem::exists (_cinemas_file)) {
cxml::Document f ("Cinemas");
break;
}
+ root->add_child("RespectKDMValidityPeriods")->add_child_text(_respect_kdm_validity_periods ? "1" : "0");
+
try {
doc.write_to_file_formatted(config_file().string());
} catch (xmlpp::exception& e) {
return _player_mode;
}
+ bool respect_kdm_validity_periods () const {
+ return _respect_kdm_validity_periods;
+ }
+
/* SET (mostly) */
void set_master_encoding_threads (int n) {
maybe_set (_player_mode, m);
}
+ void set_respect_kdm_validity_periods (bool r) {
+ maybe_set (_respect_kdm_validity_periods, r);
+ }
+
void changed (Property p = OTHER);
boost::signals2::signal<void (Property)> Changed;
/** Emitted if read() failed on an existing Config file. There is nothing
boost::optional<std::string> _gdc_password;
Interface _interface_complexity;
PlayerMode _player_mode;
+ bool _respect_kdm_validity_periods;
static int const _current_version;
_cpl = id;
}
}
+
+bool
+DCPContent::kdm_timing_window_valid () const
+{
+ if (!_kdm) {
+ return true;
+ }
+
+ dcp::LocalTime now;
+ return _kdm->not_valid_before() < now && now < _kdm->not_valid_after();
+}
return _three_d;
}
+ bool kdm_timing_window_valid () const;
+
private:
friend class reels_test5;
_viewer.reset (new FilmViewer (_overall_panel));
_controls = new Controls (_overall_panel, _viewer);
_viewer->set_dcp_decode_reduction (Config::instance()->decode_reduction ());
+ _viewer->PlaybackPermitted.connect (bind(&DOMFrame::playback_permitted, this));
_info = new PlayerInformation (_overall_panel, _viewer);
wxSizer* main_sizer = new wxBoxSizer (wxVERTICAL);
main_sizer->Add (_viewer->panel(), 1, wxEXPAND);
setup_screen ();
}
+ bool playback_permitted ()
+ {
+ if (!_film || !Config::instance()->respect_kdm_validity_periods()) {
+ return true;
+ }
+
+ bool ok = true;
+ BOOST_FOREACH (shared_ptr<Content> i, _film->content()) {
+ shared_ptr<DCPContent> d = dynamic_pointer_cast<DCPContent>(i);
+ if (d && !d->kdm_timing_window_valid()) {
+ ok = false;
+ }
+ }
+
+ if (!ok) {
+ error_dialog (this, _("The KDM does not allow playback of this content at this time."));
+ }
+
+ return ok;
+ }
+
void set_decode_reduction (optional<int> reduction)
{
_viewer->set_dcp_decode_reduction (reduction);
return;
}
+ optional<bool> v = PlaybackPermitted ();
+ if (v && !*v) {
+ /* Computer says no */
+ return;
+ }
+
if (_audio.isStreamOpen()) {
_audio.setStreamTime (_video_position.seconds());
_audio.startStream ();
boost::signals2::signal<void ()> Stopped;
boost::signals2::signal<void ()> FilmChanged;
+ boost::signals2::signal<bool ()> PlaybackPermitted;
+
private:
void paint_panel ();
void panel_sized (wxSizeEvent &);
table->Add (_player_mode, wxGBPosition(r, 1));
++r;
+ _respect_kdm = new wxCheckBox (_panel, wxID_ANY, _("Respect KDM validity periods"));
+ table->Add (_respect_kdm, wxGBPosition(r, 0), wxGBSpan(1, 2));
+ ++r;
+
_player_mode->Bind (wxEVT_CHOICE, bind(&PlayerGeneralPage::player_mode_changed, this));
+ _respect_kdm->Bind (wxEVT_CHECKBOX, bind(&PlayerGeneralPage::respect_kdm_changed, this));
}
void config_changed ()
checked_set (_player_mode, 2);
break;
}
+
+ checked_set (_respect_kdm, Config::instance()->respect_kdm_validity_periods());
}
private:
}
}
+ void respect_kdm_changed ()
+ {
+ Config::instance()->set_respect_kdm_validity_periods(_respect_kdm->GetValue());
+ }
+
wxChoice* _player_mode;
+ wxCheckBox* _respect_kdm;
};
wxPreferencesEditor*