summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/video_content.cc13
-rw-r--r--src/lib/video_content.h2
-rw-r--r--src/wx/kdm_dialog.cc4
-rw-r--r--src/wx/screen_dialog.cc15
-rw-r--r--src/wx/screen_dialog.h3
5 files changed, 29 insertions, 8 deletions
diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc
index 3f6e171a5..af0c3e12c 100644
--- a/src/lib/video_content.cc
+++ b/src/lib/video_content.cc
@@ -19,6 +19,7 @@
#include <iomanip>
#include <libcxml/cxml.h>
+#include <libdcp/colour_matrix.h>
#include "video_content.h"
#include "video_examiner.h"
#include "ratio.h"
@@ -49,9 +50,8 @@ VideoContent::VideoContent (shared_ptr<const Film> f, Time s, VideoContent::Fram
, _video_frame_rate (0)
, _video_frame_type (VIDEO_FRAME_TYPE_2D)
, _ratio (Ratio::from_id ("185"))
- , _colour_conversion (Config::instance()->colour_conversions().front().conversion)
{
-
+ setup_default_colour_conversion ();
}
VideoContent::VideoContent (shared_ptr<const Film> f, boost::filesystem::path p)
@@ -60,9 +60,8 @@ VideoContent::VideoContent (shared_ptr<const Film> f, boost::filesystem::path p)
, _video_frame_rate (0)
, _video_frame_type (VIDEO_FRAME_TYPE_2D)
, _ratio (Ratio::from_id ("185"))
- , _colour_conversion (Config::instance()->colour_conversions().front().conversion)
{
-
+ setup_default_colour_conversion ();
}
VideoContent::VideoContent (shared_ptr<const Film> f, shared_ptr<const cxml::Node> node)
@@ -104,6 +103,12 @@ VideoContent::as_xml (xmlpp::Node* node) const
}
void
+VideoContent::setup_default_colour_conversion ()
+{
+ _colour_conversion = PresetColourConversion (_("sRGB"), 2.4, true, libdcp::colour_matrix::srgb_to_xyz, 2.6).conversion;
+}
+
+void
VideoContent::take_from_video_examiner (shared_ptr<VideoExaminer> d)
{
/* These examiner calls could call other content methods which take a lock on the mutex */
diff --git a/src/lib/video_content.h b/src/lib/video_content.h
index 72c72625b..81325516d 100644
--- a/src/lib/video_content.h
+++ b/src/lib/video_content.h
@@ -109,6 +109,8 @@ private:
friend class best_dcp_frame_rate_test_single;
friend class best_dcp_frame_rate_test_double;
friend class audio_sampling_rate_test;
+
+ void setup_default_colour_conversion ();
libdcp::Size _video_size;
float _video_frame_rate;
diff --git a/src/wx/kdm_dialog.cc b/src/wx/kdm_dialog.cc
index 6164f7fd9..02b91a1e2 100644
--- a/src/wx/kdm_dialog.cc
+++ b/src/wx/kdm_dialog.cc
@@ -276,7 +276,9 @@ KDMDialog::add_screen_clicked ()
shared_ptr<Cinema> c = selected_cinemas().front().second;
ScreenDialog* d = new ScreenDialog (this, "Add Screen");
- d->ShowModal ();
+ if (d->ShowModal () != wxID_OK) {
+ return;
+ }
shared_ptr<Screen> s (new Screen (d->name(), d->certificate()));
c->add_screen (s);
diff --git a/src/wx/screen_dialog.cc b/src/wx/screen_dialog.cc
index 6584e1ad6..32a0bce43 100644
--- a/src/wx/screen_dialog.cc
+++ b/src/wx/screen_dialog.cc
@@ -65,7 +65,9 @@ ScreenDialog::ScreenDialog (wxWindow* parent, string title, string name, shared_
overall_sizer->Layout ();
overall_sizer->SetSizeHints (this);
- _certificate_load->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (ScreenDialog::load_certificate), 0, this);
+ _certificate_load->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&ScreenDialog::load_certificate, this));
+
+ setup_sensitivity ();
}
string
@@ -81,7 +83,7 @@ ScreenDialog::certificate () const
}
void
-ScreenDialog::load_certificate (wxCommandEvent &)
+ScreenDialog::load_certificate ()
{
wxFileDialog* d = new wxFileDialog (this, _("Select Certificate File"));
@@ -95,4 +97,13 @@ ScreenDialog::load_certificate (wxCommandEvent &)
}
d->Destroy ();
+
+ setup_sensitivity ();
+}
+
+void
+ScreenDialog::setup_sensitivity ()
+{
+ wxButton* ok = dynamic_cast<wxButton*> (FindWindowById (wxID_OK, this));
+ ok->Enable (_certificate);
}
diff --git a/src/wx/screen_dialog.h b/src/wx/screen_dialog.h
index 1bd4a89a9..271ae2055 100644
--- a/src/wx/screen_dialog.h
+++ b/src/wx/screen_dialog.h
@@ -30,7 +30,8 @@ public:
boost::shared_ptr<libdcp::Certificate> certificate () const;
private:
- void load_certificate (wxCommandEvent &);
+ void load_certificate ();
+ void setup_sensitivity ();
wxTextCtrl* _name;
wxButton* _certificate_load;