diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/config.cc | 3 | ||||
| -rw-r--r-- | src/lib/config.h | 9 | ||||
| -rw-r--r-- | src/lib/film.cc | 2 | ||||
| -rw-r--r-- | src/lib/playlist.cc | 26 | ||||
| -rw-r--r-- | src/wx/config_dialog.cc | 21 | ||||
| -rw-r--r-- | src/wx/config_dialog.h | 2 | ||||
| -rw-r--r-- | src/wx/film_viewer.cc | 9 |
7 files changed, 66 insertions, 6 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc index e0fbcc703..82a5b1095 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -54,6 +54,7 @@ Config::Config () , _default_still_length (10) , _default_container (Ratio::from_id ("185")) , _default_dcp_content_type (0) + , _default_j2k_bandwidth (200000000) { _allowed_dcp_frame_rates.push_back (24); _allowed_dcp_frame_rates.push_back (25); @@ -110,6 +111,7 @@ Config::read () _default_dci_metadata = DCIMetadata (f.node_child ("DCIMetadata")); _default_still_length = f.optional_number_child<int>("DefaultStillLength").get_value_or (10); + _default_j2k_bandwidth = f.optional_number_child<int>("DefaultJ2KBandwidth").get_value_or (200000000); } void @@ -241,6 +243,7 @@ Config::write () const _default_dci_metadata.as_xml (root->add_child ("DCIMetadata")); root->add_child("DefaultStillLength")->add_child_text (lexical_cast<string> (_default_still_length)); + root->add_child("DefaultJ2KBandwidth")->add_child_text (lexical_cast<string> (_default_j2k_bandwidth)); doc.write_to_file_formatted (file (false)); } diff --git a/src/lib/config.h b/src/lib/config.h index f3e8f1441..38664f093 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -118,6 +118,10 @@ public: return _dcp_metadata; } + int default_j2k_bandwidth () const { + return _default_j2k_bandwidth; + } + /** @param n New number of local encoding threads */ void set_num_local_encoding_threads (int n) { _num_local_encoding_threads = n; @@ -196,6 +200,10 @@ public: void set_dcp_metadata (libdcp::XMLMetadata m) { _dcp_metadata = m; } + + void set_default_j2k_bandwidth (int b) { + _default_j2k_bandwidth = b; + } void write () const; @@ -239,6 +247,7 @@ private: Ratio const * _default_container; DCPContentType const * _default_dcp_content_type; libdcp::XMLMetadata _dcp_metadata; + int _default_j2k_bandwidth; /** Singleton instance, or 0 */ static Config* _instance; diff --git a/src/lib/film.cc b/src/lib/film.cc index 295f80ccb..d216e303f 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -94,7 +94,7 @@ Film::Film (string d) , _container (Config::instance()->default_container ()) , _scaler (Scaler::from_id ("bicubic")) , _with_subtitles (false) - , _j2k_bandwidth (200000000) + , _j2k_bandwidth (Config::instance()->default_j2k_bandwidth ()) , _dci_metadata (Config::instance()->default_dci_metadata ()) , _dcp_video_frame_rate (24) , _dcp_audio_channels (MAX_AUDIO_CHANNELS) diff --git a/src/lib/playlist.cc b/src/lib/playlist.cc index 0d6462f6c..028b2b880 100644 --- a/src/lib/playlist.cc +++ b/src/lib/playlist.cc @@ -75,15 +75,40 @@ Playlist::content_changed (weak_ptr<Content> c, int p) if (p == ContentProperty::LENGTH) { maybe_sequence_video (); } +<<<<<<< HEAD + + ContentChanged (c, p); +} + +======= ContentChanged (c, p); } +>>>>>>> 1ea6a456bc2b4a695f6db4720353c35167597b30 void Playlist::maybe_sequence_video () { if (!_sequence_video || _sequencing_video) { return; +<<<<<<< HEAD + } + + _sequencing_video = true; + + ContentList cl = _content; + sort (cl.begin(), cl.end(), ContentSorter ()); + Time last = 0; + for (ContentList::iterator i = cl.begin(); i != cl.end(); ++i) { + if (!dynamic_pointer_cast<VideoContent> (*i)) { + continue; + } + + (*i)->set_start (last); + last = (*i)->end (); + } + +======= } _sequencing_video = true; @@ -100,6 +125,7 @@ Playlist::maybe_sequence_video () last = (*i)->end (); } +>>>>>>> 1ea6a456bc2b4a695f6db4720353c35167597b30 _sequencing_video = false; } diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc index e66be174d..618baca2c 100644 --- a/src/wx/config_dialog.cc +++ b/src/wx/config_dialog.cc @@ -18,7 +18,7 @@ */ /** @file src/config_dialog.cc - * @brief A dialogue to edit DVD-o-matic configuration. + * @brief A dialogue to edit DCP-o-matic configuration. */ #include <iostream> @@ -43,7 +43,7 @@ using namespace std; using boost::bind; ConfigDialog::ConfigDialog (wxWindow* parent) - : wxDialog (parent, wxID_ANY, _("DVD-o-matic Preferences"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) + : wxDialog (parent, wxID_ANY, _("DCP-o-matic Preferences"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { wxBoxSizer* s = new wxBoxSizer (wxVERTICAL); _notebook = new wxNotebook (this, wxID_ANY); @@ -93,7 +93,7 @@ ConfigDialog::make_misc_panel () table->Add (_language, 1, wxEXPAND); table->AddSpacer (0); - wxStaticText* restart = add_label_to_sizer (table, _misc_panel, _("(restart DVD-o-matic to see language changes)"), false); + wxStaticText* restart = add_label_to_sizer (table, _misc_panel, _("(restart DCP-o-matic to see language changes)"), false); wxFont font = restart->GetFont(); font.SetStyle (wxFONTSTYLE_ITALIC); font.SetPointSize (font.GetPointSize() - 1); @@ -134,6 +134,11 @@ ConfigDialog::make_misc_panel () _default_dcp_content_type = new wxChoice (_misc_panel, wxID_ANY); table->Add (_default_dcp_content_type); table->AddSpacer (1); + + add_label_to_sizer (table, _misc_panel, _("Default JPEG2000 bandwidth"), true); + _default_j2k_bandwidth = new wxSpinCtrl (_misc_panel); + table->Add (_default_j2k_bandwidth, 1); + add_label_to_sizer (table, _misc_panel, _("MBps"), false); Config* config = Config::instance (); @@ -192,6 +197,10 @@ ConfigDialog::make_misc_panel () } _default_dcp_content_type->Connect (wxID_ANY, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler (ConfigDialog::default_dcp_content_type_changed), 0, this); + + _default_j2k_bandwidth->SetRange (50, 250); + _default_j2k_bandwidth->SetValue (config->default_j2k_bandwidth() / 1e6); + _default_j2k_bandwidth->Connect (wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEventHandler (ConfigDialog::default_j2k_bandwidth_changed), 0, this); } void @@ -500,3 +509,9 @@ ConfigDialog::creator_changed (wxCommandEvent &) m.creator = wx_to_std (_creator->GetValue ()); Config::instance()->set_dcp_metadata (m); } + +void +ConfigDialog::default_j2k_bandwidth_changed (wxCommandEvent &) +{ + Config::instance()->set_default_j2k_bandwidth (_default_j2k_bandwidth->GetValue() * 1e6); +} diff --git a/src/wx/config_dialog.h b/src/wx/config_dialog.h index 459d64dd7..8d9c7af52 100644 --- a/src/wx/config_dialog.h +++ b/src/wx/config_dialog.h @@ -59,6 +59,7 @@ private: void default_dcp_content_type_changed (wxCommandEvent &); void issuer_changed (wxCommandEvent &); void creator_changed (wxCommandEvent &); + void default_j2k_bandwidth_changed (wxCommandEvent &); void add_server_to_control (ServerDescription *); void setup_language_sensitivity (); @@ -95,5 +96,6 @@ private: wxButton* _remove_server; wxTextCtrl* _issuer; wxTextCtrl* _creator; + wxSpinCtrl* _default_j2k_bandwidth; }; diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index b50cb7451..cb5e6b4c2 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -145,8 +145,13 @@ FilmViewer::fetch_current_frame_again () /* Player::video_position is the time after the last frame that we received. We want to see it again, so seek back one frame. */ - - _player->seek (_player->video_position() - _film->video_frames_to_time(1), true); + + Time p = _player->video_position() - _film->video_frames_to_time (1); + if (p < 0) { + p = 0; + } + + _player->seek (p, true); fetch_next_frame (); } |
