diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-03-31 16:23:01 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-03-31 16:23:01 +0100 |
| commit | 640c53f0a5f178a894ff2718bf6d74e9e977eb80 (patch) | |
| tree | 111388daecf0f7e75f05c603ceecc9221c00c31c /src | |
| parent | d5a4d9632b352192027700dbb1f59827216b16e8 (diff) | |
A little tidying up.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/film.cc | 20 | ||||
| -rw-r--r-- | src/lib/film.h | 14 | ||||
| -rw-r--r-- | src/wx/film_editor.cc | 23 | ||||
| -rw-r--r-- | src/wx/film_editor.h | 5 |
4 files changed, 26 insertions, 36 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc index 0e57cf8eb..d22f67e67 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -87,7 +87,7 @@ int const Film::state_version = 4; Film::Film (string d, bool must_exist) : _use_dci_name (true) - , _trust_content_header (true) + , _trust_content_headers (true) , _dcp_content_type (0) , _format (0) , _scaler (Scaler::from_id ("bicubic")) @@ -149,7 +149,7 @@ Film::Film (Film const & o) , _directory (o._directory) , _name (o._name) , _use_dci_name (o._use_dci_name) - , _trust_content_header (o._trust_content_header) + , _trust_content_headers (o._trust_content_headers) , _dcp_content_type (o._dcp_content_type) , _format (o._format) , _crop (o._crop) @@ -321,7 +321,7 @@ Film::analyse_audio () void Film::examine_content (shared_ptr<Content> c) { - shared_ptr<Job> j (new ExamineContentJob (shared_from_this(), c, trust_content_header ())); + shared_ptr<Job> j (new ExamineContentJob (shared_from_this(), c, trust_content_headers ())); j->Finished.connect (bind (&Film::examine_content_finished, this)); JobManager::instance()->add (j); } @@ -391,7 +391,7 @@ Film::write_metadata () const f << "name " << _name << endl; f << "use_dci_name " << _use_dci_name << endl; // f << "content " << _content << endl; - f << "trust_content_header " << (_trust_content_header ? "1" : "0") << endl; + f << "trust_content_headers " << (_trust_content_headers ? "1" : "0") << endl; if (_dcp_content_type) { f << "dcp_content_type " << _dcp_content_type->dci_name () << endl; } @@ -495,8 +495,8 @@ Film::read_metadata () _use_dci_name = (v == "1"); } else if (k == "content") { // _content = v; - } else if (k == "trust_content_header") { - _trust_content_header = (v == "1"); + } else if (k == "trust_content_headers") { + _trust_content_headers = (v == "1"); } else if (k == "dcp_content_type") { if (version < 3) { _dcp_content_type = DCPContentType::from_pretty_name (v); @@ -792,16 +792,16 @@ Film::set_use_dci_name (bool u) } void -Film::set_trust_content_header (bool t) +Film::set_trust_content_headers (bool t) { { boost::mutex::scoped_lock lm (_state_mutex); - _trust_content_header = t; + _trust_content_headers = t; } - signal_changed (TRUST_CONTENT_HEADER); + signal_changed (TRUST_CONTENT_HEADERS); - if (!_trust_content_header && !content().empty()) { + if (!_trust_content_headers && !content().empty()) { /* We just said that we don't trust the content's header */ /* XXX */ // examine_content (); diff --git a/src/lib/film.h b/src/lib/film.h index afd57b7c2..928866161 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -114,7 +114,7 @@ public: NONE, NAME, USE_DCI_NAME, - TRUST_CONTENT_HEADER, + TRUST_CONTENT_HEADERS, CONTENT, DCP_CONTENT_TYPE, FORMAT, @@ -155,9 +155,9 @@ public: return _use_dci_name; } - bool trust_content_header () const { + bool trust_content_headers () const { boost::mutex::scoped_lock lm (_state_mutex); - return _trust_content_header; + return _trust_content_headers; } std::list<boost::shared_ptr<Content> > content () const { @@ -255,7 +255,7 @@ public: void set_directory (std::string); void set_name (std::string); void set_use_dci_name (bool); - void set_trust_content_header (bool); + void set_trust_content_headers (bool); void add_content (boost::shared_ptr<Content>); void set_dcp_content_type (DCPContentType const *); void set_format (Format const *); @@ -314,11 +314,7 @@ private: bool _use_dci_name; typedef std::list<boost::shared_ptr<Content> > ContentList; ContentList _content; - /** If this is true, we will believe the length specified by the content - * file's header; if false, we will run through the whole content file - * the first time we see it in order to obtain the length. - */ - bool _trust_content_header; + bool _trust_content_headers; /** The type of content that this Film represents (feature, trailer etc.) */ DCPContentType const * _dcp_content_type; /** The format to present this Film in (flat, scope, etc.) */ diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc index 100d3a93d..40f4f0362 100644 --- a/src/wx/film_editor.cc +++ b/src/wx/film_editor.cc @@ -122,8 +122,8 @@ FilmEditor::make_film_panel () grid->Add (_edit_dci_button, wxGBPosition (r, 1), wxDefaultSpan); ++r; - _trust_content_header = new wxCheckBox (_film_panel, wxID_ANY, _("Trust content's header")); - grid->Add (_trust_content_header, wxGBPosition (r, 0), wxGBSpan(1, 2)); + _trust_content_headers = new wxCheckBox (_film_panel, wxID_ANY, _("Trust content's header")); + grid->Add (_trust_content_headers, wxGBPosition (r, 0), wxGBSpan(1, 2)); ++r; add_label_to_grid_bag_sizer (grid, _film_panel, _("Content Type"), wxGBPosition (r, 0)); @@ -131,11 +131,6 @@ FilmEditor::make_film_panel () grid->Add (_dcp_content_type, wxGBPosition (r, 1)); ++r; - add_label_to_grid_bag_sizer (grid, _film_panel, _("Original Frame Rate"), wxGBPosition (r, 0)); - _source_frame_rate = new wxStaticText (_film_panel, wxID_ANY, wxT ("")); - grid->Add (_source_frame_rate, wxGBPosition (r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL); - ++r; - { add_label_to_grid_bag_sizer (grid, _film_panel, _("DCP Frame Rate"), wxGBPosition (r, 0)); wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); @@ -202,7 +197,7 @@ FilmEditor::connect_to_widgets () _use_dci_name->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (FilmEditor::use_dci_name_toggled), 0, this); _edit_dci_button->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::edit_dci_button_clicked), 0, this); _format->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (FilmEditor::format_changed), 0, this); - _trust_content_header->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (FilmEditor::trust_content_header_changed), 0, this); + _trust_content_headers->Connect (wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler (FilmEditor::trust_content_headers_changed), 0, this); _content->Connect (wxID_ANY, wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler (FilmEditor::content_item_selected), 0, this); _content_add->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::content_add_clicked), 0, this); _content_remove->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (FilmEditor::content_add_clicked), 0, this); @@ -483,13 +478,13 @@ FilmEditor::bottom_crop_changed (wxCommandEvent &) } void -FilmEditor::trust_content_header_changed (wxCommandEvent &) +FilmEditor::trust_content_headers_changed (wxCommandEvent &) { if (!_film) { return; } - _film->set_trust_content_header (_trust_content_header->GetValue ()); + _film->set_trust_content_headers (_trust_content_headers->GetValue ()); } /** Called when the DCP A/B switch has been toggled */ @@ -594,8 +589,8 @@ FilmEditor::film_changed (Film::Property p) setup_streams (); setup_show_audio_sensitivity (); break; - case Film::TRUST_CONTENT_HEADER: - checked_set (_trust_content_header, _film->trust_content_header ()); + case Film::TRUST_CONTENT_HEADERS: + checked_set (_trust_content_headers, _film->trust_content_headers ()); break; // case Film::SUBTITLE_STREAMS: // setup_subtitle_control_sensitivity (); @@ -808,7 +803,7 @@ FilmEditor::set_film (shared_ptr<Film> f) film_changed (Film::NAME); film_changed (Film::USE_DCI_NAME); film_changed (Film::CONTENT); - film_changed (Film::TRUST_CONTENT_HEADER); + film_changed (Film::TRUST_CONTENT_HEADERS); film_changed (Film::DCP_CONTENT_TYPE); film_changed (Film::FORMAT); film_changed (Film::CROP); @@ -841,7 +836,7 @@ FilmEditor::set_things_sensitive (bool s) _edit_dci_button->Enable (s); _format->Enable (s); _content->Enable (s); - _trust_content_header->Enable (s); + _trust_content_headers->Enable (s); _content->Enable (s); _left_crop->Enable (s); _right_crop->Enable (s); diff --git a/src/wx/film_editor.h b/src/wx/film_editor.h index 4048cd587..50457bdce 100644 --- a/src/wx/film_editor.h +++ b/src/wx/film_editor.h @@ -62,7 +62,7 @@ private: void right_crop_changed (wxCommandEvent &); void top_crop_changed (wxCommandEvent &); void bottom_crop_changed (wxCommandEvent &); - void trust_content_header_changed (wxCommandEvent &); + void trust_content_headers_changed (wxCommandEvent &); void content_item_selected (wxListEvent &); void content_add_clicked (wxCommandEvent &); void content_remove_clicked (wxCommandEvent &); @@ -132,7 +132,7 @@ private: wxButton* _edit_dci_button; wxChoice* _format; wxStaticText* _format_description; - wxCheckBox* _trust_content_header; + wxCheckBox* _trust_content_headers; wxSpinCtrl* _left_crop; wxSpinCtrl* _right_crop; wxSpinCtrl* _top_crop; @@ -151,7 +151,6 @@ private: wxChoice* _colour_lut; wxSpinCtrl* _j2k_bandwidth; wxChoice* _dcp_content_type; - wxStaticText* _source_frame_rate; wxChoice* _dcp_frame_rate; wxButton* _best_dcp_frame_rate; wxStaticText* _frame_rate_description; |
