using boost::shared_ptr;
using boost::dynamic_pointer_cast;
using boost::optional;
+using namespace dcpomatic;
SwaroopControls::SwaroopControls (wxWindow* parent, shared_ptr<FilmViewer> viewer)
: Controls (parent, viewer, false)
void
SwaroopControls::check_restart ()
{
+ cout << "check_restart called\n";
FILE* f = fopen_boost (Config::path("position"), "r");
if (!f) {
+ cout << "could not open position file (" << errno << ")\n";
return;
}
int64_t time;
fscanf (f, "%63s %d %ld", id, &index, &time);
+ cout << "Looking for playlist " << id << " to restart.\n";
+
for (size_t i = 0; i < _playlists.size(); ++i) {
if (_playlists[i].id() == id) {
+ cout << "Found playlist " << id << "\n";
select_playlist (i, index);
update_current_content ();
_viewer->seek (DCPTime(time), false);
}
}
-#ifdef DCPOMATIC_LINUX
- fsync (fileno(f));
-#endif
fclose (f);
}
+ " " + dcp::raw_convert<string>(_viewer->position().get());
checked_fwrite (p.c_str(), p.length(), f, Config::path("position"));
+#ifdef DCPOMATIC_LINUX
+ fflush (f);
+ fsync (fileno(f));
+#endif
fclose (f);
}
}
wxString ts = std_to_wx(string(buffer)) + N_(": ");
_log->SetValue(_log->GetValue() + ts + s + "\n");
- optional<boost::filesystem::path> log = Config::instance()->player_log_file();
+ optional<boost::filesystem::path> log = Config::instance()->player_activity_log_file();
if (!log) {
return;
}
string url = Config::instance()->kdm_server_url();
boost::algorithm::replace_all (url, "{CPL}", *dcp->cpl());
optional<dcp::EncryptedKDM> kdm;
- if (dcp->cpl() && !get_from_url(url, false, temp)) {
+ if (dcp->cpl() && !get_from_url(url, false, false, temp)) {
try {
kdm = dcp::EncryptedKDM (dcp::file_to_string(temp.file()));
if (kdm->cpl_id() != dcp->cpl()) {