Add NamedChannel and use it to hide the never-used channels
[dcpomatic.git] / src / lib / audio_content.cc
index 170b9299f5578d312e514d7c34fd613bd916fd02..22521c9e9b8be6ab6a263ef44b62b7ed22302e5f 100644 (file)
@@ -43,6 +43,7 @@ using boost::shared_ptr;
 using boost::dynamic_pointer_cast;
 using boost::optional;
 using dcp::raw_convert;
+using namespace dcpomatic;
 
 /** Something stream-related has changed */
 int const AudioContentProperty::STREAMS = 200;
@@ -264,17 +265,18 @@ AudioContent::processing_description (shared_ptr<const Film> film) const
 }
 
 /** @return User-visible names of each of our audio channels */
-vector<string>
+vector<NamedChannel>
 AudioContent::channel_names () const
 {
-       vector<string> n;
+       vector<NamedChannel> n;
 
-       int t = 1;
+       int index = 0;
+       int stream = 1;
        BOOST_FOREACH (AudioStreamPtr i, streams ()) {
                for (int j = 0; j < i->channels(); ++j) {
-                       n.push_back (String::compose ("%1:%2", t, j + 1));
+                       n.push_back (NamedChannel(String::compose ("%1:%2", stream, j + 1), index++));
                }
-               ++t;
+               ++stream;
        }
 
        return n;