summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-03-08 20:04:05 +0000
committerCarl Hetherington <cth@carlh.net>2013-03-08 20:04:05 +0000
commita9172427858ec747ed5ff6ff4c2ab6eba1613135 (patch)
tree8e9082ee9cccf90e320be91651489ed3b52c9577 /src/lib
parentdf499ab4fd81b3cf4686f2e97fd4c9cd339dfdff (diff)
Disable show audio button when there is no audio (#73).
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/film.cc18
-rw-r--r--src/lib/film.h2
2 files changed, 19 insertions, 1 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc
index 8f545952b..20e08c037 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -1434,3 +1434,21 @@ Film::have_dcp () const
return true;
}
+
+bool
+Film::has_audio () const
+{
+ if (use_content_audio()) {
+ return audio_stream();
+ }
+
+ vector<string> const e = external_audio ();
+ for (vector<string>::const_iterator i = e.begin(); i != e.end(); ++i) {
+ if (!i->empty ()) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
diff --git a/src/lib/film.h b/src/lib/film.h
index 9921acbb4..88f6fbcd7 100644
--- a/src/lib/film.h
+++ b/src/lib/film.h
@@ -327,7 +327,7 @@ public:
}
boost::shared_ptr<AudioStream> audio_stream () const;
-
+ bool has_audio () const;
/* SET */