Remove player activity logging. Fixes #2122.
authorCarl Hetherington <cth@carlh.net>
Thu, 11 Nov 2021 21:49:34 +0000 (22:49 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 11 Nov 2021 21:51:31 +0000 (22:51 +0100)
If I remember right this was for swaroop and I suspect nobody else
is really interested.

src/lib/config.cc
src/lib/config.h
src/tools/dcpomatic_player.cc
src/wx/controls.cc
src/wx/controls.h
src/wx/film_viewer.cc
src/wx/film_viewer.h
src/wx/player_config_dialog.cc
src/wx/playlist_controls.cc
src/wx/playlist_controls.h

index bfde74a75678e063de6fc90ef136083b5d35850a..419436995dc829337bf59c0cf81a604c01741603 100644 (file)
@@ -168,7 +168,6 @@ Config::set_defaults ()
        _image_display = 0;
        _video_view_type = VIDEO_VIEW_SIMPLE;
        _respect_kdm_validity_periods = true;
        _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;
        _player_debug_log_file = boost::none;
        _player_content_directory = boost::none;
        _player_playlist_directory = boost::none;
@@ -535,11 +534,6 @@ try
                _video_view_type = VIDEO_VIEW_SIMPLE;
        }
        _respect_kdm_validity_periods = f.optional_bool_child("RespectKDMValidityPeriods").get_value_or(true);
                _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");
        _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");
@@ -962,10 +956,6 @@ Config::write_config () const
        }
        /* [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");
        }
        /* [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());
        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());
index c9206b139fce004f83c63a5840b3c6083be7e918..19e05608c5e7a0116c7b73d62b3ecae6ca03ab67 100644 (file)
@@ -517,10 +517,6 @@ public:
                return _respect_kdm_validity_periods;
        }
 
                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;
        }
        boost::optional<boost::filesystem::path> player_debug_log_file () const {
                return _player_debug_log_file;
        }
@@ -993,18 +989,6 @@ public:
                maybe_set (_respect_kdm_validity_periods, r);
        }
 
                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);
        }
        void set_player_debug_log_file (boost::filesystem::path p) {
                maybe_set (_player_debug_log_file, p, PLAYER_DEBUG_LOG);
        }
@@ -1263,10 +1247,6 @@ private:
        int _image_display;
        VideoViewType _video_view_type;
        bool _respect_kdm_validity_periods;
        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
        /** 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
index e409b97311be1fa5c78a5952d6d5a20c51a2102b..8c9f016d4b71a65f16b8a871a0b74b5befd1423e 100644 (file)
@@ -199,8 +199,6 @@ public:
                _viewer->set_dcp_decode_reduction (Config::instance()->decode_reduction ());
                _viewer->set_optimise_for_j2k (true);
                _viewer->PlaybackPermitted.connect (bind(&DOMFrame::playback_permitted, this));
                _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());
                _viewer->TooManyDropped.connect (bind(&DOMFrame::too_many_frames_dropped, this));
                _info = new PlayerInformation (_overall_panel, _viewer);
                setup_main_sizer (Config::instance()->player_mode());
@@ -294,51 +292,6 @@ public:
                return ok;
        }
 
                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 ()
        {
 
        void too_many_frames_dropped ()
        {
index 29f4aeaa364e2416de48dda239f25e2ebbd8ee27..a90ac79b40e5b89ab706a55a9e0a1a3ecb4b368d 100644 (file)
 */
 
 
 */
 
 
+#include "check_box.h"
+#include "content_view.h"
 #include "controls.h"
 #include "controls.h"
+#include "dcpomatic_button.h"
 #include "film_viewer.h"
 #include "film_viewer.h"
-#include "wx_util.h"
-#include "playhead_to_timecode_dialog.h"
 #include "playhead_to_frame_dialog.h"
 #include "playhead_to_frame_dialog.h"
-#include "content_view.h"
+#include "playhead_to_timecode_dialog.h"
 #include "static_text.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/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>
 #include <dcp/dcp.h>
 #include <dcp/cpl.h>
 #include <dcp/reel.h>
@@ -249,12 +249,6 @@ Controls::slider_moved (bool page)
        }
        viewer->seek (t, accurate);
        update_position_label ();
        }
        viewer->seek (t, accurate);
        update_position_label ();
-
-       log (
-               wxString::Format(
-                       "playback-seeked %s", t.timecode(_film->video_frame_rate()).c_str()
-                       )
-               );
 }
 
 
 }
 
 
index 377960425ba2807e5982ede7f25ffd4ec8e376a5..ca9c2008759c0ad9b7a8609d41982e0f74e32b37 100644 (file)
@@ -57,7 +57,6 @@ public:
                bool editor_controls = true
                );
 
                bool editor_controls = true
                );
 
-       virtual void log (wxString) {}
        virtual void set_film (std::shared_ptr<Film> film);
 
        virtual void play () {};
        virtual void set_film (std::shared_ptr<Film> film);
 
        virtual void play () {};
index e678c6aa3045cc9057d29c77ecd6cafbe2f69cbe..2c90b86095278c9bd19b81831e27f3d82123909b 100644 (file)
@@ -371,7 +371,7 @@ FilmViewer::start ()
        /* 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.
         */
        /* 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 ();
 }
 
        _video_view->start ();
 }
 
@@ -390,7 +390,7 @@ FilmViewer::stop ()
 
        _playing = false;
        _video_view->stop ();
 
        _playing = false;
        _video_view->stop ();
-       Stopped (position());
+       Stopped ();
 
        _video_view->rethrow ();
        return true;
 
        _video_view->rethrow ();
        return true;
index 5e5bb791660c0ebfe4d295adf03cfb0c1508908b..0291b660fa403ea0e57359dc286216d5143be7f0 100644 (file)
@@ -139,8 +139,8 @@ public:
        }
 
        boost::signals2::signal<void (std::shared_ptr<PlayerVideo>)> ImageChanged;
        }
 
        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 */
        /** 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 */
index 802ab6b3bcb7ee40ee3d68818db43eabaa5ab221..91434beaeb6a64b36539f3acf2d74c9faeb72757 100644 (file)
@@ -120,11 +120,6 @@ private:
                table->Add (_respect_kdm, wxGBPosition(r, 0), wxGBSpan(1, 2));
                ++r;
 
                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));
                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));
@@ -134,7 +129,6 @@ private:
                _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));
                _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));
        }
 
                _debug_log_file->Bind (wxEVT_FILEPICKER_CHANGED, bind(&PlayerGeneralPage::debug_log_file_changed, this));
        }
 
@@ -167,9 +161,6 @@ private:
 
                checked_set (_image_display, config->image_display());
                checked_set (_respect_kdm, config->respect_kdm_validity_periods());
 
                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());
                }
                if (config->player_debug_log_file()) {
                        checked_set (_debug_log_file, *config->player_debug_log_file());
                }
@@ -210,11 +201,6 @@ private:
                Config::instance()->set_respect_kdm_validity_periods(_respect_kdm->GetValue());
        }
 
                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()));
        void debug_log_file_changed ()
        {
                Config::instance()->set_player_debug_log_file(wx_to_std(_debug_log_file->GetPath()));
@@ -224,7 +210,6 @@ private:
        wxChoice* _image_display;
        wxChoice* _video_display_mode;
        wxCheckBox* _respect_kdm;
        wxChoice* _image_display;
        wxChoice* _video_display_mode;
        wxCheckBox* _respect_kdm;
-       FilePickerCtrl* _activity_log_file;
        FilePickerCtrl* _debug_log_file;
 };
 
        FilePickerCtrl* _debug_log_file;
 };
 
index 129e0ceca407eee9990cac7a69e092552c8bb90e..3be47ad97cd0d4ad7a264cb938bc3263e078d072 100644 (file)
@@ -232,28 +232,6 @@ PlaylistControls::next_clicked ()
        update_current_content ();
 }
 
        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::add_playlist_to_list (SPL spl)
@@ -361,8 +339,6 @@ PlaylistControls::spl_selection_changed ()
 void
 PlaylistControls::select_playlist (int selected, int position)
 {
 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()) {
        wxProgressDialog dialog (_("DCP-o-matic"), "Loading playlist and KDMs");
 
        for (auto const& i: _playlists[selected].get()) {
index b0d04f4cb28caac81d5d2cb0cc508b1cbf2a1a0d..8375f952e29ebd6e12b4f11060923e4a6fa79663 100644 (file)
@@ -28,7 +28,6 @@ class PlaylistControls : public Controls
 public:
        PlaylistControls (wxWindow* parent, std::shared_ptr<FilmViewer> viewer);
 
 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
        void set_film (std::shared_ptr<Film> film);
 
        /** This is so that we can tell our parent player to reset the film