Accessor for ClosedCaptionsDialog.
[dcpomatic.git] / src / lib / audio_ring_buffers.h
index cec7c712aee24d663bc2de8dc8859e47568f23fa..bfaad5ec97074d0077ca9376bb636d4c4bdf55d0 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,21 +33,16 @@ class AudioRingBuffers : public boost::noncopyable
 public:
        AudioRingBuffers ();
 
-       void put (boost::shared_ptr<const AudioBuffers> data, DCPTime time);
-       void get (float* out, int channels, int frames);
+       void put (boost::shared_ptr<const AudioBuffers> data, dcpomatic::DCPTime time, int frame_rate);
+       boost::optional<dcpomatic::DCPTime> get (float* out, int channels, int frames);
+       boost::optional<dcpomatic::DCPTime> peek () const;
 
        void clear ();
-       Frame size ();
-
-       DCPTime latest () const {
-               boost::mutex::scoped_lock lm (_mutex);
-               return _latest;
-       }
+       Frame size () const;
 
 private:
        mutable boost::mutex _mutex;
-       std::list<boost::shared_ptr<const AudioBuffers> > _buffers;
-       DCPTime _latest;
+       std::list<std::pair<boost::shared_ptr<const AudioBuffers>, dcpomatic::DCPTime> > _buffers;
        int _used_in_head;
 };