summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-03-05 16:20:23 +0000
committerCarl Hetherington <cth@carlh.net>2014-03-05 16:20:23 +0000
commit79ce26d031d109177ba4b0f637fa2960345a37a3 (patch)
tree987dbb3419f779fbd8192795898f3f93d0291efe /src/lib
parenta79d78d8bb6d51f6662f1f63b9f8fd19e1a0c5f1 (diff)
parenta476ad31d447b8436326ba1bf448471f321a3ca9 (diff)
Merge branch 'master' into 2.0
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/film.cc3
-rw-r--r--src/lib/job.cc25
-rw-r--r--src/lib/util.cc10
-rw-r--r--src/lib/util.h2
-rw-r--r--src/lib/wscript3
5 files changed, 32 insertions, 11 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc
index aecb389fd..21e7383bf 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<int> ("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");
diff --git a/src/lib/job.cc b/src/lib/job.cc
index 01df2c570..2ac8c6077 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 DCPTime (in seconds) that this sub-job has been running */
diff --git a/src/lib/util.cc b/src/lib/util.cc
index e8f83d4e4..15109eee0 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -756,7 +756,7 @@ ensure_ui_thread ()
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
@@ -769,8 +769,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 d91a6b435..2ae97814c 100644
--- a/src/lib/util.h
+++ b/src/lib/util.h
@@ -50,7 +50,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/lib/wscript b/src/lib/wscript
index 16b5aafe4..5d27cfe45 100644
--- a/src/lib/wscript
+++ b/src/lib/wscript
@@ -87,6 +87,9 @@ def build(bld):
CURL ZIP QUICKMAIL PANGOMM CAIROMM
"""
+ if bld.env.TARGET_OSX:
+ obj.framework = ['IOKit', 'Foundation']
+
obj.source = sources + ' version.cc'
if bld.env.TARGET_WINDOWS: