+
+
+/** Extend these buffers with the data from another. The AudioBuffers must have the same number of channels. */
+void
+AudioBuffers::append (shared_ptr<const AudioBuffers> other)
+{
+ DCPOMATIC_ASSERT (channels() == other->channels());
+ auto old_frames = frames();
+ set_frames(old_frames + other->frames());
+ copy_from (other.get(), other->frames(), 0, old_frames);
+}
+
+
+/** Remove some frames from the start of these AudioBuffers */
+void
+AudioBuffers::trim_start (int frames_to_trim)
+{
+ DCPOMATIC_ASSERT (frames_to_trim <= frames());
+ move (frames() - frames_to_trim, frames_to_trim, 0);
+ set_frames (frames() - frames_to_trim);
+}
+
+
+void
+AudioBuffers::update_data_pointers ()
+{
+ _data_pointers.resize (channels());
+ for (int i = 0; i < channels(); ++i) {
+ _data_pointers[i] = _data[i].data();
+ }
+}
+