return _cpl;
}
+ std::string name () const {
+ boost::mutex::scoped_lock lm (_mutex);
+ return _name;
+ }
+
private:
friend class reels_test5;
std::list<std::string>& why_not
) const;
- std::string name () const {
- boost::mutex::scoped_lock lm (_mutex);
- return _name;
- }
-
std::string _name;
/** true if our DCP is encrypted */
bool _encrypted;
#include "lib/encode_server_finder.h"
#include "lib/dcp_content.h"
#include "lib/job_manager.h"
+#include "lib/job.h"
#include "wx/wx_signal_manager.h"
#include "wx/wx_util.h"
#include "wx/about_dialog.h"
#include "wx/report_problem_dialog.h"
#include "wx/film_viewer.h"
+#include "wx/player_information.h"
#include "wx/update_dialog.h"
#include <wx/wx.h>
#include <wx/stdpaths.h>
#include <wx/splash.h>
#include <wx/cmdline.h>
#include <boost/bind.hpp>
+#include <iostream>
using std::string;
+using std::cout;
using std::exception;
using boost::shared_ptr;
using boost::optional;
wxPanel* overall_panel = new wxPanel (this, wxID_ANY);
_viewer = new FilmViewer (overall_panel, false, false);
- wxBoxSizer* main_sizer = new wxBoxSizer (wxHORIZONTAL);
+ _info = new PlayerInformation (overall_panel, _viewer);
+ wxBoxSizer* main_sizer = new wxBoxSizer (wxVERTICAL);
main_sizer->Add (_viewer, 1, wxEXPAND | wxALL, 6);
+ main_sizer->Add (_info, 0, wxALL, 6);
overall_panel->SetSizer (main_sizer);
UpdateChecker::instance()->StateChanged.connect (boost::bind (&DOMFrame::update_checker_state_changed, this));
dcpomatic_sleep (1);
}
- /* XXX: report errors */
+ while (signal_manager->ui_idle ()) {}
+
+ if (jm->errors ()) {
+ wxString errors;
+ BOOST_FOREACH (shared_ptr<Job> i, jm->get()) {
+ if (i->finished_in_error()) {
+ errors += std_to_wx (i->error_summary()) + "\n";
+ }
+ }
+ error_dialog (this, errors);
+ return;
+ }
_viewer->set_film (_film);
+ _info->update ();
}
private:
wxMenu* file = new wxMenu;
file->Append (ID_file_open, _("&Open...\tCtrl-O"));
-#ifndef __WXOSX__
- file->AppendSeparator ();
-#endif
-
#ifdef __WXOSX__
file->Append (wxID_EXIT, _("&Exit"));
#else
}
bool _update_news_requested;
+ PlayerInformation* _info;
FilmViewer* _viewer;
boost::shared_ptr<Film> _film;
};
}
_frame->Show ();
+ signal_manager = new wxSignalManager (this);
+
if (!_dcp_to_load.empty() && boost::filesystem::is_directory (_dcp_to_load)) {
try {
_frame->load_dcp (_dcp_to_load);
}
}
- signal_manager = new wxSignalManager (this);
Bind (wxEVT_IDLE, boost::bind (&App::idle, this));
Bind (wxEVT_TIMER, boost::bind (&App::check, this));
~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 {
--- /dev/null
+/*
+ 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);
+}
--- /dev/null
+/*
+ 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;
+};
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