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 | |
| parent | 3bc475617d5aceb54b09cc1f2fd5f8de77db55e8 (diff) | |
swaroop: various logging fixes.
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/dcpomatic_player.cc | 57 | ||||
| -rw-r--r-- | src/wx/controls.cc | 6 | ||||
| -rw-r--r-- | src/wx/controls.h | 1 | ||||
| -rw-r--r-- | src/wx/film_viewer.cc | 1 | ||||
| -rw-r--r-- | src/wx/film_viewer.h | 1 | ||||
| -rw-r--r-- | src/wx/swaroop_controls.cc | 11 |
6 files changed, 32 insertions, 45 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) diff --git a/src/wx/controls.cc b/src/wx/controls.cc index 3df62fd31..01b689c9e 100644 --- a/src/wx/controls.cc +++ b/src/wx/controls.cc @@ -207,6 +207,12 @@ Controls::slider_moved (bool page) } _viewer->seek (t, false); update_position_label (); + + log ( + wxString::Format( + "playback-seeked %s", t.timecode(_film->video_frame_rate()).c_str() + ) + ); } void diff --git a/src/wx/controls.h b/src/wx/controls.h index fd6181d91..7ffe0c4ea 100644 --- a/src/wx/controls.h +++ b/src/wx/controls.h @@ -51,6 +51,7 @@ public: bool editor_controls = true ); + virtual void log (wxString) {} virtual void set_film (boost::shared_ptr<Film> film); boost::shared_ptr<Film> film () const; void back_frame (); diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index 90f8c9fd2..5c1b59ad6 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -603,7 +603,6 @@ FilmViewer::seek (DCPTime t, bool accurate) } PositionChanged (); - Seeked (position()); } void diff --git a/src/wx/film_viewer.h b/src/wx/film_viewer.h index 73c923c26..123172ad2 100644 --- a/src/wx/film_viewer.h +++ b/src/wx/film_viewer.h @@ -92,7 +92,6 @@ public: boost::signals2::signal<void ()> PositionChanged; boost::signals2::signal<void (DCPTime)> Started; boost::signals2::signal<void (DCPTime)> Stopped; - boost::signals2::signal<void (DCPTime)> Seeked; /** While playing back we reached the end of the film (emitted from GUI thread) */ boost::signals2::signal<void ()> Finished; diff --git a/src/wx/swaroop_controls.cc b/src/wx/swaroop_controls.cc index 62d9d0300..f93cc66f1 100644 --- a/src/wx/swaroop_controls.cc +++ b/src/wx/swaroop_controls.cc @@ -262,6 +262,15 @@ SwaroopControls::log (wxString s) strftime (buffer, 64, "%c", t); 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(); + if (!log) { + return; + } + + FILE* f = fopen_boost (*log, "a"); + fprintf (f, "%s%s\n", wx_to_std(ts).c_str(), wx_to_std(s).c_str()); + fclose (f); } void @@ -385,6 +394,8 @@ SwaroopControls::spl_selection_changed () return; } + log (wxString::Format("load-playlist %s", std_to_wx(_playlists[selected].name()).data())); + wxProgressDialog dialog (_("DCP-o-matic"), "Loading playlist and KDMs"); BOOST_FOREACH (SPLEntry const & i, _playlists[selected].get()) { |
