diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-08-03 01:28:43 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-08-14 21:07:48 +0100 |
| commit | 709a3af8ac11cdeb688f2d77209e036a88b3c714 (patch) | |
| tree | e8ec30e72f8556d19658437c9a67fa2a34c1009a /src/wx | |
| parent | 154fae5683aa15e84bd07e37f4b219c86354692d (diff) | |
Initial and not-working information panel in player.
Diffstat (limited to 'src/wx')
| -rw-r--r-- | src/wx/film_viewer.h | 3 | ||||
| -rw-r--r-- | src/wx/player_information.cc | 73 | ||||
| -rw-r--r-- | src/wx/player_information.h | 38 | ||||
| -rw-r--r-- | src/wx/wscript | 1 |
4 files changed, 115 insertions, 0 deletions
diff --git a/src/wx/film_viewer.h b/src/wx/film_viewer.h index a411be5ec..b445528b1 100644 --- a/src/wx/film_viewer.h +++ b/src/wx/film_viewer.h @@ -45,6 +45,9 @@ public: ~FilmViewer (); void set_film (boost::shared_ptr<Film>); + boost::shared_ptr<Film> film () const { + return _film; + } /** @return our `playhead' position; this may not lie exactly on a frame boundary */ DCPTime position () const { diff --git a/src/wx/player_information.cc b/src/wx/player_information.cc new file mode 100644 index 000000000..e79e71622 --- /dev/null +++ b/src/wx/player_information.cc @@ -0,0 +1,73 @@ +/* + Copyright (C) 2017 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 "player_information.h" +#include "wx_util.h" +#include "film_viewer.h" +#include "lib/playlist.h" +#include "lib/dcp_content.h" + +using std::cout; +using boost::shared_ptr; +using boost::dynamic_pointer_cast; + +PlayerInformation::PlayerInformation (wxWindow* parent, FilmViewer* viewer) + : wxPanel (parent) + , _viewer (viewer) + , _sizer (new wxBoxSizer (wxHORIZONTAL)) +{ + wxFont title_font (*wxNORMAL_FONT); + title_font.SetWeight (wxFONTWEIGHT_BOLD); + + { + wxSizer* s = new wxBoxSizer (wxVERTICAL); + add_label_to_sizer(s, this, _("DCP"), false, 0)->SetFont(title_font); + _cpl_name = add_label_to_sizer(s, this, wxT(""), false, 0); + _sizer->Add (s, 1, wxEXPAND | wxALL, 6); + } + + { + wxSizer* s = new wxBoxSizer (wxVERTICAL); + add_label_to_sizer(s, this, _("Performance"), false, 0)->SetFont(title_font); + _decoded_fps = add_label_to_sizer(s, this, wxT(""), false, 0); + _sizer->Add (s, 1, wxEXPAND | wxALL, 6); + } + + SetSizerAndFit (_sizer); + + update (); +} + +void +PlayerInformation::update () +{ + wxString cpl_name; + if (_viewer->film()) { + ContentList content = _viewer->film()->content(); + if (content.size() == 1) { + shared_ptr<DCPContent> dcp = dynamic_pointer_cast<DCPContent>(content.front()); + if (dcp) { + cpl_name = std_to_wx (dcp->name()); + } + } + } + + checked_set (_cpl_name, cpl_name); +} diff --git a/src/wx/player_information.h b/src/wx/player_information.h new file mode 100644 index 000000000..7d784d715 --- /dev/null +++ b/src/wx/player_information.h @@ -0,0 +1,38 @@ +/* + Copyright (C) 2017 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> + +class FilmViewer; + +class PlayerInformation : public wxPanel +{ +public: + PlayerInformation (wxWindow* parent, FilmViewer* viewer); + + void update (); + +private: + + FilmViewer* _viewer; + wxSizer* _sizer; + wxStaticText* _cpl_name; + wxStaticText* _decoded_fps; +}; diff --git a/src/wx/wscript b/src/wx/wscript index 66b928247..79b1490c5 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -75,6 +75,7 @@ sources = """ name_format_editor.cc new_dkdm_folder_dialog.cc normal_job_view.cc + player_information.cc playhead_to_timecode_dialog.cc playhead_to_frame_dialog.cc question_dialog.cc |
