#include "wx/update_dialog.h"
#include "wx/player_config_dialog.h"
#include "wx/verify_dcp_dialog.h"
-#include "wx/controls.h"
+#include "wx/standard_controls.h"
+#include "wx/swaroop_controls.h"
#include "lib/cross.h"
#include "lib/config.h"
#include "lib/util.h"
#include "lib/job_manager.h"
#include "lib/job.h"
#include "lib/film.h"
+#include "lib/null_log.h"
#include "lib/video_content.h"
#include "lib/text_content.h"
#include "lib/ratio.h"
#include "lib/monitor_checker.h"
#include "lib/lock_file_checker.h"
#include "lib/ffmpeg_content.h"
+#include "lib/dcpomatic_log.h"
#include <dcp/dcp.h>
#include <dcp/raw_convert.h>
#include <dcp/exceptions.h>
using std::exception;
using std::vector;
using boost::shared_ptr;
+using boost::weak_ptr;
using boost::scoped_array;
using boost::optional;
using boost::dynamic_pointer_cast;
, _view_full_screen (0)
, _view_dual_screen (0)
{
+ dcpomatic_log.reset (new NullLog());
#if defined(DCPOMATIC_WINDOWS)
maybe_open_console ();
_overall_panel = new wxPanel (this, wxID_ANY);
_viewer.reset (new FilmViewer (_overall_panel));
- _controls = new Controls (_overall_panel, _viewer, false);
+#ifdef DCPOMATIC_VARIANT_SWAROOP
+ SwaroopControls* sc = new SwaroopControls (_overall_panel, _viewer);
+ _controls = sc;
+ sc->ResetFilm.connect (bind(&DOMFrame::reset_film_weak, this, _1));
+#else
+ _controls = new StandardControls (_overall_panel, _viewer, false);
+#endif
_viewer->set_dcp_decode_reduction (Config::instance()->decode_reduction ());
_viewer->PlaybackPermitted.connect (bind(&DOMFrame::playback_permitted, this));
_viewer->Started.connect (bind(&DOMFrame::playback_started, this, _1));
reset_film ();
try {
- shared_ptr<DCPContent> dcp (new DCPContent(_film, dir));
+ shared_ptr<DCPContent> dcp (new DCPContent(dir));
_film->examine_and_add_content (dcp);
bool const ok = display_progress (_("DCP-o-matic Player"), _("Loading content"));
if (!ok || !report_errors_from_last_job(this)) {
return optional<dcp::EncryptedKDM>();
}
+ void reset_film_weak (weak_ptr<Film> weak_film)
+ {
+ shared_ptr<Film> film = weak_film.lock ();
+ if (film) {
+ reset_film (film);
+ }
+ }
+
void reset_film (shared_ptr<Film> film = shared_ptr<Film>(new Film(optional<boost::filesystem::path>())))
{
_film = film;
_viewer->set_film (_film);
+ _controls->set_film (_film);
_film->Change.connect (bind(&DOMFrame::film_changed, this, _1, _2));
+ _info->triggered_update ();
}
void film_changed (ChangeType type, Film::Property property)
if (kdm) {
dcp->add_kdm (*kdm);
- dcp->examine (shared_ptr<Job>());
+ dcp->examine (_film, shared_ptr<Job>());
}
}
DCPOMATIC_ASSERT (dcp);
try {
dcp->add_kdm (dcp::EncryptedKDM (dcp::file_to_string (wx_to_std (d->GetPath ()), MAX_KDM_SIZE)));
- dcp->examine (shared_ptr<Job>());
+ dcp->examine (_film, shared_ptr<Job>());
} catch (exception& e) {
error_dialog (this, wxString::Format (_("Could not load KDM.")), std_to_wx(e.what()));
d->Destroy ();
}
dcp->set_cpl ((*i)->id());
- dcp->examine (shared_ptr<Job>());
+ dcp->examine (_film, shared_ptr<Job>());
}
void view_full_screen ()
void setup_screen ()
{
_controls->Show (_mode != Config::PLAYER_MODE_FULL);
- _controls->show_extended_player_controls (_mode == Config::PLAYER_MODE_DUAL);
_info->Show (_mode != Config::PLAYER_MODE_FULL);
_overall_panel->SetBackgroundColour (_mode == Config::PLAYER_MODE_FULL ? wxColour(0, 0, 0) : wxNullColour);
ShowFullScreen (_mode == Config::PLAYER_MODE_FULL);