From c8636a2ce85eb3073ac5a32a89f9d77031366dc2 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 4 Mar 2014 21:25:44 +0000 Subject: Stop old versions of DCP-o-matic loading new state files. Fix missing content type setup in dcpomatic_create. --- src/lib/film.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/lib') diff --git a/src/lib/film.cc b/src/lib/film.cc index 00beb870f..1b724b27e 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -397,6 +397,9 @@ Film::read_metadata () f.read_file (file ("metadata.xml")); _state_version = f.number_child ("Version"); + if (_state_version > current_state_version) { + throw StringError (_("This film was created with a newer version of DCP-o-matic, and it cannot be loaded into this version. Sorry!")); + } _name = f.string_child ("Name"); _use_dci_name = f.bool_child ("UseDCIName"); -- cgit v1.2.3 From bbd5444a9eb98b52136327dad0744b4c62a88ab2 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 5 Mar 2014 14:43:12 +0000 Subject: Bump maximum audio channels to 12 so that we can (crudely) use BsL/BsR. Requested-by: Markus Raab --- ChangeLog | 5 +++++ src/lib/util.cc | 10 +++++++--- src/lib/util.h | 2 +- src/wx/audio_mapping_view.cc | 24 ++++++++++++++++++++---- src/wx/audio_plot.cc | 6 +++++- 5 files changed, 38 insertions(+), 9 deletions(-) (limited to 'src/lib') diff --git a/ChangeLog b/ChangeLog index 62d76fbf5..46230393f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-03-05 Carl Hetherington + + * Bump maximum audio channels to 12 so that we can + (crudely at least) get BsL/BsR. + 2014-03-04 Carl Hetherington * Version 1.64.18 released. diff --git a/src/lib/util.cc b/src/lib/util.cc index 48b418d37..35385ab40 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -792,7 +792,7 @@ video_frames_to_audio_frames (VideoContent::Frame v, float audio_sample_rate, fl string audio_channel_name (int c) { - assert (MAX_AUDIO_CHANNELS == 8); + assert (MAX_AUDIO_CHANNELS == 12); /* TRANSLATORS: these are the names of audio channels; Lfe (sub) is the low-frequency enhancement channel (sub-woofer). HI is the hearing-impaired audio track and @@ -805,8 +805,12 @@ audio_channel_name (int c) _("Lfe (sub)"), _("Left surround"), _("Right surround"), - _("HI"), - _("VI") + _("Hearing impaired"), + _("Visually impaired"), + _("Left centre"), + _("Right centre"), + _("Left rear surround"), + _("Right rear surround"), }; return channels[c]; diff --git a/src/lib/util.h b/src/lib/util.h index fc17dc944..c05680859 100644 --- a/src/lib/util.h +++ b/src/lib/util.h @@ -49,7 +49,7 @@ extern "C" { #undef check /** The maximum number of audio channels that we can cope with */ -#define MAX_AUDIO_CHANNELS 8 +#define MAX_AUDIO_CHANNELS 12 #define DCPOMATIC_HELLO "Boys, you gotta learn not to talk to nuns that way" diff --git a/src/wx/audio_mapping_view.cc b/src/wx/audio_mapping_view.cc index fe3219261..7fdecb8d5 100644 --- a/src/wx/audio_mapping_view.cc +++ b/src/wx/audio_mapping_view.cc @@ -34,7 +34,7 @@ using std::max; using boost::shared_ptr; using boost::lexical_cast; -#define INDICATOR_SIZE 20 +#define INDICATOR_SIZE 16 enum { ID_off = 1, @@ -270,9 +270,9 @@ AudioMappingView::set_column_labels () { int const c = _grid->GetNumberCols (); - _grid->SetColLabelValue (0, _("Content channel")); + _grid->SetColLabelValue (0, _("Content")); -#if MAX_AUDIO_CHANNELS != 8 +#if MAX_AUDIO_CHANNELS != 12 #warning AudioMappingView::set_column_labels() is expecting the wrong MAX_AUDIO_CHANNELS #endif @@ -307,7 +307,23 @@ AudioMappingView::set_column_labels () if (c > 7) { _grid->SetColLabelValue (8, _("VI")); } - + + if (c > 8) { + _grid->SetColLabelValue (9, _("Lc")); + } + + if (c > 9) { + _grid->SetColLabelValue (10, _("Rc")); + } + + if (c > 10) { + _grid->SetColLabelValue (11, _("BsL")); + } + + if (c > 11) { + _grid->SetColLabelValue (12, _("BsR")); + } + _grid->AutoSize (); } diff --git a/src/wx/audio_plot.cc b/src/wx/audio_plot.cc index 2e8b24e36..124b92736 100644 --- a/src/wx/audio_plot.cc +++ b/src/wx/audio_plot.cc @@ -62,8 +62,12 @@ AudioPlot::AudioPlot (wxWindow* parent) _colours.push_back (wxColour ( 0, 139, 0)); _colours.push_back (wxColour ( 0, 0, 139)); _colours.push_back (wxColour (255, 255, 0)); + _colours.push_back (wxColour ( 0, 255, 255)); + _colours.push_back (wxColour (255, 0, 255)); + _colours.push_back (wxColour (255, 0, 139)); + _colours.push_back (wxColour (139, 0, 255)); -#if MAX_AUDIO_CHANNELS != 8 +#if MAX_AUDIO_CHANNELS != 12 #warning AudioPlot::AudioPlot is expecting the wrong MAX_AUDIO_CHANNELS #endif -- cgit v1.2.3 From b2343f145e47de7e63446476f537425be49c8ff9 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 5 Mar 2014 14:47:18 +0000 Subject: More attempted OS X fixes. --- src/lib/wscript | 3 +++ wscript | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/lib') diff --git a/src/lib/wscript b/src/lib/wscript index 8702adebb..7c9712ff8 100644 --- a/src/lib/wscript +++ b/src/lib/wscript @@ -80,6 +80,9 @@ def build(bld): CURL ZIP QUICKMAIL """ + if bld.env.TARGET_OSX: + obj.framework = ['IOKit', 'Foundation'] + obj.source = sources + ' version.cc' if bld.env.TARGET_WINDOWS: diff --git a/wscript b/wscript index d00793d75..883de0023 100644 --- a/wscript +++ b/wscript @@ -230,8 +230,8 @@ def configure(conf): # OSX if conf.env.TARGET_OSX: - conf.env.append_value('CXXFLAGS', '-DDCPOMATIC_OSX') - conf.env.append_value('LINKFLAGS', ['-headerpad_max_install_names', '-framework IOKit', '-framework Foundation']) + conf.env.append_value('CXXFLAGS', ['-DDCPOMATIC_OSX', '-Wno-unused-function', '-Wno-unused-parameter']) + conf.env.append_value('LINKFLAGS', '-headerpad_max_install_names') # # Dependencies. -- cgit v1.2.3 From a476ad31d447b8436326ba1bf448471f321a3ca9 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 5 Mar 2014 16:02:39 +0000 Subject: Fix nasty race in dcpomatic_create. --- src/lib/job.cc | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'src/lib') diff --git a/src/lib/job.cc b/src/lib/job.cc index 76976df32..db9a9b215 100644 --- a/src/lib/job.cc +++ b/src/lib/job.cc @@ -186,22 +186,33 @@ Job::paused () const void Job::set_state (State s) { - bool finished = false; + bool const finished = (s == FINISHED_OK || s == FINISHED_ERROR || s == FINISHED_CANCELLED); + /* Do this first, so that we handle things that should happen on finish before the + * job is actually marked as such. This is important for callers that do: + * + * while (JobManager::work_to_do ()) { + * ui_signaller->ui_idle (); + * } + * + * as otherwise this loop can finish before the Finished handler has been executed + * (job finishes, calls set_state(), this sets the state and sets a pending signal + * for Finished, but this is never called as a ui_idle() never happens as work_to_do() + * is now false). + */ + if (finished && ui_signaller) { + ui_signaller->emit (boost::bind (boost::ref (Finished))); + } + { boost::mutex::scoped_lock lm (_state_mutex); _state = s; - if (_state == FINISHED_OK || _state == FINISHED_ERROR || _state == FINISHED_CANCELLED) { + if (finished) { _ran_for = elapsed_time (); - finished = true; _sub_name.clear (); } } - - if (finished && ui_signaller) { - ui_signaller->emit (boost::bind (boost::ref (Finished))); - } } /** @return Time (in seconds) that this sub-job has been running */ -- cgit v1.2.3