summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-09-25 00:23:12 +0100
committerCarl Hetherington <cth@carlh.net>2018-09-25 00:23:12 +0100
commitf1b928749ca8082ca5929d6042c5d1e6a89ef489 (patch)
tree9c31da9e9a6efd0fa62ab7708769630f538858e5
parentd0d89009ad0acca0ddfa43dc45d8ac4186c5fc21 (diff)
Add very basic logging in the dual-screen player.
-rw-r--r--src/tools/dcpomatic_player.cc2
-rw-r--r--src/wx/controls.cc25
-rw-r--r--src/wx/controls.h2
3 files changed, 27 insertions, 2 deletions
diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc
index e0112764f..07583ccaf 100644
--- a/src/tools/dcpomatic_player.cc
+++ b/src/tools/dcpomatic_player.cc
@@ -344,6 +344,8 @@ public:
j->Check(!dcp->cpl() || i->id() == *dcp->cpl());
++id;
}
+
+ _controls->log (wxString::Format(_("Load DCP %s"), dir.filename().string().c_str()));
}
private:
diff --git a/src/wx/controls.cc b/src/wx/controls.cc
index e96d8055e..bc373812d 100644
--- a/src/wx/controls.cc
+++ b/src/wx/controls.cc
@@ -73,11 +73,19 @@ Controls::Controls (wxWindow* parent, shared_ptr<FilmViewer> viewer, bool editor
_v_sizer->Add (view_options, 0, wxALL, DCPOMATIC_SIZER_GAP);
- _dcp_directory = new wxListCtrl (this, wxID_ANY, wxDefaultPosition, wxSize(600, -1), wxLC_REPORT | wxLC_NO_HEADER);
+ wxBoxSizer* e_sizer = new wxBoxSizer (wxHORIZONTAL);
+
+ _dcp_directory = new wxListCtrl (this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_NO_HEADER);
_dcp_directory->AppendColumn (wxT(""), wxLIST_FORMAT_LEFT, 580);
- _v_sizer->Add (_dcp_directory, 0, wxALL, DCPOMATIC_SIZER_GAP);
+ e_sizer->Add (_dcp_directory, 1, wxALL | wxEXPAND, DCPOMATIC_SIZER_GAP);
+
+ _log = new wxTextCtrl (this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1, 400), wxTE_READONLY | wxTE_MULTILINE);
+ e_sizer->Add (_log, 1, wxALL | wxEXPAND, DCPOMATIC_SIZER_GAP);
+
_dcp_directory->Show (false);
+ _v_sizer->Add (e_sizer, 0, wxEXPAND);
+
wxBoxSizer* h_sizer = new wxBoxSizer (wxHORIZONTAL);
wxBoxSizer* time_sizer = new wxBoxSizer (wxVERTICAL);
@@ -502,3 +510,16 @@ Controls::stop_clicked ()
DCPEjected ();
}
#endif
+
+void
+Controls::log (wxString s)
+{
+ 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_(": ");
+ _log->SetValue(_log->GetValue() + ts + s + "\n");
+}
diff --git a/src/wx/controls.h b/src/wx/controls.h
index bd87d658b..63e9fb38a 100644
--- a/src/wx/controls.h
+++ b/src/wx/controls.h
@@ -47,6 +47,7 @@ public:
void forward_frame ();
void show_extended_player_controls (bool s);
+ void log (wxString s);
boost::signals2::signal<void (boost::filesystem::path)> DCPDirectorySelected;
boost::signals2::signal<void ()> DCPEjected;
@@ -97,6 +98,7 @@ private:
wxChoice* _eye;
wxCheckBox* _jump_to_selected;
wxListCtrl* _dcp_directory;
+ wxTextCtrl* _log;
std::vector<boost::filesystem::path> _dcp_directories;
wxSlider* _slider;
wxButton* _rewind_button;