_image_display = 0;
_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_kdm_directory = boost::none;
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_kdm_directory = f.optional_string_child("PlayerKDMDirectory");
/* [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_content_directory) {
- /* [XML] PlayerContentDirectory Filename to use for player content in the dual-screen mode. */
+ /* [XML] PlayerContentDirectory Directory to use for player content in the dual-screen mode. */
root->add_child("PlayerContentDirectory")->add_child_text(_player_content_directory->string());
}
if (_player_playlist_directory) {
- /* [XML] PlayerPlaylistDirectory Filename to use for player playlists in the dual-screen mode. */
+ /* [XML] PlayerPlaylistDirectory Directory to use for player playlists in the dual-screen mode. */
root->add_child("PlayerPlaylistDirectory")->add_child_text(_player_playlist_directory->string());
}
if (_player_kdm_directory) {
- /* [XML] PlayerKDMDirectory Filename to use for player KDMs in the dual-screen mode. */
+ /* [XML] PlayerKDMDirectory Directory to use for player KDMs in the dual-screen mode. */
root->add_child("PlayerKDMDirectory")->add_child_text(_player_kdm_directory->string());
}
#ifdef DCPOMATIC_VARIANT_SWAROOP
INTERFACE_COMPLEXITY,
PLAYER_CONTENT_DIRECTORY,
PLAYER_PLAYLIST_DIRECTORY,
+ PLAYER_DEBUG_LOG,
HISTORY,
#ifdef DCPOMATIC_VARIANT_SWAROOP
PLAYER_BACKGROUND_IMAGE,
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_content_directory () const {
return _player_content_directory;
}
changed ();
}
+ void set_player_debug_log_file (boost::filesystem::path p) {
+ maybe_set (_player_debug_log_file, p, PLAYER_DEBUG_LOG);
+ }
+
+ void unset_player_debug_log_file () {
+ if (!_player_debug_log_file) {
+ return;
+ }
+ _player_debug_log_file = boost::none;
+ changed (PLAYER_DEBUG_LOG);
+ }
+
void set_player_content_directory (boost::filesystem::path p) {
maybe_set (_player_content_directory, p, PLAYER_CONTENT_DIRECTORY);
}
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
in the dual-screen player mode. DCPs on the list can be loaded
for playback.
#include "lib/lock_file_checker.h"
#include "lib/ffmpeg_content.h"
#include "lib/dcpomatic_log.h"
+#include "lib/file_log.h"
#include <dcp/dcp.h>
#include <dcp/raw_convert.h>
#include <dcp/exceptions.h>
#endif
_config_changed_connection = Config::instance()->Changed.connect (boost::bind (&DOMFrame::config_changed, this, _1));
- update_from_config ();
+ update_from_config (Config::PLAYER_DEBUG_LOG);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::file_open, this), ID_file_open);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::file_add_ov, this), ID_file_add_ov);
);
}
- update_from_config ();
+ update_from_config (prop);
}
- void update_from_config ()
+ void update_from_config (Config::Property prop)
{
for (int i = 0; i < _history_items; ++i) {
delete _file_menu->Remove (ID_file_history + i);
}
_history_items = history.size ();
+
+ if (prop == Config::PLAYER_DEBUG_LOG) {
+ optional<boost::filesystem::path> p = Config::instance()->player_debug_log_file();
+ if (p) {
+ dcpomatic_log.reset (new FileLog(*p));
+ } else {
+ dcpomatic_log.reset (new NullLog());
+ }
+ dcpomatic_log->set_types (LogEntry::TYPE_GENERAL | LogEntry::TYPE_WARNING | LogEntry::TYPE_ERROR);
+ }
}
void set_menu_sensitivity ()
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"), "*", true);
+ table->Add (_debug_log_file, wxGBPosition(r, 1));
+ ++r;
+
#ifdef DCPOMATIC_VARIANT_SWAROOP
add_label_to_sizer (table, _panel, _("KDM server URL"), true, wxGBPosition(r, 0));
_kdm_server_url = new wxTextCtrl (_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(400, -1));
_image_display->Bind (wxEVT_CHOICE, bind(&PlayerGeneralPage::image_display_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));
#ifdef DCPOMATIC_VARIANT_SWAROOP
_kdm_server_url->Bind (wxEVT_TEXT, bind(&PlayerGeneralPage::kdm_server_url_changed, this));
_lock_file->Bind (wxEVT_FILEPICKER_CHANGED, bind(&PlayerGeneralPage::lock_file_changed, this));
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());
+ }
#ifdef DCPOMATIC_VARIANT_SWAROOP
checked_set (_kdm_server_url, config->kdm_server_url());
if (config->player_lock_file()) {
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()));
+ }
+
#ifdef DCPOMATIC_VARIANT_SWAROOP
void kdm_server_url_changed ()
{
wxChoice* _image_display;
wxCheckBox* _respect_kdm;
FilePickerCtrl* _activity_log_file;
+ FilePickerCtrl* _debug_log_file;
#ifdef DCPOMATIC_VARIANT_SWAROOP
wxTextCtrl* _kdm_server_url;
FilePickerCtrl* _lock_file;