projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix the build for older macOS.
[dcpomatic.git]
/
src
/
lib
/
text_ring_buffers.cc
diff --git
a/src/lib/text_ring_buffers.cc
b/src/lib/text_ring_buffers.cc
index 3586ab648db074a9f10ee1e91479667da478bd24..e2be7bf418a86b9fec1fc157f08a8a39c813f688 100644
(file)
--- a/
src/lib/text_ring_buffers.cc
+++ b/
src/lib/text_ring_buffers.cc
@@
-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.
This file is part of DCP-o-matic.
@@
-18,31
+18,37
@@
*/
*/
+
#include "text_ring_buffers.h"
#include "text_ring_buffers.h"
+
using std::pair;
using boost::optional;
using std::pair;
using boost::optional;
+using namespace dcpomatic;
+
void
void
-TextRingBuffers::put (
pair<PlayerText, DCPTimePeriod> text
)
+TextRingBuffers::put (
PlayerText text, DCPTextTrack track, DCPTimePeriod period
)
{
boost::mutex::scoped_lock lm (_mutex);
{
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);
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;
}
return r;
}
+
void
TextRingBuffers::clear ()
{
void
TextRingBuffers::clear ()
{