Try to move J2K bandwidth and colour LUT to be per-film (#23).
authorCarl Hetherington <cth@carlh.net>
Sat, 12 Jan 2013 01:37:59 +0000 (01:37 +0000)
committerCarl Hetherington <cth@carlh.net>
Sat, 12 Jan 2013 01:37:59 +0000 (01:37 +0000)
14 files changed:
src/lib/config.cc
src/lib/config.h
src/lib/dcp_video_frame.cc
src/lib/dcp_video_frame.h
src/lib/encoder.cc
src/lib/film.cc
src/lib/film.h
src/tools/makedcp.cc
src/wx/config_dialog.cc
src/wx/config_dialog.h
src/wx/film_editor.cc
src/wx/film_editor.h
src/wx/properties_dialog.cc
test/test.cc

index d19adc2a41886e4fd7dd7c46eb569b6f4eece5d9..65d01bf00b64654e0e96762d6fb0f43f43e2aec6 100644 (file)
@@ -40,8 +40,6 @@ Config* Config::_instance = 0;
 Config::Config ()
        : _num_local_encoding_threads (2)
        , _server_port (6192)
-       , _colour_lut_index (0)
-       , _j2k_bandwidth (250000000)
        , _reference_scaler (Scaler::from_id ("bicubic"))
        , _tms_path (".")
        , _sound_processor (SoundProcessor::from_id ("dolby_cp750"))
@@ -71,10 +69,6 @@ Config::Config ()
                        _default_directory = v;
                } else if (k == "server_port") {
                        _server_port = atoi (v.c_str ());
-               } else if (k == "colour_lut_index") {
-                       _colour_lut_index = atoi (v.c_str ());
-               } else if (k == "j2k_bandwidth") {
-                       _j2k_bandwidth = atoi (v.c_str ());
                } else if (k == "reference_scaler") {
                        _reference_scaler = Scaler::from_id (v);
                } else if (k == "reference_filter") {
@@ -124,8 +118,6 @@ Config::write () const
        f << "num_local_encoding_threads " << _num_local_encoding_threads << "\n"
          << "default_directory " << _default_directory << "\n"
          << "server_port " << _server_port << "\n"
-         << "colour_lut_index " << _colour_lut_index << "\n"
-         << "j2k_bandwidth " << _j2k_bandwidth << "\n"
          << "reference_scaler " << _reference_scaler->id () << "\n";
 
        for (vector<Filter const *>::const_iterator i = _reference_filters.begin(); i != _reference_filters.end(); ++i) {
index 4575cb54d6864e23ed3c614e63f4f1dd8bd30c81..c84ce76b514bf64cf6e370c8231871857832c534 100644 (file)
@@ -56,19 +56,6 @@ public:
                return _server_port;
        }
 
-       /** @return index of colour LUT to use when converting RGB to XYZ.
-        *  0: sRGB
-        *  1: Rec 709
-        */
-       int colour_lut_index () const {
-               return _colour_lut_index;
-       }
-
-       /** @return bandwidth for J2K files in bits per second */
-       int j2k_bandwidth () const {
-               return _j2k_bandwidth;
-       }
-
        /** @return J2K encoding servers to use */
        std::vector<ServerDescription*> servers () const {
                return _servers;
@@ -121,16 +108,6 @@ public:
                _server_port = p;
        }
 
-       /** @param i New colour LUT index */
-       void set_colour_lut_index (int i) {
-               _colour_lut_index = i;
-       }
-
-       /** @param b New J2K bandwidth */
-       void set_j2k_bandwidth (int b) {
-               _j2k_bandwidth = b;
-       }
-
        /** @param s New list of servers */
        void set_servers (std::vector<ServerDescription*> s) {
                _servers = s;
@@ -178,12 +155,6 @@ private:
        std::string _default_directory;
        /** port to use for J2K encoding servers */
        int _server_port;
-       /** index of colour LUT to use when converting RGB to XYZ
-        *  (see colour_lut_index ())
-        */
-       int _colour_lut_index;
-       /** bandwidth for J2K files in bits per second */
-       int _j2k_bandwidth;
 
        /** J2K encoding servers to use */
        std::vector<ServerDescription *> _servers;
index 8b70b0aa4697286e82f3b0da3abad72b7f3e95c9..c6b29ba4169a62b8d61578caf1261c50262ad70a 100644 (file)
@@ -88,7 +88,7 @@ DCPVideoFrame::DCPVideoFrame (
        , _frame (f)
        , _frames_per_second (dcp_frame_rate(fps).frames_per_second)
        , _post_process (pp)
-       , _colour_lut_index (clut)
+       , _colour_lut (clut)
        , _j2k_bandwidth (bw)
        , _log (l)
        , _image (0)
@@ -188,22 +188,22 @@ DCPVideoFrame::encode_locally ()
                for (int x = 0; x < _out_size.width; ++x) {
 
                        /* In gamma LUT (converting 8-bit input to 12-bit) */
-                       s.r = lut_in[_colour_lut_index][*p++ << 4];
-                       s.g = lut_in[_colour_lut_index][*p++ << 4];
-                       s.b = lut_in[_colour_lut_index][*p++ << 4];
+                       s.r = lut_in[_colour_lut][*p++ << 4];
+                       s.g = lut_in[_colour_lut][*p++ << 4];
+                       s.b = lut_in[_colour_lut][*p++ << 4];
                        
                        /* RGB to XYZ Matrix */
-                       d.x = ((s.r * color_matrix[_colour_lut_index][0][0]) +
-                              (s.g * color_matrix[_colour_lut_index][0][1]) +
-                              (s.b * color_matrix[_colour_lut_index][0][2]));
+                       d.x = ((s.r * color_matrix[_colour_lut][0][0]) +
+                              (s.g * color_matrix[_colour_lut][0][1]) +
+                              (s.b * color_matrix[_colour_lut][0][2]));
                        
-                       d.y = ((s.r * color_matrix[_colour_lut_index][1][0]) +
-                              (s.g * color_matrix[_colour_lut_index][1][1]) +
-                              (s.b * color_matrix[_colour_lut_index][1][2]));
+                       d.y = ((s.r * color_matrix[_colour_lut][1][0]) +
+                              (s.g * color_matrix[_colour_lut][1][1]) +
+                              (s.b * color_matrix[_colour_lut][1][2]));
                        
-                       d.z = ((s.r * color_matrix[_colour_lut_index][2][0]) +
-                              (s.g * color_matrix[_colour_lut_index][2][1]) +
-                              (s.b * color_matrix[_colour_lut_index][2][2]));
+                       d.z = ((s.r * color_matrix[_colour_lut][2][0]) +
+                              (s.g * color_matrix[_colour_lut][2][1]) +
+                              (s.b * color_matrix[_colour_lut][2][2]));
                        
                        /* DCI companding */
                        d.x = d.x * DCI_COEFFICENT * (DCI_LUT_SIZE - 1);
@@ -334,8 +334,8 @@ DCPVideoFrame::encode_remotely (ServerDescription const * serv)
                s << "post_process " << _post_process << "\n";
        }
        
-       s << "colour_lut " << Config::instance()->colour_lut_index () << "\n"
-         << "j2k_bandwidth " << Config::instance()->j2k_bandwidth () << "\n";
+       s << "colour_lut " << _colour_lut << "\n"
+         << "j2k_bandwidth " << _j2k_bandwidth << "\n";
 
        if (_subtitle) {
                s << "subtitle_x " << _subtitle->position().x << "\n"
index 57e7e6203fe158970bfcb124136fbbf60ae46f86..134720da8d5fdba78b80b9dd1749498bc51ebf6c 100644 (file)
@@ -133,8 +133,8 @@ private:
        SourceFrame _frame;              ///< frame index within the Film's source
        int _frames_per_second;          ///< Frames per second that we will use for the DCP (rounded)
        std::string _post_process;       ///< FFmpeg post-processing string to use
-       int _colour_lut_index;           ///< Colour look-up table to use (see Config::colour_lut_index ())
-       int _j2k_bandwidth;              ///< J2K bandwidth to use (see Config::j2k_bandwidth ())
+       int _colour_lut;                 ///< Colour look-up table to use
+       int _j2k_bandwidth;              ///< J2K bandwidth to use
 
        Log* _log; ///< log
 
index 693bd5bc8e5baecceb779189b4a1f7e339c1a3cb..efedfcfef76e18bd30923a3ca193ac25a19a3129 100644 (file)
@@ -325,7 +325,7 @@ Encoder::process_video (shared_ptr<Image> image, bool same, boost::shared_ptr<Su
                                          new DCPVideoFrame (
                                                  image, sub, _opt->out_size, _opt->padding, _film->subtitle_offset(), _film->subtitle_scale(),
                                                  _film->scaler(), _video_frame, _film->frames_per_second(), s.second,
-                                                 Config::instance()->colour_lut_index (), Config::instance()->j2k_bandwidth (),
+                                                 _film->colour_lut(), _film->j2k_bandwidth(),
                                                  _film->log()
                                                  )
                                          ));
index 8fd8efc3ad8946fe8c4c40f50b85cb631e2ed70e..4e48a0e73f172f4af274b631869d59317ef62f96 100644 (file)
@@ -99,6 +99,8 @@ Film::Film (string d, bool must_exist)
        , _with_subtitles (false)
        , _subtitle_offset (0)
        , _subtitle_scale (1)
+       , _colour_lut (0)
+       , _j2k_bandwidth (200000000)
        , _frames_per_second (0)
        , _dirty (false)
 {
@@ -166,6 +168,8 @@ Film::Film (Film const & o)
        , _with_subtitles    (o._with_subtitles)
        , _subtitle_offset   (o._subtitle_offset)
        , _subtitle_scale    (o._subtitle_scale)
+       , _colour_lut        (o._colour_lut)
+       , _j2k_bandwidth     (o._j2k_bandwidth)
        , _audio_language    (o._audio_language)
        , _subtitle_language (o._subtitle_language)
        , _territory         (o._territory)
@@ -249,7 +253,7 @@ Film::make_dcp (bool transcode)
                log()->log (String::compose ("Content length %1", length()));
                log()->log (String::compose ("Content digest %1", content_digest()));
                log()->log (String::compose ("%1 threads", Config::instance()->num_local_encoding_threads()));
-               log()->log (String::compose ("J2K bandwidth %1", Config::instance()->j2k_bandwidth()));
+               log()->log (String::compose ("J2K bandwidth %1", j2k_bandwidth()));
        }
                
        if (format() == 0) {
@@ -423,6 +427,8 @@ Film::write_metadata () const
        f << "with_subtitles " << _with_subtitles << "\n";
        f << "subtitle_offset " << _subtitle_offset << "\n";
        f << "subtitle_scale " << _subtitle_scale << "\n";
+       f << "colour_lut " << _colour_lut << "\n";
+       f << "j2k_bandwidth " << _j2k_bandwidth << "\n";
        f << "audio_language " << _audio_language << "\n";
        f << "subtitle_language " << _subtitle_language << "\n";
        f << "territory " << _territory << "\n";
@@ -548,6 +554,10 @@ Film::read_metadata ()
                        _subtitle_offset = atoi (v.c_str ());
                } else if (k == "subtitle_scale") {
                        _subtitle_scale = atof (v.c_str ());
+               } else if (k == "colour_lut") {
+                       _colour_lut = atoi (v.c_str ());
+               } else if (k == "j2k_bandwidth") {
+                       _j2k_bandwidth = atoi (v.c_str ());
                } else if (k == "audio_language") {
                        _audio_language = v;
                } else if (k == "subtitle_language") {
@@ -1193,6 +1203,26 @@ Film::set_subtitle_scale (float s)
        signal_changed (SUBTITLE_SCALE);
 }
 
+void
+Film::set_colour_lut (int i)
+{
+       {
+               boost::mutex::scoped_lock lm (_state_mutex);
+               _colour_lut = i;
+       }
+       signal_changed (COLOUR_LUT);
+}
+
+void
+Film::set_j2k_bandwidth (int b)
+{
+       {
+               boost::mutex::scoped_lock lm (_state_mutex);
+               _j2k_bandwidth = b;
+       }
+       signal_changed (J2K_BANDWIDTH);
+}
+
 void
 Film::set_audio_language (string l)
 {
index eb199784edbdaed4813904b88f528c6d6f548839..467573ae12f03cb10ef09cf82422268d3a8c80cc 100644 (file)
@@ -124,6 +124,8 @@ public:
                WITH_SUBTITLES,
                SUBTITLE_OFFSET,
                SUBTITLE_SCALE,
+               COLOUR_LUT,
+               J2K_BANDWIDTH,
                DCI_METADATA,
                SIZE,
                LENGTH,
@@ -250,6 +252,21 @@ public:
                return _subtitle_scale;
        }
 
+       /** @return index of colour LUT to use when converting RGB to XYZ.
+        *  0: sRGB
+        *  1: Rec 709
+        */
+       int colour_lut () const {
+               boost::mutex::scoped_lock lm (_state_mutex);
+               return _colour_lut;
+       }
+
+       /** @return bandwidth for J2K files in bits per second */
+       int j2k_bandwidth () const {
+               boost::mutex::scoped_lock lm (_state_mutex);
+               return _j2k_bandwidth;
+       }
+
        std::string audio_language () const {
                boost::mutex::scoped_lock lm (_state_mutex);
                return _audio_language;
@@ -351,6 +368,8 @@ public:
        void set_with_subtitles (bool);
        void set_subtitle_offset (int);
        void set_subtitle_scale (float);
+       void set_colour_lut (int);
+       void set_j2k_bandwidth (int);
        void set_audio_language (std::string);
        void set_subtitle_language (std::string);
        void set_territory (std::string);
@@ -444,7 +463,13 @@ private:
        int _subtitle_offset;
        /** scale factor to apply to subtitles */
        float _subtitle_scale;
-
+       /** index of colour LUT to use when converting RGB to XYZ
+        *  (see colour_lut ())
+        */
+       int _colour_lut;
+       /** bandwidth for J2K files in bits per second */
+       int _j2k_bandwidth;
+       
        /* DCI naming stuff */
        std::string _audio_language;
        std::string _subtitle_language;
index c0fb7ccee3dff138d88370541261fd706daf3c4e..900c31bfc9fca7630bc8002ba833128be88563ff 100644 (file)
@@ -51,7 +51,6 @@ help (string n)
             << "  -v, --version      show DVD-o-matic version\n"
             << "  -h, --help         show this help\n"
             << "  -d, --deps         list DVD-o-matic dependency details and quit\n"
-            << "  -c, --config       list configuration settings that affect output and quit\n"
             << "  -t, --test         run in test mode (repeatable UUID generation, timestamps etc.)\n"
             << "  -n, --no-progress  do not print progress to stdout\n"
             << "  -r, --no-remote    do not use any remote servers\n"
@@ -74,7 +73,6 @@ main (int argc, char* argv[])
                        { "version", no_argument, 0, 'v'},
                        { "help", no_argument, 0, 'h'},
                        { "deps", no_argument, 0, 'd'},
-                       { "config", no_argument, 0, 'c'},
                        { "test", no_argument, 0, 't'},
                        { "no-progress", no_argument, 0, 'n'},
                        { "no-remote", no_argument, 0, 'r'},
@@ -82,7 +80,7 @@ main (int argc, char* argv[])
                        { 0, 0, 0, 0 }
                };
 
-               int c = getopt_long (argc, argv, "vhdctnrl:", long_options, &option_index);
+               int c = getopt_long (argc, argv, "vhdtnrl:", long_options, &option_index);
 
                if (c == -1) {
                        break;
@@ -107,15 +105,6 @@ main (int argc, char* argv[])
                case 'r':
                        no_remote = true;
                        break;
-               case 'c':
-                       cout << "Colour LUT " << colour_lut_index_to_name (Config::instance()->colour_lut_index()) << "; "
-                            << "J2K bandwidth " << Config::instance()->j2k_bandwidth() << "; ";
-#ifdef DVDOMATIC_DEBUG
-                       cout << "built in debug mode\n";
-#else
-                       cout << "built in optimised mode\n";
-#endif                 
-                       exit (EXIT_SUCCESS);
                case 'l':
                        log_level = atoi (optarg);
                        break;
index adf039e41f09045ab2b49b1f174abf55c8ef9efc..9de8e700194642eaeff484c075f098c486b66919 100644 (file)
@@ -79,20 +79,6 @@ ConfigDialog::ConfigDialog (wxWindow* parent)
        table->Add (_default_directory, 1, wxEXPAND);
        table->AddSpacer (0);
 
-       add_label_to_sizer (table, this, "Colour look-up table");
-       _colour_lut = new wxComboBox (this, wxID_ANY);
-       for (int i = 0; i < 2; ++i) {
-               _colour_lut->Append (std_to_wx (colour_lut_index_to_name (i)));
-       }
-       _colour_lut->SetSelection (0);
-       table->Add (_colour_lut, 1, wxEXPAND);
-       table->AddSpacer (0);
-
-       add_label_to_sizer (table, this, "JPEG2000 bandwidth");
-       _j2k_bandwidth = new wxSpinCtrl (this, wxID_ANY);
-       table->Add (_j2k_bandwidth, 1, wxEXPAND);
-       add_label_to_sizer (table, this, "MBps");
-
        add_label_to_sizer (table, this, "Reference scaler for A/B");
        _reference_scaler = new wxComboBox (this, wxID_ANY);
        vector<Scaler const *> const sc = Scaler::all ();
@@ -156,12 +142,6 @@ ConfigDialog::ConfigDialog (wxWindow* parent)
        _default_directory->SetPath (std_to_wx (config->default_directory_or (wx_to_std (wxStandardPaths::Get().GetDocumentsDir()))));
        _default_directory->Connect (wxID_ANY, wxEVT_COMMAND_DIRPICKER_CHANGED, wxCommandEventHandler (ConfigDialog::default_directory_changed), 0, this);
 
-       _colour_lut->Connect (wxID_ANY, wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler (ConfigDialog::colour_lut_changed), 0, this);
-       
-       _j2k_bandwidth->SetRange (50, 250);
-       _j2k_bandwidth->SetValue (rint ((double) config->j2k_bandwidth() / 1e6));
-       _j2k_bandwidth->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (ConfigDialog::j2k_bandwidth_changed), 0, this);
-
        _reference_scaler->SetSelection (Scaler::as_index (config->reference_scaler ()));
        _reference_scaler->Connect (wxID_ANY, wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler (ConfigDialog::reference_scaler_changed), 0, this);
 
@@ -232,18 +212,6 @@ ConfigDialog::default_directory_changed (wxCommandEvent &)
        Config::instance()->set_default_directory (wx_to_std (_default_directory->GetPath ()));
 }
 
-void
-ConfigDialog::colour_lut_changed (wxCommandEvent &)
-{
-       Config::instance()->set_colour_lut_index (_colour_lut->GetSelection ());
-}
-
-void
-ConfigDialog::j2k_bandwidth_changed (wxCommandEvent &)
-{
-       Config::instance()->set_j2k_bandwidth (_j2k_bandwidth->GetValue() * 1e6);
-}
-
 void
 ConfigDialog::add_server_to_control (ServerDescription* s)
 {
index 615d36f830744cfe03ea74824b43437e09357082..32123a0d7eb92748d3b0e3cd701dca15c614bb53 100644 (file)
@@ -45,8 +45,6 @@ private:
        void tms_password_changed (wxCommandEvent &);
        void num_local_encoding_threads_changed (wxCommandEvent &);
        void default_directory_changed (wxCommandEvent &);
-       void colour_lut_changed (wxCommandEvent &);
-       void j2k_bandwidth_changed (wxCommandEvent &);
        void reference_scaler_changed (wxCommandEvent &);
        void edit_reference_filters_clicked (wxCommandEvent &);
        void reference_filters_changed (std::vector<Filter const *>);
@@ -67,8 +65,6 @@ private:
 #else
        wxDirPickerCtrl* _default_directory;
 #endif 
-       wxComboBox* _colour_lut;
-       wxSpinCtrl* _j2k_bandwidth;
        wxComboBox* _reference_scaler;
        wxStaticText* _reference_filters;
        wxButton* _reference_filters_button;
index dece245689b84d1092265c652da51e11c046280f..72f2d48071316beeec6c7c2a0fc27d7974763642 100644 (file)
@@ -194,6 +194,8 @@ FilmEditor::connect_to_widgets ()
        _with_subtitles->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (FilmEditor::with_subtitles_toggled), 0, this);
        _subtitle_offset->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::subtitle_offset_changed), 0, this);
        _subtitle_scale->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::subtitle_scale_changed), 0, this);
+       _colour_lut->Connect (wxID_ANY, wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler (FilmEditor::colour_lut_changed), 0, this);
+       _j2k_bandwidth->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::j2k_bandwidth_changed), 0, this);
        _subtitle_stream->Connect (wxID_ANY, wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler (FilmEditor::subtitle_stream_changed), 0, this);
        _audio_stream->Connect (wxID_ANY, wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler (FilmEditor::audio_stream_changed), 0, this);
        _audio_gain->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (FilmEditor::audio_gain_changed), 0, this);
@@ -265,6 +267,23 @@ FilmEditor::make_video_panel ()
                _scaler->Append (std_to_wx ((*i)->name()));
        }
 
+       add_label_to_sizer (_video_sizer, _video_panel, "Colour look-up table");
+       _colour_lut = new wxComboBox (_video_panel, wxID_ANY);
+       for (int i = 0; i < 2; ++i) {
+               _colour_lut->Append (std_to_wx (colour_lut_index_to_name (i)));
+       }
+       _colour_lut->SetSelection (0);
+       _video_sizer->Add (_colour_lut, 1, wxEXPAND);
+
+       {
+               add_label_to_sizer (_video_sizer, _video_panel, "JPEG2000 bandwidth");
+               wxSizer* s = new wxBoxSizer (wxHORIZONTAL);
+               _j2k_bandwidth = new wxSpinCtrl (_video_panel, wxID_ANY);
+               s->Add (_j2k_bandwidth, 1);
+               add_label_to_sizer (s, _video_panel, "MBps");
+               _video_sizer->Add (s, 1);
+       }
+
        _left_crop->SetRange (0, 1024);
        _top_crop->SetRange (0, 1024);
        _right_crop->SetRange (0, 1024);
@@ -272,6 +291,7 @@ FilmEditor::make_video_panel ()
        _still_duration->SetRange (1, 60 * 60);
        _dcp_trim_start->SetRange (0, 100);
        _dcp_trim_end->SetRange (0, 100);
+       _j2k_bandwidth->SetRange (50, 250);
 }
 
 void
@@ -485,6 +505,26 @@ FilmEditor::subtitle_scale_changed (wxCommandEvent &)
        _film->set_subtitle_scale (_subtitle_scale->GetValue() / 100.0);
 }
 
+void
+FilmEditor::colour_lut_changed (wxCommandEvent &)
+{
+       if (!_film) {
+               return;
+       }
+       
+       _film->set_colour_lut (_colour_lut->GetSelection ());
+}
+
+void
+FilmEditor::j2k_bandwidth_changed (wxCommandEvent &)
+{
+       if (!_film) {
+               return;
+       }
+       
+       _film->set_j2k_bandwidth (_j2k_bandwidth->GetValue() * 1e6);
+}      
+
 
 /** Called when the metadata stored in the Film object has changed;
  *  so that we can update the GUI.
@@ -620,6 +660,12 @@ FilmEditor::film_changed (Film::Property p)
        case Film::SUBTITLE_SCALE:
                checked_set (_subtitle_scale, _film->subtitle_scale() * 100);
                break;
+       case Film::COLOUR_LUT:
+               checked_set (_colour_lut, _film->colour_lut ());
+               break;
+       case Film::J2K_BANDWIDTH:
+               checked_set (_j2k_bandwidth, double (_film->j2k_bandwidth()) / 1e6);
+               break;
        case Film::USE_DCI_NAME:
                checked_set (_use_dci_name, _film->use_dci_name ());
                _dcp_name->SetLabel (std_to_wx (_film->dcp_name ()));
@@ -727,6 +773,8 @@ FilmEditor::set_film (shared_ptr<Film> f)
        film_changed (Film::WITH_SUBTITLES);
        film_changed (Film::SUBTITLE_OFFSET);
        film_changed (Film::SUBTITLE_SCALE);
+       film_changed (Film::COLOUR_LUT);
+       film_changed (Film::J2K_BANDWIDTH);
        film_changed (Film::DCI_METADATA);
        film_changed (Film::SIZE);
        film_changed (Film::LENGTH);
@@ -760,6 +808,8 @@ FilmEditor::set_things_sensitive (bool s)
        _dcp_trim_start->Enable (s);
        _dcp_trim_end->Enable (s);
        _dcp_ab->Enable (s);
+       _colour_lut->Enable (s);
+       _j2k_bandwidth->Enable (s);
        _audio_gain->Enable (s);
        _audio_gain_calculate_button->Enable (s);
        _audio_delay->Enable (s);
index 7e75b4bf00841fbcd766778471a989f7f81ec425..8a900f1e4bedf05bf325183739d96e0b34383ec5 100644 (file)
@@ -74,6 +74,8 @@ private:
        void with_subtitles_toggled (wxCommandEvent &);
        void subtitle_offset_changed (wxCommandEvent &);
        void subtitle_scale_changed (wxCommandEvent &);
+       void colour_lut_changed (wxCommandEvent &);
+       void j2k_bandwidth_changed (wxCommandEvent &);
        void still_duration_changed (wxCommandEvent &);
        void audio_stream_changed (wxCommandEvent &);
        void subtitle_stream_changed (wxCommandEvent &);
@@ -148,6 +150,8 @@ private:
        wxComboBox* _subtitle_stream;
        wxSpinCtrl* _subtitle_offset;
        wxSpinCtrl* _subtitle_scale;
+       wxComboBox* _colour_lut;
+       wxSpinCtrl* _j2k_bandwidth;
        /** The Film's DCP content type */
        wxComboBox* _dcp_content_type;
        /** The Film's frames per second */
index 61e1f34f0ab1d8513d18a464dae7cd4fb835e5ef..b03c6b32c54d95e3b23cda98d63e121ee5338b29 100644 (file)
@@ -56,7 +56,7 @@ PropertiesDialog::PropertiesDialog (wxWindow* parent, shared_ptr<Film> film)
 
        if (_film->length()) {
                _frames->SetLabel (std_to_wx (lexical_cast<string> (_film->length().get())));
-               double const disk = ((double) Config::instance()->j2k_bandwidth() / 8) * _film->length().get() / (_film->frames_per_second () * 1073741824);
+               double const disk = ((double) _film->j2k_bandwidth() / 8) * _film->length().get() / (_film->frames_per_second () * 1073741824);
                stringstream s;
                s << fixed << setprecision (1) << disk << "Gb";
                _disk_for_frames->SetLabel (std_to_wx (s.str ()));
index 6d4cca060f5d6f6304f0a648ee691a55573c663f..c393aac5e4d485c5a01e59e6410335db9ef7c013 100644 (file)
@@ -55,8 +55,6 @@ void
 setup_test_config ()
 {
        Config::instance()->set_num_local_encoding_threads (1);
-       Config::instance()->set_colour_lut_index (0);
-       Config::instance()->set_j2k_bandwidth (200000000);
        Config::instance()->set_servers (vector<ServerDescription*> ());
        Config::instance()->set_server_port (61920);
 }