#include "lib/ffmpeg_content.h"
#include "lib/file_log.h"
#include "lib/film.h"
+#include "lib/font_config.h"
#include "lib/image.h"
#include "lib/image_jpeg.h"
#include "lib/image_png.h"
#include <dcp/cpl.h>
#include <dcp/dcp.h>
#include <dcp/exceptions.h>
+#include <dcp/filesystem.h>
#include <dcp/raw_convert.h>
#include <dcp/search.h>
#include <dcp/warnings.h>
if (filenames.GetCount() == 1) {
/* Try to load a directory */
auto path = boost::filesystem::path(wx_to_std(filenames[0]));
- if (boost::filesystem::is_directory(path)) {
+ if (dcp::filesystem::is_directory(path)) {
_frame->load_dcp(wx_to_std(filenames[0]));
return true;
}
Bind (wxEVT_MENU, boost::bind (&DOMFrame::tools_timing, this), ID_tools_timing);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::tools_system_information, this), ID_tools_system_information);
+ Bind(wxEVT_CLOSE_WINDOW, boost::bind(&DOMFrame::close, this, _1));
+
if (Config::instance()->player_mode() == Config::PLAYER_MODE_DUAL) {
auto pc = new PlaylistControls (_overall_panel, _viewer);
_controls = pc;
} else {
_controls = new StandardControls (_overall_panel, _viewer, false);
}
+ _controls->set_film(_viewer.film());
_viewer.set_dcp_decode_reduction(Config::instance()->decode_reduction());
_viewer.set_optimise_for_j2k(true);
_viewer.PlaybackPermitted.connect(bind(&DOMFrame::playback_permitted, this));
_viewer.stop();
}
+ void close(wxCloseEvent& ev)
+ {
+ FontConfig::drop();
+ ev.Skip();
+ }
+
void setup_main_sizer (Config::PlayerMode mode)
{
_main_sizer->Detach(_viewer.panel());
_info->triggered_update ();
}
- void film_changed (ChangeType type, Film::Property property)
+ void film_changed (ChangeType type, FilmProperty property)
{
- if (type != ChangeType::DONE || property != Film::Property::CONTENT) {
+ if (type != ChangeType::DONE || property != FilmProperty::CONTENT) {
return;
}
void file_save_frame ()
{
- wxFileDialog dialog (this, _("Save frame to file"), "", "", "PNG files (*.png)|*.png|JPEG files (*.jpg,*.jpeg)|*.jpg,*.jpeg", wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
+ wxFileDialog dialog (this, _("Save frame to file"), "", "", "PNG files (*.png)|*.png|JPEG files (*.jpg;*.jpeg)|*.jpg;*.jpeg", wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
if (dialog.ShowModal() == wxID_CANCEL) {
return;
}
DCPOMATIC_ASSERT (dcp);
auto job = make_shared<VerifyDCPJob>(dcp->directories());
- auto progress = new VerifyDCPProgressDialog(this, _("DCP-o-matic Player"));
- bool const completed = progress->run (job);
- progress->Destroy ();
- if (!completed) {
- return;
- }
+ VerifyDCPProgressDialog progress(this, _("DCP-o-matic Player"));
+ bool const completed = progress.run(job);
+ progress.Close();
- auto d = new VerifyDCPDialog (this, job);
- d->ShowModal ();
- d->Destroy ();
+ if (completed) {
+ VerifyDCPDialog dialog(this, job);
+ dialog.ShowModal();
+ }
}
void tools_check_for_updates ()
void tools_timing ()
{
- auto d = new TimerDisplay(this, _viewer.state_timer(), _viewer.gets());
+ auto d = make_wx<TimerDisplay>(this, _viewer.state_timer(), _viewer.gets());
d->ShowModal ();
- d->Destroy ();
}
void tools_system_information ()
void help_about ()
{
- auto d = new AboutDialog (this);
+ auto d = make_wx<AboutDialog>(this);
d->ShowModal ();
- d->Destroy ();
}
void help_report_a_problem ()
{
- auto d = new ReportProblemDialog (this);
+ auto d = make_wx<ReportProblemDialog>(this);
if (d->ShowModal () == wxID_OK) {
d->report ();
}
- d->Destroy ();
}
void update_checker_state_changed ()
}
if (uc->state() == UpdateChecker::State::YES) {
- auto dialog = new UpdateDialog (this, uc->stable (), uc->test ());
+ auto dialog = make_wx<UpdateDialog>(this, uc->stable (), uc->test ());
dialog->ShowModal ();
- dialog->Destroy ();
} else if (uc->state() == UpdateChecker::State::FAILED) {
error_dialog (this, _("The DCP-o-matic download server could not be contacted."));
} else {
bool OnInit () override
{
- wxSplashScreen* splash = nullptr;
+ wxSplashScreen* splash;
try {
wxInitAllImageHandlers ();
LOG_DEBUG_PLAYER ("Failed to start play server (%1)", e.what());
}
- if (!_dcp_to_load.empty() && boost::filesystem::is_directory (_dcp_to_load)) {
+ if (!_dcp_to_load.empty() && dcp::filesystem::is_directory(_dcp_to_load)) {
try {
_frame->load_dcp (_dcp_to_load);
} catch (exception& e) {