+
+void
+AudioContent::set_streams (vector<AudioStreamPtr> streams)
+{
+ ChangeSignaller<Content> cc (_parent, AudioContentProperty::STREAMS);
+
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ _streams = streams;
+ }
+}
+
+AudioStreamPtr
+AudioContent::stream () const
+{
+ boost::mutex::scoped_lock lm (_mutex);
+ DCPOMATIC_ASSERT (_streams.size() == 1);
+ return _streams.front ();
+}
+
+void
+AudioContent::add_stream (AudioStreamPtr stream)
+{
+ ChangeSignaller<Content> cc (_parent, AudioContentProperty::STREAMS);
+
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ _streams.push_back (stream);
+ }
+}
+
+void
+AudioContent::set_stream (AudioStreamPtr stream)
+{
+ ChangeSignaller<Content> cc (_parent, AudioContentProperty::STREAMS);
+
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ _streams.clear ();
+ _streams.push_back (stream);
+ }
+}
+
+void
+AudioContent::take_settings_from (shared_ptr<const AudioContent> c)
+{
+ set_gain (c->_gain);
+ set_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;
+ }
+}
+
+void
+AudioContent::modify_position (shared_ptr<const Film> film, DCPTime& pos) const
+{
+ pos = pos.round (film->audio_frame_rate());
+}
+
+void
+AudioContent::modify_trim_start (ContentTime& trim) const
+{
+ DCPOMATIC_ASSERT (!_streams.empty());
+ /* XXX: we're in trouble if streams have different rates */
+ trim = trim.round (_streams.front()->frame_rate());
+}