/*
- 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