s/use_template/take_settings_from/g
[dcpomatic.git] / src / lib / audio_content.cc
index e66b8b998ded170d9ec2d56df47417c278c653b7..8334627762ffcd02856a602471f388ca6532ad26 100644 (file)
@@ -135,9 +135,9 @@ AudioContent::set_delay (int d)
 string
 AudioContent::technical_summary () const
 {
-       string s = "audio :";
+       string s = "audio";
        BOOST_FOREACH (AudioStreamPtr i, streams ()) {
-               s += String::compose ("stream channels %1 rate %2", i->channels(), i->frame_rate());
+               s += String::compose ("stream channels %1 rate %2 ", i->channels(), i->frame_rate());
        }
 
        return s;
@@ -379,3 +379,19 @@ AudioContent::set_stream (AudioStreamPtr stream)
 
        _parent->signal_changed (AudioContentProperty::STREAMS);
 }
+
+void
+AudioContent::take_settings_from (shared_ptr<const AudioContent> c)
+{
+       _gain = c->_gain;
+       _delay = c->_delay;
+
+       size_t i = 0;
+       size_t j = 0;
+
+       while (i < _streams.size() && j < c->_streams.size()) {
+               _streams[i]->set_mapping (c->_streams[j]->mapping());
+               ++i;
+               ++j;
+       }
+}