Fix the build for older macOS.
[dcpomatic.git] / src / lib / audio_buffers.h
index a294ff9144944c804d805ce2f7d82f8c7efc1aa8..146d5bd3e2d8f88c260b3f7776d0104cd66d8c0b 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 /** @file  src/lib/audio_buffers.h
  *  @brief AudioBuffers class.
  */
 
+
 #ifndef DCPOMATIC_AUDIO_BUFFERS_H
 #define DCPOMATIC_AUDIO_BUFFERS_H
 
-#include <boost/shared_ptr.hpp>
+
 #include <stdint.h>
+#include <memory>
+
 
 /** @class AudioBuffers
  *  @brief A class to hold multi-channel audio data in float format.
  *
  *  The use of int32_t for frame counts in this class is due to the
- *  round-up to the next power-of-2 code in ::ensure_size; if that
+ *  round-up to the next power-of-2 code in ensure_size(); if that
  *  were changed the frame count could use any integer type.
  */
 class AudioBuffers
@@ -40,13 +44,14 @@ class AudioBuffers
 public:
        AudioBuffers (int channels, int32_t frames);
        AudioBuffers (AudioBuffers const &);
-       AudioBuffers (boost::shared_ptr<const AudioBuffers>);
+       explicit AudioBuffers (std::shared_ptr<const AudioBuffers>);
+       AudioBuffers (std::shared_ptr<const AudioBuffers> other, int32_t frames_to_copy, int32_t read_offset);
        ~AudioBuffers ();
 
        AudioBuffers & operator= (AudioBuffers const &);
 
-       boost::shared_ptr<AudioBuffers> clone () const;
-       boost::shared_ptr<AudioBuffers> channel (int) const;
+       std::shared_ptr<AudioBuffers> clone () const;
+       std::shared_ptr<AudioBuffers> channel (int) const;
 
        void ensure_size (int32_t);
 
@@ -74,9 +79,11 @@ public:
 
        void copy_from (AudioBuffers const * from, int32_t frames_to_copy, int32_t read_offset, int32_t write_offset);
        void copy_channel_from (AudioBuffers const * from, int from_channel, int to_channel);
-       void move (int32_t from, int32_t to, int32_t frames);
+       void move (int32_t frames, int32_t from, int32_t to);
        void accumulate_channel (AudioBuffers const * from, int from_channel, int to_channel, float gain = 1);
-       void accumulate_frames (AudioBuffers const *, int32_t read_offset, int32_t write_offset, int32_t frames);
+       void accumulate_frames (AudioBuffers const * from, int32_t frames, int32_t read_offset, int32_t write_offset);
+       void append (std::shared_ptr<const AudioBuffers> other);
+       void trim_start (int32_t frames);
 
 private:
        void allocate (int channels, int32_t frames);
@@ -92,4 +99,5 @@ private:
        float** _data;
 };
 
+
 #endif