Add --gain option to dcpomatic_create.
[dcpomatic.git] / src / tools / dcpomatic_create.cc
index 73bcfd882c395cb28a4f8a725e1dd7fd7edce6da..3a240ec85bf7c5bbbcefdbdfd3e84d0a6e96988c 100644 (file)
@@ -137,6 +137,18 @@ main (int argc, char* argv[])
                                if (j->video) {
                                        j->video->set_frame_type (i.frame_type);
                                }
+                               if (j->audio && i.channel) {
+                                       for (auto stream: j->audio->streams()) {
+                                               AudioMapping mapping(stream->channels(), film->audio_channels());
+                                               for (int channel = 0; channel < stream->channels(); ++channel) {
+                                                       mapping.set(channel, *i.channel, 1.0f);
+                                               }
+                                               stream->set_mapping (mapping);
+                                       }
+                               }
+                               if (j->audio && i.gain) {
+                                       j->audio->set_gain (*i.gain);
+                               }
                        }
                }