+2018-09-14 Carl Hetherington <cth@carlh.net>
+
+ * Basic dual-screen mode for player.
+
2018-09-11 Carl Hetherington <cth@carlh.net>
* Full-screen mode for player (#1329).
*/
-
#include "wx/wx_signal_manager.h"
#include "wx/wx_util.h"
#include "wx/about_dialog.h"
#include "wx/player_config_dialog.h"
#include "wx/verify_dcp_dialog.h"
#include "wx/controls.h"
+#include "wx/cinema_player_dialog.h"
#include "lib/cross.h"
#include "lib/config.h"
#include "lib/util.h"
#include <wx/cmdline.h>
#include <wx/preferences.h>
#include <wx/progdlg.h>
+#include <wx/display.h>
#ifdef __WXOSX__
#include <ApplicationServices/ApplicationServices.h>
#endif
ID_view_cpl,
/* Allow spare IDs for CPLs */
ID_view_full_screen = 200,
+ ID_view_dual_screen,
ID_view_closed_captions,
ID_view_scale_appropriate,
ID_view_scale_full,
class DOMFrame : public wxFrame
{
public:
+ enum Screen {
+ SCREEN_WINDOW,
+ SCREEN_FULL,
+ SCREEN_DUAL
+ };
+
DOMFrame ()
: wxFrame (0, -1, _("DCP-o-matic Player"))
, _update_news_requested (false)
, _info (0)
, _config_dialog (0)
- , _full_screen (false)
+ , _screen (SCREEN_WINDOW)
+ , _cinema_dialog (0)
, _file_menu (0)
, _history_items (0)
, _history_position (0)
Bind (wxEVT_MENU, boost::bind (&DOMFrame::file_exit, this), wxID_EXIT);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::edit_preferences, this), wxID_PREFERENCES);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::view_full_screen, this), ID_view_full_screen);
+ Bind (wxEVT_MENU, boost::bind (&DOMFrame::view_dual_screen, this), ID_view_dual_screen);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::view_closed_captions, this), ID_view_closed_captions);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::view_cpl, this, _1), ID_view_cpl, ID_view_cpl + MAX_CPLS);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::set_decode_reduction, this, optional<int>(0)), ID_view_scale_full);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::back_frame, this), ID_back_frame);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::forward_frame, this), ID_forward_frame);
+ _cinema_dialog = new CinemaPlayerDialog (this, _viewer);
+
UpdateChecker::instance()->StateChanged.connect (boost::bind (&DOMFrame::update_checker_state_changed, this));
}
wxMenu* view = new wxMenu;
optional<int> c = Config::instance()->decode_reduction();
_view_cpl = view->Append(ID_view_cpl, _("CPL"), _cpl_menu);
- view->AppendCheckItem(ID_view_full_screen, _("Full screen\tF11"))->Check(_full_screen);
+ view->AppendCheckItem(ID_view_full_screen, _("Full screen\tF11"))->Check(_screen == SCREEN_FULL);
+ view->AppendCheckItem(ID_view_dual_screen, _("Dual screen\tShift+F11"))->Check(_screen == SCREEN_DUAL);
view->Append(ID_view_closed_captions, _("Closed captions..."));
view->AppendSeparator();
view->AppendRadioItem(ID_view_scale_appropriate, _("Set decode resolution to match display"))->Check(!static_cast<bool>(c));
void view_full_screen ()
{
- _full_screen = !_full_screen;
- _controls->Show (!_full_screen);
- _info->Show (!_full_screen);
- _overall_panel->SetBackgroundColour (_full_screen ? wxColour(0, 0, 0) : wxNullColour);
- ShowFullScreen (_full_screen);
+ if (_screen == SCREEN_FULL) {
+ _screen = SCREEN_WINDOW;
+ } else {
+ _screen = SCREEN_FULL;
+ }
+ setup_screen ();
+ }
+
+ void view_dual_screen ()
+ {
+ if (_screen == SCREEN_DUAL) {
+ _screen = SCREEN_WINDOW;
+ } else {
+ _screen = SCREEN_DUAL;
+ }
+ setup_screen ();
+ }
+
+ void setup_screen ()
+ {
+ _controls->Show (_screen == SCREEN_WINDOW);
+ _info->Show (_screen == SCREEN_WINDOW);
+ _overall_panel->SetBackgroundColour (_screen == SCREEN_WINDOW ? wxNullColour : wxColour(0, 0, 0));
+ ShowFullScreen (_screen != SCREEN_WINDOW);
+ if (_screen == SCREEN_DUAL) {
+ _cinema_dialog->Show ();
+ if (wxDisplay::GetCount() > 1) {
+ this->Move (0, 0);
+ _cinema_dialog->Move (wxDisplay(0).GetClientArea().GetWidth(), 0);
+ }
+ }
}
void view_closed_captions ()
bool _update_news_requested;
PlayerInformation* _info;
wxPreferencesEditor* _config_dialog;
- bool _full_screen;
+ Screen _screen;
+ CinemaPlayerDialog* _cinema_dialog;
wxPanel* _overall_panel;
wxMenu* _file_menu;
wxMenuItem* _view_cpl;
--- /dev/null
+/*
+ Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+
+ This file is part of DCP-o-matic.
+
+ DCP-o-matic is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ DCP-o-matic is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include "cinema_player_dialog.h"
+#include "controls.h"
+#include "player_information.h"
+#include <boost/shared_ptr.hpp>
+
+using boost::shared_ptr;
+
+CinemaPlayerDialog::CinemaPlayerDialog (wxWindow* parent, shared_ptr<FilmViewer> viewer)
+ : wxDialog (parent, wxID_ANY, _("DCP-o-matic Player"))
+{
+ _controls = new Controls (this, viewer, false, false, false);
+ _info = new PlayerInformation (this, viewer);
+
+ wxBoxSizer* s = new wxBoxSizer (wxVERTICAL);
+ s->Add (_controls, 0, wxEXPAND | wxALL, 6);
+ s->Add (_info, 0, wxEXPAND | wxALL, 6);
+
+ SetSize (640, -1);
+
+ SetSizer (s);
+}
--- /dev/null
+/*
+ Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+
+ This file is part of DCP-o-matic.
+
+ DCP-o-matic is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ DCP-o-matic is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include <wx/wx.h>
+#include <boost/shared_ptr.hpp>
+
+class Controls;
+class PlayerInformation;
+class FilmViewer;
+
+class CinemaPlayerDialog : public wxDialog
+{
+public:
+ CinemaPlayerDialog (wxWindow* parent, boost::shared_ptr<FilmViewer> viewer);
+
+private:
+ Controls* _controls;
+ PlayerInformation* _info;
+};
/** @param outline_content true if viewer should present an "outline content" checkbox.
* @param jump_to_selected true if viewer should present a "jump to selected" checkbox.
*/
-Controls::Controls (wxWindow* parent, shared_ptr<FilmViewer> viewer, bool outline_content, bool jump_to_selected)
+Controls::Controls (wxWindow* parent, shared_ptr<FilmViewer> viewer, bool outline_content, bool jump_to_selected, bool eye)
: wxPanel (parent)
, _viewer (viewer)
, _slider_being_moved (false)
view_options->Add (_outline_content, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_GAP);
}
- _eye = new wxChoice (this, wxID_ANY);
- _eye->Append (_("Left"));
- _eye->Append (_("Right"));
- _eye->SetSelection (0);
- view_options->Add (_eye, 0, wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_GAP);
+ if (eye) {
+ _eye = new wxChoice (this, wxID_ANY);
+ _eye->Append (_("Left"));
+ _eye->Append (_("Right"));
+ _eye->SetSelection (0);
+ view_options->Add (_eye, 0, wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_GAP);
+ }
if (jump_to_selected) {
_jump_to_selected = new wxCheckBox (this, wxID_ANY, _("Jump to selected content"));
_back_button->SetMinSize (wxSize (32, -1));
_forward_button->SetMinSize (wxSize (32, -1));
- _eye->Bind (wxEVT_CHOICE, boost::bind (&Controls::eye_changed, this));
+ if (_eye) {
+ _eye->Bind (wxEVT_CHOICE, boost::bind (&Controls::eye_changed, this));
+ }
if (_outline_content) {
_outline_content->Bind (wxEVT_CHECKBOX, boost::bind (&Controls::outline_content_changed, this));
}
_jump_to_selected->Enable (c);
}
- _eye->Enable (c && _film->three_d ());
+ if (_eye) {
+ _eye->Enable (c && _film->three_d ());
+ }
}
void
class Controls : public wxPanel
{
public:
- Controls (wxWindow* parent, boost::shared_ptr<FilmViewer>, bool outline_content = true, bool jump_to_selected = true);
+ Controls (wxWindow* parent, boost::shared_ptr<FilmViewer>, bool outline_content = true, bool jump_to_selected = true, bool eyes = true);
boost::shared_ptr<Film> film () const;
void back_frame ();
text_view.cc
christie_certificate_panel.cc
cinema_dialog.cc
+ cinema_player_dialog.cc
colour_conversion_editor.cc
config_dialog.cc
config_move_dialog.cc