/*
- 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.
*/
+
#include "text_ring_buffers.h"
+
using std::pair;
using boost::optional;
+using namespace dcpomatic;
+
void
-TextRingBuffers::put (pair<PlayerText, DCPTimePeriod> text)
+TextRingBuffers::put (PlayerText text, DCPTextTrack track, DCPTimePeriod period)
{
boost::mutex::scoped_lock lm (_mutex);
- _data.push_back (text);
+ _data.push_back (Data(text, track, period));
}
-optional<pair<PlayerText, DCPTimePeriod> >
+
+optional<TextRingBuffers::Data>
TextRingBuffers::get ()
{
boost::mutex::scoped_lock lm (_mutex);
- if (_data.empty ()) {
- return pair<PlayerText, DCPTimePeriod>();
+ if (_data.empty()) {
+ return {};
}
- pair<PlayerText, DCPTimePeriod> r = _data.front ();
- _data.pop_front ();
+ auto r = _data.front();
+ _data.pop_front();
return r;
}
+
void
TextRingBuffers::clear ()
{