_interface_complexity = INTERFACE_SIMPLE;
_player_mode = PLAYER_MODE_WINDOW;
_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;
}
_image_display = f.optional_number_child<int>("ImageDisplay").get_value_or(0);
+ optional<string> vc = f.optional_string_child("VideoViewType");
+ if (vc && *vc == "opengl") {
+ _video_view_type = VIDEO_VIEW_OPENGL;
+ } else if (vc && *vc == "simple") {
+ _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");
/* [XML] ImageDisplay Screen number to put image on in dual-screen player mode. */
root->add_child("ImageDisplay")->add_child_text(raw_convert<string>(_image_display));
+ switch (_video_view_type) {
+ case VIDEO_VIEW_SIMPLE:
+ root->add_child("VideoViewType")->add_child_text("simple");
+ break;
+ case VIDEO_VIEW_OPENGL:
+ root->add_child("VideoViewType")->add_child_text("opengl");
+ break;
+ }
/* [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) {
return _image_display;
}
+ enum VideoViewType {
+ VIDEO_VIEW_SIMPLE,
+ VIDEO_VIEW_OPENGL
+ };
+
+ VideoViewType video_view_type () const {
+ return _video_view_type;
+ }
+
bool respect_kdm_validity_periods () const {
return _respect_kdm_validity_periods;
}
maybe_set (_image_display, n);
}
+ void set_video_view_type (VideoViewType v) {
+ maybe_set (_video_view_type, v);
+ }
+
void set_respect_kdm_validity_periods (bool r) {
maybe_set (_respect_kdm_validity_periods, r);
}
Interface _interface_complexity;
PlayerMode _player_mode;
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.
}
FilmViewer::FilmViewer (wxWindow* p)
- /* XXX: make this configurable */
-// : _video_view (new GLVideoView(p))
- : _video_view (new SimpleVideoView(this, p))
- , _coalesce_player_changes (false)
+ : _coalesce_player_changes (false)
, _audio (DCPOMATIC_RTAUDIO_API)
, _audio_channels (0)
, _audio_block_size (1024)
, _state_timer ("viewer")
, _gets (0)
{
+ switch (Config::instance()->video_view_type()) {
+ case Config::VIDEO_VIEW_OPENGL:
+ _video_view = new GLVideoView (p);
+ break;
+ case Config::VIDEO_VIEW_SIMPLE:
+ _video_view = new SimpleVideoView (this, p);
+ break;
+ }
+
/* XXX: maybe this should be proxied through the VideoView */
_video_view->get()->Bind (wxEVT_SIZE, boost::bind (&FilmViewer::video_view_sized, this));
_timer.Bind (wxEVT_TIMER, boost::bind (&FilmViewer::timer, this));
table->Add (s, 1);
}
+ add_label_to_sizer (table, _panel, _("Video display mode"), true);
+ _video_display_mode = new wxChoice (_panel, wxID_ANY);
+ table->Add (_video_display_mode);
+
+ wxStaticText* restart = add_label_to_sizer (table, _panel, _("(restart DCP-o-matic to change display mode)"), false);
+ wxFont font = restart->GetFont();
+ font.SetStyle (wxFONTSTYLE_ITALIC);
+ font.SetPointSize (font.GetPointSize() - 1);
+ restart->SetFont (font);
+ table->AddSpacer (0);
+
_allow_any_dcp_frame_rate = new CheckBox (_panel, _("Allow any DCP frame rate"));
table->Add (_allow_any_dcp_frame_rate, 1, wxEXPAND | wxALL);
table->AddSpacer (0);
table->Add (_allow_any_container, 1, wxEXPAND | wxALL);
table->AddSpacer (0);
- wxStaticText* restart = add_label_to_sizer (table, _panel, _("(restart DCP-o-matic to see all ratios)"), false);
- wxFont font = restart->GetFont();
- font.SetStyle (wxFONTSTYLE_ITALIC);
- font.SetPointSize (font.GetPointSize() - 1);
+ restart = add_label_to_sizer (table, _panel, _("(restart DCP-o-matic to see all ratios)"), false);
restart->SetFont (font);
table->AddSpacer (0);
_maximum_j2k_bandwidth->SetRange (1, 1000);
_maximum_j2k_bandwidth->Bind (wxEVT_SPINCTRL, boost::bind (&AdvancedPage::maximum_j2k_bandwidth_changed, this));
+ _video_display_mode->Append (_("Simple (safer)"));
+ _video_display_mode->Append (_("OpenGL (faster)"));
+ _video_display_mode->Bind (wxEVT_CHOICE, boost::bind(&AdvancedPage::video_display_mode_changed, this));
_allow_any_dcp_frame_rate->Bind (wxEVT_CHECKBOX, boost::bind (&AdvancedPage::allow_any_dcp_frame_rate_changed, this));
_allow_any_container->Bind (wxEVT_CHECKBOX, boost::bind (&AdvancedPage::allow_any_container_changed, this));
_only_servers_encode->Bind (wxEVT_CHECKBOX, boost::bind (&AdvancedPage::only_servers_encode_changed, this));
Config* config = Config::instance ();
checked_set (_maximum_j2k_bandwidth, config->maximum_j2k_bandwidth() / 1000000);
+ switch (config->video_view_type()) {
+ case Config::VIDEO_VIEW_SIMPLE:
+ checked_set (_video_display_mode, 0);
+ break;
+ case Config::VIDEO_VIEW_OPENGL:
+ checked_set (_video_display_mode, 1);
+ break;
+ }
checked_set (_allow_any_dcp_frame_rate, config->allow_any_dcp_frame_rate ());
checked_set (_allow_any_container, config->allow_any_container ());
checked_set (_only_servers_encode, config->only_servers_encode ());
Config::instance()->set_maximum_j2k_bandwidth (_maximum_j2k_bandwidth->GetValue() * 1000000);
}
+ void video_display_mode_changed ()
+ {
+ if (_video_display_mode->GetSelection() == 0) {
+ Config::instance()->set_video_view_type (Config::VIDEO_VIEW_SIMPLE);
+ } else {
+ Config::instance()->set_video_view_type (Config::VIDEO_VIEW_OPENGL);
+ }
+ }
+
void frames_in_memory_multiplier_changed ()
{
Config::instance()->set_frames_in_memory_multiplier (_frames_in_memory_multiplier->GetValue());
#endif
wxSpinCtrl* _maximum_j2k_bandwidth;
+ wxChoice* _video_display_mode;
wxSpinCtrl* _frames_in_memory_multiplier;
wxCheckBox* _allow_any_dcp_frame_rate;
wxCheckBox* _allow_any_container;