s/destroy_thread/stop_thread/
[dcpomatic.git] / src / lib / audio_ring_buffers.h
index 3c726425c9b749b6807a19da2eaf38f218d379c1..8d830ecf78046f77e39012f1877f0bf0391968e6 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2016-2017 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2016-2019 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -33,15 +33,16 @@ class AudioRingBuffers : public boost::noncopyable
 public:
        AudioRingBuffers ();
 
-       void put (boost::shared_ptr<const AudioBuffers> data);
-       bool get (float* out, int channels, int frames);
+       void put (boost::shared_ptr<const AudioBuffers> data, DCPTime time, int frame_rate);
+       boost::optional<DCPTime> get (float* out, int channels, int frames);
+       boost::optional<DCPTime> peek () const;
 
        void clear ();
        Frame size () const;
 
 private:
        mutable boost::mutex _mutex;
-       std::list<boost::shared_ptr<const AudioBuffers> > _buffers;
+       std::list<std::pair<boost::shared_ptr<const AudioBuffers>, DCPTime> > _buffers;
        int _used_in_head;
 };