/*
- Copyright (C) 2016-2018 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2016-2019 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
}
void
-Hints::stop_thread ()
+Hints::start ()
{
- if (_thread) {
- try {
- {
- boost::mutex::scoped_lock lm (_mutex);
- _stop = true;
- }
- _thread->interrupt ();
- _thread->join ();
- } catch (...) {
-
- }
-
- delete _thread;
- _thread = 0;
- }
+ _thread = new boost::thread (bind(&Hints::thread, this));
}
Hints::~Hints ()
{
- stop_thread ();
-}
+ if (!_thread) {
+ return;
+ }
-void
-Hints::start ()
-{
- stop_thread ();
- _long_ccap = false;
- _overlap_ccap = false;
- _too_many_ccap_lines = false;
- _stop = false;
- _thread = new boost::thread (bind(&Hints::thread, this));
+ try {
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ _stop = true;
+ }
+ _thread->interrupt ();
+ _thread->join ();
+ } catch (...) {
+
+ }
+
+ delete _thread;
}
void
hint (h);
}
+ if (film->video_frame_rate() > 30) {
+ hint (String::compose(_("You are set up for a DCP at a frame rate of %1. This frame rate is not supported by all projectors. You are advised to change the DCP frame rate to %2."), film->video_frame_rate(), film->video_frame_rate() / 2));
+ }
+
optional<double> lowest_speed_up;
optional<double> highest_speed_up;
BOOST_FOREACH (shared_ptr<const Content> i, content) {
/*
- Copyright (C) 2016 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2016-2019 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
private:
void thread ();
- void stop_thread ();
void hint (std::string h);
void text (PlayerText text, TextType type, DCPTimePeriod period);
HintsDialog::HintsDialog (wxWindow* parent, boost::weak_ptr<Film> film, bool ok)
: wxDialog (parent, wxID_ANY, _("Hints"))
, _film (film)
- , _hints (new Hints (film))
+ , _hints (0)
, _finished (false)
{
wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL);
_film_content_change_connection = locked_film->ContentChange.connect (boost::bind (&HintsDialog::film_content_change, this, _1));
}
- _hints->Hint.connect (bind (&HintsDialog::hint, this, _1));
- _hints->Progress.connect (bind (&HintsDialog::progress, this, _1));
- _hints->Pulse.connect (bind (&HintsDialog::pulse, this));
- _hints->Finished.connect (bind (&HintsDialog::finished, this));
-
film_change (CHANGE_TYPE_DONE);
}
_gauge->SetValue (0);
update ();
_finished = false;
+
+ _hints.reset (new Hints (_film));
+ _hints->Hint.connect (bind (&HintsDialog::hint, this, _1));
+ _hints->Progress.connect (bind (&HintsDialog::progress, this, _1));
+ _hints->Pulse.connect (bind (&HintsDialog::pulse, this));
+ _hints->Finished.connect (bind (&HintsDialog::finished, this));
_hints->start ();
}
wxGauge* _gauge;
wxStaticText* _gauge_message;
wxRichTextCtrl* _text;
- boost::shared_ptr<Hints> _hints;
+ boost::scoped_ptr<Hints> _hints;
std::list<std::string> _current;
bool _finished;