X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Faudio_ring_buffers.h;h=6fb84e0d76dc8684757827742d183943e7b62a51;hb=4f9314a311de379b105741273a15821da62a75cc;hp=8d830ecf78046f77e39012f1877f0bf0391968e6;hpb=64ff57b866e19daa8ed16b08d0a8038f787948c1;p=dcpomatic.git diff --git a/src/lib/audio_ring_buffers.h b/src/lib/audio_ring_buffers.h index 8d830ecf7..6fb84e0d7 100644 --- a/src/lib/audio_ring_buffers.h +++ b/src/lib/audio_ring_buffers.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2016-2019 Carl Hetherington + Copyright (C) 2016-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,32 +18,39 @@ */ + #ifndef DCPOMATIC_AUDIO_RING_BUFFERS_H #define DCPOMATIC_AUDIO_RING_BUFFERS_H + #include "audio_buffers.h" #include "types.h" #include "dcpomatic_time.h" -#include #include #include -class AudioRingBuffers : public boost::noncopyable + +class AudioRingBuffers { public: AudioRingBuffers (); - void put (boost::shared_ptr data, DCPTime time, int frame_rate); - boost::optional get (float* out, int channels, int frames); - boost::optional peek () const; + AudioRingBuffers (AudioBuffers const&) = delete; + AudioRingBuffers& operator= (AudioBuffers const&) = delete; + + void put (std::shared_ptr data, dcpomatic::DCPTime time, int frame_rate); + boost::optional get (float* out, int channels, int frames); + boost::optional peek () const; void clear (); + /** @return number of frames currently available */ Frame size () const; private: mutable boost::mutex _mutex; - std::list, DCPTime> > _buffers; - int _used_in_head; + std::list, dcpomatic::DCPTime>> _buffers; + int _used_in_head = 0; }; + #endif