Use dcp::file_to_string().
[dcpomatic.git] / src / lib / text_ring_buffers.h
index e33d9be3b14fbbcd9ce14ce55555bf9b8de36ae6..2014dacc5e9886a30c00e69cbc735146b13928db 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2018-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
+#ifndef DCPOMATIC_TEXT_RING_BUFFERS_H
+#define DCPOMATIC_TEXT_RING_BUFFERS_H
+
+
+#include "dcp_text_track.h"
 #include "player_text.h"
 #include <boost/thread.hpp>
 #include <utility>
 
+
 class TextRingBuffers
 {
 public:
-       void put (std::pair<PlayerText, DCPTimePeriod> text);
-       boost::optional<std::pair<PlayerText, DCPTimePeriod> > get ();
+       void put (PlayerText text, DCPTextTrack track, dcpomatic::DCPTimePeriod period);
+
+       struct Data {
+               Data (PlayerText text_, DCPTextTrack track_, dcpomatic::DCPTimePeriod period_)
+                       : text (text_)
+                       , track (track_)
+                       , period (period_)
+               {}
+
+               PlayerText text;
+               DCPTextTrack track;
+               dcpomatic::DCPTimePeriod period;
+       };
+
+       boost::optional<Data> get ();
        void clear ();
 
 private:
        boost::mutex _mutex;
-       std::list<std::pair<PlayerText, DCPTimePeriod> > _data;
+
+       std::list<Data> _data;
 };
+
+
+#endif