_image_display = 0;
_video_view_type = VIDEO_VIEW_SIMPLE;
_respect_kdm_validity_periods = true;
- _player_activity_log_file = boost::none;
_player_debug_log_file = boost::none;
_player_content_directory = boost::none;
_player_playlist_directory = boost::none;
_video_view_type = VIDEO_VIEW_SIMPLE;
}
_respect_kdm_validity_periods = f.optional_bool_child("RespectKDMValidityPeriods").get_value_or(true);
- /* PlayerLogFile is old name */
- _player_activity_log_file = f.optional_string_child("PlayerLogFile");
- if (!_player_activity_log_file) {
- _player_activity_log_file = f.optional_string_child("PlayerActivityLogFile");
- }
_player_debug_log_file = f.optional_string_child("PlayerDebugLogFile");
_player_content_directory = f.optional_string_child("PlayerContentDirectory");
_player_playlist_directory = f.optional_string_child("PlayerPlaylistDirectory");
}
/* [XML] RespectKDMValidityPeriods 1 to refuse to use KDMs that are out of date, 0 to ignore KDM dates. */
root->add_child("RespectKDMValidityPeriods")->add_child_text(_respect_kdm_validity_periods ? "1" : "0");
- if (_player_activity_log_file) {
- /* [XML] PlayerLogFile Filename to use for player activity logs (e.g starting, stopping, playlist loads) */
- root->add_child("PlayerActivityLogFile")->add_child_text(_player_activity_log_file->string());
- }
if (_player_debug_log_file) {
/* [XML] PlayerLogFile Filename to use for player debug logs. */
root->add_child("PlayerDebugLogFile")->add_child_text(_player_debug_log_file->string());
return _respect_kdm_validity_periods;
}
- boost::optional<boost::filesystem::path> player_activity_log_file () const {
- return _player_activity_log_file;
- }
-
boost::optional<boost::filesystem::path> player_debug_log_file () const {
return _player_debug_log_file;
}
maybe_set (_respect_kdm_validity_periods, r);
}
- void set_player_activity_log_file (boost::filesystem::path p) {
- maybe_set (_player_activity_log_file, p);
- }
-
- void unset_player_activity_log_file () {
- if (!_player_activity_log_file) {
- return;
- }
- _player_activity_log_file = boost::none;
- changed ();
- }
-
void set_player_debug_log_file (boost::filesystem::path p) {
maybe_set (_player_debug_log_file, p, PLAYER_DEBUG_LOG);
}
int _image_display;
VideoViewType _video_view_type;
bool _respect_kdm_validity_periods;
- /** Log file containing things the player does (e.g. started, stopped, loaded
- playlist etc.) Does not contain debugging information.
- */
- boost::optional<boost::filesystem::path> _player_activity_log_file;
/** Log file containing debug information for the player */
boost::optional<boost::filesystem::path> _player_debug_log_file;
/** A directory containing DCPs whose contents are presented to the user
_viewer->set_dcp_decode_reduction (Config::instance()->decode_reduction ());
_viewer->set_optimise_for_j2k (true);
_viewer->PlaybackPermitted.connect (bind(&DOMFrame::playback_permitted, this));
- _viewer->Started.connect (bind(&DOMFrame::playback_started, this, _1));
- _viewer->Stopped.connect (bind(&DOMFrame::playback_stopped, this, _1));
_viewer->TooManyDropped.connect (bind(&DOMFrame::too_many_frames_dropped, this));
_info = new PlayerInformation (_overall_panel, _viewer);
setup_main_sizer (Config::instance()->player_mode());
return ok;
}
- void playback_started (DCPTime time)
- {
- /* XXX: this only logs the first piece of content; probably should be each piece? */
- if (_film->content().empty()) {
- return;
- }
-
- auto dcp = dynamic_pointer_cast<DCPContent>(_film->content().front());
- if (dcp) {
- DCPExaminer ex (dcp, true);
- shared_ptr<dcp::CPL> playing_cpl;
- for (auto i: ex.cpls()) {
- if (!dcp->cpl() || i->id() == *dcp->cpl()) {
- playing_cpl = i;
- }
- }
- DCPOMATIC_ASSERT (playing_cpl);
-
- _controls->log (
- wxString::Format(
- "playback-started %s %s %s",
- time.timecode(_film->video_frame_rate()).c_str(),
- dcp->directories().front().string().c_str(),
- playing_cpl->annotation_text().get_value_or("").c_str()
- )
- );
- }
-
- auto ffmpeg = dynamic_pointer_cast<FFmpegContent>(_film->content().front());
- if (ffmpeg) {
- _controls->log (
- wxString::Format(
- "playback-started %s %s",
- time.timecode(_film->video_frame_rate()).c_str(),
- ffmpeg->path(0).string().c_str()
- )
- );
- }
- }
-
- void playback_stopped (DCPTime time)
- {
- _controls->log (wxString::Format("playback-stopped %s", time.timecode(_film->video_frame_rate()).c_str()));
- }
-
void too_many_frames_dropped ()
{
*/
+#include "check_box.h"
+#include "content_view.h"
#include "controls.h"
+#include "dcpomatic_button.h"
#include "film_viewer.h"
-#include "wx_util.h"
-#include "playhead_to_timecode_dialog.h"
#include "playhead_to_frame_dialog.h"
-#include "content_view.h"
+#include "playhead_to_timecode_dialog.h"
#include "static_text.h"
-#include "check_box.h"
-#include "dcpomatic_button.h"
-#include "lib/job_manager.h"
-#include "lib/player_video.h"
-#include "lib/dcp_content.h"
-#include "lib/job.h"
-#include "lib/examine_content_job.h"
+#include "wx_util.h"
#include "lib/content_factory.h"
#include "lib/cross.h"
+#include "lib/dcp_content.h"
+#include "lib/examine_content_job.h"
+#include "lib/job.h"
+#include "lib/job_manager.h"
+#include "lib/player_video.h"
#include <dcp/dcp.h>
#include <dcp/cpl.h>
#include <dcp/reel.h>
}
viewer->seek (t, accurate);
update_position_label ();
-
- log (
- wxString::Format(
- "playback-seeked %s", t.timecode(_film->video_frame_rate()).c_str()
- )
- );
}
bool editor_controls = true
);
- virtual void log (wxString) {}
virtual void set_film (std::shared_ptr<Film> film);
virtual void play () {};
/* Calling start() below may directly result in Stopped being emitted, and if that
* happens we want it to come after the Started signal, so do that first.
*/
- Started (position());
+ Started ();
_video_view->start ();
}
_playing = false;
_video_view->stop ();
- Stopped (position());
+ Stopped ();
_video_view->rethrow ();
return true;
}
boost::signals2::signal<void (std::shared_ptr<PlayerVideo>)> ImageChanged;
- boost::signals2::signal<void (dcpomatic::DCPTime)> Started;
- boost::signals2::signal<void (dcpomatic::DCPTime)> Stopped;
+ boost::signals2::signal<void ()> Started;
+ boost::signals2::signal<void ()> Stopped;
/** While playing back we reached the end of the film (emitted from GUI thread) */
boost::signals2::signal<void ()> Finished;
/** Emitted from the GUI thread when a lot of frames are being dropped */
table->Add (_respect_kdm, wxGBPosition(r, 0), wxGBSpan(1, 2));
++r;
- add_label_to_sizer (table, _panel, _("Activity log file"), true, wxGBPosition (r, 0));
- _activity_log_file = new FilePickerCtrl (_panel, _("Select activity log file"), "*", false, true);
- table->Add (_activity_log_file, wxGBPosition(r, 1));
- ++r;
-
add_label_to_sizer (table, _panel, _("Debug log file"), true, wxGBPosition (r, 0));
_debug_log_file = new FilePickerCtrl (_panel, _("Select debug log file"), "*", false, true);
table->Add (_debug_log_file, wxGBPosition(r, 1));
_image_display->Bind (wxEVT_CHOICE, bind(&PlayerGeneralPage::image_display_changed, this));
_video_display_mode->Bind (wxEVT_CHOICE, bind(&PlayerGeneralPage::video_display_mode_changed, this));
_respect_kdm->Bind (wxEVT_CHECKBOX, bind(&PlayerGeneralPage::respect_kdm_changed, this));
- _activity_log_file->Bind (wxEVT_FILEPICKER_CHANGED, bind(&PlayerGeneralPage::activity_log_file_changed, this));
_debug_log_file->Bind (wxEVT_FILEPICKER_CHANGED, bind(&PlayerGeneralPage::debug_log_file_changed, this));
}
checked_set (_image_display, config->image_display());
checked_set (_respect_kdm, config->respect_kdm_validity_periods());
- if (config->player_activity_log_file()) {
- checked_set (_activity_log_file, *config->player_activity_log_file());
- }
if (config->player_debug_log_file()) {
checked_set (_debug_log_file, *config->player_debug_log_file());
}
Config::instance()->set_respect_kdm_validity_periods(_respect_kdm->GetValue());
}
- void activity_log_file_changed ()
- {
- Config::instance()->set_player_activity_log_file(wx_to_std(_activity_log_file->GetPath()));
- }
-
void debug_log_file_changed ()
{
Config::instance()->set_player_debug_log_file(wx_to_std(_debug_log_file->GetPath()));
wxChoice* _image_display;
wxChoice* _video_display_mode;
wxCheckBox* _respect_kdm;
- FilePickerCtrl* _activity_log_file;
FilePickerCtrl* _debug_log_file;
};
update_current_content ();
}
-void
-PlaylistControls::log (wxString s)
-{
- optional<boost::filesystem::path> log = Config::instance()->player_activity_log_file();
- if (!log) {
- return;
- }
-
- struct timeval time;
- gettimeofday (&time, 0);
- char buffer[64];
- time_t const sec = time.tv_sec;
- struct tm* t = localtime (&sec);
- strftime (buffer, 64, "%c", t);
- wxString ts = std_to_wx(string(buffer)) + N_(": ");
- FILE* f = fopen_boost (*log, "a");
- if (!f) {
- return;
- }
- fprintf (f, "%s%s\n", wx_to_std(ts).c_str(), wx_to_std(s).c_str());
- fclose (f);
-}
void
PlaylistControls::add_playlist_to_list (SPL spl)
void
PlaylistControls::select_playlist (int selected, int position)
{
- log (wxString::Format("load-playlist %s", std_to_wx(_playlists[selected].name()).data()));
-
wxProgressDialog dialog (_("DCP-o-matic"), "Loading playlist and KDMs");
for (auto const& i: _playlists[selected].get()) {
public:
PlaylistControls (wxWindow* parent, std::shared_ptr<FilmViewer> viewer);
- void log (wxString s);
void set_film (std::shared_ptr<Film> film);
/** This is so that we can tell our parent player to reset the film