diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-12-23 22:54:36 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-12-23 22:54:36 +0000 |
| commit | c19a3e0b6fdd8b129caf7c56336215ba5df282ec (patch) | |
| tree | e4d82983db2fcaba7e95a5a09cfdf86887e35097 /src/tools | |
| parent | 3bc475617d5aceb54b09cc1f2fd5f8de77db55e8 (diff) | |
swaroop: various logging fixes.
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/dcpomatic_player.cc | 57 |
1 files changed, 14 insertions, 43 deletions
diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc index 32e5b16d6..793600001 100644 --- a/src/tools/dcpomatic_player.cc +++ b/src/tools/dcpomatic_player.cc @@ -184,7 +184,6 @@ public: _viewer->set_dcp_decode_reduction (Config::instance()->decode_reduction ()); _viewer->PlaybackPermitted.connect (bind(&DOMFrame::playback_permitted, this)); _viewer->Started.connect (bind(&DOMFrame::playback_started, this, _1)); - _viewer->Seeked.connect (bind(&DOMFrame::playback_seeked, this, _1)); _viewer->Stopped.connect (bind(&DOMFrame::playback_stopped, this, _1)); _info = new PlayerInformation (_overall_panel, _viewer); setup_main_sizer (Config::instance()->player_mode()); @@ -288,13 +287,6 @@ public: void playback_started (DCPTime time) { - optional<boost::filesystem::path> log = Config::instance()->player_log_file(); - if (!log) { - return; - } - - FILE* f = fopen_boost(*log, "a"); - /* XXX: this only logs the first piece of content; probably should be each piece? */ shared_ptr<DCPContent> dcp = dynamic_pointer_cast<DCPContent>(_film->content().front()); @@ -308,40 +300,26 @@ public: } DCPOMATIC_ASSERT (playing_cpl); - fprintf ( - f, - "%s playback-started %s %s %s\n", - dcp::LocalTime().as_string().c_str(), - time.timecode(_film->video_frame_rate()).c_str(), - dcp->directories().front().string().c_str(), - playing_cpl->annotation_text().c_str() + _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().c_str() + ) ); } shared_ptr<FFmpegContent> ffmpeg = dynamic_pointer_cast<FFmpegContent>(_film->content().front()); if (ffmpeg) { - fprintf ( - f, - "%s playback-started %s %s\n", - dcp::LocalTime().as_string().c_str(), - time.timecode(_film->video_frame_rate()).c_str(), - ffmpeg->path(0).string().c_str() + _controls->log ( + wxString::Format( + "playback-started %s %s", + time.timecode(_film->video_frame_rate()).c_str(), + ffmpeg->path(0).string().c_str() + ) ); } - - fclose (f); - } - - void playback_seeked (DCPTime time) - { - optional<boost::filesystem::path> log = Config::instance()->player_log_file(); - if (!log) { - return; - } - - FILE* f = fopen_boost(*log, "a"); - fprintf (f, "%s playback-seeked %s\n", dcp::LocalTime().as_string().c_str(), time.timecode(_film->video_frame_rate()).c_str()); - fclose (f); } void playback_stopped (DCPTime time) @@ -354,14 +332,7 @@ public: } #endif - optional<boost::filesystem::path> log = Config::instance()->player_log_file(); - if (!log) { - return; - } - - FILE* f = fopen_boost(*log, "a"); - fprintf (f, "%s playback-stopped %s\n", dcp::LocalTime().as_string().c_str(), time.timecode(_film->video_frame_rate()).c_str()); - fclose (f); + _controls->log (wxString::Format("playback-stopped %s", time.timecode(_film->video_frame_rate()).c_str())); } void set_decode_reduction (optional<int> reduction) |
