diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-12-24 00:18:03 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-12-24 00:18:03 +0000 |
| commit | e194f0003b60b2607da0822485c56cd8267e78dc (patch) | |
| tree | 85aa72e1c8131372ec813c3d5a3a7f0cbb53568e /src | |
| parent | 6d39d3df8e2fed1ec5e13d54ce6cd22c59b69eba (diff) | |
| parent | 3318969a7ad685fc2f624ac0af302ca1e454e62b (diff) | |
Merge 1.0.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/config.cc | 6 | ||||
| -rw-r--r-- | src/lib/config.h | 18 | ||||
| -rw-r--r-- | src/lib/dcp_video_frame.cc | 9 | ||||
| -rw-r--r-- | src/lib/dcp_video_frame.h | 3 | ||||
| -rw-r--r-- | src/lib/encoder.cc | 2 | ||||
| -rw-r--r-- | src/lib/kdm.cc | 39 | ||||
| -rw-r--r-- | src/lib/kdm.h | 6 | ||||
| -rw-r--r-- | src/lib/send_kdm_email_job.cc | 69 | ||||
| -rw-r--r-- | src/lib/send_kdm_email_job.h | 44 | ||||
| -rw-r--r-- | src/lib/types.h | 3 | ||||
| -rw-r--r-- | src/lib/video_content.cc | 2 | ||||
| -rw-r--r-- | src/lib/video_decoder.cc | 7 | ||||
| -rw-r--r-- | src/lib/wscript | 1 | ||||
| -rw-r--r-- | src/tools/dcpomatic.cc | 5 | ||||
| -rw-r--r-- | src/tools/server_test.cc | 4 | ||||
| -rw-r--r-- | src/wx/config_dialog.cc | 137 | ||||
| -rw-r--r-- | src/wx/config_dialog.h | 6 | ||||
| -rw-r--r-- | src/wx/video_panel.cc | 1 |
18 files changed, 291 insertions, 71 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc index 93eec9bc0..1c34619b4 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -66,7 +66,7 @@ Config::Config () , _default_j2k_bandwidth (200000000) , _default_audio_delay (0) , _kdm_email ( - "Dear Projectionist\n\nPlease find attached KDMs for $CPL_NAME.\n\nBest regards,\nDCP-o-matic" + "Dear Projectionist\n\nPlease find attached KDMs for $CPL_NAME.\n\nThe KDMs are valid from $START_TIME until $END_TIME.\n\nBest regards,\nDCP-o-matic" ) { _allowed_dcp_frame_rates.push_back (24); @@ -176,6 +176,8 @@ Config::read () } _mail_server = f.string_child ("MailServer"); + _mail_user = f.optional_string_child("MailUser").get_value_or (""); + _mail_password = f.optional_string_child("MailPassword").get_value_or (""); _kdm_from = f.string_child ("KDMFrom"); _kdm_email = f.string_child ("KDMEmail"); } @@ -347,6 +349,8 @@ Config::write () const } root->add_child("MailServer")->add_child_text (_mail_server); + root->add_child("MailUser")->add_child_text (_mail_user); + root->add_child("MailPassword")->add_child_text (_mail_password); root->add_child("KDMFrom")->add_child_text (_kdm_from); root->add_child("KDMEmail")->add_child_text (_kdm_email); diff --git a/src/lib/config.h b/src/lib/config.h index 14c707dd2..67d293884 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -155,6 +155,14 @@ public: return _mail_server; } + std::string mail_user () const { + return _mail_user; + } + + std::string mail_password () const { + return _mail_password; + } + std::string kdm_from () const { return _kdm_from; } @@ -261,6 +269,14 @@ public: _mail_server = s; } + void set_mail_user (std::string u) { + _mail_user = u; + } + + void set_mail_password (std::string p) { + _mail_password = p; + } + void set_kdm_from (std::string f) { _kdm_from = f; } @@ -321,6 +337,8 @@ private: std::vector<PresetColourConversion> _colour_conversions; std::list<boost::shared_ptr<Cinema> > _cinemas; std::string _mail_server; + std::string _mail_user; + std::string _mail_password; std::string _kdm_from; std::string _kdm_email; diff --git a/src/lib/dcp_video_frame.cc b/src/lib/dcp_video_frame.cc index 679a0490e..e719d7ef4 100644 --- a/src/lib/dcp_video_frame.cc +++ b/src/lib/dcp_video_frame.cc @@ -79,7 +79,7 @@ using libdcp::Size; * @param l Log to write to. */ DCPVideoFrame::DCPVideoFrame ( - shared_ptr<const Image> image, int f, Eyes eyes, ColourConversion c, int dcp_fps, int bw, shared_ptr<Log> l + shared_ptr<const Image> image, int f, Eyes eyes, ColourConversion c, int dcp_fps, int bw, Resolution r, shared_ptr<Log> l ) : _image (image) , _frame (f) @@ -87,6 +87,7 @@ DCPVideoFrame::DCPVideoFrame ( , _conversion (c) , _frames_per_second (dcp_fps) , _j2k_bandwidth (bw) + , _resolution (r) , _log (l) { @@ -110,6 +111,7 @@ DCPVideoFrame::DCPVideoFrame (shared_ptr<const Image> image, shared_ptr<const cx _conversion = ColourConversion (node->node_child ("ColourConversion")); _frames_per_second = node->number_child<int> ("FramesPerSecond"); _j2k_bandwidth = node->number_child<int> ("J2KBandwidth"); + _resolution = Resolution (node->optional_number_child<int>("J2KBandwidth").get_value_or (RESOLUTION_2K)); } /** J2K-encode this frame on the local host. @@ -194,9 +196,9 @@ DCPVideoFrame::encode_locally () parameters.tcp_rates[0] = 0; parameters.tcp_numlayers++; parameters.cp_disto_alloc = 1; - parameters.cp_rsiz = CINEMA2K; + parameters.cp_rsiz = _resolution == RESOLUTION_2K ? CINEMA2K : CINEMA4K; parameters.cp_comment = strdup (N_("DCP-o-matic")); - parameters.cp_cinema = CINEMA2K_24; + parameters.cp_cinema = _resolution == RESOLUTION_2K ? CINEMA2K_24 : CINEMA4K_24; /* 3 components, so use MCT */ parameters.tcp_mct = 1; @@ -317,6 +319,7 @@ DCPVideoFrame::add_metadata (xmlpp::Element* el) const el->add_child("FramesPerSecond")->add_child_text (lexical_cast<string> (_frames_per_second)); el->add_child("J2KBandwidth")->add_child_text (lexical_cast<string> (_j2k_bandwidth)); + el->add_child("Resolution")->add_child_text (lexical_cast<string> (int (_resolution))); } EncodedData::EncodedData (int s) diff --git a/src/lib/dcp_video_frame.h b/src/lib/dcp_video_frame.h index c642fb4db..40f758c74 100644 --- a/src/lib/dcp_video_frame.h +++ b/src/lib/dcp_video_frame.h @@ -102,7 +102,7 @@ public: class DCPVideoFrame : public boost::noncopyable { public: - DCPVideoFrame (boost::shared_ptr<const Image>, int, Eyes, ColourConversion, int, int, boost::shared_ptr<Log>); + DCPVideoFrame (boost::shared_ptr<const Image>, int, Eyes, ColourConversion, int, int, Resolution, boost::shared_ptr<Log>); DCPVideoFrame (boost::shared_ptr<const Image>, boost::shared_ptr<const cxml::Node>, boost::shared_ptr<Log>); boost::shared_ptr<EncodedData> encode_locally (); @@ -126,6 +126,7 @@ private: ColourConversion _conversion; int _frames_per_second; ///< Frames per second that we will use for the DCP int _j2k_bandwidth; ///< J2K bandwidth to use + Resolution _resolution; ///< Resolution (2K or 4K) boost::shared_ptr<Log> _log; ///< log }; diff --git a/src/lib/encoder.cc b/src/lib/encoder.cc index 046a3248e..475c230da 100644 --- a/src/lib/encoder.cc +++ b/src/lib/encoder.cc @@ -217,7 +217,7 @@ Encoder::process_video (shared_ptr<PlayerImage> image, Eyes eyes, ColourConversi _queue.push_back (shared_ptr<DCPVideoFrame> ( new DCPVideoFrame ( image->image(PIX_FMT_RGB24, false), _video_frames_out, eyes, conversion, _film->video_frame_rate(), - _film->j2k_bandwidth(), _film->log() + _film->j2k_bandwidth(), _film->resolution(), _film->log() ) )); diff --git a/src/lib/kdm.cc b/src/lib/kdm.cc index 4d8f29723..cf551285b 100644 --- a/src/lib/kdm.cc +++ b/src/lib/kdm.cc @@ -31,6 +31,7 @@ using std::list; using std::string; +using std::stringstream; using boost::shared_ptr; struct ScreenKDM @@ -45,7 +46,7 @@ struct ScreenKDM }; static string -kdm_filename (shared_ptr<Film> film, ScreenKDM kdm) +kdm_filename (shared_ptr<const Film> film, ScreenKDM kdm) { return tidy_for_filename (film->name()) + "_" + tidy_for_filename (kdm.screen->cinema->name) + "_" + tidy_for_filename (kdm.screen->name) + ".kdm.xml"; } @@ -55,7 +56,7 @@ struct CinemaKDMs shared_ptr<Cinema> cinema; list<ScreenKDM> screen_kdms; - void make_zip_file (shared_ptr<Film> film, boost::filesystem::path zip_file) const + void make_zip_file (shared_ptr<const Film> film, boost::filesystem::path zip_file) const { int error; struct zip* zip = zip_open (zip_file.string().c_str(), ZIP_CREATE | ZIP_EXCL, &error); @@ -99,7 +100,7 @@ operator== (ScreenKDM const & a, ScreenKDM const & b) static list<ScreenKDM> make_screen_kdms ( - shared_ptr<Film> film, + shared_ptr<const Film> film, list<shared_ptr<Screen> > screens, boost::filesystem::path dcp, boost::posix_time::ptime from, @@ -123,7 +124,7 @@ make_screen_kdms ( static list<CinemaKDMs> make_cinema_kdms ( - shared_ptr<Film> film, + shared_ptr<const Film> film, list<shared_ptr<Screen> > screens, boost::filesystem::path dcp, boost::posix_time::ptime from, @@ -165,7 +166,7 @@ make_cinema_kdms ( void write_kdm_files ( - shared_ptr<Film> film, + shared_ptr<const Film> film, list<shared_ptr<Screen> > screens, boost::filesystem::path dcp, boost::posix_time::ptime from, @@ -185,7 +186,7 @@ write_kdm_files ( void write_kdm_zip_files ( - shared_ptr<Film> film, + shared_ptr<const Film> film, list<shared_ptr<Screen> > screens, boost::filesystem::path dcp, boost::posix_time::ptime from, @@ -204,7 +205,7 @@ write_kdm_zip_files ( void email_kdms ( - shared_ptr<Film> film, + shared_ptr<const Film> film, list<shared_ptr<Screen> > screens, boost::filesystem::path dcp, boost::posix_time::ptime from, @@ -226,14 +227,30 @@ email_kdms ( quickmail_add_to (mail, i->cinema->email.c_str ()); string body = Config::instance()->kdm_email().c_str(); - boost::algorithm::replace_all (body, "$DCP_NAME", film->dcp_name ()); - + boost::algorithm::replace_all (body, "$CPL_NAME", film->dcp_name ()); + stringstream start; + start << from.date() << " " << from.time_of_day(); + boost::algorithm::replace_all (body, "$START_TIME", start.str ()); + stringstream end; + end << to.date() << " " << to.time_of_day(); + boost::algorithm::replace_all (body, "$END_TIME", end.str ()); + quickmail_set_body (mail, body.c_str()); quickmail_add_attachment_file (mail, zip_file.string().c_str(), "application/zip"); - char const* error = quickmail_send (mail, Config::instance()->mail_server().c_str(), 25, "", ""); + + int const port = Config::instance()->mail_user().empty() ? 25 : 587; + + char const* error = quickmail_send ( + mail, + Config::instance()->mail_server().c_str(), + port, + Config::instance()->mail_user().c_str(), + Config::instance()->mail_password().c_str() + ); + if (error) { quickmail_destroy (mail); - throw StringError (String::compose ("Failed to send KDM email (%1)", error)); + throw KDMError (String::compose ("Failed to send KDM email (%1)", error)); } quickmail_destroy (mail); } diff --git a/src/lib/kdm.h b/src/lib/kdm.h index 5701a8bf8..c4fd43d49 100644 --- a/src/lib/kdm.h +++ b/src/lib/kdm.h @@ -24,7 +24,7 @@ class Screen; class Film; extern void write_kdm_files ( - boost::shared_ptr<Film> film, + boost::shared_ptr<const Film> film, std::list<boost::shared_ptr<Screen> > screens, boost::filesystem::path dcp, boost::posix_time::ptime from, @@ -33,7 +33,7 @@ extern void write_kdm_files ( ); extern void write_kdm_zip_files ( - boost::shared_ptr<Film> film, + boost::shared_ptr<const Film> film, std::list<boost::shared_ptr<Screen> > screens, boost::filesystem::path dcp, boost::posix_time::ptime from, @@ -42,7 +42,7 @@ extern void write_kdm_zip_files ( ); extern void email_kdms ( - boost::shared_ptr<Film> film, + boost::shared_ptr<const Film> film, std::list<boost::shared_ptr<Screen> > screens, boost::filesystem::path dcp, boost::posix_time::ptime from, diff --git a/src/lib/send_kdm_email_job.cc b/src/lib/send_kdm_email_job.cc new file mode 100644 index 000000000..89bce9a14 --- /dev/null +++ b/src/lib/send_kdm_email_job.cc @@ -0,0 +1,69 @@ +/* + Copyright (C) 2013 Carl Hetherington <cth@carlh.net> + + This program 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. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include "send_kdm_email_job.h" +#include "compose.hpp" +#include "film.h" +#include "kdm.h" + +#include "i18n.h" + +using std::string; +using std::list; +using boost::shared_ptr; + +SendKDMEmailJob::SendKDMEmailJob ( + shared_ptr<const Film> f, + list<shared_ptr<Screen> > screens, + boost::filesystem::path dcp, + boost::posix_time::ptime from, + boost::posix_time::ptime to + ) + : Job (f) + , _screens (screens) + , _dcp (dcp) + , _from (from) + , _to (to) +{ + +} + +string +SendKDMEmailJob::name () const +{ + return String::compose (_("Email KDMs for %1"), _film->name()); +} + +void +SendKDMEmailJob::run () +{ + try { + + set_progress_unknown (); + email_kdms (_film, _screens, _dcp, _from, _to); + set_progress (1); + set_state (FINISHED_OK); + + } catch (std::exception& e) { + + set_progress (1); + set_state (FINISHED_ERROR); + throw; + } +} diff --git a/src/lib/send_kdm_email_job.h b/src/lib/send_kdm_email_job.h new file mode 100644 index 000000000..fcab56ce5 --- /dev/null +++ b/src/lib/send_kdm_email_job.h @@ -0,0 +1,44 @@ +/* + Copyright (C) 2013 Carl Hetherington <cth@carlh.net> + + This program 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. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include <boost/filesystem.hpp> +#include "job.h" + +class Screen; + +class SendKDMEmailJob : public Job +{ +public: + SendKDMEmailJob ( + boost::shared_ptr<const Film>, + std::list<boost::shared_ptr<Screen> >, + boost::filesystem::path, + boost::posix_time::ptime, + boost::posix_time::ptime + ); + + std::string name () const; + void run (); + +private: + std::list<boost::shared_ptr<Screen> > _screens; + boost::filesystem::path _dcp; + boost::posix_time::ptime _from; + boost::posix_time::ptime _to; +}; diff --git a/src/lib/types.h b/src/lib/types.h index 1ab6a94d4..33c0c171f 100644 --- a/src/lib/types.h +++ b/src/lib/types.h @@ -69,7 +69,8 @@ struct TimedAudioBuffers enum VideoFrameType { VIDEO_FRAME_TYPE_2D, - VIDEO_FRAME_TYPE_3D_LEFT_RIGHT + VIDEO_FRAME_TYPE_3D_LEFT_RIGHT, + VIDEO_FRAME_TYPE_3D_TOP_BOTTOM }; enum Eyes diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc index ebec8b6db..404549532 100644 --- a/src/lib/video_content.cc +++ b/src/lib/video_content.cc @@ -327,6 +327,8 @@ VideoContent::video_size_after_3d_split () const return s; case VIDEO_FRAME_TYPE_3D_LEFT_RIGHT: return libdcp::Size (s.width / 2, s.height); + case VIDEO_FRAME_TYPE_3D_TOP_BOTTOM: + return libdcp::Size (s.width, s.height / 2); } assert (false); diff --git a/src/lib/video_decoder.cc b/src/lib/video_decoder.cc index 3a8891111..1503af955 100644 --- a/src/lib/video_decoder.cc +++ b/src/lib/video_decoder.cc @@ -48,5 +48,12 @@ VideoDecoder::video (shared_ptr<const Image> image, bool same, ContentTime time) _pending.push_back (shared_ptr<DecodedVideo> (new DecodedVideo (image->crop (Crop (half, 0, 0, 0), true), EYES_RIGHT, same, time))); break; } + case VIDEO_FRAME_TYPE_3D_TOP_BOTTOM: + { + int const half = image->size().height / 2; + Video (image->crop (Crop (0, 0, 0, half), true), EYES_LEFT, same, frame); + Video (image->crop (Crop (0, 0, half, 0), true), EYES_RIGHT, same, frame); + break; + } } } diff --git a/src/lib/wscript b/src/lib/wscript index 1699c5ec8..25186a3d3 100644 --- a/src/lib/wscript +++ b/src/lib/wscript @@ -44,6 +44,7 @@ sources = """ resampler.cc scp_dcp_job.cc scaler.cc + send_kdm_email_job.cc server.cc server_finder.cc sndfile_content.cc diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index c20283b2e..72fb56b4f 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -53,6 +53,7 @@ #include "lib/exceptions.h" #include "lib/cinema.h" #include "lib/kdm.h" +#include "lib/send_kdm_email_job.h" using std::cout; using std::string; @@ -459,7 +460,9 @@ private: if (d->write_to ()) { write_kdm_files (film, d->screens (), d->dcp (), d->from (), d->until (), d->directory ()); } else { - email_kdms (film, d->screens (), d->dcp (), d->from (), d->until ()); + JobManager::instance()->add ( + shared_ptr<Job> (new SendKDMEmailJob (film, d->screens (), d->dcp (), d->from (), d->until ())) + ); } } catch (KDMError& e) { error_dialog (this, e.what ()); diff --git a/src/tools/server_test.cc b/src/tools/server_test.cc index cc500eeb0..38e4704b7 100644 --- a/src/tools/server_test.cc +++ b/src/tools/server_test.cc @@ -50,11 +50,11 @@ void process_video (shared_ptr<PlayerImage> image, Eyes eyes, ColourConversion conversion, DCPTime) { shared_ptr<DCPVideoFrame> local ( - new DCPVideoFrame (image->image (PIX_FMT_RGB24, false), frame, eyes, conversion, film->video_frame_rate(), 250000000, log_) + new DCPVideoFrame (image->image (PIX_FMT_RGB24, false), frame, eyes, conversion, film->video_frame_rate(), 250000000, RESOLUTION_2K, log_) ); shared_ptr<DCPVideoFrame> remote ( - new DCPVideoFrame (image->image (PIX_FMT_RGB24, false), frame, eyes, conversion, film->video_frame_rate(), 250000000, log_) + new DCPVideoFrame (image->image (PIX_FMT_RGB24, false), frame, eyes, conversion, film->video_frame_rate(), 250000000, RESOLUTION_2K, log_) ); cout << "Frame " << frame << ": "; diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc index 4743000f2..7c4601c42 100644 --- a/src/wx/config_dialog.cc +++ b/src/wx/config_dialog.cc @@ -57,6 +57,8 @@ ConfigDialog::ConfigDialog (wxWindow* parent) make_misc_panel (); _notebook->AddPage (_misc_panel, _("Miscellaneous"), true); + make_defaults_panel (); + _notebook->AddPage (_defaults_panel, _("Defaults"), false); make_servers_panel (); _notebook->AddPage (_servers_panel, _("Encoding servers"), false); make_colour_conversions_panel (); @@ -117,57 +119,22 @@ ConfigDialog::make_misc_panel () _mail_server = new wxTextCtrl (_misc_panel, wxID_ANY); table->Add (_mail_server, 1, wxEXPAND | wxALL); + add_label_to_sizer (table, _misc_panel, _("Mail user name"), true); + _mail_user = new wxTextCtrl (_misc_panel, wxID_ANY); + table->Add (_mail_user, 1, wxEXPAND | wxALL); + + add_label_to_sizer (table, _misc_panel, _("Mail password"), true); + _mail_password = new wxTextCtrl (_misc_panel, wxID_ANY); + table->Add (_mail_password, 1, wxEXPAND | wxALL); + + wxStaticText* plain = add_label_to_sizer (table, _misc_panel, _("(password will be stored on disk in plaintext)"), false); + plain->SetFont (font); + table->AddSpacer (0); + add_label_to_sizer (table, _misc_panel, _("From address for KDM emails"), true); _kdm_from = new wxTextCtrl (_misc_panel, wxID_ANY); table->Add (_kdm_from, 1, wxEXPAND | wxALL); - { - add_label_to_sizer (table, _misc_panel, _("Default duration of still images"), true); - wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); - _default_still_length = new wxSpinCtrl (_misc_panel); - s->Add (_default_still_length); - add_label_to_sizer (s, _misc_panel, _("s"), false); - table->Add (s, 1); - } - - add_label_to_sizer (table, _misc_panel, _("Default directory for new films"), true); -#ifdef DCPOMATIC_USE_OWN_DIR_PICKER - _default_directory = new DirPickerCtrl (_misc_panel); -#else - _default_directory = new wxDirPickerCtrl (_misc_panel, wxDD_DIR_MUST_EXIST); -#endif - table->Add (_default_directory, 1, wxEXPAND); - - add_label_to_sizer (table, _misc_panel, _("Default DCI name details"), true); - _default_dci_metadata_button = new wxButton (_misc_panel, wxID_ANY, _("Edit...")); - table->Add (_default_dci_metadata_button); - - add_label_to_sizer (table, _misc_panel, _("Default container"), true); - _default_container = new wxChoice (_misc_panel, wxID_ANY); - table->Add (_default_container); - - add_label_to_sizer (table, _misc_panel, _("Default content type"), true); - _default_dcp_content_type = new wxChoice (_misc_panel, wxID_ANY); - table->Add (_default_dcp_content_type); - - { - add_label_to_sizer (table, _misc_panel, _("Default JPEG2000 bandwidth"), true); - wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); - _default_j2k_bandwidth = new wxSpinCtrl (_misc_panel); - s->Add (_default_j2k_bandwidth); - add_label_to_sizer (s, _misc_panel, _("MBps"), false); - table->Add (s, 1); - } - - { - add_label_to_sizer (table, _misc_panel, _("Default audio delay"), true); - wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); - _default_audio_delay = new wxSpinCtrl (_misc_panel); - s->Add (_default_audio_delay); - add_label_to_sizer (s, _misc_panel, _("ms"), false); - table->Add (s, 1); - } - Config* config = Config::instance (); _set_language->SetValue (config->language ()); @@ -195,9 +162,74 @@ ConfigDialog::make_misc_panel () _mail_server->SetValue (std_to_wx (config->mail_server ())); _mail_server->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&ConfigDialog::mail_server_changed, this)); + _mail_user->SetValue (std_to_wx (config->mail_user ())); + _mail_user->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&ConfigDialog::mail_user_changed, this)); + _mail_password->SetValue (std_to_wx (config->mail_password ())); + _mail_password->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&ConfigDialog::mail_password_changed, this)); _kdm_from->SetValue (std_to_wx (config->kdm_from ())); _kdm_from->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&ConfigDialog::kdm_from_changed, this)); +} + +void +ConfigDialog::make_defaults_panel () +{ + _defaults_panel = new wxPanel (_notebook); + wxBoxSizer* s = new wxBoxSizer (wxVERTICAL); + _defaults_panel->SetSizer (s); + + wxFlexGridSizer* table = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP); + table->AddGrowableCol (1, 1); + s->Add (table, 1, wxALL | wxEXPAND, 8); + + { + add_label_to_sizer (table, _defaults_panel, _("Default duration of still images"), true); + wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); + _default_still_length = new wxSpinCtrl (_defaults_panel); + s->Add (_default_still_length); + add_label_to_sizer (s, _defaults_panel, _("s"), false); + table->Add (s, 1); + } + + add_label_to_sizer (table, _defaults_panel, _("Default directory for new films"), true); +#ifdef DCPOMATIC_USE_OWN_DIR_PICKER + _default_directory = new DirPickerCtrl (_defaults_panel); +#else + _default_directory = new wxDirPickerCtrl (_defaults_panel, wxDD_DIR_MUST_EXIST); +#endif + table->Add (_default_directory, 1, wxEXPAND); + + add_label_to_sizer (table, _defaults_panel, _("Default DCI name details"), true); + _default_dci_metadata_button = new wxButton (_defaults_panel, wxID_ANY, _("Edit...")); + table->Add (_default_dci_metadata_button); + + add_label_to_sizer (table, _defaults_panel, _("Default container"), true); + _default_container = new wxChoice (_defaults_panel, wxID_ANY); + table->Add (_default_container); + + add_label_to_sizer (table, _defaults_panel, _("Default content type"), true); + _default_dcp_content_type = new wxChoice (_defaults_panel, wxID_ANY); + table->Add (_default_dcp_content_type); + + { + add_label_to_sizer (table, _defaults_panel, _("Default JPEG2000 bandwidth"), true); + wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); + _default_j2k_bandwidth = new wxSpinCtrl (_defaults_panel); + s->Add (_default_j2k_bandwidth); + add_label_to_sizer (s, _defaults_panel, _("MBps"), false); + table->Add (s, 1); + } + + { + add_label_to_sizer (table, _defaults_panel, _("Default audio delay"), true); + wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); + _default_audio_delay = new wxSpinCtrl (_defaults_panel); + s->Add (_default_audio_delay); + add_label_to_sizer (s, _defaults_panel, _("ms"), false); + table->Add (s, 1); + } + Config* config = Config::instance (); + _default_still_length->SetRange (1, 3600); _default_still_length->SetValue (config->default_still_length ()); _default_still_length->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&ConfigDialog::default_still_length_changed, this)); @@ -503,6 +535,17 @@ ConfigDialog::mail_server_changed () Config::instance()->set_mail_server (wx_to_std (_mail_server->GetValue ())); } +void +ConfigDialog::mail_user_changed () +{ + Config::instance()->set_mail_user (wx_to_std (_mail_user->GetValue ())); +} + +void +ConfigDialog::mail_password_changed () +{ + Config::instance()->set_mail_password (wx_to_std (_mail_password->GetValue ())); +} void ConfigDialog::kdm_from_changed () diff --git a/src/wx/config_dialog.h b/src/wx/config_dialog.h index 45739ef92..49b466bcb 100644 --- a/src/wx/config_dialog.h +++ b/src/wx/config_dialog.h @@ -60,6 +60,8 @@ private: void default_j2k_bandwidth_changed (); void default_audio_delay_changed (); void mail_server_changed (); + void mail_user_changed (); + void mail_password_changed (); void kdm_from_changed (); void kdm_email_changed (); void use_any_servers_changed (); @@ -67,6 +69,7 @@ private: void setup_language_sensitivity (); void make_misc_panel (); + void make_defaults_panel (); void make_servers_panel (); void make_tms_panel (); void make_metadata_panel (); @@ -75,6 +78,7 @@ private: wxNotebook* _notebook; wxPanel* _misc_panel; + wxPanel* _defaults_panel; wxPanel* _servers_panel; wxPanel* _tms_panel; EditableList<PresetColourConversion, PresetColourConversionDialog>* _colour_conversions_panel; @@ -89,6 +93,8 @@ private: wxTextCtrl* _tms_password; wxSpinCtrl* _num_local_encoding_threads; wxTextCtrl* _mail_server; + wxTextCtrl* _mail_user; + wxTextCtrl* _mail_password; wxTextCtrl* _kdm_from; wxSpinCtrl* _default_still_length; #ifdef DCPOMATIC_USE_OWN_DIR_PICKER diff --git a/src/wx/video_panel.cc b/src/wx/video_panel.cc index 1bf092786..dd1064d9c 100644 --- a/src/wx/video_panel.cc +++ b/src/wx/video_panel.cc @@ -199,6 +199,7 @@ VideoPanel::VideoPanel (FilmEditor* e) _frame_type->wrapped()->Append (_("2D")); _frame_type->wrapped()->Append (_("3D left/right")); + _frame_type->wrapped()->Append (_("3D top/bottom")); _filters_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&VideoPanel::edit_filters_clicked, this)); _colour_conversion_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&VideoPanel::edit_colour_conversion_clicked, this)); |
